@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=JetBrains+Mono:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap');

/* ════════════════════════════════════════════
   FOR RESELLERS Admin — Renaissance × Rococo
════════════════════════════════════════════ */
:root {
  --bg: #F4EBD8;
  --card-bg: #FFF8EC;
  --card-border: rgba(184, 134, 11, 0.28);

  --shadow-light: rgba(255, 248, 236, 0.9);
  --shadow-dark: rgba(42, 33, 24, 0.12);

  --card-shadow:
    0 10px 28px rgba(42, 33, 24, 0.08),
    0 0 0 1px rgba(184, 134, 11, 0.2);
  --card-shadow-hover:
    0 16px 36px rgba(42, 33, 24, 0.12),
    0 0 0 1px rgba(184, 134, 11, 0.35);
  --inset-shadow:
    inset 0 1px 3px rgba(42, 33, 24, 0.08),
    inset 0 0 0 1px rgba(184, 134, 11, 0.15);
  --btn-shadow:
    0 2px 8px rgba(42, 33, 24, 0.08),
    0 0 0 1px rgba(184, 134, 11, 0.22);
  --btn-shadow-active:
    inset 0 2px 6px rgba(42, 33, 24, 0.12);

  --primary: #B8860B;
  --primary-light: rgba(184, 134, 11, 0.12);
  --primary-hover: #8B6914;
  --primary-glow: rgba(184, 134, 11, 0.28);
  --wine: #6E2C3A;
  --blush: #E8D0C8;

  --text-main: #2A2118;
  --text-secondary: #5C4E3E;
  --text-muted: #8A7A66;
  --text-dim: #B5A690;

  --green: #3F5E52;
  --green-bg: rgba(63, 94, 82, 0.12);
  --blue: #4A6B7C;
  --blue-bg: rgba(74, 107, 124, 0.12);
  --orange: #A65D2E;
  --orange-bg: rgba(166, 93, 46, 0.12);
  --red: #8B1E1E;
  --red-bg: rgba(139, 30, 30, 0.1);
  --purple: #6E2C3A;
  --purple-bg: rgba(110, 44, 58, 0.1);
  --pink: #A66B6B;
  --pink-bg: rgba(166, 107, 107, 0.12);

  --font: 'Source Serif 4', Georgia, serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
}

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

html { scroll-behavior: smooth; }

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

body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(184, 134, 11, 0.12), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(110, 44, 58, 0.08), transparent 40%),
    var(--bg);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.text-green  { color: var(--green); }
.text-blue   { color: var(--blue); }
.text-red    { color: var(--red); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-muted  { color: var(--text-muted); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}
.card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }

button {
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 40px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #8B6914, #D4A017 50%, #B8860B);
  color: #FFF8EC;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #6E5410, #B8860B); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--btn-shadow-active); }

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--btn-shadow);
}
.btn-secondary:hover { color: var(--text-main); border-color: var(--card-border); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  font-size: 13px;
}
.btn-ghost:hover { color: var(--text-main); background: rgba(184, 134, 11, 0.06); }

.btn-ghost-sm {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
}
.btn-ghost-sm:hover { color: var(--text-main); border-color: var(--card-border); }

.btn-small {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-weight: 600;
  box-shadow: var(--btn-shadow);
  min-height: 36px;
}
.btn-small:hover { color: var(--text-main); }

.btn-danger { background: var(--card-bg); color: var(--red); box-shadow: var(--btn-shadow); }
.btn-danger:hover { background: var(--red-bg); }
.btn-success { background: var(--card-bg); color: var(--green); box-shadow: var(--btn-shadow); }
.btn-success:hover { background: var(--green-bg); }
.btn-close {
  background: var(--card-bg);
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  box-shadow: var(--btn-shadow);
  min-width: 40px;
  min-height: 40px;
}
.btn-close:hover { color: var(--text-main); }

.btn-hamburger {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.btn-hamburger i { width: 20px; height: 20px; }

.table-actions { display: flex; gap: 8px; align-items: center; }
.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 10px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}
.btn-icon i { width: 16px; height: 16px; }
.btn-icon:hover { color: var(--primary); }
.btn-icon.delete:hover { color: var(--red); }

.input-group { position: relative; margin-bottom: 20px; display: flex; flex-direction: column; }
.input-group label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
}
.input-group > i { position: absolute; left: 16px; bottom: 15px; color: var(--text-muted); width: 16px; height: 16px; pointer-events: none; }
.input-group input, .input-group select, .input-group textarea {
  width: 100%;
  background: #F7F0E2;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
  appearance: none;
  resize: vertical;
  box-shadow: var(--inset-shadow);
}
.input-group > i ~ input, .input-group > i ~ select { padding-left: 42px; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--inset-shadow), 0 0 0 3px var(--primary-glow);
}

.error-msg { color: var(--red); font-size: 13px; margin-top: 8px; text-align: center; }
.success-msg { color: var(--green); font-size: 13px; margin-top: 8px; }

.filter-select {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--btn-shadow);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  min-height: 40px;
}
.filter-select:focus { outline: none; color: var(--text-main); border-color: var(--primary); }

.form-row { display: flex; gap: 14px; }
.form-row .input-group { flex: 1; min-width: 0; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #F7F0E2;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 10px 0;
}
.toggle-info strong { display: block; font-size: 14px; margin-bottom: 3px; color: var(--text-main); }
.toggle-info span { font-size: 12px; color: var(--text-muted); }
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #E8DCC4; border: 1px solid var(--card-border);
  border-radius: 24px; transition: 0.2s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px; left: 3px; bottom: 2px;
  background: #FFF8EC; box-shadow: var(--btn-shadow);
  border-radius: 50%; transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary-hover); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

.view { display: none; min-height: 100vh; }
.view.active { display: flex; }
.view-section { animation: fade-in 0.2s ease; }
@keyframes fade-in { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

#login-screen {
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
  padding: 20px;
}
.login-bg-glow {
  position: fixed; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 134, 11, 0.22), rgba(110, 44, 58, 0.08), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none;
  animation: pulse-bg 6s ease-in-out infinite; opacity: 0.85;
}
@keyframes pulse-bg { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.08)} }

.login-box {
  width: 100%; max-width: 420px; padding: 48px 40px;
  display: flex; flex-direction: column; position: relative; z-index: 1;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  background: var(--card-bg);
}
.login-box::before {
  content: '';
  position: absolute; inset: 10px;
  border: 1px solid rgba(184, 134, 11, 0.18);
  border-radius: 8px;
  pointer-events: none;
}
.login-box .logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 36px; }
.login-box .logo h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--wine);
  letter-spacing: 0.02em;
}
.logo-sub { font-size: 13px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.logo-icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(145deg, #FFF8EC, #EFE4CF);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}
.logo-icon-wrap i { width: 32px; height: 32px; }
.logo-icon-wrap.small { width: 44px; height: 44px; }
.logo-icon-wrap.small i { width: 22px; height: 22px; }
.login-box button { width: 100%; margin-top: 14px; padding: 12px; font-size: 14px; min-height: 44px; }
.login-box .input-group input { background: #F7F0E2; padding: 14px 18px 14px 44px; }

#dashboard-screen { flex-direction: row; }

.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, #FFF8EC 0%, #F4EBD8 100%);
  border-right: 1px solid var(--card-border);
  box-shadow: 4px 0 24px rgba(42, 33, 24, 0.06);
  overflow-y: auto;
}
.sidebar .logo { display: flex; align-items: center; gap: 12px; padding: 0 10px; margin-bottom: 32px; }
.sidebar .logo h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--wine);
}

.nav-links { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.nav-links li {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
}
.nav-links li.active {
  background: rgba(184, 134, 11, 0.12);
  color: var(--wine);
  border: 1px solid rgba(184, 134, 11, 0.25);
}
.nav-links li:not(.active):hover {
  background: rgba(184, 134, 11, 0.06);
  color: var(--text-main);
}
.nav-links li i { width: 18px; height: 18px; flex-shrink: 0; }
.nav-links li span { white-space: nowrap; overflow: hidden; }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--card-border); }
.nav-bottom button { width: 100%; justify-content: flex-start; }

.main-content { flex: 1; padding: 28px 32px; margin-left: var(--sidebar-w); min-height: 100vh; min-width: 0; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--wine);
}
.header-sub { font-size: 13px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.reseller-toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.reseller-toggle-label input { width: 14px; height: 14px; accent-color: var(--primary); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  padding: 20px;
  display: flex; align-items: center; gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }

.stat-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--card-border); }
.stat-icon i { width: 20px; height: 20px; }
.stat-icon.icon-green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.icon-blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-icon.icon-red    { background: var(--red-bg);    color: var(--red); }
.stat-icon.icon-orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.icon-purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.icon-pink   { background: var(--pink-bg);   color: var(--pink); }

.stat-info h3 {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: var(--font-display);
}
.stat-info p {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.table-toolbar {
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.filter-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bulk-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(184, 134, 11, 0.18);
  flex-wrap: wrap;
}
.bulk-toolbar span { font-size: 13px; font-weight: 600; color: var(--wine); margin-right: 8px; }

.table-section {
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(184, 134, 11, 0.12);
  white-space: nowrap;
}
th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(184, 134, 11, 0.05);
  font-family: var(--font-display);
}
td { font-size: 13px; color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(184, 134, 11, 0.04); }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px;
  border-top: 1px solid rgba(184, 134, 11, 0.15);
  flex-wrap: wrap;
}
#pagination-info { font-size: 13px; color: var(--text-muted); }

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03px;
  display: inline-block;
  border: 1px solid transparent;
}
.badge-active  { background: var(--green-bg); color: var(--green); border-color: rgba(63,94,82,0.2); }
.badge-revoked { background: var(--red-bg); color: var(--red); border-color: rgba(139,30,30,0.2); }
.badge-expired { background: rgba(138,122,102,0.12); color: var(--text-muted); }
.badge-info    { background: var(--blue-bg); color: var(--blue); }
.badge-warning { background: var(--orange-bg); color: var(--orange); }
.badge-urgent  { background: var(--red-bg); color: var(--red); }
.badge-pinned  { background: var(--purple-bg); color: var(--purple); }
.badge-blue    { background: var(--blue-bg); color: var(--blue); }
.badge-gray    { background: rgba(138,122,102,0.12); color: var(--text-muted); }
.badge-green   { background: var(--green-bg); color: var(--green); }
.badge-red     { background: var(--red-bg); color: var(--red); }

.online-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); font-weight: 500; }
.online-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px var(--green-bg); animation: pulse 2s infinite; }
.offline-indicator { color: var(--text-muted); font-size: 12px; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(63,94,82,0.4)} 70%{box-shadow:0 0 0 8px rgba(63,94,82,0)} 100%{box-shadow:0 0 0 0 rgba(63,94,82,0)} }

.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 15px; pointer-events: none; }
.search-box input {
  background: #F7F0E2;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 34px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  width: 260px;
  transition: all 0.2s;
  min-height: 40px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: #FFF8EC;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.chart-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-display);
}
.chart-card canvas { max-height: 220px; }

.updates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 4px; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 33, 24, 0.4);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
  width: 100%;
  max-width: 580px;
  padding: 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-hover);
  animation: modal-in 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-content::before {
  content: '';
  position: absolute; inset: 10px;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 8px;
  pointer-events: none;
}
@keyframes modal-in { from{opacity:0;transform:translateY(16px) scale(0.98)} to{opacity:1;transform:none} }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.modal-header h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--wine); }

#generated-keys-output {
  width: 100%; height: 120px;
  background: #F7F0E2;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 16px;
  resize: none;
  margin-top: 14px;
}

.upload-area {
  border: 1px dashed rgba(184, 134, 11, 0.4);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F7F0E2;
}
.upload-area:hover { border-color: var(--primary); background: rgba(184, 134, 11, 0.06); }
.upload-area.dragover { background: var(--primary-light); }
.upload-area i { width: 40px; height: 40px; color: var(--primary); margin-bottom: 12px; }
.upload-area p { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.upload-area .upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.notif-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}
.notif-card:hover { box-shadow: var(--card-shadow-hover); }
.notif-card.pinned { border-left: 3px solid var(--wine); }
.notif-card.urgent { border-left: 3px solid var(--red); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon.info    { background: var(--blue-bg); color: var(--blue); }
.notif-icon.success { background: var(--green-bg); color: var(--green); }
.notif-icon.warning { background: var(--orange-bg); color: var(--orange); }
.notif-icon.urgent  { background: var(--red-bg); color: var(--red); }
.notif-content { flex: 1; }
.notif-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-display); }
.notif-content p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.notif-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.notif-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

.update-key-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #F7F0E2;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.update-key-item.used { opacity: 0.5; text-decoration: line-through; }

#mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(42,33,24,0.4); z-index: 150; }
#mobile-menu-overlay.active { display: block; }

/* Reseller helpers (replace former inline styles) */
.r-success-box {
  display: none;
  margin-top: 20px;
  padding: 16px;
  background: var(--green-bg);
  border: 1px solid rgba(63, 94, 82, 0.3);
  border-radius: 10px;
}
.r-api-key-input {
  flex: 1;
  background: #F7F0E2;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  border: 1px solid var(--card-border);
  padding: 10px;
  border-radius: 8px;
  min-height: 44px;
}
.r-generated-output {
  width: 100%;
  background: #FFF8EC;
  border: 1px solid rgba(63, 94, 82, 0.3);
  border-radius: 8px;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 12px;
  font-weight: 600;
}
.section-card { padding: 24px; margin-bottom: 30px; }
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--wine);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 1024px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .updates-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 768px) {
  .btn-hamburger { display: flex !important; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(42, 33, 24, 0.15);
  }
  .main-content { margin-left: 0 !important; padding: 16px; width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .form-row { flex-direction: column; gap: 0; }
  .search-box input { width: 100%; }
  .analytics-grid, .updates-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 24px 18px; border-radius: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 12px; }
  header h1 { font-size: 22px; }
  .bulk-toolbar { gap: 6px; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .search-box, .filter-row .filter-select { width: 100%; }
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid var(--card-border);
}
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--blue); }
.toast-content { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-main); }

.fade-enter {
  opacity: 0;
  transform: translateY(10px);
  animation: page-fade 0.3s forwards ease-out;
}
@keyframes page-fade {
  to { opacity: 1; transform: translateY(0); }
}

/* Rococo flourish */
.card::before,
.stat-card::before,
.login-box::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; top: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,134,11,0.45), transparent);
  pointer-events: none;
}
.stat-card { position: relative; }
.stat-info p {
  letter-spacing: 0.02em;
}
