/* 
 * Premium Windows 11 Dark Mode (Mica Dark)
 * Features: Deep Slate Tones, Neon Blue Glows, Zero Margins, Mica Glass
 */

@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Windows 11 Dark Palette */
    --primary: #00a2ed;
    --primary-glow: rgba(0, 162, 237, 0.4);
    --bg-dark: #0f172a;
    --bg-mica: rgba(30, 41, 59, 0.8);
    --bg-card: rgba(30, 41, 59, 0.6);
    --border-mica: rgba(255, 255, 255, 0.08);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Effects */
    --shadow-win: 0 10px 30px rgba(0, 0, 0, 0.5);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ABSOLUTE ZERO MARGINS - FIXES THE WHITE GAP */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 162, 237, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar - Premium Mica Dark */
.sidebar {
    width: 300px;
    background: var(--bg-mica);
    backdrop-filter: blur(25px) saturate(200%);
    border-right: 1px solid var(--border-mica);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

.sidebar-header {
    margin-bottom: 40px;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: white;
    width: 100%;
}

.brand-icon {
    width: 34px;
    height: 34px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: white !important;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(5px);
}

.nav-item:hover svg {
    color: var(--primary);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item.active svg {
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 10px;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 40px 60px;
    width: calc(100% - 300px);
    overflow-x: auto;
}

/* Header */
.header {
    margin-bottom: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 8px 20px;
    border-radius: 40px;
    border: 1px solid var(--border-mica);
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Stats Grid with Stunning Glow Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-mica);
    box-shadow: var(--shadow-win);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 40px;
    font-weight: 700;
    color: white;
}

/* Stunning Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-mica);
    box-shadow: var(--shadow-win);
    overflow: hidden;
    margin-bottom: 40px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Form Styling - Windows 11 Elegant */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-mica);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    transition: var(--transition);
    width: 100%;
    color-scheme: dark;
}

input[type="date"].form-control {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-control option {
    background-color: var(--bg-dark);
    color: white;
    padding: 12px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-mica);
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-mica);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.card-body {
    padding: 0;
    width: 100%;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius);
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Elegant Dark Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-mica);
}

td {
    padding: 14px 20px;
    font-size: 14px;
    color: #e2e8f0;
    border-bottom: 1px solid var(--border-mica);
    white-space: nowrap;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-mica);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background-color: #0ea5e9;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Modal Enhancements */
.modal-content {
    background: var(--bg-mica);
    backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--border-mica);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    width: 95%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
    margin: 2vh auto;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-mica);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-mica);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: inherit;
    z-index: 10;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
