/* ============================================================
   E-SURAT - DESKTOP & CORE STYLESHEET
   SD Muhammadiyah Serut
   - Token & Variabel Tema (Gojek Green seragam dengan modul lain)
   - Reset & Tipografi Dasar
   - Layout & Komponen Desktop: Sidebar, Topbar, Cards, Tabel, Modal, Form
   ============================================================ */

/* ==================================================
   1. RESET & LARAVEL FILAMENT / NOVA DESIGN SYSTEM
   ================================================== */
:root {
    /* Gojek Green & Seragam dengan E-Kesiswaan / E-Kepegawaian / E-Presensi */
    --primary: #00AA13;
    --primary-dark: #00880C;
    --primary-light: #E6F6E8;
    --primary-glow: rgba(0, 170, 19, 0.18);
    --primary-gradient: linear-gradient(135deg, #00AA13 0%, #00C853 100%);
    
    --accent: #00AA13;
    --accent-light: #E6F6E8;
    --indigo: #6366f1;
    --indigo-light: #eef2ff;
    --rose: #ED2736;
    --rose-light: #FDEAEB;
    --purple: #9333ea;
    --purple-light: #f3e8ff;
    --sky: #2563eb;
    --sky-light: #dbeafe;

    /* Neutral Colors */
    --bg-main: #F9F9F9;
    --surface: #ffffff;
    --surface-subtle: #f1f5f9;
    
    --sidebar-bg: #0D2B12;
    --sidebar-bg-alt: #123818;
    --sidebar-surface: #123818;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: rgba(255, 255, 255, 0.72);
    --sidebar-text-active: #ffffff;
    --sidebar-active-bg: #00AA13;

    --text-main: #101820;
    --text-secondary: #687176;
    --text-muted: #94a3b8;

    --border: #EAEAEA;
    --border-subtle: #f1f5f9;

    --success: #00AA13;
    --success-light: #E6F6E8;
    --warning: #FF9900;
    --warning-light: #FFF5E6;
    --danger: #ED2736;
    --danger-light: #FDEAEB;
    --info: #2563eb;
    --info-light: #dbeafe;

    /* Shadows & Border Radius */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 4px rgba(0, 170, 19, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 20px -4px rgba(0, 170, 19, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.05);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    touch-action: pan-y;
    overscroll-behavior-x: none;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.5;
}

/* Modern Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==================================================
   2. APP SHELL & LAYOUT (FILAMENT STYLE)
   ================================================== */
#appWrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    max-width: 100vw;
    background-color: var(--bg-main);
}

/* ==================================================
   3. SIDEBAR (FILAMENT DARK SLATE THEME)
   ================================================== */
.app-sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    z-index: 120;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(15, 23, 42, 0.6);
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #059669, #10b981);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.sidebar-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.1;
}

.sidebar-header p {
    font-size: 10.5px;
    color: var(--accent);
    font-weight: 700;
    margin: 3px 0 0;
    letter-spacing: 0.5px;
}

.btn-close-sidebar-mobile {
    display: none;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    margin-left: auto;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.back-btn {
    color: #6ee888 !important;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding-bottom: 12px;
    text-decoration: none;
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #a7f3d0 !important;
}

.sidebar-section-title {
    font-size: 10.5px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 12px 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-item i {
    font-size: 20px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 170, 19, 0.35);
}

.sidebar-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-item.active .sidebar-badge {
    background: #ffffff;
    color: #00880c;
    border-color: #ffffff;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-danger {
    background: linear-gradient(135deg, #ED2736 0%, #c62828 100%);
    color: white;
    border-color: #ED2736;
    box-shadow: 0 2px 6px rgba(237, 39, 54, 0.25);
}
.btn-danger:hover {
    background: #b71c1c;
    box-shadow: 0 4px 10px rgba(237, 39, 54, 0.35);
    transform: translateY(-1px);
}

.btn-purple {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    color: white;
    border-color: #9333ea;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.25);
}
.btn-purple:hover {
    background: #6b21a8;
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.35);
    transform: translateY(-1px);
}

/* ==================================================
   4. MAIN CONTENT WRAPPER & TOPBAR (NOVA STYLE)
   ================================================== */
.app-main {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - 270px);
}

.app-topbar {
    height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.btn-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    font-size: 24px;
}
.btn-hamburger:hover { background: var(--surface-subtle); color: var(--text-main); }

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.topbar-breadcrumb span.current {
    color: var(--text-main);
    font-weight: 700;
}

.topbar-search {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.topbar-search input {
    width: 100%;
    height: 38px;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0 36px 0 36px;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.topbar-search input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.topbar-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

.topbar-search .clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: none;
}

.topbar-search.has-value .clear-search {
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================================================
   5. STATS GRID METRIC CARDS (FILAMENT STYLE)
   ================================================== */
main {
    padding: 22px 28px 40px;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-card-hover);
}

.stat-card.active {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-card);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s ease;
}
.stat-card.active::after { background: var(--primary); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-info h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ==================================================
   6. ACTION TOOLBAR & FILTER TABS
   ================================================== */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.btn i { font-size: 18px; }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    background: var(--surface-subtle);
    border-color: #cbd5e1;
}

/* Filter Tabs Segmented */
.filter-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

.filter-tab {
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-tab:hover {
    color: var(--text-main);
}

.filter-tab.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ==================================================
   7. RESOURCE DATA TABLE (FILAMENT TABLE UX)
   ================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #ffffff;
}

.card-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card-header .result-count {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--surface-subtle);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: #f8fafc;
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 18px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-main);
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

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

.cell-perihal {
    max-width: 300px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.cell-subtext {
    display: block;
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.dari-ke-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.dari-ke-label.label-in { background: #ecfdf5; color: #059669; }
.dari-ke-label.label-out { background: #fff1f2; color: #e11d48; }
.dari-ke-label.label-doc { background: #f5f3ff; color: #7c3aed; }

mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* ==================================================
   8. STATUS BADGES & ACTION PILLS
   ================================================== */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.badge-in { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-out { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.badge-doc { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-action-icon:hover {
    background: var(--surface-subtle);
    color: var(--text-main);
    border-color: #cbd5e1;
}
.btn-action-icon.edit {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #00AA13;
}
.btn-action-icon.edit:hover {
    background: #00AA13;
    color: #ffffff;
    border-color: #00AA13;
    transform: translateY(-1px);
}
.btn-action-icon.delete {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #ED2736;
}
.btn-action-icon.delete:hover {
    background: #ED2736;
    color: #ffffff;
    border-color: #ED2736;
    transform: translateY(-1px);
}

.table-actions-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.table-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.table-file-btn.btn-pdf {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.table-file-btn.btn-pdf:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.table-file-btn.btn-view {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}
.table-file-btn.btn-view:hover {
    background: #d1fae5;
}
.table-file-btn.btn-template {
    background: #f0fdf4;
    color: #00880c;
    border-color: #86efac;
}
.table-file-btn.btn-template:hover {
    background: #dcfce7;
}

/* ==================================================
   9. MODALS & FORMS (PREMIUM MATERIAL 3 / GOJEK UX)
   ================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 43, 18, 0.6);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 170, 19, 0.08);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.15s ease;
}
.modal-close-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Form Controls */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; gap: 12px; }
}

.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 10px 13px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #ffffff;
}

.form-group textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary);
    background: #E6F6E8;
}

/* ==================================================
   10. MOBILE NAVIGATION & RESPONSIVE
   ================================================== */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 119;
    display: none;
}
.sidebar-overlay.active { display: block; }

.mobile-list-container {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.mobile-surat-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    gap: 3px;
    cursor: pointer;
}
.mobile-nav-item.active { color: var(--primary); font-weight: 700; }
.mobile-nav-item i { font-size: 22px; }

.mobile-fab-add {
    display: none;
    position: fixed;
    bottom: 74px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.4);
    border: none;
    cursor: pointer;
    z-index: 95;
    font-size: 26px;
}


/* ============================================================
   PERBAIKAN UI/UX: judul seksi form, Bantuan AI satu alur, toast
   ============================================================ */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--primary-dark, #00880C);
    margin: 4px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.form-section-title .material-icons-round {
    font-size: 18px;
}

/* ----- Bantuan AI ----- */
.ai-box {
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1.5px solid #ddd6fe;
    border-radius: 12px;
    padding: 14px;
    margin-top: 14px;
}

.ai-box-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #5b21b6;
}

.ai-box-head .material-icons-round {
    font-size: 19px;
}

.ai-hint {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #6b5b95;
    margin: 6px 0 12px;
}

.ai-field {
    margin-bottom: 10px;
}

.ai-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 3px;
}

.ai-opt {
    font-weight: 400;
    color: #94a3b8;
}

.ai-field input,
.ai-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    outline: none;
    resize: vertical;
}

.ai-field input:focus,
.ai-field textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ai-more {
    margin-bottom: 12px;
}

.ai-more summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c3aed;
    padding: 4px 0 8px;
    list-style: none;
}

.ai-more summary::-webkit-details-marker {
    display: none;
}

.ai-more summary::before {
    content: '▸ ';
}

.ai-more[open] summary::before {
    content: '▾ ';
}

.ai-btn-main {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.ai-btn-main:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ai-btn-main:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ai-status {
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
}

.ai-status .material-icons-round {
    font-size: 18px;
}

.ai-status.loading {
    background: #ede9fe;
    color: #6d28d9;
}

.ai-status.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ai-result {
    margin-top: 12px;
}

.ai-result-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.ai-preview {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    max-height: 280px;
    overflow-y: auto;
    font-family: 'Times New Roman', Times, serif;
    font-size: 13px;
    line-height: 1.55;
    color: #111827;
}

.ai-preview p {
    margin: 0 0 8px;
}

.ai-preview mark {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 3px;
}

.ai-note {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 10px;
}

.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ai-act,
.ai-act-primary {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #ddd6fe;
    background: #ffffff;
    color: #5b21b6;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ai-act:hover {
    background: #f5f3ff;
}

.ai-act-primary {
    background: var(--primary, #00AA13);
    border-color: var(--primary, #00AA13);
    color: #ffffff;
}

.ai-act-primary .material-icons-round {
    font-size: 16px;
}

.ai-act.ghost {
    border-color: transparent;
    background: transparent;
    color: #64748b;
    margin-left: auto;
}

/* ----- Toast ----- */
#toastHost {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 24px);
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: toastIn 0.2s ease-out;
}

.app-toast.success {
    background: #047857;
}

.app-toast.error {
    background: #b91c1c;
}

.app-toast button {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
