/**
 * SIP-BMN MTsN 4 Tabalong Tahun 2026
 * Custom Stylesheet - Modern Islamic & Government Kemenag Aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-dark: #064e3b;
    --primary-main: #065f46;
    --primary-light: #047857;
    --primary-subtle: #d1fae5;
    --primary-border: #a7f3d0;
    
    --accent-gold: #d97706;
    --accent-gold-dark: #b45309;
    --accent-gold-light: #fef3c7;
    
    --sidebar-bg: #09261f;
    --sidebar-hover: #134e4a;
    --sidebar-text: #e2e8f0;
    --sidebar-active: #047857;
    
    --bg-body: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Color Utilities */
.bg-emerald {
    background-color: var(--primary-main) !important;
    color: #ffffff !important;
}
.bg-emerald-dark {
    background-color: var(--primary-dark) !important;
    color: #ffffff !important;
}
.text-emerald {
    color: var(--primary-main) !important;
}
.text-gold {
    color: var(--accent-gold) !important;
}
.bg-gold-light {
    background-color: var(--accent-gold-light) !important;
    color: var(--accent-gold-dark) !important;
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #063d30 0%, #04251e 100%);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #059669 0%, #d97706 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4);
}

.brand-text h5 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.brand-text span {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 16px 12px;
    overflow-y: auto;
    flex-grow: 1;
}

.menu-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6ee7b7;
    margin: 18px 12px 6px;
    font-weight: 700;
    opacity: 0.85;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.sidebar-link i {
    font-size: 16px;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

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

.sidebar-link:hover i {
    color: #34d399;
}

.sidebar-link.active {
    background: linear-gradient(90deg, #059669 0%, #047857 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.2);
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-topbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.sidebar-toggle-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-main);
}

.institution-pill {
    background-color: var(--primary-subtle);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--primary-border);
}

/* User Profile Dropdown */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 30px;
    transition: background 0.2s;
}

.user-profile-badge:hover {
    background-color: #f1f5f9;
}

.avatar-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-main), var(--accent-gold));
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Page Body Container */
.app-content {
    padding: 24px;
    flex: 1 0 auto;
}

/* Footer */
.app-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 14px 24px;
    margin-top: auto;
    width: 100%;
    font-size: 13px;
}

/* Modern Card */
.card-modern {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.card-modern .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-modern .card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-md);
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.emerald::before { background-color: #059669; }
.stat-card.blue::before { background-color: #2563eb; }
.stat-card.amber::before { background-color: #d97706; }
.stat-card.purple::before { background-color: #7c3aed; }
.stat-card.rose::before { background-color: #e11d48; }
.stat-card.cyan::before { background-color: #0891b2; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.emerald { background-color: #ecfdf5; color: #059669; }
.stat-icon.blue { background-color: #eff6ff; color: #2563eb; }
.stat-icon.amber { background-color: #fffbeb; color: #d97706; }
.stat-icon.purple { background-color: #f5f3ff; color: #7c3aed; }
.stat-icon.rose { background-color: #fff1f2; color: #e11d48; }
.stat-icon.cyan { background-color: #ecfeff; color: #0891b2; }

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
}

/* Custom Table Styling */
.table-modern {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.table-modern thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 14px;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 14px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-modern tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 6px 10px;
    font-weight: 600;
    font-size: 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* Buttons */
.btn-emerald {
    background-color: var(--primary-main);
    color: #ffffff;
    border: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-emerald:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(6, 95, 70, 0.3);
}

.btn-gold {
    background-color: var(--accent-gold);
    color: #ffffff;
    border: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.btn-gold:hover {
    background-color: var(--accent-gold-dark);
    color: #ffffff;
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    margin-bottom: 5px;
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    padding: 9px 12px;
    font-size: 13.5px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

/* Timeline Activity */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-bullet {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-main);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--border-color);
}

/* Footer */
.app-footer {
    padding: 16px 24px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -270px;
    }
    .app-sidebar.show {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1030;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Bulk Delete & Action Toolbar */
.bulk-action-bar {
    display: none;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 10px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeInSlide 0.25s ease-out;
}
.bulk-action-bar.show {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Checkbox Table Styles */
.table-modern th.col-check,
.table-modern td.col-check {
    width: 38px;
    text-align: center;
    vertical-align: middle;
}
.table-modern tr.selected-row {
    background-color: #f0fdf4 !important;
}

/* Image Upload Preview Box */
.image-preview-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.image-preview-box:hover {
    border-color: var(--primary-main);
    background: #f0fdf4;
}
.image-preview-box img {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

/* Struk / Bukti Cetak Styling */
.struk-container {
    max-width: 720px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 36px 40px;
}
.struk-header {
    border-bottom: 2px dashed #94a3b8;
    padding-bottom: 18px;
    margin-bottom: 22px;
    text-align: center;
}
.struk-title {
    font-size: 15pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0f172a;
    margin: 8px 0 2px 0;
}
.struk-subtitle {
    font-size: 10pt;
    color: #64748b;
}
.struk-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.struk-table th, .struk-table td {
    padding: 8px 12px;
    font-size: 10pt;
    border-bottom: 1px solid #f1f5f9;
}
.struk-table th {
    width: 32%;
    color: #475569;
    font-weight: 600;
    background-color: #f8fafc;
}
