:root {
  --auth-blue: #6096ba;
  --auth-blue-dark: #274c77;
  --auth-ink: #274c77;
  --auth-bg: #e7ecef;
  --auth-surface: rgba(255,255,255,0.9);
  --auth-surface-strong: #e7ecef;
  --auth-border: rgba(39,76,119,0.10);
  --auth-muted: #8b8c89;
  --auth-success: #18865a;
  --auth-danger: #dc2626;
  --auth-shadow: 0 24px 50px rgba(39,76,119,0.12);
}

* { box-sizing: border-box; }
body.auth-page { margin: 0; font-family: 'Inter', sans-serif; color: var(--auth-ink); background: radial-gradient(circle at top left, rgba(96,150,186,0.16), transparent 28%), var(--auth-bg); min-height: 100vh; }
body.auth-page::before, body.auth-page::after { content: ''; position: fixed; width: 320px; height: 320px; border-radius: 50%; filter: blur(40px); opacity: 0.4; z-index: 0; pointer-events: none; }
body.auth-page::before { background: rgba(96,150,186,0.16); top: -90px; left: -80px; }
body.auth-page::after { background: rgba(96,150,186,0.12); bottom: -80px; right: -60px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.top-nav {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,0.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--auth-border);
}
.top-nav .nav-wrap { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.top-nav .brand img { height: 36px; }
.top-nav .nav-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; color: var(--auth-muted); font-size: 14px; font-weight: 600; }
.top-nav .nav-links a:hover, .top-nav .nav-links a.active { color: var(--auth-blue); }
.top-nav .nav-actions { display: flex; align-items: center; gap: 10px; }
.top-nav .nav-actions .btn-ghost, .top-nav .nav-actions .btn-primary { padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(96,150,186,0.08);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(96,150,186,0.15);
}

.sidebar-toggle:focus {
  outline: 2px solid var(--auth-blue);
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  color: var(--auth-ink);
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }
}
.btn-primary { display: inline-flex; align-items: center; justify-content: center; border: none; background: linear-gradient(135deg, var(--auth-blue), var(--auth-blue-dark)); color: white; box-shadow: 0 14px 26px rgba(42,109,244,0.2); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(42,109,244,0.24); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--auth-border); background: rgba(255,255,255,0.86); color: var(--auth-ink); cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--auth-blue); }
.btn-loading { pointer-events: none; opacity: 0.8; }

.auth-shell { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 68px); padding: 28px 18px 48px; }
.auth-card, .dashboard-card, .profile-card, .settings-card { background: var(--auth-surface); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.6); border-radius: 24px; box-shadow: var(--auth-shadow); }
.auth-card { width: min(100%, 480px); padding: 36px; }
.auth-header { margin-bottom: 20px; }
.auth-header h1 { margin: 0 0 8px; font-size: 28px; font-weight: 700; }
.auth-header p { margin: 0; color: var(--auth-muted); line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 10px; }
.auth-field label { font-size: 13px; font-weight: 700; color: var(--auth-ink); letter-spacing: 0.02em; }
.auth-field input { width: 100%; border: 1px solid var(--auth-border); border-radius: 12px; background: rgba(255,255,255,0.95); padding: 16px 18px; height: 54px; color: var(--auth-ink); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; font-size: 15px; }
.auth-field input:focus { outline: none; border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgba(42,109,244,0.1); transform: translateY(-1px); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); background: transparent; border: none; color: var(--auth-muted); cursor: pointer; font-size: 18px; padding: 4px; border-radius: 6px; transition: color 0.2s ease, background 0.2s ease; display: flex; align-items: center; justify-content: center; }
.password-toggle:hover { color: var(--auth-blue); background: rgba(42,109,244,0.06); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 14px; cursor: pointer; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--auth-blue); cursor: pointer; flex-shrink: 0; appearance: none; -webkit-appearance: none; border: 2px solid var(--auth-border); border-radius: 6px; position: relative; transition: all 0.2s ease; }
.checkbox-row input:checked { background: var(--auth-blue); border-color: var(--auth-blue); }
.checkbox-row input:checked::after { content: '✓'; position: absolute; color: white; font-size: 14px; font-weight: 700; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.checkbox-row input:hover { border-color: var(--auth-blue); }
.forgot-link, .auth-link { color: var(--auth-blue); font-weight: 600; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--auth-muted); font-size: 13px; margin: 12px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(18,22,35,0.06); }
.social-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--auth-border); background: #fff; color: var(--auth-ink); padding: 13px 16px; height: 54px; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.social-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,0.08); border-color: rgba(18,22,35,0.15); }
.social-btn.google { border-color: #e2e8f0; }
.google-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.auth-footer { margin-top: 16px; color: var(--auth-muted); text-align: center; font-size: 14px; }
.password-strength { display: flex; gap: 4px; margin-top: 6px; }
.strength-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--auth-border); transition: background 0.3s ease; }
.strength-bar.weak { background: #ef4444; }
.strength-bar.fair { background: #f59e0b; }
.strength-bar.good { background: #22c55e; }
.strength-bar.strong { background: #16a34a; }
.validation-message { font-size: 12px; margin-top: 4px; min-height: 16px; }
.validation-message.error { color: var(--auth-danger); }
.validation-message.success { color: var(--auth-success); }
.alert { padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; font-size: 14px; }
.alert-success { background: rgba(24,134,90,0.1); color: var(--auth-success); border-color: rgba(24,134,90,0.24); }
.alert-error { background: rgba(220,38,38,0.08); color: var(--auth-danger); border-color: rgba(220,38,38,0.2); }
.auth-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.helper-text { font-size: 12px; color: var(--auth-muted); }

.dashboard-shell { max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 20px; margin-top: 20px; }
.dashboard-card { padding: 24px; }
.dashboard-card h2, .dashboard-card h3 { margin: 0 0 10px; font-size: 22px; }
.dashboard-card p { margin: 0; color: var(--auth-muted); line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.stat-card { padding: 16px; border-radius: 16px; background: var(--auth-surface-strong); border: 1px solid var(--auth-border); }
.stat-card strong { display: block; font-size: 22px; color: var(--auth-blue); }
.stat-card span { font-size: 13px; color: var(--auth-muted); }
.list-card { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--auth-surface-strong); border: 1px solid var(--auth-border); }
.list-item .muted { color: var(--auth-muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; background: rgba(42,109,244,0.08); color: var(--auth-blue); font-size: 12px; font-weight: 700; }
.chip--spaced { margin-bottom: 10px; }
.btn-primary--auth { padding: 13px 16px; height: 54px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.dashboard-grid--spaced { margin-top: 20px; }
.form-grid--spaced { margin-top: 16px; }
.profile-layout { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 20px; margin-top: 20px; }
.profile-card, .settings-card { padding: 24px; }
.profile-card .avatar { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, rgba(42,109,244,0.16), rgba(42,109,244,0.06)); color: var(--auth-blue); font-size: 28px; font-weight: 700; margin-bottom: 16px; overflow: hidden; }
.profile-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.small-muted { font-size: 13px; color: var(--auth-muted); margin-top: 8px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.form-grid { display: grid; gap: 14px; }
.table-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.table-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.9); border: 1px solid var(--auth-border); }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.success { background: rgba(24,134,90,0.1); color: var(--auth-success); }
.badge.warning { background: rgba(245,158,11,0.12); color: #b26a00; }
.badge.danger { background: rgba(220,38,38,0.12); color: var(--auth-danger); }
.avatar-input { display: none; }
.skeleton { display: inline-block; width: 100%; height: 18px; border-radius: 999px; background: linear-gradient(90deg, rgba(42,109,244,0.08), rgba(42,109,244,0.16), rgba(42,109,244,0.08)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(360px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 16px; background: rgba(18,22,35,0.94); color: #fff; box-shadow: var(--auth-shadow); z-index: 100; transform: translateY(12px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 4px solid #34d399; }
.toast.error { border-left: 4px solid #f87171; }
.modal-overlay { position: fixed; inset: 0; background: rgba(8,12,24,0.46); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 120; }
.modal-card { width: min(100%, 420px); background: white; border-radius: 20px; padding: 24px; box-shadow: var(--auth-shadow); }
.modal-card h3 { margin: 0 0 8px; font-size: 20px; }
.modal-card p { margin: 0 0 14px; color: var(--auth-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.profile-menu { position: relative; }
.profile-menu .dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 188px; padding: 8px; border-radius: 16px; background: white; border: 1px solid var(--auth-border); box-shadow: var(--auth-shadow); display: none; }
.profile-menu.open .dropdown { display: block; }
.profile-menu .dropdown a { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--auth-ink); }
.profile-menu .dropdown a:hover { background: rgba(42,109,244,0.08); color: var(--auth-blue); }

@media (max-width: 900px) {
  .dashboard-grid, .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .top-nav .nav-wrap { padding: 12px 16px; }
  .top-nav .nav-links { font-size: 13px; gap: 12px; }
  .auth-card { padding: 24px; }
  .input-row, .stats-grid { grid-template-columns: 1fr; }
  .dashboard-shell { padding: 20px 16px 40px; }
  .auth-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-row, .list-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .auth-field input { height: 52px; padding: 14px 16px; }
  .social-btn { height: 52px; padding: 12px 16px; }
  .btn-primary--auth { height: 52px; }
}
