/* =============================================
   SISTEM PENDATAAN PANITIA — STYLESHEET
   ============================================= */

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

:root {
    --primary:    #1a56db;
    --primary-dk: #1e429f;
    --secondary:  #6366f1;
    --success:    #0e9f6e;
    --danger:     #e02424;
    --warning:    #ff5a1f;
    --info:       #0694a2;
    --light:      #f9fafb;
    --dark:       #111827;
    --gray:       #6b7280;
    --gray-lt:    #e5e7eb;
    --sidebar-w:  240px;
    --navbar-h:   60px;
    --radius:     10px;
    --shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f3f4f6;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--navbar-h);
    background: var(--primary-dk);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 700; }
.nav-brand i { font-size: 22px; color: #93c5fd; }
.nav-user { display: flex; align-items: center; gap: 14px; }
.nav-username { color: #d1d5db; font-size: 13px; }
.nav-username i { color: #93c5fd; }
.badge-role { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.badge-super { background: #fef3c7; color: #92400e; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.btn-logout {
    background: rgba(255,255,255,.12); color: #fff; padding: 6px 14px;
    border-radius: 6px; text-decoration: none; font-size: 13px;
    transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.22); }

/* ---- LAYOUT ---- */
.app-wrapper {
    display: flex;
    padding-top: var(--navbar-h);
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: #1e2a3b;
    position: fixed; left: 0; top: var(--navbar-h); bottom: 0;
    overflow-y: auto; padding: 16px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,.1);
}
.sidebar-menu { list-style: none; }
.menu-group {
    padding: 16px 20px 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
    color: #64748b; text-transform: uppercase;
}
.sidebar-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; color: #94a3b8; text-decoration: none;
    font-size: 13.5px; font-weight: 500; border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-menu a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.sidebar-menu a.active {
    background: rgba(59,130,246,.15);
    color: #60a5fa; border-left-color: #3b82f6;
}
.sidebar-menu a i { width: 18px; text-align: center; font-size: 15px; }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1; padding: 28px;
    max-width: calc(100vw - var(--sidebar-w));
}

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--dark); }
.page-title small { display: block; font-size: 13px; font-weight: 400; color: var(--gray); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; }

/* ---- CARDS ---- */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--gray-lt); padding-bottom: 14px; margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--dark); }

/* ---- STAT CARDS ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--primary); }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #ffedd5; color: var(--warning); }
.stat-val { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray); margin-top: 3px; }

/* ---- ALERTS ---- */
.alert {
    padding: 12px 18px; border-radius: 8px; margin-bottom: 18px;
    display: flex; align-items: center; gap: 10px; font-size: 13.5px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info     { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 7px; border: none; cursor: pointer;
    font-size: 13.5px; font-weight: 600; text-decoration: none;
    transition: all .15s; white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 5px; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #057a55; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c81e1e; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d43f00; }
.btn-secondary { background: var(--gray-lt); color: var(--dark); }
.btn-secondary:hover { background: #d1d5db; }
.btn-info      { background: var(--info); color: #fff; }
.btn-info:hover { background: #047481; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { background: #f1f5f9; }
th { padding: 11px 14px; text-align: left; font-weight: 700; color: #374151; font-size: 12.5px; letter-spacing: .3px; border-bottom: 2px solid var(--gray-lt); }
td { padding: 11px 14px; border-bottom: 1px solid var(--gray-lt); color: #374151; vertical-align: middle; }
tbody tr:hover { background: #f9fafb; }
.tbl-no { width: 46px; text-align: center; }
.tbl-actions { width: 130px; text-align: center; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span2 { grid-column: 1/-1; }
label { font-size: 13px; font-weight: 600; color: #374151; }
label span.req { color: var(--danger); margin-left: 2px; }
.form-control {
    padding: 9px 12px; border: 1.5px solid #d1d5db; border-radius: 7px;
    font-size: 13.5px; color: var(--dark); background: #fff; width: 100%;
    transition: border .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

/* ---- SEARCH BAR ---- */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-bar .form-control { max-width: 260px; }

/* ---- BADGE ---- */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ---- BIDANG REKAP ---- */
.rekap-section { margin-bottom: 28px; }
.rekap-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff; padding: 12px 20px; border-radius: 8px 8px 0 0;
    display: flex; align-items: center; justify-content: space-between;
}
.rekap-header h3 { font-size: 14px; font-weight: 700; }
.rekap-count { font-size: 12px; background: rgba(255,255,255,.2); padding: 2px 10px; border-radius: 20px; }
.rekap-table { border-radius: 0 0 8px 8px; overflow: hidden; box-shadow: var(--shadow); }
.rekap-table table thead tr { background: #f8faff; }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 14px; padding: 36px 32px; text-align: center;
    max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-icon { font-size: 48px; color: var(--warning); margin-bottom: 14px; }
.modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.modal-box p { color: var(--gray); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray); }
.empty-state i { font-size: 48px; color: #d1d5db; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 6px 13px; border-radius: 6px; font-size: 13px; text-decoration: none;
    border: 1.5px solid var(--gray-lt); color: var(--dark);
}
.pagination a:hover { background: #f3f4f6; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #d1d5db; cursor: default; }

/* ---- FOOTER ---- */
.app-footer {
    margin-left: var(--sidebar-w); padding: 16px 28px;
    text-align: center; color: var(--gray); font-size: 12px;
    border-top: 1px solid var(--gray-lt); background: #fff;
}

/* ---- LOGIN PAGE ---- */
.login-body { min-height: 100vh; background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%); display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 16px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 25px 60px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 48px; color: var(--primary); }
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--dark); margin-top: 10px; }
.login-logo p { color: var(--gray); font-size: 13px; }
.login-card .form-group { margin-bottom: 16px; }
.btn-login { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; justify-content: center; }

/* ---- PRINT / PDF ---- */
@media print {
    .navbar, .sidebar, .app-footer, .page-actions, .tbl-actions, .btn, .alert { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .app-wrapper { display: block; padding-top: 0; }
    body { background: #fff; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; max-width: 100%; }
    .app-footer { margin-left: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
