/* ============================================================
   SANTRIKU — Design System
   Tema: Islamic Green / Modern Pesantren
   Font: Plus Jakarta Sans + Lora
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Palette – Islamic green tones */
  --c-bg:           #f4f7f4;
  --c-bg-alt:       #eaf0ea;
  --c-surface:      #ffffff;
  --c-surface-alt:  #f8fbf8;
  --c-border:       #cddacd;
  --c-border-light: #deeade;

  --c-primary:      #1a4731;   /* hijau pesantren */
  --c-primary-mid:  #2d6a4f;
  --c-primary-lite: #d8eedd;
  --c-primary-tint: #f0f8f2;

  --c-accent:       #40916c;   /* hijau emerald */
  --c-accent-lite:  #e8f5ee;
  --c-accent-dark:  #2d6a4f;

  --c-gold:         #c9a84c;
  --c-gold-lite:    #fdf5e0;

  --c-green:        #52b788;
  --c-green-lite:   #e0f4ea;

  --c-red:          #c0392b;
  --c-red-lite:     #fdecea;

  --c-blue:         #1d6fa4;
  --c-blue-lite:    #e3f0fa;

  --c-orange:       #e07b39;
  --c-orange-lite:  #fef0e6;

  --c-text:         #1a2e1a;
  --c-text-mid:     #3a5c3a;
  --c-text-muted:   #7a9e7a;
  --c-text-faint:   #adc5ad;

  /* Typography */
  --font-display: 'Lora', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Shadows */
  --sh-sm:  0 1px 3px rgba(26,71,49,.07), 0 1px 2px rgba(26,71,49,.05);
  --sh-md:  0 4px 12px rgba(26,71,49,.10), 0 2px 4px rgba(26,71,49,.06);
  --sh-lg:  0 10px 30px rgba(26,71,49,.12), 0 4px 8px rgba(26,71,49,.07);

  /* Sidebar */
  --sidebar-w: 260px;
  --header-h:  64px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur:  0.2s;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sk-sidebar {
  width: var(--sidebar-w);
  background: var(--c-primary);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(64,145,108,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(201,168,76,0.12) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--dur) var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sk-sidebar::-webkit-scrollbar { width: 4px; }
.sk-sidebar::-webkit-scrollbar-track { background: transparent; }
.sk-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
  backdrop-filter: blur(2px);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.brand-icon-wrap {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--c-accent), #52b788);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(64,145,108,.45);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}
.brand-sub {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
}
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.28);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.68);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  position: relative;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,0.11);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--c-gold);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-badge {
  margin-left: auto;
  background: var(--c-gold);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* User footer */
.sidebar-footer {
  padding: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  transition: background var(--dur);
  cursor: pointer;
}
.user-card:hover { background: rgba(255,255,255,0.07); }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-accent), var(--c-gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.875rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
}

/* ── Main ────────────────────────────────────────────────────── */
.sk-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.sk-topbar {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sh-sm);
}
.sk-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-mid);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  font-size: 1.2rem;
  transition: all var(--dur);
}
.sk-menu-toggle:hover { background: var(--c-bg-alt); color: var(--c-primary); }
.topbar-brand-mobile {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-primary);
  font-size: .95rem;
}
.sk-topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-primary);
  flex: 1;
}
.sk-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Content ─────────────────────────────────────────────────── */
.sk-content {
  flex: 1;
  padding: var(--sp-6);
}

/* ── Toast / Alert ───────────────────────────────────────────── */
.sk-toast-stack {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}
.sk-toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  pointer-events: all;
  animation: toastIn .35s var(--ease) forwards;
  max-width: 360px;
  min-width: 260px;
  border-left: 4px solid transparent;
}
.sk-toast.success { background:#e8f5ee; color:#1a4731; border-color:var(--c-accent); }
.sk-toast.danger  { background:#fdecea; color:#7b1a1a; border-color:var(--c-red); }
.sk-toast.warning { background:#fef0e6; color:#7a3a0a; border-color:var(--c-orange); }
.sk-toast.info    { background:#e3f0fa; color:#0a3a5c; border-color:var(--c-blue); }
.sk-toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.sk-toast-text { flex: 1; }
.sk-toast-close {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.5; font-size: 1rem;
  padding: 0; margin-left: var(--sp-2);
}
.sk-toast-close:hover { opacity: 1; }
@keyframes toastIn {
  from { opacity:0; transform: translateX(30px); }
  to   { opacity:1; transform: translateX(0); }
}
.sk-toast.hiding {
  animation: toastOut .3s var(--ease) forwards;
}
@keyframes toastOut {
  from { opacity:1; transform: translateX(0); max-height:100px; margin-bottom:0; }
  to   { opacity:0; transform: translateX(30px); max-height:0; padding:0; margin:0; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-mid); }
.btn-accent  { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-accent:hover { background: var(--c-accent-dark); }
.btn-outline { background: transparent; color: var(--c-primary); border-color: var(--c-border); }
.btn-outline:hover { background: var(--c-primary-lite); border-color: var(--c-primary); }
.btn-danger  { background: var(--c-red); color: #fff; }
.btn-danger:hover { background: #a32320; }
.btn-ghost   { background: transparent; color: var(--c-text-mid); border-color: transparent; }
.btn-ghost:hover { background: var(--c-bg-alt); }
.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: 0.8rem; }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: 0.95rem; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
}
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: visible;
  transition: box-shadow var(--dur);
}
.card:hover { box-shadow: var(--sh-md); }
.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--c-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-primary);
}
.card-body { padding: var(--sp-6); }
.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--c-border-light);
  background: var(--c-surface-alt);
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--sh-sm);
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--c-accent));
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.stat-icon {
  font-size: 1.2rem;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--stat-bg, var(--c-accent-lite));
  display: flex; align-items: center; justify-content: center;
  color: var(--stat-color, var(--c-accent));
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.page-header-left h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.2;
}
.page-header-left p {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}
.breadcrumb a { color: var(--c-accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { opacity: 0.4; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-5);
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: var(--sp-2);
}
.form-control {
  width: 100%;
  max-width: 600px;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--c-text);
  background: var(--c-surface);
  transition: all var(--dur);
  outline: none;
}
.form-control:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.12);
}
.form-control-full { max-width: 100%; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}
.form-error {
  font-size: 0.78rem;
  color: var(--c-red);
  margin-top: var(--sp-1);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-5);
}

/* ── Info Cards (detail view) ────────────────────────────────── */
.detail-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-6);
}
.detail-card-header {
  padding: var(--sp-4) var(--sp-6);
  background: var(--c-primary-tint);
  border-bottom: 1px solid var(--c-border-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.detail-rows {}
.detail-row {
  display: flex;
  align-items: baseline;
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--c-border-light);
  gap: var(--sp-4);
}
.detail-row:last-child { border-bottom: none; }
.detail-key {
  min-width: 160px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-accent);
  flex-shrink: 0;
}
.detail-sep { color: var(--c-text-faint); flex-shrink: 0; }
.detail-val {
  font-size: 0.875rem;
  color: var(--c-text);
  word-break: break-word;
}

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green  { background: var(--c-green-lite);  color: var(--c-green); }
.badge-red    { background: var(--c-red-lite);    color: var(--c-red); }
.badge-gold   { background: var(--c-gold-lite);   color: #8a6a10; }
.badge-blue   { background: var(--c-blue-lite);   color: var(--c-blue); }
.badge-orange { background: var(--c-orange-lite); color: var(--c-orange); }
.badge-gray   { background: var(--c-bg-alt);      color: var(--c-text-muted); }

/* ── Loading overlay ─────────────────────────────────────────── */
.sk-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(244,247,244,.85);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sk-loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.sk-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sk-loading-text {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

/* ── Dark mode toggle ────────────────────────────────────────── */
button.dark-mode-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 46px;
  height: 46px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--sh-md);
  transition: all var(--dur);
}
button.dark-mode-toggle:hover {
  background: var(--c-accent);
  transform: scale(1.08);
}

/* ── Dark mode ───────────────────────────────────────────────── */
body.dark-mode {
  --c-bg:           #0f1a0f;
  --c-bg-alt:       #182418;
  --c-surface:      #1a2a1a;
  --c-surface-alt:  #1e2f1e;
  --c-border:       #2d452d;
  --c-border-light: #243824;
  --c-primary-tint: #182418;
  --c-text:         #daeada;
  --c-text-mid:     #9fc49f;
  --c-text-muted:   #6a956a;
  --c-text-faint:   #3d6b3d;
}
body.dark-mode .sk-topbar,
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .detail-card,
body.dark-mode .dt-wrapper {
  background: var(--c-surface);
  border-color: var(--c-border);
}
body.dark-mode table.dataTable thead th {
  white-space: nowrap;
  background: var(--c-bg-alt);
  color: var(--c-text);
}
body.dark-mode table.dataTable tbody td { color: var(--c-text); }
body.dark-mode .form-control {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
body.dark-mode .sk-topbar { border-color: var(--c-border); }
body.dark-mode input[type="date"] {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}

/* ── Login ───────────────────────────────────────────────────── */
.sk-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: var(--c-primary);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(64,145,108,.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(201,168,76,.15) 0%, transparent 50%),
    url("/assets/img/background.webp");
  background-size: cover;
  background-blend-mode: multiply;
  position: relative;
}
.sk-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26,71,49,.7);
}
.sk-login-card {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 420px;
  padding: var(--sp-10) var(--sp-8);
  animation: loginIn .5s var(--ease) forwards;
}
@keyframes loginIn {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}
.sk-login-logo {
  text-align: center;
  margin-bottom: var(--sp-8);
}
.sk-login-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: var(--r-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: var(--sp-4);
  box-shadow: 0 8px 24px rgba(26,71,49,.4);
}
.sk-login-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: var(--sp-1);
}
.sk-login-sub {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}
.sk-login-form .form-group { margin-bottom: var(--sp-4); }
.sk-login-form .form-control { max-width: 100%; }
.sk-login-form .btn { width: 100%; justify-content: center; padding: var(--sp-3); }
.passwordContainer { position: relative; }
.passwordContainer .showPassword {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1;
}

/* ── Misc helpers ────────────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--c-text-muted); }
.text-primary { color: var(--c-primary); }
.text-accent  { color: var(--c-accent); }
.mt-4 { margin-top: var(--sp-4); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.gap-3 { gap: var(--sp-3); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.disabled-link { pointer-events: none; opacity: 0.45; cursor: not-allowed; }

/* ── Foto / Image ────────────────────────────────────────────── */
div.foto-santri {
  width: 140px; height: 140px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--c-bg-alt);
  border-radius: var(--r-lg);
  border: 2px solid var(--c-border);
  margin: 0 auto var(--sp-4);
}

/* ── File Upload ─────────────────────────────────────────────── */
label.sk-file-upload {
  border: 2px dashed var(--c-border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  cursor: pointer;
  background: var(--c-surface-alt);
  transition: all var(--dur);
  position: relative;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
label.sk-file-upload:hover { border-color: var(--c-accent); background-color: var(--c-accent-lite); }
label.sk-file-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sk-file-upload-icon { font-size: 2rem; color: var(--c-text-faint); margin-bottom: var(--sp-3); }
.sk-file-upload-text { font-size: 0.85rem; color: var(--c-text-muted); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sk-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sk-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .sk-main {
    margin-left: 0;
  }
  .sk-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .topbar-brand-mobile { display: flex; }
  .sk-topbar-title { display: none; }
  .sk-content { padding: var(--sp-4); }
  .form-row { grid-template-columns: 1fr; }
  .detail-key { min-width: 120px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sk-content { padding: var(--sp-3); }
  .card-body { padding: var(--sp-4); }
  .page-header { flex-direction: column; align-items: flex-start; }
  button.dark-mode-toggle { bottom: 90px; }
  div.dataTables_wrapper { padding: var(--sp-3); }
}

/* ── DataTables Buttons override ─────────────────────────────── */
.dt-buttons .dt-button {
  background: var(--c-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--r-sm) !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  font-family: var(--font-body) !important;
  cursor: pointer !important;
  transition: all var(--dur) !important;
}
.dt-buttons .dt-button:hover {
  background: var(--c-accent-dark) !important;
}

/* date filter inputs */
input[type="date"] {
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--dur);
}
input[type="date"]:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.1);
}

/* ── Quill editor override ───────────────────────────────────── */
.ql-toolbar { border-color: var(--c-border) !important; border-radius: var(--r-md) var(--r-md) 0 0 !important; }
.ql-container { border-color: var(--c-border) !important; border-radius: 0 0 var(--r-md) var(--r-md) !important; }

/* KTS & special pages */
.sk-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--c-border-light);
}

/* fix for the old 'content' class if still used */
div.content {
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}

/* ── Page Section (replaces old div.content) ─────────────────── */
div.page-section {
    width: 100%;
  /* No extra margin needed since sk-content handles padding */
}

/* Old form layouts compatibility */
div.content form > div.form1,
div.page-section form > div.form1,
div.page-section form > div.form2 {
  width: 100%;
  max-width: 680px;
  margin: 0 auto var(--sp-5);
}
div.page-section form > div.form1 > div.title > label {
  font-size: .875rem; font-weight: 600;
  color: var(--c-primary); display: block;
  margin-bottom: var(--sp-2);
}
div.page-section form > div.form1 > input,
div.page-section form > div.form1 > select,
div.page-section form > div.form1 > textarea {
  width: 100%; max-width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .9rem; color: var(--c-text);
  background: var(--c-surface);
  outline: none; transition: border-color var(--dur);
  height: auto;
}
div.page-section form > div.form1 > input:focus,
div.page-section form > div.form1 > select:focus,
div.page-section form > div.form1 > textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.12);
}
div.page-section form > div.form1 > button[type="submit"],
div.page-section form > div.form2 > button[type="submit"],
div.page-section form button[type="submit"] {
  padding: var(--sp-3) var(--sp-8);
  background: var(--c-primary);
  color: #fff; border: none;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background var(--dur);
  margin-top: var(--sp-4);
}
div.page-section form button[type="submit"]:hover { background: var(--c-accent); }

/* DataTables wrapper inside cards */
.card-body .dataTables_wrapper,
.card-body div[id*="table"] {
  width: 100%;
}

/* Old view layout compatibility */
div.page-section div.view {
  max-width: 100%;
}
div.view.view2 > div {
  display: inline-table;
  width: calc(50% - 20px);
  max-width: calc(50% - 20px);
  margin: 10px;
  vertical-align: top;
}
@media (max-width: 680px) {
  div.view.view2 > div {
    display: block;
    width: 100%; max-width: 100%; margin: 0 0 var(--sp-4);
  }
}

/* Old card-text bars-2 detail layout → use new detail-card style  */
.card-body.bars-2 { padding: 0; }
.card-body.bars-2 .bar {
  display: inline-table;
  width: calc(50% - 1px);
  vertical-align: top;
  border-right: 1px solid var(--c-border-light);
}
.card-body.bars-2 .bar:last-child { border-right: none; }
.card-body.bars-2 .bar > .row {
  display: flex; align-items: baseline; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--c-border-light);
}
.card-body.bars-2 .bar > .row > p:nth-child(1) {
  min-width: 130px; flex-shrink: 0;
  font-size: .82rem; font-weight: 600; color: var(--c-accent);
}
.card-body.bars-2 .bar > .row > p:nth-child(2) {
  color: var(--c-text-faint); flex-shrink: 0;
}
.card-body.bars-2 .bar > .row > p:nth-child(3) {
  font-size: .875rem; color: var(--c-text);
}
@media (max-width: 680px) {
  .card-body.bars-2 .bar { display: block; width: 100%; border-right: none; }
}

/* File upload label */
label.file {
  border: 2px dashed var(--c-border);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 180px; cursor: pointer;
  background: var(--c-surface-alt);
  transition: all var(--dur); position: relative;
  overflow: hidden;
}
label.file:hover { border-color: var(--c-accent); background: var(--c-accent-lite); }
label.file > input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
label.file > .button { text-align: center; z-index: 2; }
label.file > .button > p { font-size: 1.5rem; font-weight: 700; color: var(--c-text-muted); }
label.file > .button > label {
  display: inline-block; margin-top: var(--sp-3);
  padding: var(--sp-2) var(--sp-5); background: var(--c-primary);
  color: #fff; border-radius: var(--r-md); font-weight: 600;
  font-size: .85rem; cursor: pointer;
}

/* Password container (old .passwordContainer) */
form div.passwordContainer { position: relative; }
form div.passwordContainer > p.showPassword {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); cursor: pointer;
  color: var(--c-text-muted); font-size: .9rem;
}

/* Tags input overrides */
div.tagsinput {
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  background: var(--c-surface) !important;
  padding: var(--sp-2) !important;
}

/* Selectize override */
.selectize-control .selectize-input {
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  box-shadow: none !important;
  padding: var(--sp-3) var(--sp-4) !important;
  font-family: var(--font-body) !important;
  font-size: .9rem !important;
}
.selectize-control.single .selectize-input.input-active {
  border-color: var(--c-accent) !important;
  box-shadow: 0 0 0 3px rgba(64,145,108,.12) !important;
}

/* Invoice and KTS pages (special print layouts) */
@media print {
  .sk-sidebar, .sk-topbar, button.dark-mode-toggle, .sk-toast-stack { display: none !important; }
  .sk-main { margin-left: 0 !important; }
  .sk-content { padding: 0 !important; }
}

/* Fingerprint modal */
#fingerModal {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-lg) !important;
  padding: var(--sp-6) !important;
  font-family: var(--font-body) !important;
}

/* Popup bg (santri detail modal) */
.popup-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; justify-content: center; align-items: center;
  z-index: 9999; padding: var(--sp-4);
  backdrop-filter: blur(4px);
}
.popup-box {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  text-align: center;
  width: 100%; max-width: 420px;
  box-shadow: var(--sh-xl);
  animation: popIn .25s ease forwards;
}
@keyframes popIn { from{transform:scale(.92);opacity:0} to{transform:scale(1);opacity:1} }
.popup-box img { width: 100%; max-width: 280px; margin: var(--sp-4) auto; border-radius: var(--r-md); }
.popup-box button {
  margin: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border: none; border-radius: var(--r-md);
  background: var(--c-primary); color: #fff;
  font-family: var(--font-body); font-size: .875rem;
  font-weight: 600; cursor: pointer; transition: background var(--dur);
}
.popup-box button:hover { background: var(--c-accent); }
.popup-box button.close { background: var(--c-bg-alt); color: var(--c-text); }
.popup-box button.close:hover { background: var(--c-border); }

/* Validation message */
.validation-message {
  font-size: .78rem; color: var(--c-red);
  margin-top: var(--sp-1);
}

/* Center helper for old center tags */
center { display: block; }
/* ══════════════════════════════════════════════════════════════
   FORMS — Unified Design System
   All inputs use .form-control. All groups use .form-group.
   Old .form1/.form2/.title classes are also styled consistently.
   ══════════════════════════════════════════════════════════════ */

/* Wrapper: max width, centered */
.sk-content form,
.sk-content > center > form {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Form card wrapper */
.sk-content .form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  max-width: 640px;
  margin: 0 auto var(--sp-6);
  width: 100%;
}

/* Every form group */
.form-group,
div.form1,
.sk-content form > div:not(.form2):not(.form-card):not(.MIKDevIndformMulti) {
  margin-bottom: var(--sp-5);
  width: 100%;
  box-sizing: border-box;
}

/* Labels */
.form-group > label,
.form-group > .form-label,
div.form1 > .title > label,
div.form1 > .title,
div.form2 > div > .title > label,
div.form2 > div > .title {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: var(--sp-2);
}

/* The unified input style */
.form-control,
.sk-content form input[type=text],
.sk-content form input[type=number],
.sk-content form input[type=password],
.sk-content form input[type=date],
.sk-content form input[type=email],
.sk-content form input[type=tel],
.sk-content form input[type=search],
.sk-content form select,
.sk-content form textarea,
div.form1 > input,
div.form1 > select,
div.form1 > textarea,
div.form2 > div > input,
div.form2 > div > select,
div.form2 > div > textarea {
  display: block;
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-surface);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
  max-width: 100%;
  height: auto;
  /* Override any old fixed widths */
  min-width: 0 !important;
}

.form-control:focus,
.sk-content form input:focus,
.sk-content form select:focus,
.sk-content form textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.12);
  background: var(--c-surface);
}

.form-control:disabled,
.sk-content form input:disabled,
.sk-content form select:disabled {
  background: var(--c-bg-alt);
  cursor: not-allowed;
  opacity: .7;
}

select.form-control,
.sk-content form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a9e7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px;
  padding-right: 2.25rem;
}

textarea.form-control,
.sk-content form textarea {
  resize: vertical;
  min-height: 90px;
}

/* Two-column row */
div.form2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  width: 100%;
  box-sizing: border-box;
}
div.form2 > div {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

/* Submit button */
.sk-content form button[type=submit],
.sk-content form .submit-btn,
div.form1 > button[type=submit],
div.form2 button[type=submit] {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: .65rem 1.75rem;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
  margin-top: var(--sp-3);
}
.sk-content form button[type=submit]:hover { background: var(--c-accent); }
.sk-content form button[type=submit]:disabled { opacity: .55; cursor: not-allowed; }

/* File upload */
label.file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-lg);
  min-height: 140px;
  cursor: pointer;
  background: var(--c-surface-alt);
  transition: border-color .18s;
  position: relative;
  overflow: hidden;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  box-sizing: border-box;
}
label.file:hover { border-color: var(--c-accent); background-color: var(--c-accent-lite); }
label.file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
label.file .button { text-align: center; pointer-events: none; padding: var(--sp-4); }
label.file .button p { font-size: 1rem; font-weight: 600; color: var(--c-text-muted); margin-bottom: var(--sp-3); }
label.file .button label {
  display: inline-block; pointer-events: none;
  padding: var(--sp-2) var(--sp-5);
  background: var(--c-primary); color: #fff;
  border-radius: var(--r-md); font-weight: 600; font-size: .85rem;
}

/* Password toggle wrapper */
form .passwordContainer,
form .lg-wrap { position: relative; }
form .passwordContainer .showPassword,
form .eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--c-text-muted); font-size: .9rem; padding: 0;
}

/* Char counter */
#charCount { font-size: .75rem; color: var(--c-text-muted); margin-top: var(--sp-1); display: block; }

/* Tags input */
div.tagsinput {
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  background: var(--c-surface) !important;
  padding: var(--sp-2) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
div.tagsinput input { width: 100% !important; }

/* form-multi rows */
div.form-multi, .MIKDevIndformMulti { margin-bottom: var(--sp-5); }
.MIKDevIndInputRow {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-2); margin-bottom: var(--sp-2);
}
.MIKDevIndInputRow input,
.MIKDevIndInputRow select {
  flex: 1; min-width: 120px;
  padding: .55rem .8rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  background: var(--c-surface);
  color: var(--c-text);
  outline: none;
  box-sizing: border-box;
}
.buttonForm, .MIKDevIndInputRowRemove {
  padding: .55rem 1rem;
  background: var(--c-accent); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-size: .85rem; font-weight: 600; cursor: pointer;
}
div.form-multi > div#inputContainer > div.template { display: none; }

/* View detail rows */
div.view { width: 100%; max-width: 100%; }
div.view > div.view1 { margin-bottom: var(--sp-4); }
div.view > div.view1 > div.title {
  font-size: .82rem; font-weight: 600; color: var(--c-accent); margin-bottom: 4px;
}
div.view > div.view1 > div.isi {
  padding: .65rem .9rem;
  border: 1.5px solid var(--c-border); border-radius: var(--r-md);
  font-size: .875rem; color: var(--c-text); background: var(--c-surface);
  min-height: 40px; box-sizing: border-box;
}
div.view2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-5);
}
div.view2 > div > div.title {
  font-size: .82rem; font-weight: 600; color: var(--c-accent); margin-bottom: 4px;
}
div.view2 > div > div.isi {
  padding: .65rem .9rem;
  border: 1.5px solid var(--c-border); border-radius: var(--r-md);
  font-size: .875rem; color: var(--c-text); background: var(--c-surface);
}

/* Mobile */
@media (max-width: 600px) {
  div.form2, div.view2 { grid-template-columns: 1fr; }
  .sk-content form, .sk-content > center > form { padding: 0; }
}

/* Dark mode forms */
body.dark-mode .form-control,
body.dark-mode .sk-content form input,
body.dark-mode .sk-content form select,
body.dark-mode .sk-content form textarea,
body.dark-mode div.form1 > input,
body.dark-mode div.form2 > div > input,
body.dark-mode div.view > div > div.isi,
body.dark-mode div.view2 > div > div.isi {
  background: var(--c-surface); color: var(--c-text); border-color: var(--c-border);
}
body.dark-mode label.file { background-color: var(--c-surface); }
body.dark-mode select.form-control {
  background-color: var(--c-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239fc49f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}


/* ══════════════════════════════════════════════════════════════
   DATATABLE — Clean Responsive
   Strategy: show key columns, hide extras behind + expand.
   On mobile: expanded hidden columns show as a card below the row.
   ══════════════════════════════════════════════════════════════ */

/* Wrapper */
.dt-wrapper,
div[id$="_wrapper"].dataTables_wrapper,
#table_wrapper {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border-light);
  box-shadow: var(--sh-sm);
  overflow: visible;
}
/* Table scroll container - only scroll if responsive can't collapse enough */
.dt-wrapper > div,
div[id$="_wrapper"].dataTables_wrapper > div.dataTables_scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
div.dataTables_wrapper { padding: var(--sp-4) var(--sp-5); }

/* Table */
table.dataTable {
  width: 100% !important;
  border-collapse: collapse;
  margin: var(--sp-3) 0 !important;
  table-layout: auto;
}

/* Header */
table.dataTable thead th {
  white-space: nowrap;
  background: var(--c-primary-tint);
  color: var(--c-primary);
  font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem .9rem;
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
  user-select: none;
}
table.dataTable thead th.sorting { cursor: pointer; }
table.dataTable thead th.sorting::after { content: ' ↕'; opacity:.3; font-size:.65rem; }
table.dataTable thead th.sorting_asc::after { content: ' ↑'; opacity:.7; }
table.dataTable thead th.sorting_desc::after { content: ' ↓'; opacity:.7; }

/* Cells */
table.dataTable tbody td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--c-border-light);
  font-size: .85rem; color: var(--c-text);
  vertical-align: middle;
}
table.dataTable tbody tr:last-child td { border-bottom: none; }
table.dataTable tbody tr:hover td { background: var(--c-primary-tint); }
table.dataTable tbody tr.even td { background: var(--c-surface-alt); }
table.dataTable tbody tr.even:hover td { background: var(--c-primary-tint); }

/* Action links */
table.dataTable a, #table a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--c-primary-lite);
  color: var(--c-primary) !important;
  font-size: .78rem;
  transition: all .18s;
  margin: 1px; text-decoration: none; flex-shrink: 0;
}
table.dataTable a:hover, #table a:hover {
  background: var(--c-primary); color: #fff !important;
}

/* Expand button (+) — responsive plugin */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control {
  cursor: pointer;
  position: relative;
  padding-left: 2.5rem !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
  content: '';
  position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  background: var(--c-accent);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2v6M2 5h6' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px;
  transition: background .18s;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > td.dtr-control::before {
  background-color: var(--c-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5h6' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Expanded child card */
table.dataTable > tbody > tr.child td.child {
  padding: 0 var(--sp-4) var(--sp-3) 2.5rem !important;
  background: transparent !important; border: none !important;
}
table.dataTable > tbody > tr.child ul.dtr-details {
  list-style: none; margin: 0; padding: var(--sp-3) var(--sp-4);
  background: var(--c-primary-tint);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-light);
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border-light);
  font-size: .82rem; align-items: baseline;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child { border-bottom: none; }
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
  font-weight: 700; color: var(--c-accent);
  min-width: 110px; flex-shrink: 0;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
}
table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-data {
  color: var(--c-text); word-break: break-word; flex: 1;
}
table.dataTable > tbody > tr.child ul.dtr-details a {
  width: 26px; height: 26px; font-size: .72rem;
}

/* Controls */
div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: .82rem; color: var(--c-text-muted);
}
div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_filter input[type=search] {
  border: 1.5px solid var(--c-border); border-radius: var(--r-sm);
  padding: 5px 10px; font-family: var(--font-body); font-size: .82rem;
  background: var(--c-surface); color: var(--c-text); outline: none;
}
div.dataTables_wrapper div.dataTables_filter input[type=search]:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(64,145,108,.1);
}
div.dataTables_wrapper div.dataTables_info {
  font-size: .78rem; color: var(--c-text-muted); padding-top: var(--sp-3);
}
div.dataTables_wrapper div.dataTables_paginate { padding-top: var(--sp-3); }
div.dataTables_wrapper .paginate_button {
  border-radius: var(--r-sm) !important; font-size: .8rem !important;
  padding: 4px 10px !important; border: none !important;
  color: var(--c-text-mid) !important; background: transparent !important;
  cursor: pointer;
}
div.dataTables_wrapper .paginate_button:hover {
  background: var(--c-primary-lite) !important; color: var(--c-primary) !important;
}
div.dataTables_wrapper .paginate_button.current,
div.dataTables_wrapper .paginate_button.current:hover {
  background: var(--c-primary) !important; color: #fff !important;
}
div.dataTables_wrapper .paginate_button.disabled { opacity: .35; cursor: not-allowed; }

/* Export buttons */
.dt-buttons { margin-bottom: var(--sp-3); }
.dt-buttons .dt-button {
  background: var(--c-accent) !important; color: #fff !important;
  border: none !important; border-radius: var(--r-sm) !important;
  padding: 5px 12px !important; font-size: .8rem !important;
  font-family: var(--font-body) !important; font-weight: 600 !important;
  cursor: pointer !important;
}
.dt-buttons .dt-button:hover { background: var(--c-accent-dark) !important; }

/* Mobile controls stacking */
@media (max-width: 700px) {
  div.dataTables_wrapper { padding: var(--sp-3); }
  div.dataTables_wrapper div.dataTables_length,
  div.dataTables_wrapper div.dataTables_filter,
  div.dataTables_wrapper div.dataTables_info,
  div.dataTables_wrapper div.dataTables_paginate {
    float: none !important; text-align: left; margin-bottom: var(--sp-2);
  }
  table.dataTable thead th, table.dataTable tbody td {
    padding: .5rem .7rem; font-size: .78rem;
  }
}

/* Dark mode tables */
body.dark-mode table.dataTable thead th {
  white-space: nowrap;
  background: var(--c-bg-alt); color: var(--c-text); border-color: var(--c-border);
}
body.dark-mode table.dataTable tbody td { color: var(--c-text); }
body.dark-mode table.dataTable tbody tr.even td { background: var(--c-surface); }
body.dark-mode table.dataTable tbody tr:hover td { background: var(--c-bg-alt); }
body.dark-mode .dt-wrapper,
body.dark-mode #table_wrapper,
body.dark-mode div[id$="_wrapper"].dataTables_wrapper {
  background: var(--c-surface); border-color: var(--c-border);
}
body.dark-mode div.dataTables_wrapper div.dataTables_length select,
body.dark-mode div.dataTables_wrapper div.dataTables_filter input {
  background: var(--c-surface); color: var(--c-text); border-color: var(--c-border);
}
body.dark-mode table.dataTable > tbody > tr.child ul.dtr-details {
  background: var(--c-bg-alt); border-color: var(--c-border);
}
