/* ===================================================================
   Track The Gold — Design System v3.0
   Light + Dark themes | Mobile-first | RTL Arabic
   =================================================================== */

/* ==================== THEME TOKENS ==================== */

:root {
  /* Base semantic tokens — LIGHT (default) */
  --bg: #FBF8F1;
  --bg-alt: #F4EFE3;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #FDFBF5;
  --card-border: rgba(11, 14, 26, 0.08);

  --text: #0B0E1A;
  --text2: #3A4155;
  --text3: #6B7280;
  --text-muted: #9CA3AF;

  --gold: #C9A961;
  --gold-deep: #8B6F30;
  --gold-light: #E5D4A0;
  --gold-glow: rgba(201, 169, 97, 0.15);
  --rose-gold: #B8865C;

  --success: #0F7B3E;
  --success-bg: rgba(15, 123, 62, 0.08);
  --danger: #A83232;
  --danger-bg: rgba(168, 50, 50, 0.08);
  --warning: #B87700;
  --info: #2563EB;

  --silver: #8A8A8A;
  --silver-light: #C0C0C0;

  --shadow-sm: 0 1px 2px rgba(11, 14, 26, 0.04);
  --shadow: 0 4px 12px rgba(11, 14, 26, 0.06), 0 1px 3px rgba(11, 14, 26, 0.04);
  --shadow-lg: 0 12px 32px rgba(11, 14, 26, 0.08), 0 4px 8px rgba(11, 14, 26, 0.04);
  --shadow-gold: 0 4px 20px rgba(201, 169, 97, 0.25);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --header-h: 56px;
  --bottom-nav-h: 64px;
  --sidebar-w: 260px;

  --z-header: 100;
  --z-bottom-nav: 90;
  --z-sidebar: 200;
  --z-modal: 1000;
  --z-toast: 1100;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms var(--ease);
}

[data-theme="dark"] {
  --bg: #0B0E1A;
  --bg-alt: #0F1220;
  --surface: #151A2E;
  --card: #151A2E;
  --card-hover: #1B2038;
  --card-border: rgba(245, 241, 232, 0.08);

  --text: #F5F1E8;
  --text2: #C4C8D1;
  --text3: #8B92A5;
  --text-muted: #6B7280;

  --gold: #D4B76A;
  --gold-deep: #A88B45;
  --gold-light: #E8D089;
  --gold-glow: rgba(212, 183, 106, 0.25);
  --rose-gold: #C99878;

  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 4px 20px rgba(212, 183, 106, 0.2);
}

/* ==================== RESET ==================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

img, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--gold-deep); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
[data-theme="dark"] a { color: var(--gold); }
[data-theme="dark"] a:hover { color: var(--gold-light); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: #fff; }

/* ==================== TYPOGRAPHY ==================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rubik', 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { color: var(--text2); }

.mono, .price-num {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.text-muted { color: var(--text3); }
.text-gold { color: var(--gold-deep); }
[data-theme="dark"] .text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ==================== LAYOUT ==================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) { .container { padding: 0 24px; } }

.app-main {
  min-height: calc(100vh - var(--header-h) - var(--bottom-nav-h));
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 24px);
}

@media (min-width: 1024px) {
  .app-main {
    padding-right: var(--sidebar-w);
    padding-bottom: 40px;
  }
}

/* ==================== HEADER ==================== */

.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--card-border);
  z-index: var(--z-header);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.header-logo:hover { color: var(--text); }

.header-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all var(--transition);
  cursor: pointer;
  font-size: 1.1rem;
}

.icon-btn:hover { background: var(--card-hover); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ==================== BOTTOM NAVIGATION ==================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--card-border);
  z-index: var(--z-bottom-nav);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

@media (min-width: 1024px) { .bottom-nav { display: none; } }

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text3);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  position: relative;
  transition: color var(--transition);
  min-height: 48px;
}

.nav-tab i {
  font-size: 1.25rem;
  transition: transform var(--transition);
}

.nav-tab:hover { color: var(--text2); }
.nav-tab:active i { transform: scale(0.9); }

.nav-tab.active { color: var(--gold-deep); }
[data-theme="dark"] .nav-tab.active { color: var(--gold); }

.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 3px 3px;
}

/* ==================== DESKTOP SIDEBAR ==================== */

.sidebar { display: none; }

@media (min-width: 1024px) {
  .sidebar {
    display: block;
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    background: var(--surface);
    border-left: 1px solid var(--card-border);
    padding: 24px 16px;
    overflow-y: auto;
    z-index: 50;
  }

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

  .sidebar-nav a, .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
    cursor: pointer;
  }

  .sidebar-nav a i, .sidebar-link i {
    width: 20px;
    text-align: center;
    color: var(--text3);
    transition: color var(--transition);
  }

  .sidebar-nav a:hover, .sidebar-link:hover {
    background: var(--card-hover);
    color: var(--text);
  }

  .sidebar-nav a.active {
    background: var(--gold-glow);
    color: var(--gold-deep);
  }

  [data-theme="dark"] .sidebar-nav a.active { color: var(--gold); }
  .sidebar-nav a.active i { color: var(--gold); }

  .sidebar-nav .has-dropdown .dropdown-menu {
    display: none;
    padding-right: 20px;
    margin-top: 4px;
    flex-direction: column;
    gap: 2px;
  }
  .sidebar-nav .has-dropdown.open .dropdown-menu { display: flex; }
  .sidebar-nav .has-dropdown .arrow { margin-inline-start: auto; transition: transform var(--transition); }
  .sidebar-nav .has-dropdown.open .arrow { transform: rotate(-90deg); }

  .sidebar-section-label {
    padding: 16px 14px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
  }
}

/* ==================== "MORE" SHEET (Mobile bottom sheet) ==================== */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.sheet-overlay.open { opacity: 1; visibility: visible; }

.sheet {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  transform: translateY(100%);
  transition: transform 300ms var(--ease);
  max-height: 80vh;
  overflow-y: auto;
}
.sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

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

.sheet-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition);
}

.sheet-list a:hover, .sheet-list a:active { background: var(--card-hover); }

.sheet-list a i {
  width: 24px;
  text-align: center;
  color: var(--gold-deep);
  font-size: 1.05rem;
}
[data-theme="dark"] .sheet-list a i { color: var(--gold); }

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(201, 169, 97, 0.35); transform: translateY(-1px); color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--card-border);
}
.btn-secondary:hover { background: var(--card-hover); border-color: var(--gold); }

.btn-ghost { color: var(--text2); background: transparent; }
.btn-ghost:hover { background: var(--card-hover); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, black); color: #fff; }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.875rem; border-radius: 10px; }
.btn-lg { min-height: 56px; padding: 16px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ==================== CARDS ==================== */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}

.card:hover { border-color: color-mix(in srgb, var(--gold) 30%, var(--card-border)); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* ==================== SIGNATURE: PRICE INGOT CARDS ==================== */

.ingot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) { .ingot-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.ingot {
  position: relative;
  border-radius: 12px;
  padding: 18px 12px 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(139, 111, 48, 0.15);
}

.ingot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 40%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.ingot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.ingot:hover::before { opacity: 1; }

.ingot-24k { background: linear-gradient(135deg, #F5E6B8 0%, #E5C87A 100%); color: #4A3910; }
.ingot-22k { background: linear-gradient(135deg, #E8D89A 0%, #D4B76A 100%); color: #4A3910; }
.ingot-21k { background: linear-gradient(135deg, #DDC98A 0%, #C4A863 100%); color: #4A3910; }
.ingot-18k { background: linear-gradient(135deg, #D0B98C 0%, #B39A6E 100%); color: #4A3910; }

.ingot-karat {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.ingot-price {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.ingot-unit {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 600;
}

.ingot-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  align-self: flex-start;
}

.ingot-change.up { background: rgba(15, 123, 62, 0.2); color: #0F5A2E; }
.ingot-change.down { background: rgba(168, 50, 50, 0.2); color: #7A2020; }

/* ==================== INPUTS ==================== */

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

.input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text2);
  font-size: 0.9rem;
}

.input-group { margin-bottom: 16px; }

/* ==================== BADGES ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gold-glow);
  color: var(--gold-deep);
}

[data-theme="dark"] .badge { color: var(--gold); }

.badge-live {
  background: rgba(15, 123, 62, 0.15);
  color: var(--success);
}
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* ==================== HERO ==================== */

.hero {
  text-align: center;
  padding: 24px 0 32px;
}

.hero-title {
  font-family: 'Rubik', sans-serif;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text3);
  font-size: 1rem;
  margin-bottom: 20px;
}

.morning-hero {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--gold) 12%, var(--card)) 0%,
    var(--card) 100%);
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--card-border));
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.morning-hero-label {
  font-size: 0.85rem;
  color: var(--text3);
  margin-bottom: 8px;
}

.morning-hero-price {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 800;
  color: var(--gold-deep);
  line-height: 1;
  margin-bottom: 8px;
}

[data-theme="dark"] .morning-hero-price { color: var(--gold); }

.morning-hero-unit {
  color: var(--text2);
  font-size: 0.95rem;
}

/* ==================== SECTIONS ==================== */

.section { margin-bottom: 32px; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.section-link {
  font-size: 0.9rem;
  color: var(--gold-deep);
  font-weight: 600;
}

[data-theme="dark"] .section-link { color: var(--gold); }

/* ==================== FEATURE GRID (Home) ==================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 130px;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
  color: var(--text);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-deep);
  font-size: 1.4rem;
}

[data-theme="dark"] .feature-icon { color: var(--gold); }

.feature-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.feature-desc {
  font-size: 0.8rem;
  color: var(--text3);
  line-height: 1.4;
}

/* ==================== METAL TABS (Prices page) ==================== */

.metal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.metal-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  color: var(--text3);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.metal-tab:hover { color: var(--text); }
.metal-tab.active.gold { background: var(--gold-glow); color: var(--gold-deep); }
[data-theme="dark"] .metal-tab.active.gold { color: var(--gold); }
.metal-tab.active.silver { background: rgba(192, 192, 192, 0.15); color: var(--silver); }

/* ==================== TABLES ==================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}

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

th, td {
  padding: 12px 16px;
  text-align: start;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text3);
  background: var(--bg-alt);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--card-hover); }

/* ==================== ALERTS ==================== */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid;
}

.alert-info { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.2); color: var(--info); }
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.alert-warning { background: rgba(184, 119, 0, 0.1); border-color: rgba(184, 119, 0, 0.3); color: var(--warning); }

/* ==================== LOADING ==================== */

.skeleton {
  background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--card-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== EMPTY STATES ==================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 8px;
}

/* ==================== iOS APP SPECIFIC ==================== */

body.ios-app .desktop-only,
body.ios-app .sidebar { display: none !important; }

body.ios-app ins.adsbygoogle { display: none !important; height: 0 !important; }
body.ios-app { -webkit-text-size-adjust: none; }

.native-ad-slot {
  min-height: 60px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.75rem;
}

body:not(.ios-app) .native-ad-slot { display: none; }

/* ==================== UTILITY ==================== */

.hidden { display: none !important; }
.desktop-only { display: none; }
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: block; }
}

.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; } .p-2 { padding: 16px; } .p-3 { padding: 24px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.grid { display: grid; }
.text-center { text-align: center; } .text-start { text-align: start; } .text-end { text-align: end; }
.w-full { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .app-header, .bottom-nav, .sidebar, .btn { display: none !important; }
  .app-main { padding: 0; }
  body { background: white; color: black; }
}

/* ==================== ADMIN PANEL ==================== */

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-hero {
  padding: 12px 0 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.stat-card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold-deep);
  line-height: 1;
}
[data-theme="dark"] .stat-card-value { color: var(--gold); }
.stat-card-label {
  color: var(--text3);
  font-size: 0.8rem;
  margin-top: 6px;
}
.stat-card-icon {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 12px;
  text-align: start;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9rem;
}
.admin-table th {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--text3);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-table tr:hover td { background: var(--card-hover); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}
.status-pill.active { background: var(--success-bg); color: var(--success); }
.status-pill.pending { background: rgba(184,119,0,0.15); color: var(--warning); }
.status-pill.inactive { background: rgba(107,114,128,0.15); color: var(--text3); }
.status-pill.danger { background: var(--danger-bg); color: var(--danger); }

.action-icons {
  display: inline-flex;
  gap: 6px;
}
.action-icons button, .action-icons a {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 0.85rem;
}
.action-icons button:hover, .action-icons a:hover {
  background: var(--card-hover);
  color: var(--text);
}
.action-icons .del:hover { color: var(--danger); background: var(--danger-bg); }
