/**
 * Sistem Informasi Pemerintahan Desa & BUMDes Serba Usaha
 * Modern Emerald & Slate Custom Stylesheet
 */

:root {
    --primary-color: #15803d;
    --primary-dark: #14532d;
    --primary-light: #22c55e;
    --primary-bg: #f0fdf4;
    --secondary-color: #0f766e;
    --accent-color: #eab308;
    --dark-bg: #0f172a;
    --sidebar-width: 270px;
    --topbar-height: 68px;
    --body-bg: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #334155;
    overflow-x: hidden;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #0f1f14;
    color: #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s ease-in-out;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

#sidebar .sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: linear-gradient(135deg, #166534 0%, #0f1f14 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebar .sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.menu-header {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #86efac;
    padding: 0.75rem 1.5rem 0.35rem;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.05rem;
    margin-right: 0.75rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: var(--primary-light);
}

.sidebar-link:hover i {
    color: #4ade80;
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0) 100%);
    border-left-color: #22c55e;
    font-weight: 600;
}

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

/* Main Content Area */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
}

/* Navbar Topbar */
#top-navbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Cards & Widgets */
.stat-card {
    border: none;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    overflow: hidden;
}

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

.stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.card-custom {
    border: none;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-custom .card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.card-custom .card-body {
    padding: 1.5rem;
}

/* Custom Badges */
.badge {
    padding: 0.45em 0.75em;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.01em;
}

/* Table Styling */
.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.table-custom td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    color: #334155;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
}

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

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.3);
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.4);
}

/* Official Letter Kop Surat Print Styling */
.kop-surat {
    border-bottom: 3px double #000000;
    padding-bottom: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    text-align: center;
}

.kop-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.kop-text h2 {
    font-size: 16pt;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.kop-text h1 {
    font-size: 20pt;
    font-weight: 900;
    margin: 2px 0;
    text-transform: uppercase;
}

.kop-text p {
    font-size: 10pt;
    margin: 0;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Times New Roman', Times, serif;
    }
    #sidebar, #top-navbar, .no-print, .btn, footer {
        display: none !important;
    }
    #main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .print-sheet {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        padding: 0 !important;
    }
}

/* Responsive Handling */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.show {
        margin-left: 0;
    }
    #main-content {
        margin-left: 0;
    }
}
