/* public/css/admin.css */
:root {
    --sidebar-width: 260px;
    --primary: #0d2137;
    --primary-2: #101e2e;
    --primary-hover: #16324f;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;
    --muted: #6b7280;
    --sidebar-bg: #0d2137;
    --main-bg: #f0f4f8;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

/* Gradient Backgrounds for Cards */
.bg-gradient-primary { background: linear-gradient(135deg, #0d2137 0%, #1a3a52 100%); color: white; }
.bg-gradient-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.bg-gradient-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.bg-gradient-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.bg-gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }

/* Dashboard Cards Enhancements */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
}

.stat-card .icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .card-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    opacity: 0.85;
}

.stat-card .card-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0;
}

.stat-card .card-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* SVG Icon Styling */
.svg-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.svg-icon-lg {
    width: 48px;
    height: 48px;
    fill: currentColor;
}

/* Premium Card (Floating effect) */
.premium-card {
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.premium-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

/* List/Table Card */
.content-card {
    border: none;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.content-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
}

.content-card .card-title {
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 0;
}

/* Custom Gradients for Dashboard Cards */
.card-primary-gradient { background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%); }
.card-success-gradient { background: linear-gradient(to right, #43e97b 0%, #38f9d7 100%); }
.card-info-gradient { background: linear-gradient(to right, #667eea 0%, #764ba2 100%); }
.card-warning-gradient { background: linear-gradient(to right, #f6d365 0%, #fda085 100%); }
.card-danger-gradient { background: linear-gradient(to right, #ff0844 0%, #ffb199 100%); }

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--main-bg) 0%, #e8f0f7 100%);
    color: #1f2937;
}

.admin-body .container-fluid {
    min-height: 100vh;
    display: flex;
}

/* SIDEBAR IMPROVEMENTS */
#sidebar, #sidebarCollapse {
    background: #0b2a5a;
    min-height: 100vh;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    position: fixed;
    width: var(--sidebar-width);
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
}

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

#sidebar .brand .title, #sidebarCollapse .brand .title {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sidebar .nav, #sidebarCollapse .nav {
    padding: 0.5rem 0;
}

#sidebar .nav-link, #sidebarCollapse .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    text-decoration: none;
    border-radius: 0;
    margin: 0;
}

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

#sidebar .nav-link:hover, #sidebarCollapse .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFD200;
}

#sidebar .nav-link.active, #sidebarCollapse .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFD200;
    font-weight: 600;
}

#sidebar .logout, #sidebarCollapse .logout {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

#sidebar .logout a, #sidebarCollapse .logout a {
    color: #ef4444;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#sidebar .logout a:hover, #sidebarCollapse .logout a:hover {
    opacity: 0.8;
}

/* MAIN CONTENT */
.admin-main, .main-content {
    background: var(--main-bg);
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
    padding: 2.5rem !important; /* Dagdag space sa paligid para sa desktop */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Siguraduhin na ang mga cards sa loob ay hindi lalampas sa 1400px para centered ang tingin */
.admin-main > *, .main-content > * {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* CARDS */
.card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius) !important;
    background: var(--card-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    color: var(--primary);
}

.card-body {
    padding: 1.75rem;
}

.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* SUMMARY CARDS */
.summary-card {
    position: relative;
    padding: 1.5rem;
    border-radius: var(--radius);
}

.summary-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.summary-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    color: var(--primary);
}

/* HERO CARD */
.hero-card {
    background: linear-gradient(135deg, #0f1f3d 0%, #1а3а52 100%);
    color: #fff;
    border: none;
    box-shadow: 0 10px 40px rgba(15, 31, 61, 0.3);
}

.hero-card .value {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
}

.hero-card .sub {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* FINANCE CARD */
.finance-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.finance-card .label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.finance-card .value {
    font-size: 1.8rem;
    font-weight: 900;
    margin-top: 0.5rem;
}

/* BUTTONS */
.btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn-premium {
    border-radius: 50px;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* TABLES */
.table {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid var(--border);
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

.table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

/* BADGES */
.badge-soft-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
}

.badge-soft-info {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    #sidebar {
        width: 220px;
    }
    
    .admin-main {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .admin-body .container-fluid {
        display: block !important;
        padding: 0 !important;
    }

    #sidebarCollapse {
        position: fixed !important; /* Fixed para laging nasa ibabaw kahit mag-scroll */
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: calc(100vh - 60px) !important; /* Sakop hanggang baba ng screen */
        z-index: 9999 !important; /* Pinaka-mataas na layer */
        background: #0b2a5a !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 15px 30px rgba(0,0,0,0.5) !important; /* Mas matapang na shadow */
        overflow-y: auto;
    }

    .admin-main, .main-content {
        margin-left: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        position: relative;
        z-index: 1; /* Mababa lang na layer para sa content */
    }

    .mobile-nav-header {
        height: 60px;
        width: 100%;
        margin: 0;
        z-index: 10000 !important; /* Mas mataas pa sa sidebar para hindi matakpan ang button */
    }
}
