/* ================================================================
   PRODETETIVE — ULTRA PREMIUM DARK UI SYSTEM
   ================================================================
   Font: Inter (Google Fonts)
   Palette: Deep Black + Red #da2d31
   Technique: Glass-morphism, micro-interactions, CSS-only icons
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS VARIABLES ─────────────────────────────── */
:root, [data-theme="dark"] {
  /* Backgrounds */
  --bg-body:      #06080f;
  --bg-primary:   #0b0f1a;
  --bg-secondary: #0f1423;
  --bg-tertiary:  #151b2e;
  --bg-card:      rgba(15, 20, 35, 0.7);
  --bg-card-solid:#0f1423;
  --bg-hover:     #1a2240;
  --bg-input:     rgba(21, 27, 46, 0.6);
  --bg-glass:     rgba(15, 20, 35, 0.45);

  /* Red accent */
  --red:          #da2d31;
  --red-dark:     #b5232a;
  --red-light:    #ff4347;
  --red-glow:     rgba(218, 45, 49, .35);
  --red-ghost:    rgba(218, 45, 49, .08);
  --red-border:   rgba(218, 45, 49, .25);

  /* Green / Yellow / Blue accents */
  --green:        #22c55e;
  --green-bg:     rgba(34, 197, 94, .12);
  --yellow:       #eab308;
  --yellow-bg:    rgba(234, 179, 8, .12);
  --blue:         #3b82f6;
  --blue-bg:      rgba(59, 130, 246, .12);
  --danger:       #ef4444;
  --danger-bg:    rgba(239, 68, 68, .12);

  /* Text */
  --text-white:   #f1f3f5;
  --text-primary: #e2e5ea;
  --text-muted:   #8892a4;
  --text-dim:     #5a6478;

  /* Borders */
  --border:       rgba(255,255,255,.06);
  --border-red:   rgba(218, 45, 49, .2);

  /* Shadows */
  --shadow-xs:    0 1px 2px rgba(0,0,0,.4);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.4);
  --shadow-md:    0 8px 24px rgba(0,0,0,.45);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.5);
  --shadow-red:   0 4px 30px rgba(218,45,49,.18);
  --shadow-glow:  0 0 40px rgba(218,45,49,.25);

  /* Sizes */
  --sidebar-w:    260px;
  --header-h:     64px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --radius-full:  9999px;

  /* Transitions */
  --ease:         cubic-bezier(.4, 0, .2, 1);
  --dur:          .25s;

  /* Dot-grid */
  --dot-color:    rgba(218,45,49,.07);
  --glow-color:   rgba(218,45,49,.08);
}

/* ── LIGHT THEME ───────────────────────────────── */
[data-theme="light"] {
  --bg-body:      #f4f5f7;
  --bg-primary:   #ffffff;
  --bg-secondary: #f0f1f3;
  --bg-tertiary:  #e8eaed;
  --bg-card:      rgba(255, 255, 255, 0.85);
  --bg-card-solid:#ffffff;
  --bg-hover:     #e8eaed;
  --bg-input:     rgba(0, 0, 0, .04);
  --bg-glass:     rgba(255, 255, 255, 0.6);

  --text-white:   #111827;
  --text-primary: #1f2937;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;

  --border:       rgba(0,0,0,.08);
  --border-red:   rgba(218, 45, 49, .2);

  --shadow-xs:    0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md:    0 8px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.1);
  --shadow-red:   0 4px 30px rgba(218,45,49,.1);
  --shadow-glow:  0 0 40px rgba(218,45,49,.1);

  --green-bg:     rgba(34, 197, 94, .1);
  --yellow-bg:    rgba(234, 179, 8, .1);
  --blue-bg:      rgba(59, 130, 246, .1);
  --danger-bg:    rgba(239, 68, 68, .1);
  --red-ghost:    rgba(218, 45, 49, .06);

  --dot-color:    rgba(218,45,49,.04);
  --glow-color:   rgba(218,45,49,.03);
}

[data-theme="light"] body {
  background: var(--bg-body);
  color: var(--text-primary);
}

[data-theme="light"] body::before {
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
}

[data-theme="light"] body::after {
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
}

[data-theme="light"] header {
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, .75);
  border-right: 1px solid var(--border);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: var(--text-dim);
}

[data-theme="light"] .user-menu-dropdown {
  background: rgba(255, 255, 255, .96);
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

[data-theme="light"] .pix-modal {
  background: var(--bg-card-solid);
}

/* ── LIGHT THEME — comprehensive overrides ───── */

/* sidebar hover / active states */
[data-theme="light"] .sidebar-nav a:hover {
  background: rgba(0,0,0,.05);
}
[data-theme="light"] .sidebar-user:hover {
  background: rgba(0,0,0,.04);
}

/* cards */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .action-card,
[data-theme="light"] .module-card,
[data-theme="light"] .result-card,
[data-theme="light"] .search-box,
[data-theme="light"] .auth-card,
[data-theme="light"] .profile-card,
[data-theme="light"] .wallet-card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

[data-theme="light"] .card:hover,
[data-theme="light"] .action-card:hover,
[data-theme="light"] .module-card:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .stat-card:hover {
  border-color: rgba(0,0,0,.12);
}

/* tables */
[data-theme="light"] thead th {
  background: rgba(0,0,0,.03);
  color: var(--text-dim);
}
[data-theme="light"] tbody td {
  color: var(--text-primary);
}
[data-theme="light"] tbody tr:hover {
  background: rgba(218,45,49,.04);
}

/* buttons */
[data-theme="light"] .btn-secondary {
  background: rgba(0,0,0,.04);
  border-color: var(--border);
  color: var(--text-primary);
}
[data-theme="light"] .btn-secondary:hover {
  background: rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.15);
  color: var(--text-white);
}
[data-theme="light"] .btn-ghost:hover {
  background: rgba(0,0,0,.05);
  color: var(--text-white);
}
[data-theme="light"] .btn-outline {
  border-color: rgba(0,0,0,.15);
  color: var(--text-primary);
}
[data-theme="light"] .btn-outline:hover {
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.2);
  color: var(--text-white);
}

/* result cards */
[data-theme="light"] .result-header {
  background: rgba(0,0,0,.02);
}
[data-theme="light"] .result-field {
  background: rgba(0,0,0,.02);
  border-color: var(--border);
}

/* search tabs */
[data-theme="light"] .search-tab {
  border-color: rgba(0,0,0,.1);
  color: var(--text-muted);
}
[data-theme="light"] .search-tab:hover {
  border-color: rgba(0,0,0,.2);
  color: var(--text-white);
}

/* user-menu */
[data-theme="light"] .user-menu-dropdown {
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
[data-theme="light"] .user-menu-toggle:hover {
  background: rgba(0,0,0,.05);
}
[data-theme="light"] .user-menu-dropdown a:hover {
  background: rgba(0,0,0,.05);
}

/* upload zone */
[data-theme="light"] .upload-zone {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.12);
}

/* header glow line */
[data-theme="light"] header {
  box-shadow: var(--shadow-sm);
}

/* wallet specific */
[data-theme="light"] .wallet-card {
  backdrop-filter: none;
}

/* pix overlay modal */
[data-theme="light"] .pix-overlay {
  background: rgba(0,0,0,.4);
}
[data-theme="light"] .pix-copy {
  background: rgba(0,0,0,.04);
  border-color: var(--border);
  color: var(--text-primary);
}

/* ── LIGHT THEME — module template overrides ──── */

/* Generic: any element using rgba(255,255,255,.XX) inline classes */
[data-theme="light"] .stat-card .stat-label,
[data-theme="light"] .cert-head .mini,
[data-theme="light"] .certidao-kicker,
[data-theme="light"] .certidao-label,
[data-theme="light"] .certidao-footer,
[data-theme="light"] .certidao-pill .lab,
[data-theme="light"] .cert-field label,
[data-theme="light"] .review-sub,
[data-theme="light"] .ft-role,
[data-theme="light"] .ft-cpf,
[data-theme="light"] .filter-item label,
[data-theme="light"] .query-hint,
[data-theme="light"] .map-legend,
[data-theme="light"] .lightbox-counter {
  color: var(--text-dim) !important;
}

[data-theme="light"] .stat-card .stat-num,
[data-theme="light"] .cert-head .cert-title-text,
[data-theme="light"] .cert-head .cert-name,
[data-theme="light"] .certidao-title,
[data-theme="light"] .certidao-value,
[data-theme="light"] .certidao-pill .val,
[data-theme="light"] .ao-header,
[data-theme="light"] .ao-section-title,
[data-theme="light"] .review-place,
[data-theme="light"] .ft-name,
[data-theme="light"] .empty-modal-title,
[data-theme="light"] .badge-tag {
  color: var(--text-white) !important;
}

[data-theme="light"] .empty-modal-text {
  color: var(--text-muted) !important;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .photo-card,
[data-theme="light"] .cert-card,
[data-theme="light"] .certidao-sheet,
[data-theme="light"] .ao-wrap,
[data-theme="light"] .review-card,
[data-theme="light"] .vehicle-item,
[data-theme="light"] .certidao-box,
[data-theme="light"] .certidao-pill,
[data-theme="light"] .ao-profile {
  border-color: rgba(0,0,0,.1) !important;
  background: rgba(0,0,0,.02) !important;
}

[data-theme="light"] .cert-head,
[data-theme="light"] .certidao-header,
[data-theme="light"] .ao-header {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.08) !important;
}

[data-theme="light"] .cert-field .cbox,
[data-theme="light"] .certidao-row {
  border-color: rgba(0,0,0,.08) !important;
}

[data-theme="light"] .certidao-footer {
  border-color: rgba(0,0,0,.06) !important;
}

[data-theme="light"] .copy-btn,
[data-theme="light"] .toolbar-btn,
[data-theme="light"] .lightbox-btn {
  border-color: rgba(0,0,0,.15) !important;
  background: rgba(0,0,0,.04) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .copy-btn:hover,
[data-theme="light"] .toolbar-btn:hover,
[data-theme="light"] .lightbox-btn:hover {
  background: rgba(0,0,0,.08) !important;
}

[data-theme="light"] .status-pill {
  border-color: rgba(0,0,0,.12) !important;
}

[data-theme="light"] .ft-avatar,
[data-theme="light"] .ft-avatar-placeholder {
  border-color: rgba(0,0,0,.12) !important;
  background: rgba(0,0,0,.04) !important;
}

[data-theme="light"] .ft-connector,
[data-theme="light"] .ft-h-line {
  background: rgba(0,0,0,.12) !important;
}

[data-theme="light"] .vehicle-main {
  background: rgba(0,0,0,.03) !important;
}
[data-theme="light"] .vehicle-thumbs img {
  border-color: rgba(0,0,0,.1) !important;
}

[data-theme="light"] #rastreamento-map {
  border-color: rgba(0,0,0,.1) !important;
}

[data-theme="light"] .empty-modal {
  background: rgba(255,255,255,.98) !important;
  border-color: rgba(0,0,0,.12) !important;
  box-shadow: 0 14px 42px rgba(0,0,0,.15) !important;
}

[data-theme="light"] .stat-link:hover {
  background: rgba(220,38,38,.06) !important;
}

/* Score module specifics */
[data-theme="light"] .score-card,
[data-theme="light"] .score-section,
[data-theme="light"] .score-detail-card,
[data-theme="light"] .score-field {
  border-color: rgba(0,0,0,.1) !important;
  background: rgba(0,0,0,.02) !important;
}

/* CNPJ module */
[data-theme="light"] .cnpj-card,
[data-theme="light"] .cnpj-section,
[data-theme="light"] .cnpj-field {
  border-color: rgba(0,0,0,.1) !important;
  background: rgba(0,0,0,.02) !important;
}

/* Generic result-field inside module results */
[data-theme="light"] .result-grid-sep {
  border-color: rgba(0,0,0,.08) !important;
}

/* Photo info text */
[data-theme="light"] .photo-card .photo-info {
  color: var(--text-primary) !important;
}

/* Address card etc */
[data-theme="light"] .address-card,
[data-theme="light"] .fachada-btn {
  border-color: rgba(0,0,0,.1) !important;
}

/* Table inside module results */
[data-theme="light"] .result-card table th,
[data-theme="light"] .result-card table td {
  border-color: rgba(0,0,0,.06) !important;
}

/* Historico page */
[data-theme="light"] .hist-card {
  border-color: rgba(0,0,0,.08) !important;
  background: rgba(0,0,0,.02) !important;
}

/* General text resets in light mode */
[data-theme="light"] .gradient {
  -webkit-text-fill-color: initial;
  background: linear-gradient(135deg, #da2d31, #ff4347);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── LIGHT THEME — admin dashboard overrides ──── */

/* chart cards / dashboard */
[data-theme="light"] .chart-card {
  background: rgba(0,0,0,.02) !important;
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .chart-title {
  color: var(--text-muted) !important;
}
[data-theme="light"] .bar-label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .bar-value {
  color: var(--text-white) !important;
}
[data-theme="light"] .h-bar-track {
  background: rgba(0,0,0,.04) !important;
}
[data-theme="light"] .h-bar-count {
  color: var(--text-muted) !important;
}
[data-theme="light"] .h-bar-name {
  color: var(--text-primary) !important;
}
[data-theme="light"] .mini-table th {
  color: var(--text-dim) !important;
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .mini-table td {
  border-color: rgba(0,0,0,.06) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .log-time {
  color: var(--text-dim) !important;
}

/* logs page */
[data-theme="light"] .filter-bar {
  background: rgba(0,0,0,.02) !important;
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .filter-bar .form-group label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .logs-table th {
  color: var(--text-dim) !important;
  border-color: rgba(0,0,0,.1) !important;
}
[data-theme="light"] .logs-table td {
  border-color: rgba(0,0,0,.06) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .logs-table tr:hover td {
  background: rgba(0,0,0,.03) !important;
}
[data-theme="light"] .log-id,
[data-theme="light"] .log-date,
[data-theme="light"] .log-detail {
  color: var(--text-dim) !important;
}
[data-theme="light"] .total-badge {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .pagination a,
[data-theme="light"] .pagination span {
  border-color: rgba(0,0,0,.1) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .pagination a:hover {
  background: rgba(220,38,38,.08) !important;
  border-color: #dc2626 !important;
  color: #dc2626 !important;
}
[data-theme="light"] .pagination .active {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

/* modules page */
[data-theme="light"] .mod-item {
  background: rgba(0,0,0,.02) !important;
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .mod-item:hover {
  border-color: rgba(220,38,38,.25) !important;
  box-shadow: var(--shadow-sm) !important;
}
[data-theme="light"] .mod-item-header {
  border-color: rgba(0,0,0,.06) !important;
}
[data-theme="light"] .mod-item-img {
  border-color: rgba(0,0,0,.1) !important;
}
[data-theme="light"] .mod-item-img-placeholder {
  border-color: rgba(0,0,0,.12) !important;
  background: rgba(0,0,0,.03) !important;
}
[data-theme="light"] .mod-item-id {
  color: var(--text-dim) !important;
}
[data-theme="light"] .mod-item-body .detail-row {
  border-color: rgba(0,0,0,.05) !important;
}
[data-theme="light"] .mod-item-body .detail-label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .mod-item-footer {
  border-color: rgba(0,0,0,.06) !important;
}

/* modal */
[data-theme="light"] .modal {
  background: var(--bg-card-solid) !important;
  border-color: rgba(0,0,0,.12) !important;
  box-shadow: 0 14px 42px rgba(0,0,0,.18) !important;
}
[data-theme="light"] .modal-header {
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .modal-close {
  color: var(--text-dim) !important;
}
[data-theme="light"] .modal-close:hover {
  color: var(--text-white) !important;
}
[data-theme="light"] .modal-body label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .modal-footer {
  border-color: rgba(0,0,0,.08) !important;
}

/* categories page */
[data-theme="light"] .cat-form label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .cat-table th {
  color: var(--text-dim) !important;
}
[data-theme="light"] .cat-table th,
[data-theme="light"] .cat-table td {
  border-color: rgba(0,0,0,.06) !important;
}
[data-theme="light"] .icon-preview {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.1) !important;
}
[data-theme="light"] .inline-edit input {
  border-color: rgba(0,0,0,.12) !important;
  background: rgba(0,0,0,.03) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .drag-handle {
  color: var(--text-dim) !important;
}

/* plan-form page */
[data-theme="light"] .module-limit-item {
  background: rgba(0,0,0,.02) !important;
  border-color: rgba(0,0,0,.08) !important;
}
[data-theme="light"] .module-limit-item label {
  color: var(--text-muted) !important;
}

/* sidebar overrides for light */
[data-theme="light"] .sidebar-label {
  color: var(--text-dim) !important;
}
[data-theme="light"] .sidebar-nav a {
  color: var(--text-muted) !important;
}
[data-theme="light"] .sidebar-nav a:hover,
[data-theme="light"] .sidebar-nav a.active {
  color: var(--text-white) !important;
}
[data-theme="light"] .sidebar-user-role {
  color: var(--text-dim) !important;
}
[data-theme="light"] .sidebar-footer {
  border-color: rgba(0,0,0,.08) !important;
}

/* page header */
[data-theme="light"] .page-subtitle {
  color: var(--text-muted) !important;
}

/* action cards in light */
[data-theme="light"] .action-desc {
  color: var(--text-muted) !important;
}

/* nav-logout in light */
[data-theme="light"] .nav-logout {
  color: var(--text-muted) !important;
}
[data-theme="light"] .nav-logout:hover {
  color: #dc2626 !important;
}

/* header nav links in light */
[data-theme="light"] header nav a {
  color: var(--text-muted) !important;
}
[data-theme="light"] header nav a:hover {
  color: var(--text-white) !important;
}

/* card header/title refinement */
[data-theme="light"] .card-header {
  border-color: rgba(0,0,0,.06) !important;
}
[data-theme="light"] .card-title {
  color: var(--text-primary) !important;
}

/* ── RESET ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--dot-color, rgba(218,45,49,.07)) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle top-left glow */
body::after {
  content: '';
  position: fixed;
  top: -180px;
  left: -180px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--glow-color, rgba(218,45,49,.08)) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--red-light); }

/* ── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-light); }

/* ── TYPOGRAPHY ────────────────────────────────── */
h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text-white);
}

h1 .gradient {
  background: linear-gradient(135deg, var(--text-white), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -.01em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
}

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-red   { color: var(--red); }
.text-green { color: var(--green); }

.page-subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  margin-top: .35rem;
}

/* ── HEADER ────────────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(11, 15, 26, .82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  z-index: 200;
}

.header-inner {
  width: 100%;
  max-width: 1700px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: .5;
}

.logo { height: 36px; opacity: .9; }
.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text-white);
}
.logo-text span { color: var(--red); }

header nav { display: flex; gap: .5rem; align-items: center; }

header nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: .88rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease);
  position: relative;
}

header nav a:hover {
  color: var(--text-white);
  background: var(--red-ghost);
}

header nav a.nav-logout {
  background: var(--red-ghost);
  color: var(--red);
  border: 1px solid var(--red-border);
}
header nav a.nav-logout:hover {
  background: var(--red);
  color: #fff;
}

/* ── USER AVATAR DROPDOWN ──────────────────────── */
.user-menu-wrap {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  padding: .35rem .65rem .35rem .35rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  background: none;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
}

.user-menu-toggle:hover {
  background: var(--red-ghost);
  border-color: var(--border);
  color: var(--text-white);
}

.user-menu-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red-border);
}

.user-menu-avatar-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red-ghost);
  border: 2px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
  color: var(--red);
}

.user-menu-toggle .chevron-svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur) var(--ease);
  opacity: .6;
}

.user-menu-wrap.open .chevron-svg {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(16, 20, 32, .96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .5rem 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .2s var(--ease);
  z-index: 999;
}

.user-menu-wrap.open .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-dropdown a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
}

.user-menu-dropdown a:hover {
  background: var(--red-ghost);
  color: var(--text-white);
}

.user-menu-dropdown a svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-menu-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: .35rem 0;
}

.user-menu-dropdown a.dropdown-logout {
  color: var(--red);
}

.user-menu-dropdown a.dropdown-logout:hover {
  background: rgba(218,45,49,.1);
}

/* ── ADMIN LAYOUT ──────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-h);
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(11, 15, 26, .65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}

.sidebar-section {
  padding: 0 .75rem;
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-dim);
  padding: 0 .75rem;
  margin-bottom: .5rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--dur) var(--ease);
  position: relative;
}

.sidebar-nav .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--dur) var(--ease);
}

.sidebar-nav .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav a:hover {
  color: var(--text-white);
  background: rgba(255,255,255,.04);
}

.sidebar-nav a:hover .nav-icon { opacity: 1; }

.sidebar-nav a.active {
  color: var(--text-white);
  background: var(--red-ghost);
  border: 1px solid var(--red-border);
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
  color: var(--red);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--red);
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}

.sidebar-user:hover { background: rgba(255,255,255,.03); }

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-ghost);
  border: 1.5px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: .65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── MAIN CONTENT ──────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  min-height: calc(100vh - var(--header-h));
  position: relative;
  z-index: 1;
}

.container { max-width: 1700px; margin: 0 auto; }

.page-header { margin-bottom: 2rem; }

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all .3s var(--ease);
}

.card:hover {
  border-color: rgba(218, 45, 49, .15);
  box-shadow: 0 2px 16px rgba(218,45,49,.08);
}

.card-solid {
  background: var(--bg-card-solid);
  backdrop-filter: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-title .icon {
  width: 20px;
  height: 20px;
  color: var(--red);
}

/* ── STAT CARDS ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all .3s var(--ease);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 80px;
  opacity: .08;
  transition: opacity .3s var(--ease);
}

.stat-card:hover { border-color: rgba(255,255,255,.08); }
.stat-card:hover::before { opacity: .12; }

.stat-card.red::before    { background: var(--red); }
.stat-card.green::before  { background: var(--green); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.yellow::before { background: var(--yellow); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .85rem;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon.red    { background: var(--red-ghost); color: var(--red); }
.stat-icon.green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }

.stat-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .35rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1;
  margin-bottom: .25rem;
  letter-spacing: -.02em;
}

.stat-change {
  font-size: .72rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--danger); }
.stat-change.flat { color: var(--text-dim); }

/* ── ACTION GRID ───────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.action-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
  transition: all .3s var(--ease);
  cursor: pointer;
}

.action-card:hover {
  border-color: rgba(218, 45, 49, .15);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.3), 0 0 12px rgba(218,45,49,.06);
  color: inherit;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--red-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  transition: all .3s var(--ease);
}

.action-card:hover .action-icon {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 12px rgba(218,45,49,.2);
}

.action-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-white);
}

.action-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── TABLES ────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: .85rem 1rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: .85rem 1rem;
  font-size: .9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: rgba(218,45,49,.03); }
tbody tr:last-child td { border-bottom: none; }

td .user-cell {
  display: flex;
  align-items: center;
  gap: .6rem;
}

td .user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-ghost);
  border: 1.5px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

td img.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--red-border);
  flex-shrink: 0;
  display: block;
}

td strong { color: var(--text-white); font-weight: 600; }
td .email-cell { color: var(--text-dim); }

/* ── BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-active  { background: var(--green-bg); color: var(--green); }
.badge-active::before  { background: var(--green); }

.badge-blocked { background: var(--danger-bg); color: var(--danger); }
.badge-blocked::before { background: var(--danger); }

.badge-suspended { background: var(--yellow-bg); color: var(--yellow); }
.badge-suspended::before { background: var(--yellow); }

/* ── BUTTONS ───────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 12px rgba(218,45,49,.25);
}

.btn-primary:hover {
  background: var(--red-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(218,45,49,.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-white);
  border-color: rgba(255,255,255,.12);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: .45rem .7rem;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-white);
}

.btn-sm {
  padding: .4rem .85rem;
  font-size: .78rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ── FORMS ─────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

input, select, textarea {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: inherit;
  font-size: .88rem;
  transition: all var(--dur) var(--ease);
  outline: none;
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 3px rgba(218,45,49,.1);
}

input[type="file"] { padding: .5rem; cursor: pointer; }
input:disabled { opacity: .5; cursor: not-allowed; }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}

.form-hint {
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: .35rem;
}

.form-divider {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.form-divider-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding-top: 1rem;
  margin-top: .5rem;
  border-top: 1px solid var(--border);
}

/* ── ALERTS ────────────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  line-height: 1.4;
}

.alert svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.2);
}

.alert-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.2);
}

/* ── AVATAR ────────────────────────────────────── */
.avatar-xl {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red-border);
  box-shadow: 0 0 30px rgba(218,45,49,.15);
}

.avatar-placeholder-xl {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--red-ghost);
  border: 3px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: var(--red);
}

.avatar-placeholder-xl svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ── AUTH PAGES ─────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 52px;
  height: 52px;
  background: var(--red-ghost);
  border: 1.5px solid var(--red-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--red);
}

.auth-logo-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: .3rem;
}

.auth-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.auth-footer p {
  font-size: .82rem;
  color: var(--text-dim);
}

.auth-footer a {
  font-weight: 600;
  color: var(--red);
}

.auth-footer a:hover { color: var(--red-light); }

/* ── USER PAGES (no sidebar) ───────────────────── */
.user-page {
  padding-top: var(--header-h);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.user-content {
  max-width: 1700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.user-welcome { margin-bottom: 2.5rem; }
.user-welcome h1 { font-size: 2rem; margin-bottom: .35rem; }

/* ── GRIDS ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ── ACTIVITY TABLE ────────────────────────────── */
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: .5rem;
}
.activity-dot.green { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,.4); }
.activity-dot.red   { background: var(--red);   box-shadow: 0 0 8px rgba(218,45,49,.4); }
.activity-dot.blue  { background: var(--blue);  box-shadow: 0 0 8px rgba(59,130,246,.4); }

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-dim);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 1;
  margin-bottom: 1rem;
  opacity: .5;
}

/* ── COUNTER TAG ───────────────────────────────── */
.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 .5rem;
  border-radius: var(--radius-full);
  background: var(--red-ghost);
  color: var(--red);
  font-size: .7rem;
  font-weight: 700;
}

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3      { grid-template-columns: repeat(2, 1fr); }
  .grid-4      { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --header-h: 56px;
  }

  .sidebar { display: none; }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
  }

  .stats-grid,
  .action-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.35rem; }
  header { padding: 0 1rem; }

  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }
  .user-content { padding: 1.25rem 1rem; }
}

/* ── ANIMATIONS ────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.fade-in      { animation: fadeInUp .4s var(--ease) both; }
.fade-in-d1   { animation-delay: .05s; }
.fade-in-d2   { animation-delay: .1s; }
.fade-in-d3   { animation-delay: .15s; }
.fade-in-d4   { animation-delay: .2s; }

/* ── UTILITIES ─────────────────────────────────── */
.flex           { display: flex; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.mt-1   { margin-top: .5rem; }
.mt-2   { margin-top: 1rem; }
.mt-3   { margin-top: 1.5rem; }
.mt-4   { margin-top: 2rem; }
.mb-1   { margin-bottom: .5rem; }
.mb-2   { margin-bottom: 1rem; }
.mb-3   { margin-bottom: 1.5rem; }
.mb-4   { margin-bottom: 2rem; }
.p-2    { padding: 1rem; }
.p-3    { padding: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none; }

/* ── PROFILE SECTION ──────────────────────────── */
.profile-section {
  margin-bottom: 2rem;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}
.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}
.profile-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red);
  box-shadow: var(--shadow-red);
  flex-shrink: 0;
}
.profile-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: .25rem;
}
.profile-info .badge {
  margin-bottom: .35rem;
}
.profile-info .text-muted {
  font-size: .875rem;
}

/* ── CARD BODY / FORM ─────────────────────────── */
.card-form {
  margin-bottom: 1.5rem;
}
.card-body {
  padding: 1.5rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ── ACTIONS CELL ─────────────────────────────── */
.actions-cell {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.actions-cell form {
  margin: 0;
}

/* ── ADMIN AVATAR SM ──────────────────────────── */
.admin-avatar {
  background: linear-gradient(135deg, var(--red), var(--red-dark)) !important;
  color: #fff !important;
}

/* ── USER PAGE FULL WIDTH ─────────────────────── */
.main-content.full-width {
  margin-left: 0;
  width: 100%;
}

/* ── MODERN UPLOAD COMPONENT ──────────────────── */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .3s var(--ease);
  background: var(--bg-input);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--red-border);
  background: rgba(218, 45, 49, .03);
}

.upload-zone.dragover {
  border-color: var(--red);
  background: rgba(218, 45, 49, .06);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--red-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .85rem;
  color: var(--red);
  transition: all .3s var(--ease);
}

.upload-zone:hover .upload-icon {
  background: var(--red);
  color: #fff;
}

.upload-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-text {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: .25rem;
}

.upload-text span {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-hint {
  font-size: .75rem;
  color: var(--text-dim);
}

.upload-preview {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.upload-preview.active {
  display: flex;
}

.upload-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red-border);
  box-shadow: 0 0 20px rgba(218,45,49,.1);
}

.upload-preview .file-name {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.upload-preview .btn-change {
  font-size: .75rem;
  color: var(--red);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-default.hidden { display: none; }

/* ── MODULE CARD ──────────────────────────────── */
.module-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.module-card:hover {
  border-color: rgba(218, 45, 49, .15);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.module-card:hover::before { opacity: 1; }

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .25rem;
  transition: all .3s var(--ease);
}

.module-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-icon.red    { background: var(--red-ghost); color: var(--red); }
.module-icon.green  { background: var(--green-bg);  color: var(--green); }
.module-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.module-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.module-icon.purple { background: rgba(139,92,246,.12); color: #8b5cf6; }

.module-card:hover .module-icon.red    { background: var(--red);    color: #fff; }
.module-card:hover .module-icon.blue   { background: var(--blue);   color: #fff; }
.module-card:hover .module-icon.green  { background: var(--green);  color: #fff; }
.module-card:hover .module-icon.yellow { background: var(--yellow); color: #fff; }
.module-card:hover .module-icon.purple { background: #8b5cf6;       color: #fff; }

.module-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
}

.module-desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

.module-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
}

.module-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.module-status.active   { color: var(--green); }
.module-status.active::before { background: var(--green); }
.module-status.coming   { color: var(--yellow); }
.module-status.coming::before { background: var(--yellow); }

/* ── CONSULTA AVANÇADA ────────────────────────── */
.search-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.search-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.search-input-group {
  display: flex;
  gap: .75rem;
  align-items: flex-end;
}

.search-input-group .form-group {
  flex: 1;
  margin-bottom: 0;
}

.search-type-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.search-tab {
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s var(--ease);
}

.search-tab:hover {
  color: var(--text-white);
  border-color: rgba(255,255,255,.12);
}

.search-tab.active {
  background: var(--red-ghost);
  color: var(--red);
  border-color: var(--red-border);
}

/* ── RESULT CARDS ─────────────────────────────── */
.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.result-header-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.result-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--red-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.result-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
}

.result-subtitle {
  font-size: .78rem;
  color: var(--text-dim);
}

.result-body {
  padding: 1.5rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.result-field {
  padding: .75rem 1rem;
  background: rgba(255,255,255,.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-field-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: .25rem;
}

.result-field-value {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-white);
  word-break: break-all;
}

.result-field.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
  .search-input-group {
    flex-direction: column;
  }
  .search-type-tabs {
    flex-wrap: wrap;
  }
}

/* ── BTN OUTLINE ──────────────────────────────── */
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text-white);
  border-color: rgba(255,255,255,.15);
  background: rgba(255,255,255,.04);
}

/* ── SECTION DIVIDER ──────────────────────────── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--red);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-title .counter {
  margin-left: .25rem;
}

/* ── LIGHT THEME — Prepaid API page overrides ── */
[data-theme="light"] .api-stat {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
[data-theme="light"] .api-stat:hover {
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .api-mod-card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
[data-theme="light"] .api-mod-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(218,45,49,.15);
}
[data-theme="light"] .token-display {
  background: var(--bg-input);
  border-color: var(--border);
}
[data-theme="light"] .token-display input {
  color: var(--text-primary);
}
[data-theme="light"] .token-action-btn {
  border-color: var(--border);
  color: var(--text-dim);
}
[data-theme="light"] .endpoint-display {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
}
[data-theme="light"] .auth-pill {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-muted);
}
[data-theme="light"] .curl-block {
  background: var(--bg-input);
  border-color: var(--border);
}
[data-theme="light"] .curl-header {
  background: rgba(0,0,0,.02);
  border-color: var(--border);
}
[data-theme="light"] .curl-body {
  color: var(--text-primary);
}
[data-theme="light"] .api-mod-example {
  background: var(--bg-input);
  border-color: var(--border);
}
[data-theme="light"] .api-mod-example code {
  color: var(--text-primary);
}
[data-theme="light"] .response-block {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-muted);
}
[data-theme="light"] .api-mod-name {
  color: var(--text-white);
}
[data-theme="light"] .api-stat-value {
  color: var(--text-white);
}

