:root {
    /* Color Palette */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --accent: #38bdf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Status Colors */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-error: #ef4444;
    --status-info: #3b82f6;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Login View */
#login-view {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 100%);
    position: relative;
}

#login-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('login_background.png') no-repeat center center;
    background-size: cover;
    opacity: 0.2;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo-wrapper {
    margin-bottom: 24px;
    background: white;
    padding: 15px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.app-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.mini-logo {
    width: 48px;
    height: 48px;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 15px;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.4);
}

.login-footer {
    margin-top: 24px;
}

.login-footer a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary);
}

/* Main Layout */
#main-view {
    display: none; /* Shown after login */
    height: 100vh;
    display: flex;
}

#main-view.active {
    display: flex;
}

.sidebar {
    width: 280px;
    height: 100vh;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    padding: 0 12px;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 8px;
    transition: var(--transition);
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 14px;
    font-weight: 600;
}

.user-info .role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

.btn-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
    background: radial-gradient(circle at 10% 10%, #1e293b 0%, #0f172a 100%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.top-bar h2 {
    font-size: 28px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-secondary {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.notifications {
    position: relative;
    font-size: 20px;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--status-error);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

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

.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 12px;
}

.stat-trend.positive {
    color: var(--status-success);
}

/* Main Cards */
.card {
    padding: 24px;
    margin-bottom: 24px;
}

.card h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.progress {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-info);
}

.status-badge.waiting {
    background: rgba(245, 158, 11, 0.2);
    color: var(--status-warning);
}

/* Section States */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

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

/* Digital Clock */
.digital-clock {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Views (Login vs Main) */
.view {
    display: none;
}

.view.active {
    display: flex;
}

/* Home Page / Dashboard */
.welcome-message {
    margin-bottom: 40px;
}

.welcome-message h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.welcome-message p {
    color: var(--text-muted);
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.action-card {
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.3));
}

.card-body h4 {
    font-size: 20px;
    color: white;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.card-body p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.card-arrow {
    margin-left: auto;
    font-size: 24px;
    color: var(--primary);
    opacity: 0;
    transition: var(--transition);
    transform: translateX(-10px);
}

.action-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 24px 12px;
    }
    .sidebar span, .user-info {
        display: none;
    }
    .content-area {
        padding: 24px;
    }
}
