/* DIGILIB SMKN 1 GEGER — Royal Violet Responsive Institutional Theme (100% Offline LAN) */
:root {
  --bg: #f6f4fc;
  --surface: #ffffff;
  --surface-alt: #f3eefc;
  --surface-hover: #faf8ff;
  --border: #e4dcf5;
  --border-strong: #cfc1ed;
  --text: #1b1033;
  --muted: #5c4c7d;

  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --primary-deep: #3b0764;
  --primary-bright: #8b5cf6;
  --primary-soft: #f2ecff;
  --primary-ring: rgba(124, 58, 237, 0.24);

  --sidebar-bg-1: #19092f;
  --sidebar-bg-2: #28104a;
  --sidebar-border: rgba(196, 181, 253, 0.14);
  --sidebar-text: #d8cdf0;
  --sidebar-muted: #a693cf;

  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --shadow-sm: 0 1px 2px rgba(46, 16, 101, 0.05), 0 4px 12px rgba(46, 16, 101, 0.03);
  --shadow-md: 0 12px 32px rgba(46, 16, 101, 0.12);
  --radius: 10px;
  --radius-sm: 7px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--primary-hover); text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  padding: 1px 5px;
  border-radius: 4px;
}

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

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg-1) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 6, 36, 0.58);
  backdrop-filter: blur(2px);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

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

.brand-copy { min-width: 0; flex: 1; }
.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 12px;
  color: var(--sidebar-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-close svg { width: 17px; height: 17px; }

.nav {
  padding: 14px 12px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sidebar-muted);
  padding: 12px 12px 5px;
}
.nav-group-label:first-child { padding-top: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-icon svg { width: 17px; height: 17px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

.nav-link:hover {
  background: rgba(167, 139, 250, 0.14);
  color: #ffffff;
  text-decoration: none;
}

.nav-link.active {
  background: linear-gradient(90deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.36);
}
.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(12, 4, 26, 0.28);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.22);
  border: 1px solid rgba(196, 181, 253, 0.3);
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta { min-width: 0; flex: 1; }
.user-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  color: var(--sidebar-muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-logout {
  background: rgba(255, 255, 255, 0.07);
  color: #f3e8ff;
  border: 1px solid rgba(196, 181, 253, 0.25);
}
.btn-sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ==================== MAIN & TOPBAR ==================== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--primary-deep);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.menu-toggle:hover { background: var(--primary-soft); border-color: var(--primary); }
.menu-toggle svg { width: 20px; height: 20px; }

.topbar-titles { min-width: 0; }
.page-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.topbar-date {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.content {
  padding: 24px 28px 36px;
  max-width: 1380px;
  width: 100%;
  flex: 1;
}

.app-footer {
  padding: 14px 28px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== DASHBOARD HERO BANNER ==================== */
.hero-banner {
  background: linear-gradient(125deg, #240c47 0%, #4c1d95 55%, #6d28d9 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(76, 29, 149, 0.22);
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 88% 20%, rgba(196, 181, 253, 0.22) 0%, transparent 45%);
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; max-width: 680px; }
.hero-kicker {
  font-size: 12.5px;
  color: #ddd6fe;
  font-weight: 500;
  margin-bottom: 4px;
}
.hero-heading {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.hero-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #ede9fe;
  opacity: 0.92;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: #ffffff;
  color: #3b0764;
  border-color: #ffffff;
}
.btn-hero-primary:hover {
  background: #f5f3ff;
  color: #2e1065;
  transform: translateY(-1px);
}

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ==================== PANELS & KPI STATS ==================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease);
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ==================== FORMS & CONTROLS ==================== */
.form-group { margin-bottom: 14px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

textarea { min-height: 86px; resize: vertical; }
.help-text { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.24);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 33, 182, 0.32);
}

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover { background: #166534; color: #ffffff; }

.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover { background: #991b1b; color: #ffffff; }

.btn-outline {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--primary-soft);
  border-color: var(--primary-bright);
  color: var(--primary-hover);
}

.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ==================== TABLES ==================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--surface-alt);
  white-space: nowrap;
}

tbody tr { transition: background 0.12s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ==================== ALERTS & STATUS ==================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 13.5px;
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.alert-info { background: var(--primary-soft); border-color: var(--border-strong); color: var(--primary-hover); }

.status-text { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.status-active, .status-returned { color: var(--success); }
.status-borrowed, .status-inactive { color: var(--warning); }
.status-overdue, .status-suspended { color: var(--danger); }

/* ==================== TOOLBAR & TABS ==================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar input[type="text"],
.toolbar select,
.toolbar input[type="date"] {
  width: auto;
  min-width: 155px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-link {
  padding: 10px 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.tab-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
  border-radius: 6px 6px 0 0;
}
.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 12.5px; }

/* ==================== LOGIN PAGE (ROYAL PURPLE + ROTATING MOTIVATION) ==================== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #16072b 0%, #2b1055 52%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 1040px;
  min-height: 600px;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  box-shadow: 0 28px 70px rgba(13, 4, 28, 0.48);
  border: 1px solid rgba(196, 181, 253, 0.22);
}

.login-hero {
  background: linear-gradient(155deg, #1b0936 0%, #3b0764 56%, #5b21b6 100%);
  color: #ffffff;
  padding: 40px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.login-hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -110px;
  bottom: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.34) 0%, transparent 68%);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.login-brand-school {
  font-size: 12.5px;
  color: #ddd6fe;
  margin-top: 2px;
}

.quote-stage {
  position: relative;
  z-index: 1;
  margin: 32px 0;
}

.quote-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #ddd6fe;
  margin-bottom: 16px;
}

.quote-topic {
  font-weight: 600;
  color: #e9d5ff;
}

.quote-counter {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #c4b5fd;
}

.quote-body-wrap {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.quote-body-wrap.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

.quote-text {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 600;
  line-height: 1.48;
  color: #ffffff;
  text-wrap: balance;
}

.quote-author-block {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(221, 214, 254, 0.22);
}

.quote-author {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.quote-role {
  font-size: 12.5px;
  color: #d8b4fe;
  margin-top: 2px;
}

.quote-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 22px;
}

.quote-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c4b5fd 0%, #ffffff 100%);
  border-radius: 99px;
}

.quote-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.quote-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid rgba(221, 214, 254, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.quote-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}
.quote-btn svg { width: 14px; height: 14px; }

.login-hero-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.login-form-pane {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.login-heading {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pw-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.pw-toggle svg { width: 17px; height: 17px; }

.login-submit {
  margin-top: 6px;
  min-height: 44px;
  font-size: 14.5px;
}

.login-footnote {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.only-print { display: none; }

/* ==================== ROLE SWITCHER & PORTAL ANGGOTA ==================== */
.role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 20px;
}

.role-tab {
  min-height: 38px;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.role-tab:hover { color: var(--text); }
.role-tab.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.28);
}

.member-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.member-topbar {
  background: linear-gradient(95deg, #19092f 0%, #2b1055 60%, #4c1d95 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(196, 181, 253, 0.2);
  position: sticky;
  top: 0;
  z-index: 30;
}

.member-topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.member-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}
.member-brand:hover { color: #ffffff; text-decoration: none; }
.member-brand-title {
  display: block;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.15;
}
.member-brand-sub {
  display: block;
  font-size: 11.5px;
  color: #ddd6fe;
}

.member-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-nav-link {
  padding: 8px 13px;
  border-radius: 7px;
  color: #e9d5ff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.member-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-decoration: none;
}
.member-nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.member-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-user-info {
  text-align: right;
  line-height: 1.25;
}
.member-user-name { font-size: 13px; font-weight: 700; color: #ffffff; }
.member-user-sub { font-size: 11.5px; color: #ddd6fe; }

.btn-member-logout {
  background: #ffffff;
  color: #3b0764;
  border-color: #ffffff;
}
.btn-member-logout:hover {
  background: #f5f3ff;
  color: #2e1065;
}

.member-content {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 36px;
  flex: 1;
}

.member-footer {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.book-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-bright);
  box-shadow: var(--shadow-sm);
}

.book-card-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.book-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.book-card-author {
  font-size: 12.5px;
  color: var(--muted);
}

.book-card-desc {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.book-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.reader-title {
  margin: 4px 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.reader-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.reader-frame-wrap {
  margin-top: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #1b1033;
}

.reader-frame {
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: none;
  display: block;
}

/* ==================== PROFILE, AVATAR & MULTI-ADMIN ==================== */
.user-avatar {
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-card-link {
  padding: 6px;
  margin: -6px;
  border-radius: 10px;
  transition: background 0.16s var(--ease);
}
.user-card-link:hover {
  background: rgba(167, 139, 250, 0.16);
  text-decoration: none;
}

.member-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 10px;
  color: #ffffff;
  transition: background 0.16s var(--ease);
}
.member-profile-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-hero-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-bright) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(91, 33, 182, 0.25);
}
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.admin-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-bright) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.admin-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  border: 1px solid var(--border-strong);
}
.role-tag-primary {
  background: linear-gradient(135deg, var(--primary-bright) 0%, var(--primary) 100%);
  color: #ffffff;
  border-color: var(--primary);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.checkbox-inline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

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

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.24s var(--ease);
    box-shadow: 16px 0 40px rgba(17, 6, 36, 0.35);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; opacity: 1; }
  .sidebar-close { display: inline-flex; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 11px 18px; }
  .content { padding: 18px 18px 30px; }
  .app-footer { padding: 14px 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .login-page { padding: 14px; align-items: stretch; }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 560px;
    margin: auto;
  }
  .login-hero { padding: 28px 24px; }
  .quote-stage { margin: 20px 0; }
  .quote-body-wrap { min-height: 128px; }
  .login-form-pane { padding: 28px 24px 32px; }
  .member-user-info { display: none; }
}

@media (max-width: 640px) {
  .topbar-cta { display: none; }
  .topbar-date { font-size: 12px; }
  .page-title { font-size: 16.5px; }
  .hero-banner { padding: 18px; }
  .hero-heading { font-size: 18px; }
  .panel { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-box { padding: 14px; }
  .stat-value { font-size: 23px; }
  .toolbar > input[type="text"],
  .toolbar > select,
  .toolbar > input[type="date"] {
    width: 100%;
    min-width: 0;
  }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .member-topbar-inner { padding: 10px 14px; gap: 10px; }
  .member-content { padding: 16px 14px 28px; }
  .reader-frame { height: 68vh; min-height: 400px; }
}

/* ==================== SCHOOL CREST & ARTISTIC JARGON ==================== */
.brand-mark-crest {
  width: 44px;
  height: 44px;
  padding: 4px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, rgba(254, 240, 138, 0.24), rgba(124, 58, 237, 0.35));
  border: 1px solid rgba(253, 224, 71, 0.42);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(17, 6, 36, 0.35));
}

.login-crest-wrap {
  width: 62px;
  height: 62px;
  padding: 6px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 25%, rgba(254, 240, 138, 0.28), rgba(91, 33, 182, 0.55));
  border: 1.5px solid rgba(253, 224, 71, 0.52);
  box-shadow: 0 10px 28px rgba(236, 72, 153, 0.26), 0 0 0 5px rgba(167, 139, 250, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-crest-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(17, 6, 36, 0.45));
}

.jargon-art {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 16px 18px 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, rgba(236, 72, 153, 0.11) 52%, rgba(250, 204, 21, 0.1) 100%);
  border: 1px solid rgba(253, 224, 71, 0.32);
  backdrop-filter: blur(6px);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 5, 34, 0.26);
}

.jargon-art::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #fde047 0%, #f472b6 52%, #a78bfa 100%);
}

.jargon-sparkle {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 28px;
  height: 28px;
  color: rgba(253, 224, 71, 0.48);
  pointer-events: none;
}

.jargon-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fef08a 0%, #fde047 48%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.jargon-diamond {
  color: #f472b6;
  -webkit-text-fill-color: #f472b6;
  font-size: 9px;
}

.jargon-headline {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.jargon-champion {
  display: inline-block;
  position: relative;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 19px;
  color: #fef08a;
  padding: 0 2px 5px;
  text-shadow: 0 2px 12px rgba(250, 204, 21, 0.35);
}

.jargon-swoosh {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: 8px;
  pointer-events: none;
}

/* Dashboard Champion Hero Banner */
.hero-champion {
  background: linear-gradient(122deg, #1b0736 0%, #3b0764 42%, #5b21b6 76%, #7c3aed 100%);
  border: 1px solid rgba(253, 224, 71, 0.28);
  padding: 24px 28px;
}

.hero-champion::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-watermark {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  width: 190px;
  height: 190px;
  opacity: 0.085;
  pointer-events: none;
  filter: saturate(1.2);
}

.hero-brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.hero-crest-medallion {
  width: 64px;
  height: 64px;
  padding: 6px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, rgba(254, 240, 138, 0.3), rgba(76, 29, 149, 0.6));
  border: 1.5px solid rgba(253, 224, 71, 0.55);
  box-shadow: 0 10px 24px rgba(15, 5, 34, 0.35), 0 0 0 4px rgba(244, 114, 182, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-crest-medallion img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-jargon-ribbon {
  position: relative;
  padding: 9px 14px 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, rgba(236, 72, 153, 0.14) 60%, rgba(250, 204, 21, 0.12) 100%);
  border: 1px solid rgba(253, 224, 71, 0.34);
  overflow: hidden;
}

.hero-jargon-ribbon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5px;
  background: linear-gradient(180deg, #fde047 0%, #f472b6 55%, #c4b5fd 100%);
}

.hero-jargon-ribbon .jargon-eyebrow {
  font-size: 10.5px;
  margin-bottom: 3px;
}

.hero-jargon-ribbon .jargon-headline {
  font-size: 15px;
}

.hero-jargon-ribbon .jargon-champion {
  font-size: 17px;
}

.print-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.print-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.print-motto {
  font-style: italic;
  font-weight: 600;
  color: #5b21b6 !important;
}

@media (max-width: 640px) {
  .login-crest-wrap, .hero-crest-medallion { width: 52px; height: 52px; border-radius: 13px; }
  .jargon-headline { font-size: 15px; }
  .jargon-champion { font-size: 17px; }
  .hero-watermark { width: 130px; height: 130px; opacity: 0.06; }
}

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

@media print {
  .no-print { display: none !important; }
  .only-print { display: block !important; }
  body { background: #ffffff; color: #000000; font-size: 12px; }
  .shell { display: block; }
  .content { padding: 0; max-width: 100%; }
  .panel { border: none; box-shadow: none; padding: 0; }
  .print-header { text-align: center; border-bottom: 2px solid #2e1065; padding-bottom: 10px; margin-bottom: 16px; }
  .print-header h2 { margin: 0; font-size: 16px; color: #2e1065; }
  .print-header p { margin: 4px 0 0; font-size: 12px; color: #334155; }
}
