/**
 * E-MEDANGGILI - Modern Professional Dashboard + Soft 3D + Glassmorphism
 * Primary Color: Sage Green (#4E6E5D), Accent: Gold/Amber, Navy (#1E293B)
 */

:root {
    --sage-primary: #4E6E5D;
    --sage-dark: #375244;
    --sage-darker: #25392F;
    --sage-light: #EBF2EE;
    --sage-border: #D1E0D7;
    --navy-dark: #0F172A;
    --navy-slate: #1E293B;
    --navy-muted: #64748B;
    --bg-surface: #F8FAFC;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 10px 25px -5px rgba(78, 110, 93, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --soft-3d-shadow: 0 4px 6px -1px rgba(78, 110, 93, 0.15), 0 2px 4px -2px rgba(78, 110, 93, 0.1);
    --soft-3d-hover: 0 10px 15px -3px rgba(78, 110, 93, 0.2), 0 4px 6px -4px rgba(78, 110, 93, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-surface);
    color: var(--navy-slate);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    box-shadow: 0 14px 28px -4px rgba(78, 110, 93, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.glass-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Soft 3D Buttons */
.btn-sage {
    background: linear-gradient(135deg, var(--sage-primary) 0%, var(--sage-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    box-shadow: var(--soft-3d-shadow);
    transition: all 0.2s ease-in-out;
}

.btn-sage:hover, .btn-sage:focus {
    background: linear-gradient(135deg, #577b68 0%, var(--sage-darker) 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--soft-3d-hover);
}

.btn-sage-light {
    background: var(--sage-light);
    color: var(--sage-dark);
    border: 1px solid var(--sage-border);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-sage-light:hover {
    background: #dceae1;
    color: var(--sage-darker);
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: #ffffff;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.85rem;
}

.sidebar-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94A3B8;
    font-weight: 700;
    margin: 1.2rem 0.75rem 0.4rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: #475569;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.925rem;
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.nav-link-custom i {
    font-size: 1.2rem;
    color: #64748B;
    transition: color 0.2s ease;
}

.nav-link-custom:hover {
    background-color: var(--sage-light);
    color: var(--sage-dark);
}

.nav-link-custom:hover i {
    color: var(--sage-primary);
}

.nav-link-custom.active {
    background: linear-gradient(135deg, var(--sage-primary) 0%, var(--sage-dark) 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(78, 110, 93, 0.25);
}

.nav-link-custom.active i {
    color: #ffffff !important;
}

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

.content-body {
    flex: 1;
    padding: 1.75rem;
}

/* Soft 3D Stat Badges & Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--glass-shadow);
}

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

.stat-icon.primary { background: #EBF2EE; color: var(--sage-primary); }
.stat-icon.navy { background: #E2E8F0; color: var(--navy-slate); }
.stat-icon.amber { background: #FEF3C7; color: #D97706; }
.stat-icon.rose { background: #FFE4E6; color: #E11D48; }
.stat-icon.emerald { background: #D1FAE5; color: #059669; }

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

.table-custom th {
    background: #F8FAFC;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid #E2E8F0;
}

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

.table-custom tr:hover td {
    background-color: #F8FAFC;
}

/* Badges */
.badge-sage {
    background-color: var(--sage-light);
    color: var(--sage-dark);
    font-weight: 600;
    padding: 0.4em 0.75em;
    border-radius: 8px;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1025;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Print Letterhead Styling for Reports & Rapor */
@media print {
    .sidebar, .glass-header, .no-print, .btn, nav, .pagination, .sidebar-overlay {
        display: none !important;
    }
    body, .main-wrapper, .content-body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    .print-only {
        display: block !important;
    }
    .glass-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .print-letterhead {
        border-bottom: 3px double #000;
        padding-bottom: 12px;
        margin-bottom: 20px;
        text-align: center;
    }
    .table-custom th, .table-custom td {
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

@media screen {
    .print-only {
        display: none !important;
    }
}
