/* style.css — Base tokens, layout and auth styling for Admin Frontend */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-dark: #059669;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --shadow: 0 4px 16px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 40px -12px rgba(15,23,42,0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: #f8fafc;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ═══════════ Topbar ═══════════ */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 0.92rem;
  flex-shrink: 0;
}
.brand-link {
  display: flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
}
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-ghost {
  background: transparent; border: 0; color: var(--text-2);
  padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .12s, color .12s;
}
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.user-chip {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═══════════ Offline banner ═══════════ */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 9px 16px; background: #fef3c7; color: #92400e; font-size: 0.84rem; font-weight: 600;
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-bottom: 1px solid #fde68a;
}
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }

/* ═══════════ Auth page (login) ═══════════ */
body.auth-page {
  background: radial-gradient(1200px 600px at 20% 0%, #1e1b4b 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #31104b 0%, transparent 55%), #0f172a;
  min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; color: #f8fafc;
}
.auth-card {
  width: 100%; max-width: 400px; background: #ffffff; color: var(--text);
  border-radius: 22px; padding: 32px 28px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: cardIn .25s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-logo { margin-bottom: 18px; }
.auth-logo .logo-mark {
  width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800;
}
.auth-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.auth-subtitle { color: var(--text-2); font-size: 0.88rem; margin: 4px 0 20px; }
.auth-card .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.auth-card .field label { font-size: 0.8rem; font-weight: 700; color: var(--text-2); }
.auth-card .field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-strong); border-radius: 12px;
  font: inherit; font-size: 0.95rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-card .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; color: var(--text-3); display: grid; place-items: center; padding: 4px;
}
.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; }
.btn-primary {
  width: 100%; padding: 13px; border: 0; border-radius: 12px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 8px 20px -6px rgba(79,70,229,.6);
  font: inherit; font-size: 0.98rem; font-weight: 700; margin-top: 6px; transition: transform .08s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 24px -6px rgba(79,70,229,.7); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 0.84rem; font-weight: 600; margin-bottom: 14px; background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
.auth-footer { text-align: center; color: var(--text-3); font-size: 0.78rem; margin-top: 18px; }

