/* ======================================================
   GOLD TRACKER - Dark Black & Gold Theme (Responsive)
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');

/* ── CSS Variables ──────────────────────────────────── */
:root {
  --gold-primary:    #D4AF37;
  --gold-bright:     #FFD700;
  --gold-light:      #F5E27A;
  --gold-dark:       #A07D1C;
  --gold-muted:      #8B6914;

  --bg-base:         #0A0A0A;
  --bg-card:         #111111;
  --bg-card-hover:   #181818;
  --bg-input:        #141414;
  --bg-modal:        #0F0F0F;
  --bg-sidebar:      #0C0C0C;
  --bg-table-alt:    #0D0D0D;

  --border:          #2A2A2A;
  --border-gold:     rgba(212,175,55,0.3);
  --border-gold-bright: rgba(212,175,55,0.7);

  --text-primary:    #F5F5F5;
  --text-secondary:  #9A9A9A;
  --text-muted:      #555555;
  --text-gold:       #D4AF37;

  --green:           #22C55E;
  --green-bg:        rgba(34,197,94,0.1);
  --red:             #EF4444;
  --red-bg:          rgba(239,68,68,0.1);

  --font-main:       'Roboto Condensed', sans-serif;
  --font-display:    'Roboto Condensed', sans-serif;

  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       16px;
  --radius-xl:       24px;

  --shadow-gold:     0 0 20px rgba(212,175,55,0.15);
  --shadow-gold-strong: 0 0 40px rgba(212,175,55,0.25);
  --shadow-card:     0 4px 24px rgba(0,0,0,0.6);
  --transition:      0.25s cubic-bezier(0.4,0,0.2,1);

  --sidebar-width:   260px;
  --sidebar-collapsed-width: 84px;
  --topbar-height:   68px;
}

/* ── Light Theme ────────────────────────────────────── */
body.light-theme {
  --bg-base:         #F3F4F6;
  --bg-card:         #FFFFFF;
  --bg-card-hover:   #F9FAFB;
  --bg-input:        #FFFFFF;
  --bg-modal:        #FFFFFF;
  --bg-sidebar:      #FFFFFF;
  --bg-table-alt:    #F9FAFB;

  --border:          #E5E7EB;
  --border-gold:     rgba(212,175,55,0.4);
  --border-gold-bright: rgba(212,175,55,0.8);

  --text-primary:    #111827;
  --text-secondary:  #4B5563;
  --text-muted:      #9CA3AF;
  
  --shadow-card:     0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-gold:     0 4px 20px rgba(212,175,55,0.12);
}

body.light-theme .stat-card {
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  box-shadow: var(--shadow-card);
}

body.light-theme .panel {
  box-shadow: var(--shadow-card);
}

body.light-theme thead {
  background: #F9FAFB;
}


body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.9);
}

body.light-theme .nav-item:hover {
  background: rgba(212,175,55,0.1);
}

body.light-theme .nav-item.active {
  background: rgba(212,175,55,0.1);
}

body.light-theme .sidebar-close {
  background: #F3F4F6;
}

body.light-theme .modal-overlay {
  background: rgba(0,0,0,0.4);
}

body.light-theme ::-webkit-scrollbar-track { background: #F3F4F6; }
body.light-theme ::-webkit-scrollbar-thumb { background: #E5E7EB; }


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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Prevent scroll when sidebar open on mobile */
body.sidebar-open { overflow: hidden; }

a { text-decoration: none; color: inherit; }

/* ── Layout ──────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar Overlay (mobile backdrop) ───────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform var(--transition);
}

/* Desktop collapsed sidebar (icon rail) */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}
body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text {
  display: none;
}
body.sidebar-collapsed .sidebar-logo {
  padding: 20px 14px 14px;
}
body.sidebar-collapsed .sidebar-logo-top {
  justify-content: center;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 12px 10px;
}
body.sidebar-collapsed .nav-item .nav-icon {
  width: auto;
}

/* Tooltip for collapsed sidebar items */
body.sidebar-collapsed .nav-item {
  position: relative;
}
body.sidebar-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,15,15,0.96);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  border: 1px solid var(--border);
  z-index: 400;
}
body.sidebar-collapsed .nav-item:hover::after {
  opacity: 1;
  transform: translate(4px, -50%);
}

/* ── Sidebar Logo ────────────────────────────────────── */
.sidebar-logo {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  object-fit: contain;
}

/* Close (X) button — hidden on desktop */
.sidebar-close {
  display: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-close:hover { background: var(--red); color: #fff; }

.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Nav ─────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(212,175,55,0.06);
  color: var(--text-primary);
  border-color: var(--border-gold);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05));
  color: var(--gold-primary);
  border-color: var(--border-gold);
  box-shadow: inset 0 0 20px rgba(212,175,55,0.05);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Sidebar Footer ──────────────────────────────────── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.gold-price-widget {
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px;
}

.gold-price-widget .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.gold-price-widget .price {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-primary);
  font-family: var(--font-display);
  word-break: break-all;
}

.gold-price-widget .price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Top Bar ─────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-price-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.price-warning-note {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  max-width: 320px;
  line-height: 1.3;
}

/* ── Hamburger Button (hidden on desktop) ─────────────── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 8px 9px;
  flex-shrink: 0;
  transition: var(--transition);
}
.hamburger:hover {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold-primary);
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-bright));
  color: #0A0A0A;
  box-shadow: 0 4px 15px rgba(212,175,55,0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  box-shadow: 0 6px 25px rgba(212,175,55,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
}

.btn-outline:hover {
  background: rgba(212,175,55,0.08);
  border-color: var(--gold-primary);
}

.btn-theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

body.light-theme .btn-theme-toggle {
  background: #FFFFFF;
  border-color: #E5E7EB;
  color: #F59E0B;
}

body.light-theme .btn-theme-toggle:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}


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

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: var(--red);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ── Page Content ─────────────────────────────────────── */
.page-content {
  padding: 32px 36px;
  flex: 1;
}

/* ── Stat Cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0;
  transition: var(--transition);
}

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

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

.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card .stat-icon.gold   { background: rgba(212,175,55,0.15); }
.stat-card .stat-icon.green  { background: rgba(34,197,94,0.12); }
.stat-card .stat-icon.blue   { background: rgba(59,130,246,0.12); }
.stat-card .stat-icon.purple { background: rgba(168,85,247,0.12); }
.stat-card .stat-icon.red    { background: rgba(239,68,68,0.12); }

.stat-card .stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1;
  margin-bottom: 5px;
  word-break: break-word;
}

.stat-card .stat-value.gold-text  { color: var(--gold-primary); }
.stat-card .stat-value.green-text { color: var(--green); }
.stat-card .stat-value.red-text   { color: var(--red); }

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Charts & Panels ─────────────────────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.panel-grid.full { grid-template-columns: 1fr; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 .icon { color: var(--gold-primary); }

.panel-body { padding: 24px; }

/* ── Data Table ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: #0E0E0E;
  position: sticky;
  top: 0;
  z-index: 10;
}

thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(212,175,55,0.04); }

tbody tr:nth-child(even) { background: var(--bg-table-alt); }
tbody tr:nth-child(even):hover { background: rgba(212,175,55,0.06); }

td {
  padding: 12px 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

td.primary { color: var(--text-primary); font-weight: 500; }
td.gold    { color: var(--gold-primary); font-weight: 600; }
td.profit  { color: var(--green); font-weight: 600; }
td.loss    { color: var(--red); font-weight: 600; }

/* ── Badge ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-profit {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}

.badge-loss {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  width: 560px;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0,0,0,0.8), var(--shadow-gold-strong);
  transform: translateY(20px) scale(0.97);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: var(--font-display);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--red); color: #fff; }

.modal-body { padding: 32px 36px; }

.modal-footer {
  padding: 14px 24px 22px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 24px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

input::placeholder { color: var(--text-muted); }
select option { background: var(--bg-card); }

/* ── Gold Price Update Form ──────────────────────────── */
.price-update-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-update-form input {
  width: 75px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

/* ── Toast Notification ──────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  max-width: calc(100vw - 40px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.info    { border-color: var(--border-gold); }
.toast .toast-icon { font-size: 18px; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: 24px 0;
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h4 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; margin-bottom: 20px; }

/* ── Glowing Gold Line ───────────────────────────────── */
.gold-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary) 30%, var(--gold-bright) 50%, var(--gold-primary) 70%, transparent);
  margin-bottom: 24px;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(212,175,55,0.4);
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-muted); }


/* ======================================================
   RESPONSIVE BREAKPOINTS
   ====================================================== */

/* ── Large tablets / small laptops ── */
@media (max-width: 1100px) {
  .panel-grid { grid-template-columns: 1fr; }
}

/* ── Tablets (768px – 1024px) ─────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 240px; }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .topbar { padding: 0 20px; }
  .page-content { padding: 22px 20px; }
}

/* ── Mobile (max 768px) ───────────────────────────────── */
@media (max-width: 768px) {

  /* Show / hide hamburger & overlay */
  .hamburger         { display: flex; }
  .sidebar-close     { display: flex; }

  /* Sidebar slides in from left */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.7);
  }

  /* Main takes full width */
  .main-content { margin-left: 0; }

  /* Topbar */
  .topbar {
    padding: 0 12px;
    gap: 8px;
    height: 60px;
  }
  .topbar-title h2 { font-size: 15px; }
  .topbar-date { display: none; }
  .price-warning-note { display: none; }
  .topbar-price-wrapper { flex-direction: row; align-items: center; gap: 4px; }
  .topbar-actions { gap: 8px; }

  /* Hide label text on "Add Transaction" button, show only icon */
  .btn-text { display: none; }
  .btn-gold { padding: 8px 12px; font-size: 18px; }

  /* Price update form: comfortable mobile sizing */
  .price-update-form input { width: 85px; font-size: 14px; padding: 7px 10px; }
  .price-update-form .btn-sm { padding: 7px 14px; font-size: 14px; }

  /* Stats grid: 2 columns */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 18px; }
  .stat-card .stat-icon { width: 36px; height: 36px; font-size: 17px; margin-bottom: 10px; }

  /* page padding */
  .page-content { padding: 16px; }

  /* Form: single column in modal */
  .form-row { grid-template-columns: 1fr; }

  /* Modal: full-width on mobile */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
  }

  /* Table filters: stack vertically */
  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-header > div { width: 100%; }
  .panel-header > div input,
  .panel-header > div select { width: 100% !important; }

  /* Toast: full width */
  .toast { max-width: 100%; }

  .btn-theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
}


/* ── Small mobile (max 480px) ─────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }

  .stat-card .stat-value { font-size: 22px; }

  .topbar-actions { gap: 6px; }

  /* Ensure price-update is large and tactile on small phones */
  .price-update-form { display: flex !important; gap: 5px; }
  .price-update-form input { width: 72px !important; font-size: 14px !important; padding: 6px 8px !important; }
  .price-update-form .btn-sm { padding: 6px 12px; font-size: 12px; }
  .topbar-title h2 { font-size: 13px; } /* Shrink title to fit form */

  /* Gold price widget in sidebar is always visible */
  .sidebar-footer { display: block; }

  .panel-body { padding: 14px; }

  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}
