/* ============================================================
 * AL-KARIMAH DESIGN SYSTEM v2.0
 * Islamic Modern Minimalism
 * 
 * Sistem Informasi Manajemen Pondok Pesantren
 * Tahfidzul Qur'an Al-Karimah
 * ============================================================ */

/* ─── DESIGN TOKENS ──────────────────────────────────────── */

:root {
  /* ── Color: Primary (Green — Brand Identity) ── */
  --color-primary-50:  #f0fdf4;
  --color-primary-100: #dcfce7;
  --color-primary-200: #bbf7d0;
  --color-primary-300: #86efac;
  --color-primary-400: #4ade80;
  --color-primary-500: #22c55e;
  --color-primary-600: #16a34a;   /* ← PRIMARY */
  --color-primary-700: #15803d;
  --color-primary-800: #166534;
  --color-primary-900: #14532d;
  --color-primary-950: #052e16;

  /* ── Color: Gold (Achievement & Prestige Only) ── */
  --color-gold-50:  #fffbeb;
  --color-gold-100: #fef3c7;
  --color-gold-200: #fde68a;
  --color-gold-300: #fcd34d;
  --color-gold-400: #fbbf24;
  --color-gold-500: #f59e0b;
  --color-gold-600: #ca8a04;
  --color-gold-700: #a16207;

  /* ── Color: Neutral (Gray Scale) ── */
  --color-gray-25:  #fcfcfd;
  --color-gray-50:  #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-gray-950: #030712;

  /* ── Color: Semantic ── */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger:  #ef4444;
  --color-info:    #3b82f6;

  --color-success-light: #f0fdf4;
  --color-warning-light: #fffbeb;
  --color-danger-light:  #fef2f2;
  --color-info-light:    #eff6ff;

  --color-success-dark: #15803d;
  --color-warning-dark: #a16207;
  --color-danger-dark:  #b91c1c;
  --color-info-dark:    #1d4ed8;

  /* ── Surfaces ── */
  --surface-page:      #f9fafb;
  --surface-card:      #ffffff;
  --surface-elevated:  #ffffff;
  --surface-overlay:   rgba(0, 0, 0, 0.5);
  --surface-sidebar:   #14532d;
  --surface-inset:     #f3f4f6;

  /* ── Text Colors ── */
  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-tertiary:  #9ca3af;
  --text-inverse:   #ffffff;
  --text-link:      #16a34a;

  /* ── Border ── */
  --border-default:  #e5e7eb;
  --border-light:    #f3f4f6;
  --border-focus:    #16a34a;

  /* ── Typography ── */
  --font-sans:   'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-extrabold: 800;

  /* ── Spacing ── */
  --space-0:  0;
  --space-px: 1px;
  --space-0-5: 0.125rem;  /* 2px */
  --space-1:  0.25rem;    /* 4px */
  --space-1-5: 0.375rem;  /* 6px */
  --space-2:  0.5rem;     /* 8px */
  --space-2-5: 0.625rem;  /* 10px */
  --space-3:  0.75rem;    /* 12px */
  --space-3-5: 0.875rem;  /* 14px */
  --space-4:  1rem;       /* 16px */
  --space-5:  1.25rem;    /* 20px */
  --space-6:  1.5rem;     /* 24px */
  --space-8:  2rem;       /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */

  /* ── Border Radius ── */
  --radius-none: 0;
  --radius-sm:   0.5rem;   /* 8px */
  --radius-md:   0.75rem;  /* 12px */
  --radius-lg:   1rem;     /* 16px */
  --radius-xl:   1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* ── Shadows (Neutral — No Colored Tint) ── */
  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ── Transitions ── */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:   150ms;
  --duration-normal: 200ms;
  --duration-slow:   300ms;
  --duration-slower: 500ms;

  /* ── Z-Index Scale ── */
  --z-dropdown:   50;
  --z-sticky:     100;
  --z-fixed:      200;
  --z-overlay:    300;
  --z-modal:      400;
  --z-popover:    500;
  --z-toast:      600;
  --z-tooltip:    700;

  /* ── Layout ── */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 56px;
  --bottomnav-height: 64px;
  --content-max-width: 1200px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}


/* ─── BASE RESET ─────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); }

/* Focus Ring */
:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Selection */
::selection {
  background-color: var(--color-primary-100);
  color: var(--color-primary-900);
}


/* ─── TYPOGRAPHY ─────────────────────────────────────────── */

.text-xs   { font-size: var(--text-xs);   line-height: var(--leading-normal); }
.text-sm   { font-size: var(--text-sm);   line-height: var(--leading-normal); }
.text-base { font-size: var(--text-base); line-height: var(--leading-normal); }
.text-lg   { font-size: var(--text-lg);   line-height: var(--leading-snug); }
.text-xl   { font-size: var(--text-xl);   line-height: var(--leading-snug); }
.text-2xl  { font-size: var(--text-2xl);  line-height: var(--leading-tight); }
.text-3xl  { font-size: var(--text-3xl);  line-height: var(--leading-tight); }

.font-normal   { font-weight: var(--font-normal); }
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-inverse   { color: var(--text-inverse); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-brand     { color: var(--color-primary-600); }

.font-arabic { font-family: var(--font-arabic); }


/* ─── LAYOUT UTILITIES ───────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-row    { flex-direction: row; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1 1 0%; }
.flex-auto   { flex: 1 1 auto; }
.flex-none   { flex: none; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.items-stretch  { align-items: stretch; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; min-height: 100dvh; }

.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.overflow-hidden   { overflow: hidden; }
.overflow-x-auto   { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.overflow-y-auto   { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-xs  { box-shadow: var(--shadow-xs); }
.shadow-sm  { box-shadow: var(--shadow-sm); }
.shadow-md  { box-shadow: var(--shadow-md); }
.shadow-lg  { box-shadow: var(--shadow-lg); }
.shadow-xl  { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

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


/* ─── CARD ───────────────────────────────────────────────── */

.ak-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-default);
}

.ak-card:hover {
  box-shadow: var(--shadow-sm);
}

.ak-card-flat {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.ak-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.ak-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}


/* ─── BUTTONS ────────────────────────────────────────────── */

.ak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  padding: var(--space-2-5) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
  user-select: none;
  min-height: 40px;
  text-decoration: none;
}

.ak-btn:hover { text-decoration: none; }

.ak-btn:active {
  transform: scale(0.97);
}

.ak-btn:disabled,
.ak-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.ak-btn-primary {
  background-color: var(--color-primary-600);
  color: var(--text-inverse);
  border-color: var(--color-primary-600);
}
.ak-btn-primary:hover {
  background-color: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

/* Secondary */
.ak-btn-secondary {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.ak-btn-secondary:hover {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

/* Ghost */
.ak-btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.ak-btn-ghost:hover {
  background-color: var(--color-gray-100);
  color: var(--text-primary);
}

/* Danger */
.ak-btn-danger {
  background-color: var(--color-danger);
  color: var(--text-inverse);
  border-color: var(--color-danger);
}
.ak-btn-danger:hover {
  background-color: var(--color-danger-dark);
}

/* Sizes */
.ak-btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-1-5) var(--space-3);
  min-height: 32px;
}

.ak-btn-lg {
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-6);
  min-height: 48px;
}

.ak-btn-block {
  display: flex;
  width: 100%;
}

.ak-btn-icon {
  padding: var(--space-2);
  min-height: 36px;
  min-width: 36px;
}


/* ─── STICKY HEADER & TABS SYSTEM ────────────────────────── */
.ak-sticky-header {
  position: -webkit-sticky;
  position: sticky;
  top: 68px;
  z-index: 45;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .ak-sticky-header {
    top: 56px;
    padding: 8px 10px;
    gap: 8px;
  }
}

body.dark-theme .ak-sticky-header {
  background-color: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4) !important;
}

.ak-sticky-header .ak-tabs {
  position: relative !important;
  top: 0 !important;
  z-index: 1 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

.ak-sticky-header .filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--border-default);
}

.ak-tabs {
  position: -webkit-sticky;
  position: sticky;
  top: 68px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
  padding: 6px 8px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .ak-tabs {
    top: 56px;
  }
}

.ak-tabs::-webkit-scrollbar {
  display: none;
}

.ak-tab,
.ak-tab-item,
.ak-tab-btn,
.btn-tab-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-default);
  outline: none;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.3;
}

.ak-tab:hover,
.ak-tab-item:hover,
.ak-tab-btn:hover,
.btn-tab-portal:hover {
  color: var(--text-primary) !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.ak-tab.active,
.ak-tab-item.active,
.ak-tab-btn.active,
.ak-tab-btn.ak-tab-active,
.btn-tab-portal.active {
  background-color: var(--color-primary-600) !important;
  color: #ffffff !important;
  font-weight: var(--font-bold) !important;
  box-shadow: var(--shadow-sm) !important;
}

.ak-tab i,
.ak-tab-item i,
.ak-tab-btn i,
.btn-tab-portal i {
  font-size: 18px;
  flex-shrink: 0;
}


/* ─── FORM CONTROLS ──────────────────────────────────────── */

.ak-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-1-5);
}

.ak-input {
  display: block;
  width: 100%;
  padding: var(--space-2-5) var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 44px;
  transition: border-color var(--duration-normal) var(--ease-default),
              box-shadow var(--duration-normal) var(--ease-default);
  appearance: none;
  -webkit-appearance: none;
}

.ak-input::placeholder {
  color: var(--text-tertiary);
}

.ak-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.ak-input:disabled {
  background-color: var(--surface-inset);
  cursor: not-allowed;
  opacity: 0.7;
}

select.ak-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  padding-right: var(--space-10);
}

.ak-form-group {
  margin-bottom: var(--space-4);
}

.ak-form-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.ak-form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.ak-checkbox,
.ak-radio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.ak-checkbox input[type="checkbox"],
.ak-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary-600);
  cursor: pointer;
}


/* ─── BADGES ─────────────────────────────────────────────── */

.ak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: var(--space-0-5) var(--space-2-5);
  border-radius: var(--radius-sm);
  line-height: var(--leading-normal);
  white-space: nowrap;
}

.ak-badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

.ak-badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.ak-badge-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.ak-badge-info {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
}

.ak-badge-neutral {
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
}

.ak-badge-gold {
  background-color: var(--color-gold-50);
  color: var(--color-gold-700);
}

.ak-badge-primary {
  background-color: var(--color-primary-50);
  color: var(--color-primary-700);
}

/* Dot badge */
.ak-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.ak-badge-dot-success { background-color: var(--color-success); }
.ak-badge-dot-warning { background-color: var(--color-warning); }
.ak-badge-dot-danger  { background-color: var(--color-danger); }


/* ─── AVATAR ─────────────────────────────────────────────── */

.ak-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--color-primary-100);
  color: var(--color-primary-700);
  font-weight: var(--font-bold);
  flex-shrink: 0;
}

.ak-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ak-avatar-sm  { width: 32px; height: 32px; font-size: var(--text-xs); }
.ak-avatar-md  { width: 40px; height: 40px; font-size: var(--text-sm); }
.ak-avatar-lg  { width: 56px; height: 56px; font-size: var(--text-lg); }
.ak-avatar-xl  { width: 80px; height: 80px; font-size: var(--text-2xl); }


/* ─── PROGRESS BAR ───────────────────────────────────────── */

.ak-progress {
  width: 100%;
  height: 8px;
  background-color: var(--color-gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ak-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-500);
  transition: width var(--duration-slow) var(--ease-out);
}

.ak-progress-gold .ak-progress-bar { background-color: var(--color-gold-400); }
.ak-progress-danger .ak-progress-bar { background-color: var(--color-danger); }
.ak-progress-info .ak-progress-bar { background-color: var(--color-info); }

/* ─── LIST COMPONENT ─────────────────────────────────────── */

.ak-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ak-list-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: var(--space-2-5) var(--space-3-5) !important;
  background-color: var(--surface-inset, #f8fafc) !important;
  border: 1px solid var(--border-default, #e2e8f0) !important;
  border-radius: var(--radius-md, 8px) !important;
  transition: all 0.2s ease;
  list-style: none !important;
}

.ak-list-item:hover {
  border-color: var(--border-focus, #16a34a) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

body.dark-theme .ak-list-item {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .ak-list-item:hover {
  background-color: #334155 !important;
  border-color: #475569 !important;
}


/* ─── TABS (SEGMENTED CONTROL) ───────────────────────────── */

.ak-tabs {
  display: flex;
  gap: var(--space-1);
  background-color: var(--color-gray-100);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ak-tabs::-webkit-scrollbar { display: none; }

.ak-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1-5);
  flex: 1 1 0%;
  min-width: max-content;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
  user-select: none;
}

.ak-tab:hover {
  color: var(--text-primary);
  background-color: var(--color-gray-200);
}

.ak-tab.active {
  color: var(--text-inverse);
  background-color: var(--color-primary-600);
  box-shadow: var(--shadow-sm);
}


/* ─── SEARCH ─────────────────────────────────────────────── */

.ak-search {
  position: relative;
  width: 100%;
}

.ak-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.ak-search-input {
  width: 100%;
  padding: var(--space-2-5) var(--space-3) var(--space-2-5) var(--space-10);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  min-height: 44px;
  transition: border-color var(--duration-normal) var(--ease-default),
              box-shadow var(--duration-normal) var(--ease-default);
}

.ak-search-input::placeholder { color: var(--text-tertiary); }
.ak-search-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}


/* ─── STAT CARD ──────────────────────────────────────────── */

.ak-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.ak-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.ak-stat-icon-primary { background-color: var(--color-primary-50); color: var(--color-primary-600); }
.ak-stat-icon-info    { background-color: var(--color-info-light); color: var(--color-info); }
.ak-stat-icon-warning { background-color: var(--color-warning-light); color: var(--color-warning); }
.ak-stat-icon-danger  { background-color: var(--color-danger-light); color: var(--color-danger); }
.ak-stat-icon-gold    { background-color: var(--color-gold-50); color: var(--color-gold-600); }

.ak-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1;
}

.ak-stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-0-5);
}


/* ─── EMPTY STATE ────────────────────────────────────────── */

.ak-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
}

.ak-empty-icon {
  width: 64px;
  height: 64px;
  color: var(--color-gray-300);
  margin-bottom: var(--space-4);
}

.ak-empty-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.ak-empty-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 360px;
}


/* ─── SKELETON LOADING ───────────────────────────────────── */

@keyframes ak-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ak-skeleton {
  background: linear-gradient(90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-200) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: ak-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.ak-skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.ak-skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: var(--space-3);
}

.ak-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.ak-skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}


/* ─── TOAST ──────────────────────────────────────────────── */

.ak-toast-container {
  position: fixed;
  bottom: calc(var(--bottomnav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  width: calc(100% - var(--space-8));
  max-width: 400px;
  pointer-events: none;
}

.ak-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-gray-900);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  pointer-events: auto;
  animation: ak-toast-in var(--duration-slow) var(--ease-spring);
}

@keyframes ak-toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ak-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}


/* ─── MODAL / BOTTOM SHEET ───────────────────────────────── */

.ak-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ak-fade-in var(--duration-normal) var(--ease-default);
}

@keyframes ak-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ak-bottom-sheet {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--surface-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-4);
  overflow-y: auto;
  animation: ak-slide-up var(--duration-slow) var(--ease-spring);
}

@keyframes ak-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.ak-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
}

/* Desktop: center as modal */
@media (min-width: 768px) {
  .ak-overlay {
    align-items: center;
  }

  .ak-bottom-sheet {
    border-radius: var(--radius-lg);
    max-height: 80vh;
    animation: ak-scale-in var(--duration-slow) var(--ease-spring);
  }

  @keyframes ak-scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
  }
}


/* ─── FAB (FLOATING ACTION BUTTON) ───────────────────────── */

.ak-fab {
  position: fixed;
  bottom: calc(var(--bottomnav-height) + var(--space-4) + var(--safe-area-bottom));
  right: var(--space-4);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-600);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: none;
  cursor: pointer;
  z-index: var(--z-fixed);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-default);
}

.ak-fab:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.ak-fab:active {
  transform: scale(0.95);
}


/* ─── TIMELINE ───────────────────────────────────────────── */

.ak-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: var(--space-6);
  position: relative;
}

.ak-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: var(--space-2);
  bottom: var(--space-2);
  width: 2px;
  background-color: var(--color-gray-200);
}

.ak-timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}

.ak-timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 6px);
  top: var(--space-1);
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-500);
  border: 2px solid var(--surface-card);
  z-index: 1;
}

.ak-timeline-dot-muted { background-color: var(--color-gray-300); }
.ak-timeline-dot-success { background-color: var(--color-success); }
.ak-timeline-dot-warning { background-color: var(--color-warning); }
.ak-timeline-dot-danger { background-color: var(--color-danger); }

.ak-timeline-content {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.ak-timeline-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}


/* ─── TABLE ──────────────────────────────────────────────── */

.ak-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ak-table thead {
  border-bottom: 2px solid var(--border-default);
}

.ak-table th {
  text-align: left;
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ak-table td {
  padding: var(--space-3) var(--space-3);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.ak-table tbody tr:hover {
  background-color: var(--color-gray-50);
}

.ak-table tbody tr:last-child td {
  border-bottom: none;
}

/* Mobile: Table to Card transformation */
@media (max-width: 768px) {
  .ak-table-responsive thead {
    display: none;
  }

  .ak-table-responsive tbody tr,
  table.custom-table tr,
  table.table tr {
    display: block;
    background: var(--surface-card) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--space-4) !important;
    margin-bottom: var(--space-4) !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .ak-table-responsive tbody td,
  table.custom-table td,
  table.table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: var(--text-sm);
  }

  .ak-table-responsive tbody td:last-child {
    border-bottom: none;
  }

  .ak-table-responsive tbody td::before {
    content: attr(data-label);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-right: var(--space-3);
  }

  /* Mobile Student Name Block — Label on Top, Name Below */
  .ak-table-responsive tbody td[data-label="Nama Santri"],
  .ak-table-responsive tbody td[data-label="Nama Lengkap"],
  .ak-table-responsive tbody td[data-label="Nama"],
  .ak-table-responsive tbody td[data-label="Santri"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: var(--space-3) 0 !important;
    border-bottom: 1px solid var(--border-default) !important;
    margin-bottom: var(--space-2) !important;
    width: 100% !important;
  }

  .ak-table-responsive tbody td[data-label="Nama Santri"]::before,
  .ak-table-responsive tbody td[data-label="Nama Lengkap"]::before,
  .ak-table-responsive tbody td[data-label="Nama"]::before,
  .ak-table-responsive tbody td[data-label="Santri"]::before {
    display: block !important;
    content: attr(data-label) !important;
    font-size: 11px !important;
    font-weight: var(--font-bold) !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-right: 0 !important;
    margin-bottom: var(--space-1) !important;
  }

  .ak-table-responsive tbody td[data-label="Nama Santri"] strong,
  .ak-table-responsive tbody td[data-label="Nama Santri"] span,
  .ak-table-responsive tbody td[data-label="Nama Lengkap"] strong,
  .ak-table-responsive tbody td[data-label="Nama Lengkap"] span,
  .ak-table-responsive tbody td[data-label="Nama"] strong,
  .ak-table-responsive tbody td[data-label="Nama"] span,
  .ak-table-responsive tbody td[data-label="Santri"] strong,
  .ak-table-responsive tbody td[data-label="Santri"] span {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    line-height: var(--leading-snug) !important;
    text-align: left !important;
    word-break: break-word !important;
    display: block !important;
  }

  /* Order of mobile card elements: 1. NO -> 2. NAMA SANTRI -> 3. NIS -> 4. Metadata */
  .ak-table-responsive tbody tr {
    display: flex !important;
    flex-direction: column !important;
  }

  .ak-table-responsive tbody td[data-label="No"] {
    order: 1 !important;
  }

  .ak-table-responsive tbody td[data-label="Nama Santri"],
  .ak-table-responsive tbody td[data-label="Nama Lengkap"],
  .ak-table-responsive tbody td[data-label="Nama"],
  .ak-table-responsive tbody td[data-label="Santri"] {
    order: 2 !important;
  }

  .ak-table-responsive tbody td[data-label="NIS"] {
    order: 3 !important;
  }

  .ak-table-responsive tbody td:not([data-label="No"]):not([data-label="Nama Santri"]):not([data-label="Nama Lengkap"]):not([data-label="Nama"]):not([data-label="Santri"]):not([data-label="NIS"]) {
    order: 10 !important;
  }

  /* Mobile input cell styling for Setoran & Table Cards */
  .ak-table-responsive tbody td[data-label="Program"],
  .ak-table-responsive tbody td[data-label="Juz & Pojok"],
  .ak-table-responsive tbody td[data-label="Surah & Ayat"],
  .ak-table-responsive tbody td[data-label="Kualitas"],
  .ak-table-responsive tbody td[data-label="Aksi Target"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 8px 0 !important;
    width: 100% !important;
  }

  .ak-table-responsive tbody td select.ak-input,
  .ak-table-responsive tbody td select.col-program,
  .ak-table-responsive tbody td select.col-quality {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ─── ATTENDANCE MOBILE CARD LAYOUT (NIS Side-by-Side, Status Below) ─── */
  #attendance-table tbody tr,
  .table-responsive #attendance-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 16px !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #attendance-table tbody td[data-label="Nama Santri"] {
    order: 1 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    border-bottom: 1px dashed var(--border-light) !important;
    padding-bottom: 8px !important;
    margin-bottom: 2px !important;
    width: 100% !important;
    display: block !important;
  }

  #attendance-table tbody td[data-label="Nama Santri"]::before {
    display: none !important;
  }

  #attendance-table tbody td[data-label="NIS"] {
    order: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    font-family: monospace !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    width: 100% !important;
    padding: 4px 0 !important;
  }

  #attendance-table tbody td[data-label="NIS"]::before {
    content: "NIS: " !important;
    display: inline-block !important;
    margin-bottom: 0 !important;
    font-family: var(--font-sans) !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    font-size: 11px !important;
    letter-spacing: 0.05em !important;
  }

  #attendance-table tbody td[data-label="Status & Keterangan"] {
    order: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin-top: 4px !important;
    padding-top: 8px !important;
    border-top: 1px dashed var(--border-light) !important;
  }

  #attendance-table tbody td[data-label="Status & Keterangan"]::before {
    content: "STATUS & KETERANGAN" !important;
    display: block !important;
    font-size: 10.5px !important;
    font-weight: 750 !important;
    color: var(--text-secondary) !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 6px !important;
  }
}

/* Prevent page horizontal overflow globally on mobile */
@media (max-width: 767px) {
  html, body, #app, #main-content {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
}


/* ─── ALERT ──────────────────────────────────────────────── */

.ak-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.ak-alert-info {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
  border-color: #bfdbfe;
}

.ak-alert-success {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
  border-color: #bbf7d0;
}

.ak-alert-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
  border-color: #fde68a;
}

.ak-alert-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
  border-color: #fecaca;
}


/* ─── DIVIDER ────────────────────────────────────────────── */

.ak-divider {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-4) 0;
}

.ak-divider-light {
  border-top-color: var(--border-light);
}


/* ─── RESPONSIVE BREAKPOINTS ─────────────────────────────── */

/* Tablet: 768px+ */
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:flex-row     { flex-direction: row; }
  .md\:hidden       { display: none !important; }
  .md\:block        { display: block !important; }
  .md\:flex         { display: flex !important; }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:hidden       { display: none !important; }
  .lg\:block        { display: block !important; }
  .lg\:flex         { display: flex !important; }
}


/* ─── DARK MODE ──────────────────────────────────────────── */

body.dark-theme {
  --surface-page:      #0f172a;
  --surface-card:      #1e293b;
  --surface-elevated:  #334155;
  --surface-inset:     #0f172a;
  --surface-sidebar:   #0f172a;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary:  #64748b;
  --text-link:      #4ade80;

  --border-default:  #334155;
  --border-light:    #1e293b;
  --border-focus:    #4ade80;

  --color-primary-50:  rgba(22, 163, 74, 0.1);
  --color-primary-100: rgba(22, 163, 74, 0.15);

  --color-success-light: rgba(34, 197, 94, 0.1);
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-danger-light:  rgba(239, 68, 68, 0.1);
  --color-info-light:    rgba(59, 130, 246, 0.1);

  --color-gray-50:  #1e293b;
  --color-gray-100: #334155;
  --color-gray-200: #475569;

  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

body.dark-theme .ak-tabs {
  background-color: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4) !important;
}

/* High Contrast Badges in Dark Mode */
body.dark-theme .ak-badge-neutral {
  background-color: #334155 !important;
  color: #ffffff !important;
  border: 1px solid #475569 !important;
}

body.dark-theme .ak-badge-primary {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
}

body.dark-theme .ak-badge-success {
  background-color: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(74, 222, 128, 0.3) !important;
}

body.dark-theme .ak-badge-warning {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

body.dark-theme .ak-badge-danger {
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.3) !important;
}

body.dark-theme .ak-badge-info {
  background-color: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(96, 165, 250, 0.3) !important;
}

body.dark-theme .ak-badge-gold {
  background-color: rgba(234, 179, 8, 0.2) !important;
  color: #facc15 !important;
  border: 1px solid rgba(250, 204, 21, 0.3) !important;
}

body.dark-theme .ak-tab,
body.dark-theme .ak-tab-item,
body.dark-theme .ak-tab-btn,
body.dark-theme .btn-tab-portal {
  color: #cbd5e1 !important;
}

body.dark-theme .ak-tab:hover,
body.dark-theme .ak-tab-item:hover,
body.dark-theme .ak-tab-btn:hover,
body.dark-theme .btn-tab-portal:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .ak-tab.active,
body.dark-theme .ak-tab-item.active,
body.dark-theme .ak-tab-btn.active,
body.dark-theme .ak-tab-btn.ak-tab-active,
body.dark-theme .btn-tab-portal.active {
  background-color: #16a34a !important;
  color: #ffffff !important;
}


/* ─── MONITORING BOARD MOBILE LAYOUT ─────────────────────── */

/* On mobile: show program-type tag inside cards, hide data-label for setoran cells */
@media (max-width: 768px) {
  /* Show the program tag (SABAQ/SABQI/MANZIL) inside each card on mobile */
  .mon-program-tag {
    display: inline-block !important;
  }

  /* Hide the data-label text for setoran cells on mobile (program label is now inside card) */
  .mon-setoran-cell::before {
    display: none !important;
  }

  /* Make setoran cells stack without the label-value flex layout */
  .mon-setoran-cell {
    display: block !important;
    padding: 4px 0 !important;
  }

  /* Kelengkapan cell: show as centered block */
  .mon-row td[data-label="Kelengkapan"] {
    display: flex !important;
    justify-content: center !important;
    padding: 8px 0 4px !important;
  }

  /* Empty state message: force visible on mobile */
  .mon-row td[colspan="7"] {
    display: block !important;
    text-align: center !important;
    padding: 32px 16px !important;
  }
  .mon-row td[colspan="7"]::before {
    display: none !important;
  }
}

/* ─── PRINT ──────────────────────────────────────────────── */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .ak-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
}
