:root {
    /* Color Palette - Premium Dark Mode */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Glassmorphism Variables */
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);

    /* Typography */
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Typography & Utilities */
h1, h2, h3 { font-weight: 600; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-main);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-light);
    background: rgba(255,255,255,0.05);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--text-light);
}

.btn-action {
    padding: 0.4rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    margin-right: 0.3rem;
    transition: background 0.2s;
}

.btn-action:hover {
    background: rgba(255,255,255,0.2);
}

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge.active { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.upcoming { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge.overdue { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Form Inputs */
.input-group {
    margin-bottom: 1.2rem;
    width: 100%;
}

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

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input, .select-filter {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.input-wrapper input {
    padding-left: 2.8rem;
}

.input-group input:focus, .select-filter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    animation: slideUp 0.6s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.icon-brand {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 1.2rem;
}

/* Main Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: calc(100vh - 2rem);
    margin: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-light);
}

.brand i { color: var(--primary); }

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 1rem 2rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-bar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    width: 350px;
}

.search-bar i { color: var(--text-muted); margin-right: 0.8rem; }
.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 100%;
    font-family: var(--font-main);
}
.search-bar input:focus { outline: none; }

.actions { display: flex; gap: 1rem; }

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.stat-details h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.stat-details p { font-size: 1.8rem; font-weight: 700; }

/* Data Section & Table */
.data-section {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.client-info strong { display: block; margin-bottom: 0.2rem; }
.client-info span { font-size: 0.85rem; color: var(--text-muted); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    width: 100%;
    max-width: 650px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: zoomIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

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

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
