/* Modern Color Palette & Variables */
:root {
    --primary: #6c5ce7;
    --primary-hover: #5b4cc4;
    --accent: #00cec9;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #2ecc71;
    --border: #334155;
    --glass: rgba(30, 41, 59, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* App-like feel */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.brand h1 {
    font-size: 24px;
    margin-bottom: 40px;
    color: var(--text-main);
}
.brand span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 15px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.nav-links li:hover, .nav-links li.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* Sections */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(30, 41, 59, 0.95));
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}

/* Forms */
.form-container {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.form-container h3 {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

/* Suggestions Autocomplete */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestions-list div {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.suggestions-list div:hover {
    background-color: var(--bg-dark);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(26px); }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.total-display {
    text-align: right;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
    color: var(--accent);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
    font-weight: 500;
}

tr:hover {
    background-color: rgba(255,255,255,0.02);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 20px; }
    .nav-links { display: flex; gap: 10px; }
    .nav-links li span { display: none; } /* Show only icons */
    .brand h1 { margin-bottom: 0; font-size: 20px; }
    .form-row { flex-direction: column; gap: 0; }
}

/* Modals */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(5px);
}
.modal-content {
    background-color: var(--bg-card);
    margin: 15% auto;
    padding: 30px;
    border: 1px solid var(--border);
    width: 90%; max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.close { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close:hover { color: white; }
