/* SIMDESA Custom Styling */
:root {
    --primary: #059669;        /* Emerald Green 600 */
    --primary-dark: #047857;   /* Emerald Green 700 */
    --primary-light: #ecfdf5;  /* Emerald Green 50 */
    --secondary: #0f172a;      /* Slate 900 */
    --accent: #2563eb;         /* Blue 600 */
    --bg-main: #f8fafc;        /* Slate 50 */
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: #1e293b;
    margin: 0;
    padding: 0;
}

/* Sidebar Styling */
.simdesa-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
    color: #f0fdf4;
    min-height: 100vh;
    transition: all 0.3s ease;
    z-index: 1040;
}

.simdesa-sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.2rem 0.5rem;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.simdesa-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.simdesa-sidebar .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.simdesa-sidebar .nav-link.active {
    color: #ffffff;
    background: #10b981;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Top Navbar */
.simdesa-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Dashboard Cards */
.stat-card {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}

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

.gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.gradient-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Data Table Card */
.table-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
}

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

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

/* Badges */
.badge-custom {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 20px;
}

/* Forms */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn-desa-primary {
    background-color: #059669;
    border-color: #059669;
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-desa-primary:hover {
    background-color: #047857;
    border-color: #047857;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

/* Live Search Suggestions Dropdown */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.autocomplete-item:hover, .autocomplete-item.selected {
    background-color: #ecfdf5;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .simdesa-sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        bottom: 0;
    }
    .simdesa-sidebar.show {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}
