:root {
  --font-main:
    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --red: #e9202a;
  --red-dark: #b71821;
  --red-soft: #fff0f1;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --white: #fff;
  --green: #16a34a;
  --yellow: #d97706;
  --blue: #2563eb;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}
* {
  box-sizing: border-box;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE 10+ & Edge Legacy */
}
*::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Edge, Opera */
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
html {
  scroll-behavior: smooth;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
}
html::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
a {
  text-decoration: none;
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
/* ==========================================================================
   SIDEBAR & NAVIGASI TERPUSAT
   ========================================================================== */
.sidebar {
  width: 265px;
  flex: 0 0 265px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 20;
}
.sidebar .brand {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 24px;
  border-bottom: 1px solid var(--line);
}
.brand img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}
.brand strong {
  display: block;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand span {
  display: block;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-top: 3px;
}
.sidebar > nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
}
.sidebar > nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
.nav-label {
  font-size: 10px;
  font-weight: 800;
  color: #a3a5ab;
  letter-spacing: 0.12em;
  padding: 20px 11px 8px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 10px;
  color: #60636b;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: visible;
  box-sizing: border-box;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.sidebar nav a .nav-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #7d818a;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}
.sidebar nav a .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}
.sidebar nav a .nav-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar nav a > span:not(.nav-icon):not(.nav-text) {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar nav a:hover {
  background: var(--red-soft);
  color: var(--red);
  transform: translateX(3px);
}
.sidebar nav a:hover .nav-icon {
  color: var(--red);
  transform: scale(1.1);
}
.sidebar nav a.active {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(233, 32, 42, 0.24);
}
.sidebar nav a.active .nav-icon {
  color: #ffffff;
}
.sidebar nav a.active:hover {
  background: var(--red-dark);
  color: #ffffff;
  transform: none;
}
.sidebar nav a.active:hover .nav-icon {
  color: #ffffff;
  transform: none;
}
.nav-spacer {
  height: 30px;
  flex-shrink: 0;
}
@media (min-width: 769px) {
  .sidebar > nav {
    width: 100%;
    padding-bottom: 25px;
  }
}
.sidebar-bottom {
  margin-top: auto;
}
.mini-card {
  background: linear-gradient(135deg, #fff0f1, #fff);
  border: 1px solid #ffd4d6;
  padding: 12px;
  border-radius: 12px;
}
.mini-card b,
.mini-card span {
  display: block;
}
.mini-card b {
  font-size: 12px;
}
.mini-card span {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.logout-link {
  display: block;
  text-align: center;
  padding: 12px;
  color: #777;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.main-content {
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h2 {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0;
}
.topbar-kicker,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.topbar-user small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}
.icon-btn {
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  transition: 0.2s;
}
.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.danger-text {
  color: #d51c27;
}
.page-body {
  padding: 28px 34px;
}
.footer {
  padding: 25px 34px 35px;
  color: #999;
  font-size: 10px;
}
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #b71821 100%);
  color: #fff;
  border-radius: 20px;
  padding: 34px 38px;
  min-height: 205px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero:after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  right: -90px;
  top: -110px;
  pointer-events: none;
}
.hero .eyebrow {
  color: #fca5a5;
  margin-bottom: 8px;
  display: inline-block;
}
.hero h1 {
  font-family: var(--font-main);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.hero h1 em {
  color: #f87171;
  font-style: normal;
}
.hero p {
  max-width: 590px;
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
}
.hero-art img {
  width: 135px;
  height: 135px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.4));
  opacity: 0.98;
}
.hero.compact {
  min-height: 155px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 22px 0;
}
.stats-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.stat-card:after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--red-soft);
  opacity: 0.7;
  pointer-events: none;
  transition: transform 0.3s ease;
}
.stat-card:hover:after {
  transform: scale(1.15);
}
.stat-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.stat-card:hover .stat-icon {
  transform: scale(1.08);
}
.stat-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stat-card strong {
  font-family: var(--font-main);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: block;
  margin: 4px 0 2px;
  line-height: 1.2;
}
.stat-card small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
}

/* Variasi Warna Semantik Stat Card */
.stat-card.stat-books .stat-icon {
  background: var(--red-soft);
  color: var(--red);
}
.stat-card.stat-books:after {
  background: var(--red-soft);
}
.stat-card.stat-members .stat-icon {
  background: #eff6ff;
  color: #2563eb;
}
.stat-card.stat-members:after {
  background: #eff6ff;
}
.stat-card.stat-borrow .stat-icon {
  background: #fef3c7;
  color: #d97706;
}
.stat-card.stat-borrow:after {
  background: #fef3c7;
}
.stat-card.stat-overdue .stat-icon {
  background: #fee2e2;
  color: #dc2626;
}
.stat-card.stat-overdue:after {
  background: #fee2e2;
}
.stat-card.stat-overdue strong {
  color: #dc2626;
}
.stat-card.stat-overdue small {
  color: #ef4444;
  font-weight: 600;
}
.stat-card.stat-success .stat-icon {
  background: #dcfce7;
  color: #15803d;
}
.stat-card.stat-success:after {
  background: #dcfce7;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 18px;
}
.content-grid.two {
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.panel h3,
.panel-head h3 {
  font-family: var(--font-main);
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.table-wrap {
  overflow: auto;
}
.table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}
.table-wrap th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-wrap td {
  font-size: 12.5px;
  padding: 14px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--ink);
}
.table-wrap tr:hover td {
  background: #f8fafc;
}
.table-wrap td b {
  font-weight: 700;
  color: var(--ink);
  display: block;
  line-height: 1.35;
}
.table-wrap td small {
  display: block;
  color: #94a3b8;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
}
.title-cell {
  font-weight: 700;
  min-width: 170px;
}
.wide {
  min-width: 1900px !important;
}
.empty {
  text-align: center !important;
  color: #94a3b8 !important;
  padding: 40px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}
.badge:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.success {
  background: #dcfce7;
  color: #15803d;
}
.badge.warning {
  background: #fef3c7;
  color: #b45309;
}
.badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.badge.info {
  background: #eff6ff;
  color: #1d4ed8;
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 7px 18px rgba(233, 32, 42, 0.18);
}
.btn-soft {
  background: #f3f3f5;
  color: #555;
}
.btn-sm {
  padding: 7px 10px;
  font-size: 10px;
}
.btn-lg {
  padding: 12px 16px;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.page-actions .muted {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}
.filterbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 6px 5px 14px;
  max-width: 680px;
  width: 100%;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.searchbox:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(233, 32, 42, 0.08);
}
.search-icon,
.searchbox > span.search-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}
.searchbox input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 120px;
  font-family: var(--font-main);
  font-size: 12.5px;
  color: var(--ink);
  background: transparent;
}
.searchbox input::placeholder {
  color: #94a3b8;
}
.result-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.result-count b {
  color: var(--ink);
  font-weight: 800;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-icon-label {
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
}
.btn-icon-label svg {
  flex-shrink: 0;
  display: block;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}
.form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-grid label {
  font-size: 10px;
  font-weight: 800;
  color: #5d6068;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-form input {
  width: 100%;
  border: 1px solid #dddfe4;
  background: #fff;
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
  font-size: 11px;
  color: #202127;
}
.form-grid textarea {
  min-height: 84px;
  resize: vertical;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.inline-form input:focus {
  border-color: #f07b81;
  box-shadow: 0 0 0 3px #fff0f1;
}
.form-span {
  grid-column: 1/-1;
}
.req {
  color: var(--red);
  margin-left: 3px;
}
.alert {
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 11px;
  margin-bottom: 14px;
}
.alert.danger {
  background: #ffeff0;
  color: #b51a23;
  border: 1px solid #ffd2d5;
}
.alert.success {
  background: #ecfaf1;
  color: #177443;
  border: 1px solid #ccefd9;
}
.quick-panel h3 {
  margin-bottom: 16px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: 3px 0;
  border-radius: 12px;
  border: 1px solid transparent;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-link:last-of-type {
  border-bottom-color: transparent;
}
.quick-link:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(4px);
}
.quick-icon,
.quick-link > span:first-child {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}
.quick-link:hover .quick-icon,
.quick-link:hover > span:first-child {
  background: var(--red);
  color: #fff;
  transform: scale(1.06);
}
.quick-icon svg,
.quick-link > span:first-child svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}
.quick-link div {
  flex: 1 1 auto;
  min-width: 0;
}
.quick-link b {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.quick-link small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.quick-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  border-radius: 6px;
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}
.quick-arrow svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  display: block;
}
.quick-link:hover .quick-arrow {
  color: var(--red);
  transform: translateX(3px);
}
.loan-list {
  display: flex;
  flex-direction: column;
}
.loan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.loan-item:last-child {
  border-bottom: none;
}
.loan-item b {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  display: block;
}
.loan-item span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}
.loan-item small {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 3px;
  display: block;
}

/* ==========================================================================
   TRANSAKSI PEMINJAMAN & PENCARIAN SISWA TERPADU
   ========================================================================== */
.siswa-search-wrapper {
  position: relative;
  width: 100%;
}
.siswa-search-wrapper input {
  width: 100%;
  box-sizing: border-box;
}
.siswa-result-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}
.siswa-result-box.show {
  display: block;
}
.siswa-result-item {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}
.siswa-result-item:last-child {
  border-bottom: none;
}
.siswa-result-item:hover {
  background: var(--red-soft);
}
.siswa-result-name {
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.siswa-result-info {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}
.siswa-result-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.status-siswa {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.status-siswa.ditemukan {
  color: var(--green);
  font-weight: 600;
}
.status-siswa.manual {
  color: #b45309;
}
.input-siswa-terpilih {
  border-color: #22c55e !important;
  background-color: #f0fdf4 !important;
}

/* ==========================================================================
   TRANSAKSI MULTI-BUKU PICKER (1-4 BUKU)
   ========================================================================== */
.buku-peminjaman-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.buku-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.buku-row label {
  flex: 1;
  margin: 0;
}
.buku-nomor {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.buku-row select {
  width: 100%;
}
.buku-hapus {
  border: 1px solid #fee2e2;
  background: #fff1f2;
  color: #dc2626;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}
.buku-hapus:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: scale(1.05);
}
.buku-tambah {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed var(--line);
  background: #f8fafc;
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 12px;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.buku-tambah:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.buku-info {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}
.buku-info strong {
  color: var(--red);
}

/* ==========================================================================
   TRANSAKSI PENGEMBALIAN & RINGKASAN KONFIRMASI
   ========================================================================== */
.return-summary-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.return-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}
.row-actions {
  display: flex;
  gap: 6px;
}
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}
.filter-grid label {
  font-family: var(--font-main);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.filter-grid input,
.filter-grid select {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
  font-family: var(--font-main);
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.filter-grid input:focus,
.filter-grid select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(233, 32, 42, 0.08);
}
@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.feature-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.feature-grid b,
.feature-grid span {
  display: block;
}
.feature-grid b {
  font-size: 11px;
}
.feature-grid span {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
}
.small-panel {
  max-width: 650px;
}
.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.inline-form input {
  flex: 1;
}
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tag-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.category-tag-name {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
.category-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.tag-row:hover .category-icon-box {
  transform: scale(1.08);
}
.segmented {
  display: inline-flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
  margin: 18px 0;
  border: 1px solid var(--line);
}
.segmented a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  font-family: var(--font-main);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.segmented a svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  display: block;
}
.segmented a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.segmented a.active {
  background: #fff;
  color: var(--red);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.btn-success-soft {
  background: #ecfdf5;
  color: #16a34a;
}
.btn-success-soft:hover {
  background: #dcfce7;
  color: #15803d;
}
.upload-box {
  border: 2px dashed #fca5a5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
  padding: 38px 24px;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.02);
}
.upload-box:hover {
  border-color: var(--red);
  background: #fff8f8;
  box-shadow: 0 6px 20px rgba(233, 32, 42, 0.06);
}
.upload-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(233, 32, 42, 0.25);
  transition: transform 0.25s ease;
}
.upload-box:hover .upload-icon-badge {
  transform: scale(1.05) translateY(-2px);
}
.upload-icon-badge svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}
.upload-box h3 {
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.upload-target-hint {
  font-family: var(--font-main);
  font-size: 13px;
  color: #475569;
  margin: 0 0 22px;
}
.upload-target-hint strong {
  color: var(--red);
  font-weight: 700;
}
.upload-target-hint .text-subtle {
  color: #94a3b8;
  font-size: 12px;
}
.upload-file-input {
  display: block;
  margin: 0 auto 24px;
  width: 100%;
  max-width: 380px;
  font-family: var(--font-main);
  font-size: 12.5px;
  color: #475569;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.upload-file-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(233, 32, 42, 0.08);
}
.btn-upload-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(233, 32, 42, 0.24);
  cursor: pointer;
}
.btn-upload-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(233, 32, 42, 0.32);
}
.upload-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-template-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-template-download:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.btn-template-download svg {
  color: var(--red);
}
.code-list {
  background: #0f172a;
  border-radius: 12px;
  padding: 16px 20px;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  overflow-x: auto;
  letter-spacing: 0.02em;
  margin-top: 14px;
}
.info-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: var(--font-main);
  font-size: 12.5px;
  color: #334155;
  margin-top: 16px;
  line-height: 1.6;
}
.info-note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.info-note-head svg {
  color: var(--red);
  flex-shrink: 0;
}
.info-note b {
  color: var(--red);
}
.alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}
.alert-head svg {
  flex-shrink: 0;
}
.alert ul {
  margin: 6px 0 0 24px;
  padding: 0;
}
.alert li {
  margin-bottom: 4px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #111218;
  position: relative;
  overflow: hidden;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #e9202a 0, rgba(233, 32, 42, 0) 70%);
  left: -200px;
  top: -180px;
  opacity: 0.45;
}
.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #b71821 0, rgba(183, 24, 33, 0) 70%);
  right: -280px;
  bottom: -300px;
  opacity: 0.35;
}
.login-card {
  width: min(430px, calc(100% - 30px));
  background: rgba(255, 255, 255, 0.97);
  padding: 35px;
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
  text-align: center;
}
.login-logo-wrap {
  width: 75px;
  height: 75px;
  margin: 0 auto 15px;
}
.login-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-card h1 {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0;
}
.login-card > .muted {
  line-height: 1.6;
  margin: 0 0 20px;
}
.login-card .form-grid {
  text-align: left;
}
.login-card label {
  font-size: 10px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-card input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  outline: 0;
}
.login-card input:focus {
  border-color: #f07b81;
  box-shadow: 0 0 0 3px #fff0f1;
}
.login-hint {
  font-size: 9px;
  color: #999;
  margin-top: 14px;
}
.reveal {
  animation: rise 0.5s both;
  animation-delay: var(--delay);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.mobile-menu {
  display: none;
}
@media (max-width: 1050px) {
  .sidebar {
    width: 220px;
    flex-basis: 220px;
  }
  .page-body,
  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }
  .content-grid,
  .content-grid.two {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filter-grid button {
    grid-column: 1/-1;
  }
  .form-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: -270px;
    transition: 0.25s;
  }
  .sidebar-open .sidebar {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
  }
  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 15;
  }
  .mobile-menu {
    display: block;
    font-size: 20px;
    margin-right: 12px;
  }
  .topbar {
    padding: 0 14px;
  }
  .topbar > div:first-of-type {
    display: flex;
    align-items: center;
  }
  .topbar-user > div:not(.avatar),
  .topbar-user .icon-btn {
    display: none;
  }
  .page-body {
    padding: 18px 14px;
  }
  .page-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .stats-grid,
  .stats-grid.three {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    padding: 25px;
    min-height: 190px;
  }
  .hero h1 {
    font-size: 23px;
  }
  .hero-art {
    display: none;
  }
  .form-grid.cols-2,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .filter-grid button {
    grid-column: auto;
  }
  .panel {
    padding: 15px;
  }
  .footer {
    padding: 20px 14px;
  }
  .login-card {
    padding: 28px;
  }
  .actions {
    width: 100%;
  }
}
@media (max-width: 450px) {
  .stats-grid,
  .stats-grid.three {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 21px;
  }
}

/* =========================================================
   MODAL COMPONENT (Versi 2.0 Consolidated Architecture)
========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 25, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-dialog {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}
.modal-dialog.modal-lg {
  max-width: 860px;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-header-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  flex-shrink: 0;
}
.modal-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}
.modal-header-icon.primary {
  background: var(--red-soft);
  color: var(--red);
}
.modal-header-icon.warning {
  background: #fef3c7;
  color: #d97706;
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-main);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
  transition: 0.15s;
}
.modal-close:hover {
  color: var(--red);
  background: var(--red-soft);
}
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafafa;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* ==========================================================================
   CROSS-BROWSER SCROLLBAR HIDING UTILITIES & CONTAINERS
   Scroll visual disembunyikan; scroll fungsional, mousewheel, keyboard & touch tetap aktif & responsif
   ========================================================================== */
.table-wrap,
.modal-dialog,
.modal-body,
.code-list,
.siswa-result-box,
.no-scrollbar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::-webkit-scrollbar,
.modal-dialog::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.code-list::-webkit-scrollbar,
.siswa-result-box::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* ==========================================================================
   TEMPLATE DOWNLOAD & VISUAL PREVIEW STYLES
   ========================================================================== */
.btn-template-excel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-template-excel:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}
.btn-template-excel svg {
  color: #059669;
}

.btn-template-csv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-template-csv:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.btn-template-csv svg {
  color: #64748b;
}

.template-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.template-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}
.template-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
}
.template-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.template-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.template-card-icon.excel {
  background: #ecfdf5;
  color: #059669;
}
.template-card-icon.csv {
  background: #eff6ff;
  color: #2563eb;
}
.template-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.template-card-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 16px;
}
.badge-status-req {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
}
.badge-status-opt {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.badge-status-auto {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #e0e7ff;
  color: #4338ca;
}
.preview-spreadsheet-container {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 16px;
}
.preview-spreadsheet-header {
  background: #f8fafc;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.preview-spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.preview-spreadsheet-table th {
  background: #1e3a8a;
  color: #ffffff;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}
.preview-spreadsheet-table th:last-child {
  border-right: none;
}
.preview-spreadsheet-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  color: #334155;
}
.preview-spreadsheet-table td:last-child {
  border-right: none;
}
.preview-spreadsheet-table tr:hover td {
  background: #f8fafc;
}
