/* ==========================================================================
   PORTAL ADMIN PSB - EXECUTIVE DASHBOARD STYLESHEET
   ========================================================================== */

/* Tema Hijau & Putih Islami Modern (Prestisius, Elegan & Bersih) */
:root,
body.admin-body {
  --bg-light: #f4faf6;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdf4;
  --bg-glass-border: rgba(5, 150, 105, 0.16);
  --bg-glass-border-focus: #059669;

  --text-main: #0f291e;          /* High-contrast charcoal with green tint */
  --text-heading: #064e3b;       /* Islamic Deep Forest Green */
  --text-muted: #374151;         /* Crisp readable dark grey */
  --text-dim: #6b7280;           /* Visible secondary slate */
  --text-subtle: #4b5563;        /* Slate text */

  /* Islamic Emerald Palette */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;

  --primary: #059669;            /* Vibrant Emerald Green */
  --primary-hover: #047857;      /* Deep Forest Green */
  --accent: #10b981;             /* Mint / Jade */
  color: #0f291e;
}

/* Headings & Section Typography */
.admin-body h1,
.admin-body h2,
.admin-body h3,
.admin-body h4,
.admin-body h5,
.admin-body h6,
.section-title {
  color: #064e3b !important;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section-title {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-sub {
  font-size: 0.85rem;
  color: #4b5563 !important;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.modal-sub {
  font-size: 0.82rem;
  color: #4b5563 !important;
  margin-top: 0.2rem;
}

/* Global Form Group Labels & Inputs in Admin */
.admin-body .form-group label,
.login-card .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #064e3b !important;
  margin-bottom: 0.45rem;
}

.admin-body .label-required {
  font-size: 0.75rem;
  color: #dc2626 !important;
  font-weight: 600;
  margin-left: 0.35rem;
}

.admin-body .label-optional {
  font-size: 0.75rem;
  color: #6b7280 !important;
  font-weight: 400;
  margin-left: 0.35rem;
}

.admin-body .input-wrap .input-icon,
.login-card .input-wrap .input-icon {
  color: #059669 !important;
  font-size: 0.95rem;
}

.admin-body .input-wrap input,
.admin-body .custom-input,
.login-card input {
  width: 100%;
  background: #ffffff !important;
  border: 1.5px solid #d1fae5 !important;
  border-radius: var(--radius-md);
  color: #0f291e !important;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.admin-body .input-wrap input,
.admin-body .input-wrap .custom-input,
.login-card .input-wrap input {
  padding-left: 2.85rem !important;
}

.admin-body input::placeholder,
.admin-body textarea::placeholder,
.login-card input::placeholder {
  color: #9ca3af !important;
  opacity: 1;
}

.admin-body .input-wrap input:focus,
.admin-body .custom-input:focus,
.login-card input:focus {
  outline: none;
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2) !important;
  background: #ffffff !important;
}

.admin-body .input-wrap input:focus ~ .input-icon,
.login-card .input-wrap input:focus ~ .input-icon {
  color: #059669 !important;
}

.admin-body select,
.admin-body .custom-select {
  background-color: #ffffff !important;
  color: #0f291e !important;
  border: 1.5px solid #d1fae5 !important;
  border-radius: var(--radius-md);
}

.admin-body select:focus,
.admin-body .custom-select:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2) !important;
}

.admin-body select option,
.custom-select option {
  background-color: #ffffff !important;
  color: #0f291e !important;
}

/* Helper Utilities */
.admin-body .text-muted { color: #4b5563 !important; }
.admin-body .text-dim { color: #6b7280 !important; }
.admin-body .text-light { color: #064e3b !important; }
.admin-body .text-primary { color: #059669 !important; }
.admin-body .text-success { color: #059669 !important; }
.admin-body .text-warning { color: #d97706 !important; }
.admin-body .text-accent { color: #10b981 !important; }
.admin-body .text-danger { color: #dc2626 !important; }

/* Layout & Base */
.admin-body {
  background-color: #f4faf6;
  background-image: 
    radial-gradient(circle at 12% 10%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(5, 150, 105, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #ffffff 0%, #f0fdf4 100%);
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: #0f291e;
}

/* ==========================================================================
   LOGIN OVERLAY GATE
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 41, 30, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-overlay.active {
  display: flex;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2.25rem;
  background: #ffffff;
  border: 1.5px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(5, 150, 105, 0.2), 0 10px 25px rgba(0, 0, 0, 0.06);
  animation: modalScale 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem auto;
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.35);
}

.login-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #064e3b;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: #4b5563 !important;
}

.login-form .form-group {
  margin-bottom: 1.35rem;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.35rem;
}

.btn-toggle-eye:hover {
  color: #059669;
}

.login-hint {
  font-size: 0.8rem;
  color: #374151 !important;
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.login-hint code {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.btn-block {
  width: 100%;
  padding: 0.9rem;
  font-size: 0.95rem;
}

.login-footer-links {
  margin-top: 1.5rem;
  text-align: center;
}

.link-back-queue {
  font-size: 0.875rem;
  color: #059669 !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.link-back-queue:hover {
  color: #047857 !important;
  text-decoration: underline;
}

/* ==========================================================================
   ADMIN MAIN LAYOUT (SIDEBAR + CONTENT)
   ========================================================================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* SIDEBAR */
.admin-sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(5, 150, 105, 0.16);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 4px 0 24px -2px rgba(5, 150, 105, 0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem 1.5rem 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(5, 150, 105, 0.12);
  position: relative;
}

.btn-sidebar-close {
  display: none;
  margin-left: auto;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  color: #064e3b;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-sidebar-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 30, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.admin-sidebar .brand-title {
  color: #064e3b;
  font-weight: 800;
}

.admin-sidebar .brand-title span {
  color: #059669;
}

.admin-sidebar .brand-subtitle,
#sidebar-school-name {
  color: #4b5563 !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-user-pill {
  margin: 1.25rem 1.25rem 0.5rem 1.25rem;
  padding: 0.75rem 0.9rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.user-info {
  flex-grow: 1;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #064e3b;
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: #047857 !important;
  font-weight: 600;
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Sidebar Menu */
.sidebar-menu {
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.menu-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #059669 !important;
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: #374151 !important;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: #6b7280;
  transition: var(--transition);
}

.nav-item:hover {
  background: #f0fdf4;
  color: #064e3b !important;
}

.nav-item:hover i {
  color: #059669 !important;
}

.nav-item.active {
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
  border-left: 3px solid #059669;
  color: #064e3b !important;
  font-weight: 700;
}

.nav-item.active i {
  color: #059669 !important;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  background: #f0fdf4;
  color: #065f46;
  border: 1px solid #d1fae5;
}

.nav-badge.green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(5, 150, 105, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-sidebar-ext {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.btn-sidebar-ext:hover {
  background: #d1fae5;
  color: #064e3b;
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-sidebar-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* ==========================================================================
   ADMIN CONTENT & TOPBAR
   ========================================================================== */
.admin-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.25rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(5, 150, 105, 0.16);
  box-shadow: 0 4px 18px -2px rgba(5, 150, 105, 0.05);
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 1.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-sidebar-toggle {
  display: none;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  color: #064e3b;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-sidebar-toggle:hover {
  background: #ecfdf5;
  color: #059669;
}

.topbar-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.topbar-page-sub {
  font-size: 0.85rem;
  color: #4b5563 !important;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-sync-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #065f46;
}

.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  letter-spacing: 0.3px;
  transition: var(--transition);
}

.db-status-badge.offline {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.db-status-badge .db-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 1.5s infinite;
}

.db-status-badge.offline .db-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.mini-clock {
  padding-left: 1rem;
  border-left: 1px solid rgba(5, 150, 105, 0.16);
}

.mini-clock .clock-time {
  color: #064e3b;
  font-weight: 700;
}

.mini-clock .clock-date {
  color: #4b5563 !important;
  font-size: 0.75rem;
}

/* Pages Container */
.admin-pages-container {
  padding: 2rem 2.25rem 4rem 2.25rem;
}

.admin-page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.admin-page.active {
  display: block;
}

/* ==========================================================================
   PAGE 1: OVERVIEW & CHARTS
   ========================================================================== */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-metric-box {
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
  transition: var(--transition);
}

.stat-metric-box:hover {
  transform: translateY(-2px);
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 12px 28px -3px rgba(5, 150, 105, 0.1);
}

.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon-wrap.blue { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.stat-icon-wrap.yellow { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.stat-icon-wrap.green { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.stat-icon-wrap.purple { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

.stat-body {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151 !important;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #064e3b;
  margin: 0.2rem 0;
}

.stat-subinfo {
  font-size: 0.75rem;
  color: #6b7280 !important;
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.chart-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #064e3b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-sub {
  font-size: 0.82rem;
  color: #4b5563 !important;
}

.chart-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.chart-tag.green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
}

/* Activity Strip */
.activity-strip-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.activity-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.overview-counters-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.mini-counter-widget {
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: var(--transition);
}

.mini-counter-widget:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #064e3b;
}

.mc-cat {
  font-size: 0.7rem;
  font-weight: 700;
}

.mc-serving {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: #059669;
  margin: 0.2rem 0;
}

.mc-officer {
  font-size: 0.78rem;
  color: #4b5563 !important;
}

/* ==========================================================================
   PAGE 2: STUDENTS MASTER TABLE
   ========================================================================== */
.full-table-card {
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-and-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  flex-grow: 1;
}

.search-box {
  min-width: 280px;
}

.filter-select {
  width: auto;
  min-width: 180px;
}

.toolbar-buttons {
  display: flex;
  gap: 0.75rem;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.table-info-text {
  font-size: 0.85rem;
  color: #4b5563 !important;
}

.action-btn-group {
  display: inline-flex;
  gap: 0.4rem;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1fae5;
  background: #f0fdf4;
  color: #065f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-action:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-icon-action.delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-icon-action.delete:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* Table Badges & Tags */
.ticket-tag {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-block;
}

.cat-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.cat-pill.ma_putra, .cat-pill.zonasi { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.cat-pill.ma_putri, .cat-pill.prestasi { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }
.cat-pill.mts_putra, .cat-pill.afirmasi { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.cat-pill.mts_putri, .cat-pill.mutasi { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.cat-pill.mi { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.cat-pill.none { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.status-badge.status-waiting { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-badge.status-serving { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.status-badge.status-completed { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status-badge.status-skipped { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Admin Global Buttons */
.admin-body .btn-primary {
  background: linear-gradient(135deg, #059669, #047857) !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  font-weight: 600;
  transition: var(--transition);
}

.admin-body .btn-primary:hover {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.admin-body .btn-secondary {
  background: #f0fdf4 !important;
  color: #065f46 !important;
  border: 1px solid #d1fae5 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.06);
  font-weight: 600;
  transition: var(--transition);
}

.admin-body .btn-secondary:hover {
  background: #d1fae5 !important;
  color: #064e3b !important;
  border-color: #a7f3d0 !important;
}

.admin-body .btn-danger-ghost {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  font-weight: 600;
  transition: var(--transition);
}

.admin-body .btn-danger-ghost:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

/* ==========================================================================
   PAGE 3: COUNTERS & STAFF MANAGEMENT
   ========================================================================== */
.page-intro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.counters-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.counter-manage-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.cmc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmc-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #064e3b;
}

.cmc-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
}

.cmc-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.cmc-k { color: #4b5563 !important; }
.cmc-v { font-weight: 700; color: #064e3b; }

.cmc-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: auto;
}

/* ==========================================================================
   PAGE 4: QUOTAS & ALLOCATION
   ========================================================================== */
.quotas-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

.quota-form-card, .quota-summary-card {
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.quota-form .input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.quota-form .input-wrap input {
  width: 100%;
  padding: 0.85rem 5rem 0.85rem 2.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f291e;
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.quota-form .input-wrap input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  background: #ffffff;
}

.input-suffix {
  position: absolute;
  right: 1.25rem;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}

.total-capacity-display {
  padding: 1.25rem;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  text-align: center;
}

.cap-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 0.25rem;
}

.cap-val {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: #064e3b;
}

.quota-bars-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quota-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.qpi-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.qpi-name { font-weight: 700; color: #064e3b; }
.qpi-stats { color: #374151 !important; font-family: var(--font-mono); }

/* ==========================================================================
   PAGE 5: BERITA ACARA HARIAN (OFFICIAL FORMAL A4 SHEET)
   ========================================================================== */
.report-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.report-btn-group {
  display: flex;
  gap: 0.75rem;
}

/* Formal Sheet Paper Styling */
.paper-report-sheet {
  background: #ffffff;
  color: #111827;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 3.5rem;
  border-radius: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.45;
}

.report-letterhead {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.letterhead-logo {
  width: 70px;
  height: 70px;
  border: 2px solid #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #111;
  flex-shrink: 0;
}

.letterhead-text {
  flex-grow: 1;
  text-align: center;
}

.lh-gov { font-size: 1rem; font-weight: bold; letter-spacing: 0.5px; }
.lh-dept { font-size: 1.15rem; font-weight: bold; }
.lh-school { font-size: 1.35rem; font-weight: 900; letter-spacing: 0.5px; }
.lh-addr { font-size: 0.75rem; font-style: italic; color: #374151; margin-top: 2px; }

.letterhead-divider {
  border-bottom: 3px double #111;
  margin-bottom: 1.5rem;
}

.report-heading {
  text-align: center;
  margin-bottom: 1.5rem;
}

.report-doc-title {
  font-size: 1.15rem;
  font-weight: bold;
  text-decoration: underline;
  letter-spacing: 0.5px;
}

.report-doc-sub {
  font-size: 0.95rem;
  font-weight: bold;
  margin-top: 2px;
}

.report-doc-num {
  font-size: 0.85rem;
  color: #374151;
  margin-top: 4px;
}

.report-body-text {
  font-size: 0.95rem;
  text-align: justify;
  margin-bottom: 1.25rem;
  text-indent: 2.5rem;
}

.report-formal-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.report-formal-table th, .report-formal-table td {
  border: 1px solid #111;
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.report-formal-table th {
  background: #f3f4f6;
  font-weight: bold;
  text-align: center;
}

.table-total-row {
  background: #f9fafb;
}

.report-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  page-break-inside: avoid;
}

.sign-box {
  width: 250px;
  text-align: center;
}

.sign-role { font-size: 0.9rem; }
.sign-title { font-size: 0.95rem; font-weight: bold; margin-bottom: 4rem; }
.sign-name { font-size: 0.95rem; font-weight: bold; text-decoration: underline; }
.sign-nip { font-size: 0.85rem; }

/* ==========================================================================
   PAGE 6: SETTINGS
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.settings-card {
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.06);
}

.custom-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-md);
  color: #0f291e;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  resize: vertical;
  transition: all 0.2s ease;
}

.custom-textarea:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.db-action-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.btn-file-upload {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   DYNAMIC LOGO RENDERING ACROSS ADMIN PORTAL
   ========================================================================== */
.brand-logo-icon.has-custom-img,
.login-logo-icon.has-custom-img {
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.15);
}

.letterhead-logo.has-custom-img {
  background: #ffffff;
  border-color: #1f2937;
  padding: 4px;
}

.brand-logo-img,
.login-logo-img,
.letterhead-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  display: block;
}

/* Settings Card Headers & Icon Boxes */
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ecfdf5;
}

.header-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.header-icon-box.school-icon-box {
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.25);
}

.header-icon-box.key-icon-box {
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.header-icon-box.marquee-icon-box {
  background: linear-gradient(135deg, #0d9488, #059669);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.header-icon-box.video-icon-box {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.header-icon-box.docs-icon-box {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.header-icon-box.db-icon-box {
  background: linear-gradient(135deg, #065f46, #047857);
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.25);
}

/* Admin Video Preview Card (16:9) */
.admin-video-preview-wrap {
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 1rem;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.preview-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.video-detect-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: #e5e7eb;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.video-detect-badge.youtube {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.video-detect-badge.gdrive {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.video-detect-badge.direct {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.admin-video-frame-16-9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.admin-video-preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  border-radius: 8px;
}

.admin-video-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #9ca3af;
  gap: 0.5rem;
  padding: 1.5rem;
  z-index: 1;
}

.admin-video-preview-empty i {
  font-size: 2.75rem;
  opacity: 0.5;
  color: #ef4444;
}

.admin-video-preview-empty p {
  font-size: 0.82rem;
  max-width: 340px;
  line-height: 1.45;
}

/* Card 1: Logo Settings Card (Spans full width) */
.logo-settings-card {
  grid-column: 1 / -1;
  background: #ffffff !important;
  border: 1px solid rgba(5, 150, 105, 0.2) !important;
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.08) !important;
}

.logo-config-wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

.logo-preview-box {
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
}

.logo-preview-display {
  width: 130px;
  height: 130px;
  border-radius: 20px;
  background: #ffffff;
  border: 2px dashed #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.logo-preview-display.has-custom-img {
  border-style: solid;
  border-color: #059669;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.2);
}

.fallback-logo-icon {
  font-size: 3.5rem;
  color: #059669;
  opacity: 0.9;
}

.preview-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #4b5563 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
}

.preview-badge.active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.preview-hint {
  font-size: 0.78rem;
  color: #4b5563 !important;
  line-height: 1.45;
}

.logo-controls-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.custom-file-dropzone {
  border: 2px dashed #059669;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.custom-file-dropzone:hover,
.custom-file-dropzone.dragover {
  border-color: #047857;
  background: #ecfdf5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.15);
}

.dropzone-icon {
  font-size: 2.2rem;
  color: #059669;
  margin-bottom: 0.25rem;
}

.dropzone-text strong {
  display: block;
  font-size: 0.95rem;
  color: #064e3b;
  margin-bottom: 0.2rem;
}

.dropzone-text small {
  color: #4b5563 !important;
  font-size: 0.8rem;
}

.form-divider-text {
  position: relative;
  text-align: center;
  margin: 0.25rem 0;
}

.form-divider-text::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #d1fae5;
}

.form-divider-text span {
  position: relative;
  background: #ffffff;
  padding: 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #059669 !important;
  text-transform: uppercase;
}

.input-with-button {
  display: flex;
  gap: 0.6rem;
}

.input-with-button .custom-input {
  flex-grow: 1;
}

.logo-action-buttons {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid #ecfdf5;
}

/* ==========================================================================
   CARD 5: VIDEO & PLAYLIST MANAGEMENT (USB, LOCAL, ONLINE, SERVER)
   ========================================================================== */
.video-settings-card {
  grid-column: 1 / -1;
  background: #ffffff !important;
  border: 1px solid rgba(5, 150, 105, 0.2) !important;
  box-shadow: 0 8px 24px -3px rgba(5, 150, 105, 0.08) !important;
}

.video-icon-box {
  background: #ecfdf5;
  color: #059669;
}

/* Playback Mode Selector Cards */
.video-mode-selector-section {
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-label-heading {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #064e3b;
  margin-bottom: 0.85rem;
}

.video-mode-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mode-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-card input[type="radio"] {
  position: absolute;
  top: 1rem;
  right: 1rem;
  accent-color: #059669;
  width: 18px;
  height: 18px;
}

.mode-card:hover {
  border-color: #a7f3d0;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.1);
}

.mode-card.active {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.15);
}

.mode-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f0fdf4;
  color: #059669;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mode-card.active .mode-card-icon {
  background: #059669;
  color: #ffffff;
}

.mode-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #064e3b;
  margin-bottom: 0.25rem;
  padding-right: 1.5rem;
}

.mode-card-desc {
  font-size: 0.78rem;
  color: #4b5563 !important;
  line-height: 1.45;
}

/* Two-column Video Workspace */
.video-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* Source Tabs */
.video-source-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 2px solid #ecfdf5;
  margin-bottom: 1.15rem;
  overflow-x: auto;
}

.source-tab-btn {
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.source-tab-btn:hover {
  color: #059669;
}

.source-tab-btn.active {
  color: #059669;
  border-bottom-color: #059669;
  background: #f0fdf4;
  border-radius: 8px 8px 0 0;
}

.source-tab-content {
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
}

.custom-video-dropzone {
  border: 2px dashed #059669;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.custom-video-dropzone:hover,
.custom-video-dropzone.dragover {
  border-color: #047857;
  background: #ecfdf5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.15);
}

.video-dropzone-icon {
  font-size: 2.75rem;
  color: #059669;
}

.video-dropzone-text strong {
  display: block;
  font-size: 0.95rem;
  color: #064e3b;
  margin-bottom: 0.25rem;
}

.video-dropzone-text small {
  color: #4b5563 !important;
  font-size: 0.78rem;
}

.selected-video-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
}

.selected-video-summary .sv-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.selected-video-summary strong {
  font-size: 0.85rem;
  color: #064e3b;
}

.selected-video-summary span {
  font-size: 0.75rem;
  color: #059669;
}

.btn-cancel-select {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #ef4444;
  cursor: pointer;
  padding: 0 0.4rem;
}

.storage-method-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
}

.storage-method-box .radio-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #374151;
  cursor: pointer;
}

.storage-method-box .radio-label input {
  margin-top: 2px;
  accent-color: #059669;
}

/* Upload Progress Bar */
.upload-progress-wrap {
  margin-top: 0.75rem;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  transition: width 0.25s ease;
}

.progress-status-text {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 700;
  margin-top: 0.25rem;
  text-align: right;
}

.btn-group-right {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Server Videos List */
.server-videos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.server-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sv-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #064e3b;
}

.server-videos-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.server-video-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.server-video-item:hover {
  border-color: #059669;
  background: #ecfdf5;
}

.sv-file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sv-file-name {
  font-weight: 700;
  color: #064e3b;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.sv-file-meta {
  font-size: 0.7rem;
  color: #6b7280;
}

/* Playlist Queue Manager */
.playlist-manager-box {
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.05);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #ecfdf5;
}

.pl-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #064e3b;
}

.pl-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.playlist-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.empty-playlist-notice {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #6b7280;
  font-size: 0.82rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
}

.playlist-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  gap: 0.65rem;
  transition: all 0.2s ease;
}

.playlist-item-card:hover {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.playlist-item-card.is-active {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.12);
}

.pl-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
  flex-grow: 1;
}

.pl-item-index {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.playlist-item-card.is-active .pl-item-index {
  background: #059669;
  color: #ffffff;
}

.pl-item-icon {
  font-size: 1.25rem;
  color: #059669;
  flex-shrink: 0;
}

.pl-item-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pl-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-card.is-active .pl-item-title {
  color: #064e3b;
}

.pl-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  color: #6b7280;
}

.pl-source-tag {
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pl-source-tag.tag-usb,
.pl-source-tag.tag-local {
  background: #dbeafe;
  color: #1d4ed8;
}

.pl-source-tag.tag-youtube {
  background: #fee2e2;
  color: #b91c1c;
}

.pl-source-tag.tag-gdrive {
  background: #fef3c7;
  color: #b45309;
}

.pl-source-tag.tag-server {
  background: #ecfdf5;
  color: #047857;
}

.pl-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-pl-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pl-action:hover {
  border-color: #059669;
  color: #059669;
  background: #ecfdf5;
}

.btn-pl-action.btn-pl-play {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.btn-pl-action.btn-pl-play:hover {
  background: #059669;
  color: #ffffff;
}

.btn-pl-action.btn-pl-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fee2e2;
}

/* Right Column: 16:9 Video Preview in Admin */
.video-preview-col {
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.06);
}

.preview-title-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-active-title {
  font-size: 0.78rem;
  color: #059669;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.admin-video-frame-16-9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #090d16;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.admin-video-preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.admin-video-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  gap: 0.5rem;
  z-index: 2;
}

.admin-video-preview-empty i {
  font-size: 2.75rem;
  color: #059669;
  opacity: 0.8;
}

.admin-video-preview-empty p {
  font-size: 0.82rem;
  max-width: 280px;
  line-height: 1.45;
}

.preview-quick-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-sm);
}

.preview-seq-info {
  font-size: 0.8rem;
  font-weight: 800;
  color: #064e3b;
}

.preview-guidance-card {
  display: flex;
  gap: 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.78rem;
  color: #065f46 !important;
  line-height: 1.45;
}

.preview-guidance-card i {
  font-size: 1.25rem;
  color: #059669;
  flex-shrink: 0;
  margin-top: 2px;
}

.preview-guidance-card strong {
  display: block;
  font-size: 0.82rem;
  color: #064e3b;
  margin-bottom: 0.2rem;
}

.preview-guidance-card p {
  margin: 0;
  color: #065f46;
}

/* Video Action Footer */
.video-action-footer {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ecfdf5;
  flex-wrap: wrap;
}

/* Responsive adjustment for video workspace */
@media (max-width: 1024px) {
  .video-workspace-grid {
    grid-template-columns: 1fr;
  }
  .video-mode-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Account & Security Helpers */
.account-security-info {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: #065f46 !important;
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

.account-security-info i {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: #059669;
}

.label-required {
  font-size: 0.75rem;
  color: #dc2626 !important;
  font-weight: 600;
  margin-left: 0.35rem;
}

.label-optional {
  font-size: 0.75rem;
  color: #6b7280 !important;
  font-weight: 500;
  margin-left: 0.35rem;
}

/* ==========================================================================
   MODALS IN ADMIN
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 30, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-backdrop.active,
.modal-backdrop.open {
  display: flex;
}

.modal-lg {
  max-width: 650px;
  width: 100%;
}

.modal-content-card {
  width: 100%;
  padding: 2rem;
  position: relative;
  background: #ffffff !important;
  border: 1.5px solid rgba(5, 150, 105, 0.2) !important;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(5, 150, 105, 0.2), 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ecfdf5;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.modal-icon-badge.green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #6b7280 !important;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.35rem;
  transition: var(--transition);
}

.btn-modal-close:hover {
  color: #064e3b !important;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ecfdf5;
}

/* Detail Modal Styles */
.detail-hero-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.detail-num {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 800;
  color: #059669;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
}

.detail-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #064e3b;
  margin-bottom: 0.35rem;
}

.detail-table-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.info-row:nth-child(odd) {
  background: #f0fdf4;
}

.info-k { color: #4b5563 !important; font-weight: 500; }
.info-v { font-weight: 600; color: #064e3b; }

/* ==========================================================================
   PRINT STYLES FOR OFFICIAL A4 REPORT
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }

  .paper-report-sheet, .paper-report-sheet * {
    visibility: visible;
  }

  .paper-report-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20mm;
    box-shadow: none;
    border: none;
  }

  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1100px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .quotas-layout {
    grid-template-columns: 1fr;
  }

  .counters-admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .logo-config-wrapper {
    grid-template-columns: 1fr;
  }

  .overview-counters-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATION (PORTAL ADMIN)
   ========================================================================== */

/* Tablets & Laptops */
@media (max-width: 1100px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .quotas-layout {
    grid-template-columns: 1fr;
  }

  .counters-admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .logo-config-wrapper {
    grid-template-columns: 1fr;
  }

  .overview-counters-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Devices & Tablets (max-width: 768px) */
@media (max-width: 768px) {
  /* Off-canvas Mobile Sidebar */
  .admin-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    box-shadow: none;
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .admin-sidebar.open {
    left: 0;
    box-shadow: 10px 0 35px rgba(5, 150, 105, 0.2);
  }

  .btn-sidebar-close {
    display: inline-flex;
  }

  .btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Compact Topbar */
  .admin-topbar {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .topbar-left {
    gap: 0.65rem;
  }

  .topbar-page-title {
    font-size: 1.05rem;
  }

  .topbar-page-sub {
    display: none; /* Hide subtitle for clean mobile topbar */
  }

  .topbar-right {
    gap: 0.45rem;
  }

  /* Hide Clock on Mobile to Avoid Horizontal Overflow */
  .mini-clock {
    display: none !important;
  }

  .btn-quick-add {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    min-height: 38px;
    gap: 0.35rem;
  }

  .db-status-badge {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .topbar-sync-indicator {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  /* Content Padding */
  .admin-pages-container {
    padding: 1rem 0.85rem 3rem 0.85rem;
  }

  /* KPI Cards Grid on Mobile (2x2) */
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.25rem;
  }

  .kpi-card {
    padding: 0.9rem;
  }

  .kpi-val {
    font-size: 1.75rem;
  }

  .kpi-label {
    font-size: 0.75rem;
  }

  .charts-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-card {
    padding: 1.15rem 1rem;
  }

  .counters-admin-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .overview-counters-strip {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Student Management (Master Data) Mobile Layout */
  .full-table-card {
    padding: 1.15rem 0.85rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-and-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .search-box input,
  .filter-select {
    width: 100%;
    min-height: 46px;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }

  .toolbar-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .toolbar-buttons .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    font-size: 0.88rem;
  }

  /* Touch-Friendly Scrollable Table */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-glass-border);
    margin: 0.65rem 0;
  }

  .master-student-table {
    min-width: 700px;
    font-size: 0.82rem;
  }

  .master-student-table th,
  .master-student-table td {
    padding: 0.65rem 0.55rem;
  }

  .action-btn-group .btn-icon-action {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .table-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
  }

  /* Quotas Layout */
  .quotas-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .quota-input-group input {
    min-height: 48px;
    font-size: 16px !important;
  }

  /* Settings Grid */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Mobile Optimized Modals */
  .modal-dialog {
    width: 95vw !important;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .modal-body {
    padding: 0.5rem 0;
  }

  .custom-input,
  .custom-select,
  textarea {
    min-height: 46px;
    font-size: 16px !important;
  }

  .modal-footer-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .paper-report-sheet {
    padding: 1.25rem;
  }

  .report-signatures {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }
}

/* Extra Small Smartphones (max-width: 480px) */
@media (max-width: 480px) {
  .admin-topbar {
    padding: 0.5rem 0.75rem;
  }

  .topbar-page-title {
    font-size: 0.95rem;
  }

  .btn-quick-text {
    display: none; /* Icon-only on very small phones to save space */
  }

  .sync-text {
    display: none; /* Icon-only dot on very small phones */
  }

  .admin-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .kpi-card {
    padding: 0.75rem 0.65rem;
  }

  .kpi-val {
    font-size: 1.45rem;
  }

  .kpi-label {
    font-size: 0.7rem;
  }

  .db-status-badge {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
    margin: 1rem;
    border-radius: var(--radius-lg);
  }

  .login-title {
    font-size: 1.35rem;
  }

  .login-logo-icon {
    width: 52px;
    height: 52px;
    font-size: 1.45rem;
    margin-bottom: 1rem;
  }
}
