/* SPPG FRESH & MODERN V3 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- COLOR PALETTE (Fresh & Vivid) --- */
    --primary: #4361ee;
    /* Vibrant Blue */
    --primary-hover: #3a56d4;
    --primary-light: #eef2ff;

    --secondary: #3f37c9;
    /* Deep Indigo */
    --accent: #f72585;
    /* Vivid Pink (for small highlights) */

    /* Backgrounds */
    --bg-body: #f3f4f6;
    /* Soft Gray */
    --bg-surface: #ffffff;
    /* Pure White */

    /* Sidebar Gradient */
    --sidebar-start: #1e1e2e;
    /* Very Dark Blue/Gray */
    --sidebar-end: #181825;

    /* Text - HIGH CONTRAST */
    --text-main: #111827;
    /* Almost Black */
    --text-body: #374151;
    /* Dark Gray */
    --text-muted: #6b7280;
    /* Accessible Gray */
    --text-on-dark: #ffffff;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* UI Variables */
    --sidebar-width: 280px;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Shadows (Soft & Modern) */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 0 15px rgba(67, 97, 238, 0.3);
}

/* --- RESET & LAYOUT --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Main Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* --- SIDEBAR (Modern Dark) --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    color: white;
}

.modern-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1em;
    transition: transform 0.2s;
}

/* Active & Hover States */
.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

.nav-link.active i {
    transform: scale(1.1);
}

.user-info {
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- MAIN CONTENT (Fluid) --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* Matches fixed sidebar */
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flex items from overflowing */
    background: var(--bg-body);
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.breadcrumb {
    margin: 0;
}

.breadcrumb-item {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* --- CONTENT AREA --- */
#content {
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* --- COOLER BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    /* Modern Pill/Rounded */
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    text-decoration: none;
    gap: 8px;
}

.btn i {
    font-size: 1em;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.35);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: var(--primary);
}

/* Danger Button */
.btn-danger {
    background: #fff1f2;
    color: var(--danger);
    border: 1px solid #fecdd3;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* --- MODERN CARDS (No Clutter) --- */
.card {
    background: var(--bg-surface);
    border: none;
    /* Removed borders for cleaner look */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
    /* Allow shadows/tooltips */
    margin-bottom: 24px;
}

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

.card-header {
    background: transparent;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-body {
    padding: 28px;
}

/* Dashboard Metrics v3 */
.modern-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Responsive grid */
    gap: 28px;
    margin-bottom: 40px;
}

.modern-metric-card {
    background: white;
    padding: 30px;
    border-radius: 24px;
    /* Super rounded */
    box-shadow: var(--shadow-card);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.modern-metric-card:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-5px) scale(1.01);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.metric-icon-modern {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--bg-body);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.modern-metric-card:hover .metric-icon-modern {
    background: var(--primary);
    color: white;
    transform: rotate(-5deg);
}

.metric-value-modern {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.metric-label-modern {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- FORMS & TABLES --- */
.form-control {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: #f8fafc;
    padding: 16px 24px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 20px 24px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-main);
    font-weight: 500;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Badges - Solid High Contrast */
.status-badge,
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    border: none;
}

.bg-success {
    background: #10b981 !important;
    /* Emerald 500 */
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.bg-warning {
    background: #f59e0b !important;
    /* Amber 500 */
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.bg-danger {
    background: #ef4444 !important;
    /* Red 500 */
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.bg-primary {
    background: #4f46e5 !important;
    /* Indigo 600 */
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.bg-info {
    background: #0ea5e9 !important;
    /* Sky 500 */
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

/* --- RESPONSIVENESS --- */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 100px 0 0 rgba(0, 0, 0, 0.3);
    }

    /* Hackish backdrop */

    .mobile-menu-toggle {
        display: block !important;
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 10px;
    color: var(--text-main);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- LOGIN PAGE STYLES --- */
.login-body-wrapper {
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-body-wrapper::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(67, 97, 238, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(247, 37, 133, 0.05) 0%, transparent 40%);
    z-index: 0;
}

.login-card-modern {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    box-shadow: var(--shadow-float);
    position: relative;
    z-index: 1;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.login-header-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
    position: relative;
}

.login-logo-modern {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.login-title-modern {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-subtitle-modern {
    opacity: 0.9;
    font-size: 0.95rem;
    font-weight: 400;
}

.login-form-body {
    padding: 40px;
}

.login-input-group {
    position: relative;
    margin-bottom: 20px;
}

.login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.2s;
    z-index: 2;
}

.login-form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    /* space for icon */
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.login-form-control:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.login-form-control:focus+.login-input-icon {
    color: var(--primary);
}

.btn-login-modern {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #3a56d4 100%);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MODERN TABS (Fix for light background) --- */
.nav-tabs {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    gap: 10px;
}

.nav-tabs .nav-link {
    color: var(--text-muted) !important;
    /* Override sidebar white text */
    border: none;
    background: transparent;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(67, 97, 238, 0.05);
    /* Tint of primary */
    transform: translateY(-1px);
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: white !important;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    position: relative;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}