:root {
    --primary: #4f46e5;
    --dark: #1e1b4b;
    --light: #f3f4f6;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
}

body { font-family: 'Segoe UI', sans-serif; background: var(--light); margin: 0; display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 250px; background: var(--dark); color: white; padding: 20px; display: flex; flex-direction: column; }
.sidebar h2 { margin-bottom: 30px; font-size: 1.2rem; text-align: center; border-bottom: 1px solid #ffffff30; padding-bottom: 10px; }
.sidebar a { color: #a5b4fc; text-decoration: none; padding: 12px; margin: 5px 0; border-radius: 5px; transition: 0.3s; display: block; }
.sidebar a:hover, .sidebar a.active { background: var(--primary); color: white; }

/* Main Content */
.main { flex: 1; padding: 30px; overflow-y: auto; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }

.stat-card { background: var(--white); padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border-left: 5px solid var(--primary); }
.stat-card h3 { margin: 0; font-size: 2rem; color: var(--dark); }
.stat-card p { margin: 5px 0 0; color: #666; }

/* Tables & Forms */
.content-box { background: var(--white); padding: 25px; border-radius: 10px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
th { background: #f8fafc; color: #64748b; }

.btn { padding: 8px 15px; border-radius: 5px; text-decoration: none; font-size: 0.9rem; color: white; border: none; cursor: pointer; }
.btn-primary { background: var(--primary); }
.btn-danger { background: var(--danger); }

input, select, textarea { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; }
.form-group { margin-bottom: 15px; }
/* Modern Dashboard Tweaks */
:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.search-bar {
    padding: 10px 15px;
    width: 300px;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    outline: none;
    transition: 0.3s;
    background: white url('https://cdn-icons-png.flaticon.com/512/622/622669.png') no-repeat 95% center;
    background-size: 16px;
}
.search-bar:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); border-color: #4f46e5; }

/* Stats Card 2.0 */
.stat-card-new {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}
.stat-card-new:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.icon-box {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
}

/* Charts Section */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Table Enhancements */
.modern-table th { background: #f9fafb; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; color: #6b7280; }
.modern-table tr:hover td { background-color: #f9fafb; }
.avatar { width: 35px; height: 35px; background: #e0e7ff; color: #4f46e5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; margin-right: 10px; }
.user-cell { display: flex; align-items: center; }

/* ===========================================================
   v5 — Professional / Sophisticated Polish Layer
   Refines typography, spacing, motion & depth across every
   admin page that shares this stylesheet.
   =========================================================== */

@keyframes v5FadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes v5Shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1f2937;
}

/* Smooth, slim scrollbars for the content area */
.main { scrollbar-width: thin; scrollbar-color: #c7d2fe transparent; }
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 10px; }
.main::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }

.header h1 { letter-spacing: -0.3px; }
.header p { font-size: 13.5px; }

/* Buttons — gradient, lift, soft glow */
.btn {
    padding: 10px 18px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    letter-spacing: .2px; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 2px 6px -2px rgba(0,0,0,0.15);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary-gradient); box-shadow: 0 8px 20px -8px rgba(79,70,229,0.6); }
.btn-danger { background: var(--danger-gradient); box-shadow: 0 8px 20px -8px rgba(239,68,68,0.55); }

/* Inputs — refined borders & focus glow */
input, select, textarea {
    border: 1px solid #e2e4ea; border-radius: 8px; font-size: 13.5px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.14);
}

.search-bar { border-radius: 10px; box-shadow: 0 2px 8px -4px rgba(0,0,0,0.08); }

/* Cards & content surfaces — softer depth, gentle entrance, hover lift */
.content-box, .chart-container, .stat-card, .stat-card-new, .kpi-card {
    border-radius: 14px;
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12);
    border: 1px solid #eef0f4;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: v5FadeUp .45s ease both;
}
.content-box:hover, .chart-container:hover, .stat-card:hover, .stat-card-new:hover, .kpi-card:hover {
    box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.18);
}
.stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover, .stat-card-new:hover { transform: translateY(-4px); }

.icon-box { box-shadow: 0 8px 18px -6px rgba(0,0,0,0.25); }

/* Tables — crisper rows, smooth hover transitions */
table { border-spacing: 0; }
th, td { border-bottom: 1px solid #f1f2f6; }
th { font-weight: 700; letter-spacing: 0.04em; }
.modern-table tr td { transition: background-color .15s ease; }
.modern-table tbody tr { animation: v5FadeUp .35s ease both; }

/* Section headings used across admin pages */
.section-title { letter-spacing: -0.2px; }

/* Status / badge pills get a touch more polish wherever used inline */
span[class*="badge-"] { letter-spacing: 0.3px; }

/* Subtle shimmer accent for progress bars site-wide */
.progress-fill { background-size: 220% 100%; animation: v5Shimmer 3s linear infinite; }

/* Generic page fade-in so navigations feel smoother */
.main > * { animation: v5FadeUp .4s ease both; }
/* ===========================================================
   v6 — Global Mobile Responsiveness Layer
   Shared by admin, employee & super-admin (all link style.css).
   Adds an off-canvas sidebar drawer, scrollable tables,
   fluid modals and wrapping headers on small screens.
   =========================================================== */

/* Never let media/embeds blow out the viewport width */
img, video, canvas, svg, iframe { max-width: 100%; }

/* Floating hamburger (hidden on desktop, shown on mobile) + dim overlay */
.mobile-nav-toggle {
    display: none; position: fixed; top: 14px; left: 14px; z-index: 1300;
    width: 44px; height: 44px; border: none; border-radius: 11px; cursor: pointer;
    align-items: center; justify-content: center; font-size: 18px; color: #fff;
    background: var(--primary-gradient, #4f46e5);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,.45);
}
.mnav-overlay {
    display: none; position: fixed; inset: 0; z-index: 1150;
    background: rgba(15,23,42,.5); backdrop-filter: blur(2px);
}
.mnav-overlay.show { display: block; }

@media (max-width: 768px) {
    /* --- Admin drawer (.sidebar + .main are body's flex children) --- */
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100%; width: min(84vw, 300px);
        transform: translateX(-100%); transition: transform .28s ease; z-index: 1200;
        overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.35);
    }
    .sidebar.open { transform: translateX(0); }
    .main { width: 100%; padding: 64px 16px 60px; }
    .mobile-nav-toggle { display: flex; }

    /* Headers wrap instead of squashing */
    .header { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
    .header h1 { font-size: 1.35rem; }
    .search-bar { width: 100%; box-sizing: border-box; }

    /* Wide tables scroll on their own instead of stretching the page */
    table, .modern-table {
        display: block; max-width: 100%; overflow-x: auto;
        -webkit-overflow-scrolling: touch; white-space: nowrap;
    }

    /* Content padding a touch tighter */
    .content-box, .chart-container { padding: 16px; }

    /* Fixed-width modal panels become fluid & centered */
    [style*="width:520px"], [style*="width:500px"], [style*="width:480px"],
    [style*="width:460px"], [style*="width:450px"], [style*="width:440px"],
    [style*="width:420px"], [style*="width:400px"], [style*="width:380px"],
    [style*="width: 520px"], [style*="width: 500px"], [style*="width: 480px"],
    [style*="width: 450px"], [style*="width: 440px"], [style*="width: 420px"],
    [style*="width: 400px"], [style*="width: 380px"] {
        width: 94% !important; max-width: 94% !important;
        margin-left: auto !important; margin-right: auto !important;
    }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .main { padding: 60px 12px 50px; }
}
