/* ============================================================
   THE FLUENT CIRCLE — Admin Dashboard Styles
   ============================================================ */

:root {
  --a-primary:   #2563EB;
  --a-success:   #16a34a;
  --a-warning:   #d97706;
  --a-danger:    #dc2626;
  --a-ink:       #0f172a;
  --a-muted:     #64748b;
  --a-border:    #e2e8f0;
  --a-surface:   #f8fafc;
  --a-card:      #ffffff;
  --a-sidebar:   #0f172a;
  --a-sidebar-text: rgba(255,255,255,.75);
  --a-sidebar-active: rgba(255,255,255,.12);
  --a-r: 10px;
  --a-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.08);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--a-surface);
  color: var(--a-ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--a-primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--a-primary); color: #fff; }

/* ── Login Screen ─────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #0e7490 100%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: clamp(2rem, 5vw, 3rem);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: .02em;
}
.login-title {
  font-size: 1.4rem; font-weight: 700;
  margin-bottom: .35rem;
  color: var(--a-ink);
}
.login-sub {
  font-size: .875rem;
  color: var(--a-muted);
  margin-bottom: 2rem;
}
.login-field {
  position: relative;
  margin-bottom: 1rem;
}
.login-field input {
  width: 100%;
  border: 1.5px solid var(--a-border);
  border-radius: var(--a-r);
  padding: .875rem 1rem;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
}
.login-field input:focus {
  outline: none;
  border-color: var(--a-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-btn {
  width: 100%;
  background: linear-gradient(115deg, #2563EB, #06B6D4);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: .875rem;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .2s, transform .2s;
  margin-top: .5rem;
}
.login-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-error {
  color: var(--a-danger);
  font-size: .82rem;
  margin-top: .75rem;
  display: none;
}
.login-error.visible { display: block; }

/* ── App Shell ────────────────────────────────────────────── */
#app { display: none; min-height: 100vh; }
#app.visible { display: flex; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--a-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); }
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .75rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-name {
  font-size: .8rem; font-weight: 700;
  color: rgba(255,255,255,.9);
  line-height: 1.3;
}
.sidebar-badge {
  display: block;
  font-size: .65rem; font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}
.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: 1rem 1.25rem .4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1.25rem;
  color: var(--a-sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .2s, color .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active { background: var(--a-sidebar-active); color: #fff; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: .6rem;
  font-size: .8rem; color: rgba(255,255,255,.5);
  transition: color .2s;
}
.sidebar-footer a:hover { color: rgba(255,255,255,.8); }
.sidebar-footer svg { width: 16px; height: 16px; }

/* ── Main Area ────────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: var(--a-card);
  border-bottom: 1px solid var(--a-border);
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--a-ink);
}
@media (max-width: 768px) { .topbar-menu-btn { display: flex; } }
.topbar-menu-btn svg { width: 20px; height: 20px; }
.topbar-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--a-ink);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.topbar-save-btn {
  background: var(--a-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: .4rem;
  transition: filter .2s;
}
.topbar-save-btn:hover { filter: brightness(1.08); }
.topbar-save-btn svg { width: 16px; height: 16px; }

/* ── Content Panels ───────────────────────────────────────── */
.panel { display: none; padding: 1.75rem; }
.panel.active { display: block; }
.panel-title {
  font-size: 1.2rem; font-weight: 700;
  color: var(--a-ink);
  margin-bottom: 1.5rem;
}
.panel-subtitle {
  font-size: .875rem;
  color: var(--a-muted);
  margin-bottom: 1.5rem;
  margin-top: -.875rem;
  line-height: 1.6;
}

/* ── Cards within panels ──────────────────────────────────── */
.a-card {
  background: var(--a-card);
  border: 1px solid var(--a-border);
  border-radius: var(--a-r);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--a-shadow);
}
.a-card-title {
  font-size: .875rem; font-weight: 700;
  color: var(--a-ink);
  margin-bottom: 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--a-border);
  display: flex; align-items: center; gap: .5rem;
}
.a-card-title svg { width: 16px; height: 16px; color: var(--a-primary); }
.a-grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .a-grid-2 { grid-template-columns: 1fr 1fr; } }
.a-grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .a-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ── Form Fields ──────────────────────────────────────────── */
.a-field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.a-field:last-child { margin-bottom: 0; }
.a-label {
  font-size: .78rem; font-weight: 600;
  color: var(--a-ink);
  display: flex; align-items: center; gap: .4rem;
}
.a-label .badge {
  font-size: .65rem; font-weight: 700;
  background: rgba(37,99,235,.1);
  color: var(--a-primary);
  border-radius: 4px;
  padding: .1rem .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.a-input, .a-select, .a-textarea {
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  padding: .65rem .875rem;
  font-size: .875rem;
  color: var(--a-ink);
  background: var(--a-card);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.a-input:focus, .a-select:focus, .a-textarea:focus {
  outline: none;
  border-color: var(--a-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.a-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.a-hint { font-size: .72rem; color: var(--a-muted); }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0;
  border-bottom: 1px solid var(--a-border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-info strong { display: block; font-size: .875rem; font-weight: 600; }
.toggle-info span { font-size: .78rem; color: var(--a-muted); }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--a-border);
  border-radius: 99px;
  cursor: pointer;
  transition: background .25s;
}
.toggle input:checked + .toggle-track { background: var(--a-primary); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Buttons ──────────────────────────────────────────────── */
.a-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  border: none; border-radius: 8px;
  padding: .6rem 1.1rem;
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}
.a-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.a-btn svg { width: 16px; height: 16px; }
.a-btn--primary { background: var(--a-primary); color: #fff; }
.a-btn--success { background: var(--a-success); color: #fff; }
.a-btn--danger  { background: var(--a-danger);  color: #fff; }
.a-btn--outline { background: none; border: 1.5px solid var(--a-border); color: var(--a-ink); }
.a-btn--sm { padding: .4rem .8rem; font-size: .78rem; }

/* ── Stats row on dashboard ───────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 600px) { .stat-cards { grid-template-columns: repeat(4,1fr); } }
.stat-card {
  background: var(--a-card);
  border: 1px solid var(--a-border);
  border-radius: var(--a-r);
  padding: 1.25rem;
  text-align: center;
}
.stat-card__val {
  font-size: 1.75rem; font-weight: 800;
  color: var(--a-primary);
  line-height: 1;
}
.stat-card__label {
  font-size: .75rem; color: var(--a-muted);
  margin-top: .3rem;
}

/* ── Logo upload ──────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--a-border);
  border-radius: var(--a-r);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.logo-upload-area:hover { border-color: var(--a-primary); background: rgba(37,99,235,.03); }
.logo-upload-area.drag-over { border-color: var(--a-primary); background: rgba(37,99,235,.05); }
.logo-preview {
  max-width: 160px; max-height: 60px;
  margin: 0 auto .75rem;
  object-fit: contain;
}
.logo-upload-icon { font-size: 2rem; margin-bottom: .5rem; }
.logo-upload-text { font-size: .85rem; color: var(--a-muted); }
.logo-upload-text strong { color: var(--a-primary); }
#logo-file-input { display: none; }

/* ── Toast notification ───────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000;
  background: var(--a-ink); color: #fff;
  border-radius: 10px;
  padding: .875rem 1.25rem;
  font-size: .875rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  transform: translateY(80px); opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: none;
  display: flex; align-items: center; gap: .6rem;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--a-success); }
#toast.error { background: var(--a-danger); }
#toast svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Overlay for mobile sidebar ───────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,.5);
}
#sidebar-overlay.visible { display: block; }

/* ── Export section ───────────────────────────────────────── */
.export-box {
  background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(6,182,212,.06));
  border: 1.5px solid rgba(37,99,235,.2);
  border-radius: var(--a-r);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.export-box h3 { font-size: 1rem; margin-bottom: .5rem; }
.export-box p { font-size: .85rem; color: var(--a-muted); margin-bottom: 1rem; line-height: 1.6; }
.export-steps {
  counter-reset: step;
  display: flex; flex-direction: column; gap: .65rem;
  margin-bottom: 1.25rem;
}
.export-step {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .85rem; color: var(--a-muted);
}
.export-step::before {
  counter-increment: step;
  content: counter(step);
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%;
  background: var(--a-primary);
  color: #fff;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: .05rem;
}
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  .panel { padding: 1.25rem; }
  .a-card { padding: 1.25rem; }
}
