@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Merriweather:wght@400;700&display=swap');

:root {
    /* IAKN Brand Colors */
    --iakn:       #6b21a8;
    --iakn-dark:  #4a1772;
    --iakn-light: #9333ea;
    --iakn-pale:  #f5f0ff;
    --gold:       #d97706;
    --gold-light: #fbbf24;
    --success:    #16a34a;
    --danger:     #dc2626;
    --warning:    #d97706;
    --info:       #0284c7;
    --bg:         #f8f6ff;
    --surface:    #ffffff;
    --surface-2:  #faf9ff;
    --border:     #e9d5ff;
    --border-2:   #f3e8ff;
    --text:       #1e1b2e;
    --text-muted: #6b5f7a;
    --sidebar-w:  268px;
    --radius:     12px;
    --shadow:     0 1px 3px rgba(107,33,168,.06), 0 4px 16px rgba(107,33,168,.08);
    --shadow-lg:  0 8px 32px rgba(107,33,168,.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--iakn); text-decoration: none; }
a:hover { color: var(--iakn-light); }

/* ===== AUTH ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a1772 0%, #6b21a8 45%, #9333ea 100%);
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    top: -200px; right: -150px;
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(217,119,6,.08);
    bottom: -100px; left: -80px;
}
.auth-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%; max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    position: relative; z-index: 1;
}
.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.auth-brand .logo { width: 64px; height: 64px; margin-bottom: 10px; }
.auth-brand h1 {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    color: var(--iakn-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}
.auth-brand p { font-size: 12px; color: var(--text-muted); }

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--iakn-dark);
    position: fixed; top:0; left:0; bottom:0;
    z-index: 100;
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.sb-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 12px;
}
.sb-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: white; padding: 2px; flex-shrink: 0; }
.sb-brand-text h2 {
    font-family: 'Merriweather', serif;
    font-size: 12px; font-weight: 700;
    color: #fff; line-height: 1.3;
}
.sb-brand-text p { font-size: 10px; color: rgba(255,255,255,.4); margin-top: 1px; }

.sb-nav { padding: 12px 10px; flex: 1; }
.sb-section { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.3); padding: 12px 8px 6px; }

.sb-link {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,.6);
    font-size: 13px; font-weight: 500;
    margin-bottom: 1px;
    transition: all .18s;
}
.sb-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-link.active { background: var(--gold); color: #fff; font-weight: 700; }
.sb-link .ic { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sb-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sb-user {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    margin-bottom: 6px;
}
.sb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--iakn-light);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 13px;
    flex-shrink: 0;
}
.sb-uname { color: #fff; font-size: 12px; font-weight: 700; }
.sb-urole { color: rgba(255,255,255,.4); font-size: 10px; }

/* ===== MAIN ===== */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

.topbar {
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 14px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 800; flex: 1; color: var(--iakn-dark); }
.topbar-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.page { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-2);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 800; color: var(--iakn-dark); }
.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; align-items: flex-start; gap: 14px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-ic {
    width: 46px; height: 46px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.ic-purple { background: #f3e8ff; }
.ic-gold   { background: #fef3c7; }
.ic-green  { background: #dcfce7; }
.ic-blue   { background: #dbeafe; }
.ic-red    { background: #fee2e2; }

.stat-val { font-size: 28px; font-weight: 800; color: var(--iakn-dark); line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%; padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit; font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-control:focus { border-color: var(--iakn); box-shadow: 0 0 0 3px rgba(107,33,168,.1); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Radio & Checkbox */
.opts { display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.opt input { accent-color: var(--iakn); width: 16px; height: 16px; cursor: pointer; margin-top: 2px; flex-shrink: 0; }
.opt label { cursor: pointer; font-size: 13.5px; line-height: 1.5; }

/* Rating */
.rating-table { width: 100%; border-collapse: collapse; }
.rating-table th, .rating-table td { padding: 9px 12px; border: 1px solid var(--border-2); font-size: 13px; }
.rating-table thead th { background: var(--iakn-pale); color: var(--iakn-dark); font-weight: 700; text-align: center; }
.rating-table tbody tr:hover { background: var(--iakn-pale); }
.rating-table td:first-child { text-align: left; }
.rating-table td:not(:first-child) { text-align: center; }
.rating-table input[type=radio] { accent-color: var(--iakn); width: 16px; height: 16px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border-radius: 8px; font-family: inherit;
    font-size: 13px; font-weight: 700;
    cursor: pointer; border: none;
    transition: all .18s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--iakn); color: #fff; }
.btn-primary:hover { background: var(--iakn-light); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--iakn); color: var(--iakn); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== TABLE ===== */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--iakn-pale);
    padding: 11px 14px;
    text-align: left; font-size: 11px; font-weight: 800;
    color: var(--iakn-dark); text-transform: uppercase;
    letter-spacing: .05em; border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--iakn-pale); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* ===== ALERTS ===== */
.alert { padding: 11px 15px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ===== PROGRESS ===== */
.progress-wrap { background: var(--border-2); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 20px; background: var(--iakn); transition: width .4s; }

/* ===== SECTION HEADING ===== */
.sect {
    background: var(--iakn-pale);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 20px 0 14px;
    font-size: 12px; font-weight: 800;
    color: var(--iakn-dark);
    text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: center; gap: 8px;
}

/* ===== MISC ===== */
.mb-4 { margin-bottom: 16px; } .mt-4 { margin-top: 16px; }
.mt-3 { margin-top: 12px; } .mb-3 { margin-bottom: 12px; }
.flex { display: flex; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; opacity: .4; margin-bottom: 14px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h3 { font-size: 16px; font-weight: 800; color: var(--iakn-dark); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }

.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.page-link { padding: 6px 11px; border-radius: 6px; border: 1.5px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600; transition: all .15s; }
.page-link:hover, .page-link.active { background: var(--iakn); border-color: var(--iakn); color: #fff; }

/* Step indicator for forms */
.step-bar { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-item:not(:last-child)::after { content: ''; position: absolute; top: 16px; left: 55%; width: 90%; height: 2px; background: var(--border); z-index: 0; }
.step-item.done:not(:last-child)::after { background: var(--iakn); }
.step-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; z-index: 1; position: relative; }
.step-item.active .step-dot { background: var(--iakn); color: #fff; }
.step-item.done .step-dot { background: var(--success); color: #fff; }
.step-lbl { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-top: 5px; text-align: center; }
.step-item.active .step-lbl { color: var(--iakn); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .cols-2, .cols-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
}