/* ==========================================================================
   HSKI 2027 - MODUL 3: ADMIN & MODERATION DASHBOARD STYLESHEET
   Clean Corporate, High Contrast (WCAG AAA), Full Responsive & Adaptive Layout
   ========================================================================== */

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

:root {
  /* Surface & Base Colors */
  --bg-main: #f1f5f9;
  --bg-sidebar: #0f172a;        /* Deep Navy / Slate 900 */
  --bg-sidebar-hover: #1e293b;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  
  /* Text Contrast Hierarchy (Strict High Contrast) */
  --text-main: #0f172a;         /* Slate 900 */
  --text-muted: #334155;        /* Slate 700 */
  --text-light: #64748b;        /* Slate 500 */
  --text-white: #ffffff;
  --text-sidebar: #cbd5e1;      /* Slate 300 */
  --text-sidebar-active: #ffffff;

  /* Accent Colors */
  --accent-blue: #1d4ed8;       /* Blue 700 */
  --accent-blue-hover: #1e40af;
  --accent-blue-subtle: #eff6ff;
  
  --accent-green: #047857;      /* Emerald 700 */
  --accent-green-subtle: #ecfdf5;
  --accent-green-border: #a7f3d0;
  
  --accent-amber: #b45309;      /* Amber 700 */
  --accent-amber-subtle: #fffbeb;
  --accent-amber-border: #fde68a;
  
  --accent-rose: #be123c;       /* Rose 700 */
  --accent-rose-subtle: #fff1f2;
  --accent-rose-border: #fecdd3;

  --accent-purple: #6d28d9;     /* Purple 700 */
  --accent-purple-subtle: #f5f3ff;
  --accent-purple-border: #ddd6fe;

  --accent-indigo: #4338ca;     /* Indigo 700 */
  --accent-indigo-subtle: #eef2ff;
  --accent-indigo-border: #c7d2fe;

  /* Borders & Shadows */
  --border-color: #cbd5e1;      /* Slate 300 - High Definition */
  --border-light: #e2e8f0;      /* Slate 200 */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 24px 48px -12px rgba(15, 23, 42, 0.25);

  /* Typography */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOP GLOBAL BAR
   ========================================================================== */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.45rem;
  cursor: pointer;
}

.sidebar-toggle-btn:hover {
  background: var(--border-light);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.admin-badge {
  background: linear-gradient(135deg, var(--accent-blue), #1e3a8a);
  color: #ffffff;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
}

.brand-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Module Links */
.module-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.nav-link-pill:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: var(--accent-blue-subtle);
}

.nav-link-pill.active {
  background: #eff6ff;
  color: var(--accent-blue);
  border-color: #bfdbfe;
}

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

.system-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #ecfdf5;
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
  padding: 0.32rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.clock-display {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.operator-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-color);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.operator-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.operator-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   DASHBOARD LAYOUT (SIDEBAR + MAIN CONTENT)
   ========================================================================== */
.dashboard-wrapper {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex: 1;
}

/* Sidebar */
.dashboard-sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e293b;
  flex-shrink: 0;
}

.sidebar-inner {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  padding-left: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: transparent;
  color: var(--text-sidebar);
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
}

.nav-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.badge-count-alert {
  background: var(--accent-amber);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.badge-count-alert.zero {
  background: #334155;
  color: #94a3b8;
}

.sidebar-footer-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.footer-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #ffffff;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.sidebar-footer-card p {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.btn-sidebar-reset {
  width: 100%;
  padding: 0.5rem;
  background: #0f172a;
  border: 1px solid #475569;
  color: #f87171;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sidebar-reset:hover {
  background: #450a0a;
  border-color: #ef4444;
  color: #ffffff;
}

/* Main Dashboard Area */
.dashboard-main {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.75rem;
}

.tab-pane.active {
  display: flex;
}

/* Tab Header */
.tab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tab-header h2 {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.tab-header p {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
  transition: all 0.2s;
}

.btn-primary-action:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.4);
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-secondary-action:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ==========================================================================
   TAB 1: OVERVIEW & KPI METRICS (FITUR 3.1)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.kpi-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue { background: #eff6ff; color: var(--accent-blue); }
.icon-green { background: #ecfdf5; color: var(--accent-green); }
.icon-amber { background: #fffbeb; color: var(--accent-amber); }
.icon-rose { background: #fff1f2; color: var(--accent-rose); }
.icon-purple { background: #f5f3ff; color: var(--accent-purple); }

.kpi-value {
  font-family: var(--font-title);
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.text-green { color: var(--accent-green); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-purple { color: var(--accent-purple); }
.text-blue { color: var(--accent-blue); }

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

/* Two Column Layout in Overview */
.overview-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.card-title-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card-title-left h3 {
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
}

.health-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.badge-operational {
  background: #ecfdf5;
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
}

.health-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.95rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.health-item-label {
  display: flex;
  flex-direction: column;
}

.health-item-label strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.health-item-label span {
  font-size: 0.76rem;
  color: var(--text-light);
}

.health-pill {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.health-pill.operational {
  background: #ecfdf5;
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
}

.link-btn-text {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.overview-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.queue-preview-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #ffffff;
  transition: all 0.2s;
}

.queue-preview-item:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-blue);
}

.queue-preview-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.queue-preview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.queue-preview-school {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.queue-preview-reason {
  font-size: 0.76rem;
  color: var(--accent-amber);
  font-weight: 600;
}

.queue-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
  text-align: center;
  gap: 0.5rem;
}

/* ==========================================================================
   TAB 2: ANTREAN MODERASI FOTO (FITUR 3.3)
   ========================================================================== */
.filter-pills-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.42rem 0.95rem;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-pill.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.moderation-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.mod-card-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mod-card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.mod-card-image-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  background: #0f172a;
  cursor: pointer;
}

.mod-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.mod-card-img:hover {
  opacity: 0.9;
}

.mod-card-badge-status {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.badge-status-review {
  background: #f59e0b;
  color: #ffffff;
}

.badge-status-approved {
  background: #10b981;
  color: #ffffff;
}

.badge-status-rejected {
  background: #ef4444;
  color: #ffffff;
}

.mod-inspect-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mod-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.mod-card-header-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.mod-card-school-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.mod-card-time {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 700;
  white-space: nowrap;
}

.mod-card-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

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

.meta-col span {
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: 700;
}

.meta-col strong {
  font-size: 0.82rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-doubt-reason {
  background: var(--accent-amber-subtle);
  border: 1.5px solid var(--accent-amber-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: #78350f;
  line-height: 1.4;
}

.mod-doubt-reason strong {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-amber);
  margin-bottom: 0.2rem;
}

/* Card Action Buttons */
.mod-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.btn-card-action {
  padding: 0.55rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}

.btn-card-approve {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-card-approve:hover {
  background: #065f46;
}

.btn-card-reject {
  background: #ffffff;
  color: var(--accent-rose);
  border-color: var(--accent-rose-border);
}

.btn-card-reject:hover {
  background: var(--accent-rose-subtle);
  border-color: var(--accent-rose);
}

.btn-card-hide {
  grid-column: span 2;
  background: #ffffff;
  color: var(--accent-indigo);
  border-color: var(--accent-indigo-border);
}

.btn-card-hide:hover {
  background: var(--accent-indigo-subtle);
}

/* ==========================================================================
   TAB 3: MASTER DATA SEKOLAH (FITUR 3.2)
   ========================================================================== */
.toolbar-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  flex: 1;
  min-width: 260px;
}

.search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light);
}

.filter-selects-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-select-sm {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  outline: none;
}

.form-select-sm:focus {
  border-color: var(--accent-blue);
}

/* Table Responsive Wrapper */
.table-responsive-wrapper {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.corporate-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.corporate-table th {
  background: #f8fafc;
  color: var(--text-main);
  font-weight: 800;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.corporate-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

/* Sticky ID & Nama Sekolah Columns on Horizontal Scroll */
.corporate-table th:first-child,
.corporate-table td:first-child {
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 3;
}

.corporate-table td:first-child {
  background: #ffffff;
}

.corporate-table tbody tr:hover td:first-child {
  background-color: #f1f5f9;
}

.corporate-table th:nth-child(2),
.corporate-table td:nth-child(2) {
  position: sticky;
  left: 85px;
  background: #f8fafc;
  z-index: 3;
  box-shadow: 4px 0 8px -3px rgba(15, 23, 42, 0.12);
}

.corporate-table td:nth-child(2) {
  background: #ffffff;
}

.corporate-table tbody tr:hover td:nth-child(2) {
  background-color: #f1f5f9;
}

.corporate-table tbody tr:hover {
  background-color: #f1f5f9;
}

.badge-tag {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
  white-space: nowrap;
}

.badge-tag-attended {
  background: var(--accent-green-subtle);
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
}

.badge-tag-notyet {
  background: #f1f5f9;
  color: var(--text-light);
  border: 1px solid var(--border-color);
}

.badge-tag-zoom {
  background: var(--accent-indigo-subtle);
  color: var(--accent-indigo);
  border: 1px solid var(--accent-indigo-border);
}

.badge-tag-offline {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-table-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--accent-blue);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-table-edit:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.table-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 600;
  padding: 0 0.5rem;
}

.info-tag {
  color: var(--accent-blue);
  font-weight: 700;
}

/* ==========================================================================
   TAB 4: MANAJEMEN 5 PILAR KEPEDULIAN (FITUR 3.4)
   ========================================================================== */
.pillars-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.pillar-admin-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.pillar-card-hero {
  height: 140px;
  position: relative;
  background: #0f172a;
}

.pillar-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pillar-badge-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.pillar-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.pillar-school-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.pillar-location-tag {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

.pillar-desc-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pillar-needs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pillar-needs-list li {
  font-size: 0.8rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pillar-needs-list li::before {
  content: "•";
  color: var(--accent-blue);
  font-weight: bold;
}

/* ==========================================================================
   MODAL DIALOGS (LIGHTBOX & FALLBACK EDIT)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border-color);
}

.modal-lg {
  max-width: 960px;
}

.modal-md {
  max-width: 680px;
}

.modal-sm {
  max-width: 480px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title-group h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-badge-status {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.modal-badge-emergency {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.modal-image-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.img-preview-box {
  width: 100%;
  height: 380px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.img-caption-strip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.modal-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.meta-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.meta-data-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-subtle);
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}

.meta-row span {
  color: var(--text-light);
}

.meta-row strong {
  color: var(--text-main);
}

.ai-doubt-reason-box {
  background: var(--accent-amber-subtle);
  border: 1.5px solid var(--accent-amber-border);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.84rem;
  color: #78350f;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.mini-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.mini-score-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.modal-actions-box {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-top: auto;
}

.action-buttons-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-op-action {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}

.btn-op-approve {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-op-approve:hover {
  background: #065f46;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.btn-op-hide {
  background: #ffffff;
  color: var(--accent-indigo);
  border-color: var(--accent-indigo-border);
}

.btn-op-hide:hover {
  background: var(--accent-indigo-subtle);
  border-color: var(--accent-indigo);
}

.btn-op-reject {
  background: #ffffff;
  color: var(--accent-rose);
  border-color: var(--accent-rose-border);
}

.btn-op-reject:hover {
  background: var(--accent-rose-subtle);
  border-color: var(--accent-rose);
}

/* Modal Fallback Phone Edit Form */
.modal-body {
  padding: 1.5rem;
}

.modal-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.form-group-field {
  margin-bottom: 1rem;
}

.form-label-txt {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-input-readonly {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
}

.form-input-active {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--accent-blue);
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  outline: none;
}

.modal-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-cancel {
  padding: 0.6rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-save-primary {
  padding: 0.6rem 1.2rem;
  background: var(--accent-blue);
  border: none;
  color: #ffffff;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save-primary:hover {
  background: var(--accent-blue-hover);
}

/* Toast Message */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1080px) {
  .dashboard-wrapper {
    position: relative;
  }

  .sidebar-toggle-btn {
    display: block;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 65px;
    left: 0;
    height: calc(100vh - 65px);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .dashboard-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }

  .overview-details-grid {
    grid-template-columns: 1fr;
  }

  .modal-body-split {
    grid-template-columns: 1fr;
  }

  .img-preview-box {
    height: 280px;
  }
}

@media (max-width: 768px) {
  .topbar-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .topbar-left {
    width: 100%;
    justify-content: space-between;
  }

  .module-nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .module-nav-links::-webkit-scrollbar {
    display: none;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-main {
    padding: 1.25rem 1rem;
  }

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

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

  .moderation-cards-container {
    grid-template-columns: 1fr;
  }

  .modal-actions-box {
    padding: 0.75rem;
  }
}

