@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Vibrant Accent Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --grad-teal: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
  --grad-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-sunset: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
  --grad-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --grad-violet: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  --grad-dark: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  --grad-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 70%, #6366f1 100%);

  /* Color Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --sidebar-bg: #0b0f19;
  --sidebar-nav: #0f172a;
  --sidebar-line: rgba(255, 255, 255, 0.08);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-line: #e2e8f0;
  --border-focus: #818cf8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 8px 24px -4px rgba(99, 102, 241, 0.25);
  --shadow-glow-emerald: 0 8px 24px -4px rgba(16, 185, 129, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(at 15% 10%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 85% 15%, rgba(6, 182, 212, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(245, 158, 11, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

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

/* ==========================================================
   APP SHELL & SIDEBAR
   ========================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text b {
  color: #a855f7;
  font-weight: 800;
}

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px;
}

.side-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 18px 12px 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.nav-item .nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item .nav-text {
  flex: 1;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  transform: translateX(3px);
}

.nav-item:hover .nav-icon {
  color: #a855f7;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: #ffffff;
  border-left: 3px solid #8b5cf6;
  box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.15);
}

.nav-item.active .nav-icon {
  color: #a855f7;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-line);
  background: rgba(0, 0, 0, 0.2);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
}

.user-avatar-gradient {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 14px;
  box-shadow: var(--shadow-glow);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  margin-top: 2px;
}

.logout-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.logout-action svg {
  width: 17px;
  height: 17px;
}

.logout-action:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* ==========================================================
   MAIN CONTAINER & TOPBAR
   ========================================================== */
.main {
  margin-left: 270px;
  width: calc(100% - 270px);
  padding: 30px 42px 60px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border-line);
  padding: 8px;
  border-radius: 10px;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.eyebrow-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin-bottom: 2px;
}

.topbar-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #065f46;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: #ffffff;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-display-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-level-tag {
  font-size: 10px;
  font-weight: 600;
  color: #8b5cf6;
}

/* ==========================================================
   HERO BANNER
   ========================================================== */
.hero {
  background: var(--grad-hero);
  border-radius: var(--radius-lg);
  padding: 38px 42px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 20px 30px -10px rgba(79, 70, 229, 0.35);
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  color: #ffffff;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #a5f3fc 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: #c7d2fe;
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

.hero-actions {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--grad-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn.primary:hover {
  box-shadow: 0 10px 25px -4px rgba(99, 102, 241, 0.45);
}

.btn.accent-emerald {
  background: var(--grad-emerald);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow-emerald);
}

.btn.hero-cta {
  background: #ffffff;
  color: #4338ca;
  font-weight: 800;
  border: none;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn.hero-cta:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.btn.full {
  width: 100%;
}

/* ==========================================================
   STAT CARDS GRID
   ========================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

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

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.indigo { background: var(--grad-primary); box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.35); }
.stat-icon.emerald { background: var(--grad-emerald); box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.35); }
.stat-icon.amber { background: var(--grad-sunset); box-shadow: 0 6px 16px -2px rgba(245, 158, 11, 0.35); }
.stat-icon.cyan { background: var(--grad-teal); box-shadow: 0 6px 16px -2px rgba(6, 182, 212, 0.35); }

.stat-card small {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 4px 0 6px;
}

.stat-card .trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.trend-pill.indigo { background: #eef2ff; color: #4f46e5; }
.trend-pill.emerald { background: #ecfdf5; color: #059669; }
.trend-pill.amber { background: #fef3c7; color: #b45309; }
.trend-pill.cyan { background: #e0f2fe; color: #0284c7; }

/* ==========================================================
   PANELS & LAYOUT GRIDS
   ========================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  margin-bottom: 26px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 22px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin: 0 0 4px;
}

.panel h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================
   LEVEL RING PANEL
   ========================================================== */
.level-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.level-ring-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 12px auto 16px;
}

.level-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#8b5cf6 0% 70%, #e2e8f0 70% 100%);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.level-ring::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #ffffff;
}

.level-ring-inner {
  position: relative;
  z-index: 1;
}

.level-ring-inner strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  color: #4f46e5;
  line-height: 1;
}

.level-ring-inner span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.progress-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  display: block;
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ==========================================================
   BOOK LIST & SHELF
   ========================================================== */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-card-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card-item:hover {
  background: #f8fafc;
  transform: translateX(4px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.book-thumbnail {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.book-thumbnail svg {
  width: 22px;
  height: 22px;
}

.book-thumbnail.emerald { background: var(--grad-emerald); }
.book-thumbnail.sunset { background: var(--grad-sunset); }

.book-details {
  flex: 1;
  min-width: 0;
}

.book-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-author {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-read-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #6366f1;
}

/* ==========================================================
   COMMUNITY FEED
   ========================================================== */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-item {
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-line);
}

.feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-violet);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.feed-body {
  flex: 1;
}

.feed-author {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.feed-text {
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-line);
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-btn:hover, .reaction-btn.reacted {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #e11d48;
}

/* ==========================================================
   TABLES & CRUD
   ========================================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.modern-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-line);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.modern-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-line);
  color: var(--text-main);
}

.modern-table tr:last-child td {
  border-bottom: none;
}

.modern-table tr:hover td {
  background: #f8fafc;
}

/* ==========================================================
   AUTH & LOGIN PAGE
   ========================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 15%, rgba(99, 102, 241, 0.15) 0, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(236, 72, 153, 0.12) 0, transparent 40%),
    #0b0f19;
}

.auth-card {
  width: min(440px, 100%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: #f1f5f9;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-card h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #ffffff;
}

.auth-card p.subtitle {
  color: #94a3b8;
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.auth-form input, .input-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  margin-top: 6px;
  transition: all 0.2s ease;
}

.auth-form input:focus, .input-control:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  background: rgba(15, 23, 42, 0.8);
}

.demo-account-pills {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 10px;
}

.demo-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.demo-chip {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.demo-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #ffffff;
}

/* Alert Boxes */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.alert.danger {
  background: #fef2f2;
  border: 1px solid #fecdd3;
  color: #991b1b;
}

.alert.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* ==========================================================
   READER
   ========================================================== */
.reader-top {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--border-line);
}

.reader-container {
  max-width: 1180px;
  margin: 36px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
}

.page-card {
  background: #ffffff;
  min-height: 580px;
  padding: 50px 65px;
  border: 1px solid var(--border-line);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  position: relative;
}

.page-card h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 1.25;
  color: var(--text-main);
  margin-top: 8px;
}

.reader-controls {
  position: absolute;
  bottom: 28px;
  left: 65px;
  right: 65px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-line);
  padding-top: 18px;
}

/* ==========================================================
   RESPONSIVENESS
   ========================================================== */
@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid, .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open .sidebar-backdrop {
    display: block;
  }
  .mobile-close-btn, .mobile-menu-btn {
    display: block;
  }
  .main {
    margin-left: 0;
    width: 100%;
    padding: 20px 16px 50px;
  }
  .topbar-right .live-clock-pill,
  .topbar-right .status-indicator-pill {
    display: none;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
    gap: 20px;
  }
  .reader-container {
    grid-template-columns: 1fr;
  }
  .page-card {
    padding: 30px 20px;
  }
  .reader-controls {
    left: 20px;
    right: 20px;
  }
}

body.nav-open,
body.landing-menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-title {
    font-size: 20px;
  }

  .user-profile-badge {
    padding: 6px;
  }

  .user-meta {
    display: none;
  }

  .panel {
    padding: 18px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.partnership-page {
  min-height: 100vh;
  padding: 28px 20px 64px;
  background:
    radial-gradient(circle at 85% 5%, rgba(99, 102, 241, 0.12), transparent 28rem),
    var(--bg-app);
}

.partnership-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
}

.partnership-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.partnership-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.partnership-form {
  display: grid;
  gap: 14px;
}

.partnership-form label {
  margin: 0 0 5px;
}

.partnership-form textarea {
  min-height: 130px;
  resize: vertical;
}

.partnership-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.partnership-visual {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}

.partnership-visual img {
  width: min(250px, 70%);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 760px) {
  .partnership-grid {
    grid-template-columns: 1fr;
  }

  .partnership-page {
    padding: 18px 16px 40px;
  }

  .partnership-nav {
    margin-bottom: 22px;
  }
}
