:root {
    --primary: hsl(160, 100%, 30%);
    --primary-light: hsl(160, 100%, 45%);
    --bg-dark: hsl(220, 20%, 10%);
    --card-bg: hsla(220, 20%, 15%, 0.8);
    --text-main: hsl(0, 0%, 95%);
    --text-muted: hsl(220, 10%, 70%);
    --gold: hsl(45, 100%, 50%);
    --sidebar-w: 260px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-color: hsla(0, 0%, 100%, 0.1);
    --border-subtle: hsla(0, 0%, 100%, 0.05);
}

/* Light Theme Variables */
.light-theme {
    --bg-dark: hsl(220, 20%, 95%);
    --card-bg: hsla(220, 20%, 100%, 0.9);
    --text-main: hsl(220, 20%, 15%);
    --text-muted: hsl(220, 10%, 40%);
    --border-color: hsla(0, 0%, 0%, 0.1);
    --border-subtle: hsla(0, 0%, 0%, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

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

/* Header Utilities */
.header-tools {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.live-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Inter', sans-serif;
}

#header-time {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: 0.5px;
}

#header-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--primary);
    color: white;
}

.light-theme .theme-toggle {
    border-color: rgba(0,0,0,0.1);
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 16px;
}

.light-theme .glass {
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 8px 32px rgba(0,0,0,0.05);
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--primary), transparent),
                radial-gradient(circle at bottom left, var(--bg-dark), transparent);
}

.login-card {
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.8s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: hsl(220, 20%, 18%); /* Solid background for input */
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 8px;
    color: #ffffff;
    outline: none;
    transition: 0.3s;
    appearance: none;
}

select.form-input {
    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 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.form-input option {
    background-color: #1a1d23; /* Very solid dark background */
    color: #ffffff;
    padding: 10px;
}

.form-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px hsla(160, 100%, 30%, 0.2);
    background: hsl(220, 20%, 22%); /* Slightly lighter on focus */
}

/* Ensure placeholder visibility */
::placeholder {
    color: hsla(0, 0%, 100%, 0.4);
}

.btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
}

.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.main-content {
    margin-left: var(--sidebar-w);
    padding: 2rem;
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: 0.3s;
}

.nav-link.active, .nav-link:hover {
    background: hsla(160, 100%, 30%, 0.15);
    color: var(--primary-light);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Analytics Section */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

th {
    text-align: left;
    padding: 1.2rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    background: hsla(0, 0%, 100%, 0.02);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-subtle);
}

th:last-child {
    border-right: none;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    transition: var(--transition);
}

td:last-child {
    border-right: none;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: hsla(160, 100%, 30%, 0.05);
    transform: scale(1.002) translateX(4px);
}

tbody tr:hover td {
    color: var(--primary-light);
    border-bottom-color: hsla(160, 100%, 30%, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Section */
.footer {
    margin-top: 5rem;
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid hsla(0, 0%, 100%, 0.1);
    width: 100%;
    opacity: 0.9;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.mib-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border-bottom: 1px solid transparent;
}

.mib-link:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
    text-shadow: 0 0 10px hsla(45, 100%, 50%, 0.3);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.page-btn:hover:not(.disabled) {
    background: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px hsla(160, 100%, 30%, 0.3);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    color: var(--text-main);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    transition: 0.3s;
}

.toast.success {
    border-left: 4px solid var(--primary-light);
}

.toast.error {
    border-left: 4px solid #ff4d4d;
}

.toast.warning {
    border-left: 4px solid var(--gold);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    transform: translateX(100%);
    opacity: 0;
}

