/* ===================================================
   IFApps UMP — Design System v2
   Minimal Clean Light · Tailwind v3 + DaisyUI v4
=================================================== */

:root {
    --ink-900: #0f1115;
    --ink-700: #30343c;
    --ink-500: #6b7280;
    --ink-400: #9aa1ac;
    --ink-300: #d6dae1;
    --ink-200: #e7eaef;
    --ink-100: #f3f4f7;
    --ink-50:  #fafbfc;
    --accent:       #5b5ff5;
    --accent-dark:  #4347d9;
    --accent-light: #eef0ff;
    --accent-soft:  #f4f5ff;
    --ring: 0 0 0 3px rgba(91, 95, 245, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body { height: 100%; font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

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

/* ---- Sidebar Nav ---- */
.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-500);
    transition: background .15s ease, color .15s ease;
    text-decoration: none;
}
.sidebar-nav a:hover { background: var(--ink-100); color: var(--ink-900); }
.sidebar-nav a.active-nav-link,
.sidebar-nav a[data-active="true"] {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 600;
}
.sidebar-nav a i { width: 1.1rem; text-align: center; font-size: .85rem; transition: transform .15s ease; }
.sidebar-nav a:hover i { transform: translateX(1px); }
.sidebar-nav .nav-section-label {
    padding: 1rem 0.75rem 0.35rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-400);
}

/* ---- Stat Cards ---- */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid var(--ink-200);
    padding: 1.35rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
}
.stat-card:hover {
    box-shadow: 0 12px 28px -8px rgba(15,17,21,.09);
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* ---- Data Tables Override ---- */
/* overflow-x: auto (bukan hidden) agar tabel lebar tetap bisa discroll
   horizontal di mobile — border-radius tetap terlihat karena diterapkan
   di wrapper ini sendiri, bukan di elemen yang discroll. */
.datatable-wrapper .datatable-container { border-radius: 0.85rem; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--ink-200); -webkit-overflow-scrolling: touch; }
.datatable-wrapper input, .datatable-wrapper select {
    border: 1px solid var(--ink-200) !important;
    border-radius: 0.6rem !important;
    padding: 0.4rem 0.75rem !important;
    color: var(--ink-900) !important;
    font-size: 0.8125rem !important;
    outline: none !important;
    background: #fff !important;
}
.datatable-wrapper input:focus, .datatable-wrapper select:focus {
    border-color: var(--accent) !important;
    box-shadow: var(--ring) !important;
}
.datatable-table thead tr th {
    background: var(--ink-50);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
    font-weight: 700;
    border-bottom: 1px solid var(--ink-200);
    padding-top: .75rem;
    padding-bottom: .75rem;
}
.datatable-table tbody tr { border-bottom: 1px solid var(--ink-100); }
.datatable-table tbody tr:hover { background: var(--ink-50); }
.datatable-pagination-list-item-link {
    border-radius: 0.5rem !important;
    border: 1px solid var(--ink-200) !important;
    color: var(--ink-700) !important;
}
.datatable-active .datatable-pagination-list-item-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ---- Form Inputs ---- */
.input, .select, .textarea {
    border-color: var(--ink-200);
    background: #fff;
    color: var(--ink-900) !important;
    font-size: 0.8125rem;
    border-radius: 0.65rem !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.select option { background-color: #fff !important; color: var(--ink-900) !important; }
.file-input { color: var(--ink-900) !important; background-color: #fff !important; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
    outline: none;
}
.input-error { border-color: #e4584c !important; }
.label-text { font-size: 0.8rem; font-weight: 500; color: var(--ink-700); }
.label-text-alt { font-size: 0.7rem; color: #e4584c; }

/* ---- Buttons ---- */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary-custom:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(91,95,245,.4);
    color: #fff;
}
.btn-primary-custom:active { transform: translateY(0); }

/* Tombol kecil (btn-xs/btn-sm) di dalam sel tabel: DaisyUI defaultnya
   nowrap dengan lebar mengikuti teks, sehingga pada kolom tabel yang
   sempit di mobile tombol bisa meluber keluar batas sel/kartu. Izinkan
   teksnya wrap dan tinggi menyesuaikan, serta jangan biarkan tombol
   melebihi lebar kolom tempatnya berada. */
td .btn.btn-xs, td .btn.btn-sm {
    white-space: normal;
    height: auto;
    min-height: 1.5rem;
    max-width: 100%;
    line-height: 1.3;
    text-align: center;
}

/* ---- DaisyUI btn-primary / badge-primary ----
   Override eksplisit (background + border + TEKS) agar selaras dengan token
   `primary` Tailwind custom (indigo #5b5ff5), bukan warna 'primary' bawaan
   tema DaisyUI "light". Ditulis sebagai properti CSS biasa (bukan lewat
   variabel internal DaisyUI seperti --p/--pc) karena format variabel warna
   DaisyUI v4 (OKLCH) berbeda dari HSL biasa dan mudah salah format — override
   langsung lebih aman dan tidak tergantung versi/format internal library. */
.btn.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn.btn-primary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}
.btn.btn-outline.btn-primary {
    background-color: transparent;
    border-color: var(--accent);
    color: var(--accent);
}
.btn.btn-outline.btn-primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn.btn-ghost.btn-primary,
.btn.btn-ghost.text-primary {
    background-color: transparent;
    color: var(--accent);
}
.btn.btn-ghost.btn-primary:hover,
.btn.btn-ghost.text-primary:hover {
    background-color: var(--accent-light);
    color: var(--accent-dark);
}
.badge.badge-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---- Badge / Status Chips ---- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.status-chip::before { content:''; width: .4rem; height: .4rem; border-radius: 99px; background: currentColor; }
.chip-pending     { background: #fff6e5; color: #a16207; }
.chip-aktif       { background: #e9f9ef; color: #157347; }
.chip-disetujui   { background: #eaf1ff; color: #1d4ed8; }
.chip-ditolak     { background: #fdeceb; color: #c0392b; }
.chip-lulus       { background: #e9f9ef; color: #157347; }
.chip-belum_lulus { background: #fff6e5; color: #a16207; }
.chip-selesai     { background: var(--accent-light); color: var(--accent-dark); }

/* ---- Card Sections ---- */
.section-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid var(--ink-200);
    padding: 1.5rem;
}
.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--ink-100);
}
.section-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* ---- Glassmorphism (Auth Pages) ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px -12px rgba(15,17,21,.18);
}

/* ---- Page Header ---- */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }
.page-header p { font-size: 0.8125rem; color: var(--ink-500); margin-top: 0.25rem; }

/* ---- Empty State ---- */
.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border: 1.5px dashed var(--ink-200);
    border-radius: 1rem;
    color: var(--ink-400);
}
.empty-state i { font-size: 1.75rem; display: block; margin-bottom: .6rem; color: var(--ink-300); }
.empty-state p { font-size: 0.8125rem; }

/* ---- Timeline / Stepper ---- */
.timeline-dot {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}
.timeline-dot.done    { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-light); }
.timeline-dot.current { background: #f0a92e; color: #fff; box-shadow: 0 0 0 4px rgba(240,169,46,.2); animation: pulse-ring 1.5s ease infinite; }
.timeline-dot.pending { background: var(--ink-200); color: var(--ink-400); }

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(240,169,46,.4); }
    70%  { box-shadow: 0 0 0 8px rgba(240,169,46,0); }
    100% { box-shadow: 0 0 0 0 rgba(240,169,46,0); }
}

/* ---- Fade/slide-in utility (progressive reveal) ---- */
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fade-up .35s ease both; }

/* ---- Counter Animation ---- */
.counter-animate { transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---- Alert ---- */
.alert { border-radius: 0.85rem; }

/* ---- Modal (native, non-DaisyUI) ---- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,17,21,0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box-custom {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 30px 60px -12px rgba(15,17,21,.25);
    width: 100%; max-width: 28rem;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* ---- Print ---- */
@media print {
    aside, header, .no-print { display: none !important; }
    body { background: white; }
    main { padding: 0 !important; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .section-card { padding: 1.1rem; }
    .page-header h1 { font-size: 1.2rem; }
}
