:root {
    --bg-dark: #0f1115;
    --bg-panel: #1a1d24;
    --primary: #e63946; /* Crimson Red */
    --primary-hover: #d62839;
    --accent: #f1faee; /* Platinum White */
    --text: #f8f9fa;
    --text-muted: #adb5bd;
    --border: rgba(255, 255, 255, 0.1);
    --radius: 12px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    min-height: 100vh;
}
.view.active {
    display: flex;
}

/* Glass UI Utilities */
.glass-panel {
    background: rgba(26, 29, 36, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
}
.glass-card {
    background: rgba(26, 29, 36, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Buttons */
.cta-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.cta-primary:hover {
    background: var(--primary-hover);
}
.cta-danger {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.cta-danger:hover {
    background: var(--primary);
    color: #fff;
}
.w-full { width: 100%; }

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
input, select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus {
    border-color: var(--primary);
}
.error-msg {
    color: var(--primary);
    font-size: 0.85rem;
    display: none;
    margin-top: -0.5rem;
}

/* --- LOGIN VIEW --- */
.login-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }

/* --- APP LAYOUT --- */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
}
.sidebar-logo {
    padding: 2rem 1.5rem;
}
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}
.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}
.nav-item.active {
    background: rgba(230, 57, 70, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}
.logout-btn {
    margin: 1rem;
    color: var(--primary);
}
.logout-btn:hover { background: rgba(230, 57, 70, 0.1); }

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}
.workspace-view {
    display: none;
    flex-direction: column;
    gap: 2rem;
}
.workspace-view.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.workspace-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.workspace-header p {
    color: var(--text-muted);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.stat-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 12px;
}
.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Data Table */
.workspace-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Dialog / Modal */
.premium-dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    padding: 0;
    width: 90%;
    max-width: 600px;
    margin: auto;
}
.premium-dialog::backdrop {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}
.dialog-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dialog-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.dialog-body {
    padding: 1.5rem;
}
