/* =====================================================================
   BUNDA NILAI - CUSTOM STYLES
   Tema: Soft Indigo + Warm Amber
   Font: Poppins
   Dark mode: prefix body[data-theme="dark"]
   ===================================================================== */

:root {
    /* Light Mode */
    --primary:       #6366F1;
    --primary-light: #EEF2FF;
    --primary-dark:  #4F46E5;
    --accent:        #F59E0B;
    --success:       #10B981;
    --danger:        #EF4444;
    --warning:       #F97316;
    --info:          #0EA5E9;

    --bg:        #F8FAFC;
    --surface:   #FFFFFF;
    --text:      #1E293B;
    --text-muted:#64748B;
    --border:    #E2E8F0;
    --shadow:    0 4px 20px rgba(99, 102, 241, 0.08);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
}

body[data-theme="dark"] {
    --primary-light: #312E81;
    --bg:        #0F172A;
    --surface:   #1E293B;
    --text:      #F1F5F9;
    --text-muted:#94A3B8;
    --border:    #334155;
    --shadow:    0 4px 20px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.2s, color 0.2s;
}

/* ========== Navbar ========== */
.navbar-bunda {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem 1.5rem;
}
.navbar-bunda .navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-bunda .nav-link {
    color: var(--text) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.navbar-bunda .nav-link:hover,
.navbar-bunda .nav-link.active {
    background: var(--primary-light);
    color: var(--primary) !important;
}

/* ========== Card ========== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ========== Button ========== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.15s;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* ========== Form ========== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.55rem 0.85rem;
    background: var(--surface);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text);
}

/* ========== Table ========== */
.table {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    border-color: var(--border);
}
.table thead th {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.table tbody tr:hover {
    background: var(--primary-light);
}

/* ========== Badge ========== */
.badge-huruf {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4em 0.75em;
    border-radius: var(--radius-sm);
}
.huruf-a  { background: #D1FAE5; color: #065F46; }
.huruf-ab { background: #A7F3D0; color: #065F46; }
.huruf-b  { background: #DBEAFE; color: #1E40AF; }
.huruf-bc { background: #FEF3C7; color: #92400E; }
.huruf-c  { background: #FED7AA; color: #9A3412; }
.huruf-d  { background: #FECACA; color: #991B1B; }
.huruf-e  { background: #FCA5A5; color: #7F1D1D; }

/* Alpha warning */
.alpha-warn { color: var(--warning); font-weight: 600; }
.alpha-danger { color: var(--danger); font-weight: 600; }
.alpha-critical { color: #7F1D1D; font-weight: 700; }

/* ========== Login page ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15);
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo .emoji { font-size: 3rem; }
.login-logo h2 {
    color: var(--primary);
    font-weight: 700;
    margin-top: 0.5rem;
}

/* ========== Utility ========== */
.bg-primary-soft { background: var(--primary-light); }
.text-primary-custom { color: var(--primary); }
.bg-warning-soft { background: #FEF3C7; }
.bg-success-soft { background: #D1FAE5; }
.bg-info-soft    { background: #DBEAFE; }
.bg-danger-soft  { background: #FEE2E2; }
.text-warning    { color: #92400E !important; }
.text-success    { color: #065F46 !important; }
.text-info       { color: #1E40AF !important; }
.text-danger     { color: #991B1B !important; }
.border-soft { border: 1px solid var(--border); }

/* ========== Dark mode navbar tweak ========== */
body[data-theme="dark"] .navbar-bunda {
    background: var(--surface);
}
body[data-theme="dark"] .table thead th {
    background: rgba(99, 102, 241, 0.15);
}

/* ========== Lucide icon sizing ========== */
[data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    vertical-align: -3px;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ========== Dashboard stat cards ========== */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
}
.stat-card .stat-icon [data-lucide] {
    width: 24px;
    height: 24px;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-icon.bg-success-soft { background: #D1FAE5; color: #065F46; }
.stat-icon.bg-warning-soft { background: #FEF3C7; color: #92400E; }
.stat-icon.bg-danger-soft  { background: #FEE2E2; color: #991B1B; }
.stat-icon.bg-info-soft    { background: #DBEAFE; color: #1E40AF; }

/* ========== MK Card (dashboard) ========== */
.mk-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.15s;
    height: 100%;
}
.mk-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}
.mk-card .mk-code {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.mk-card .mk-name {
    font-weight: 600;
    font-size: 1rem;
    margin: 0.25rem 0;
    color: var(--text);
}
.mk-card .mk-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.mk-card .progress {
    height: 6px;
    margin-top: 0.75rem;
    border-radius: 3px;
    background: var(--border);
}
.mk-card .progress-bar {
    background: var(--primary);
    border-radius: 3px;
}

/* ========== Status badge for MK ========== */
.mk-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mk-status.status-draft      { background: #E2E8F0; color: #475569; }
.mk-status.status-diumumkan  { background: #FEF3C7; color: #92400E; }
.mk-status.status-final      { background: #D1FAE5; color: #065F46; }

body[data-theme="dark"] .mk-status.status-draft { background: #334155; color: #CBD5E1; }

/* ========== Page header ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ========== Empty state ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}
.empty-state h5 {
    color: var(--text);
    margin: 0.5rem 0;
}
