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

:root {
    --primary: #001f3f; /* Navy Blue */
    --primary-hover: #003366;
    --secondary: #ffb703; /* Yellow */
    --accent: #d90429; /* Red */
    --bg-body: #f1f5f9; /* Muted Blue-Grey */
    --side-nav-bg: #001f3f; /* Deep Navy Sidebar */
    --surface: rgba(255, 255, 255, 0.9);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: rgba(0, 31, 63, 0.1);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Decoration */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 31, 63, 0.03) 0%, transparent 70%);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(217, 4, 41, 0.02) 0%, transparent 70%);
    z-index: -1;
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 31, 63, 0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header/Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--secondary), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Side Navigation */
.side-nav {
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--side-nav-bg);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    z-index: 1000;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

.side-nav::-webkit-scrollbar {
    width: 5px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.side-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.side-nav .logo {
    margin-bottom: 3rem;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    padding: 0.85rem 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.nav-links a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.nav-links a.active {
    color: var(--secondary);
    background: rgba(255, 183, 3, 0.1);
    font-weight: 600;
}

.nav-links a.active i {
    color: var(--secondary);
}

.nav-bottom {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* User Profile in Sidebar */
.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.user-details-sidebar {
    overflow: hidden;
}

.user-name-sidebar {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: #fff;
}

.user-role-sidebar {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: calc(100vw - 280px);
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

/* 1366x768 Optimization */
@media (max-width: 1400px) {
    .side-nav {
        width: 240px;
        padding: 1.25rem 0.85rem;
    }
    .side-nav .logo {
        margin-bottom: 1.5rem;
    }
    .nav-links {
        gap: 0.25rem;
    }
    .nav-links a {
        padding: 0.65rem 1rem;
        font-size: 0.88rem;
    }
    .nav-bottom {
        padding-top: 1rem;
    }
    .main-content {
        margin-left: 240px;
        max-width: calc(100vw - 240px);
        padding: 1.5rem;
    }
    .logo {
        font-size: 1.25rem;
    }
    .stat-card {
        padding: 1.5rem;
    }
    .stat-value {
        font-size: 2rem;
    }
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.6rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 31, 63, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Table Design */
.table-container {
    margin-top: 1.5rem;
    overflow-x: auto;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.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); }

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-control, .form-select {
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-select {
    padding-right: 2.25rem !important; /* Retain space for the dropdown arrow */
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 0.25rem rgba(0, 31, 63, 0.1);
}

.input-group-text {
    min-height: 46px;
    padding: 0.6rem 0.9rem;
    background: rgba(0, 31, 63, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}
