/* style.css */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Modern Light Color Palette */
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --color-brand: #4f46e5;       /* Indigo */
    --color-brand-hover: #4338ca;
    --color-brand-light: #e0e7ff;
    
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;

    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;

    --border-color: #e2e8f0;
    
    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.04), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.04), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    --shadow-premium: 0 25px 50px -12px rgba(15, 23, 42, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
}

/* Premium Typography classes */
.font-outfit {
    font-family: var(--font-heading);
}

/* Glassmorphism & Modern Card Styling */
.premium-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Login Page Layout */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 0% 0%, #f1f5f9 0%, #f8fafc 100%);
    position: relative;
    padding: 20px;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-brand-light) 0%, #c7d2fe 100%);
    top: 10%;
    left: 10%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.7;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    bottom: 10%;
    right: 10%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-premium);
    padding: 2.5rem;
    z-index: 1;
}

/* Form Controls Styling */
.form-floating > .form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.2s ease-in-out;
}

.form-floating > .form-control:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
    background-color: var(--bg-card);
}

.form-floating > label {
    color: var(--text-secondary);
}

.btn-primary {
    background-color: var(--color-brand);
    border-color: var(--color-brand);
    font-family: var(--font-heading);
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    transition: all 0.25s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Dashboard Sidebar Styling */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    width: 240px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Top logo area — fixed, never scrolls */
.sidebar-header {
    flex-shrink: 0;
    padding: 1.25rem 1rem 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Scrollable nav area fills remaining height */
.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem;
    /* Thin styled scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 rgba(0, 0, 0, 0.05);
}
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* User footer — pinned to bottom, never scrolls */
.sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
}

.main-content {
    margin-left: 240px;
    padding: 2rem;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 2px;
    transition: all 0.18s ease;
    white-space: nowrap;        /* keep icon + label on ONE line always */
    overflow: hidden;
}

.nav-link-custom i {
    font-size: 1rem;
    margin-right: 0.65rem;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
}

.nav-link-custom span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link-custom:hover {
    background-color: var(--bg-primary);
    color: var(--color-brand);
}

.nav-link-custom.active {
    background-color: var(--color-brand-light);
    color: var(--color-brand);
    font-weight: 600;
}

/* Section separators inside sidebar-nav */
.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    padding: 0.6rem 0.75rem 0.2rem 0.75rem;
    user-select: none;
}

/* Stats Metric Cards */
.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.metric-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-right: 1rem;
}

.metric-icon-primary {
    background-color: var(--color-brand-light);
    color: var(--color-brand);
}

.metric-icon-success {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.metric-icon-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
}

/* Modern tables */
.custom-table {
    vertical-align: middle;
}

.custom-table thead th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.custom-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.custom-table tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.75);
}

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

.badge-custom-success {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.badge-custom-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-custom-danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 300 !important;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 72px !important;
    }
}

/* ===========================
   MOBILE FIXED TOPNAV
   Shown on all pages at ≤991px
   =========================== */
.mobile-topnav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.mobile-topnav .brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-brand);
}
.mobile-topnav .hamburger {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mobile-topnav .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #172B4D;
    border-radius: 2px;
    transition: all 0.25s;
}
@media (max-width: 991.98px) {
    .mobile-topnav { display: flex; }
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
}
.sidebar-backdrop.visible { display: block; }

