/* ==================== RESET & VARIABLES ==================== */
:root {
    --primary: #1a237e;
    --primary-dark: #0d1555;
    --primary-light: #3949ab;
    --secondary: #ff6f00;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #e65100;
    --info: #0d47a1;
    --gray: #757575;
    --light-gray: #f5f6fa;
    --border-color: #e8ecf1;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --sidebar-width: 260px;
    --header-height: 72px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ==================== LAYOUT ==================== */
.app { display: flex; min-height: 100vh; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a237e 0%, #0d1555 100%);
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ff6f00;
    backdrop-filter: blur(10px);
}
.brand-text h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 60%, #ff6f00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-text span { font-size: 11px; opacity: 0.7; display: block; margin-top: -2px; letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}
.nav-item i { width: 20px; font-size: 18px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.15); color: #fff; box-shadow: inset 3px 0 0 #ff6f00; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ==================== MAIN CONTENT ==================== */
.main { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }

/* ==================== HEADER ==================== */
.header {
    background: #fff;
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(255,255,255,0.95);
}
.header-left { display: flex; align-items: center; gap: 20px; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--primary); cursor: pointer; padding: 8px; border-radius: 8px; transition: var(--transition); }
.menu-toggle:hover { background: var(--light-gray); }
.header-title h1 { font-size: 22px; font-weight: 700; color: var(--primary); margin: 0; line-height: 1.2; }
.header-title span { font-size: 13px; color: var(--gray); display: block; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-date, .header-time {
    font-size: 13px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light-gray);
    padding: 6px 14px;
    border-radius: 20px;
}
.header-date i, .header-time i { color: var(--primary); }
.user-profile img { border-radius: 50%; border: 2px solid var(--border-color); transition: var(--transition); }
.user-profile img:hover { border-color: var(--primary); }

/* ==================== CONTENT ==================== */
.content { padding: 24px 32px; }

/* ==================== STATS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.stat-blue::before { background: #1a237e; }
.stat-orange::before { background: #ff6f00; }
.stat-green::before { background: #2e7d32; }
.stat-purple::before { background: #6a1b9a; }
.stat-pink::before { background: #c62828; }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-blue .stat-icon { background: #e3f2fd; color: #1a237e; }
.stat-orange .stat-icon { background: #fff3e0; color: #ff6f00; }
.stat-green .stat-icon { background: #e8f5e9; color: #2e7d32; }
.stat-purple .stat-icon { background: #f3e5f5; color: #6a1b9a; }
.stat-pink .stat-icon { background: #fce4ec; color: #c62828; }

.stat-info { flex: 1; }
.stat-label { font-size: 13px; color: var(--gray); display: block; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); display: block; line-height: 1.2; }
.stat-change { font-size: 12px; color: var(--gray); display: block; margin-top: 2px; }
.stat-change i { font-size: 11px; }
.stat-blue .stat-change i { color: #1a237e; }
.stat-orange .stat-change i { color: #ff6f00; }
.stat-green .stat-change i { color: #2e7d32; }
.stat-purple .stat-change i { color: #6a1b9a; }

/* ==================== GRID ==================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ==================== CARDS ==================== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}
.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.card-header h3 i { color: var(--secondary); }
.card-badge {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--light-gray);
    color: var(--gray);
    font-weight: 500;
}
.card-body { padding: 24px; }
.card-body.p-0 { padding: 0; }

/* ==================== TABLE ==================== */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table thead { background: var(--primary); color: #fff; }
.table th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 13px; white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table tbody tr:hover { background: #fafafa; }
.table .text-center { text-align: center; }

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-primary { background: #e3f2fd; color: #0d47a1; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e0f7fa; color: #00695c; }
.badge-secondary { background: #f5f5f5; color: #616161; }

/* ==================== FORMS ==================== */
.form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.form-section h4 {
    color: #1a237e;
    margin-bottom: 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-section h4 i { color: #ff6f00; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.form-group .required { color: #c62828; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #1a237e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.disabled-input { background: #f5f5f5 !important; cursor: not-allowed; }

.form-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.btn-primary { background: #1a237e; color: #fff; }
.btn-primary:hover { background: #0d1555; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3); }
.btn-secondary { background: #f5f5f5; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #1b5e20; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-sm i { font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ==================== QUEUE LIST ==================== */
.queue-list { max-height: 500px; overflow-y: auto; }
.queue-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.queue-item:hover { background: #f5f5f5; }
.queue-item.active { background: #e8eaf6; border-left: 3px solid #1a237e; }
.queue-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    background: #e3f2fd;
    color: #1a237e;
}
.queue-info { flex: 1; }
.queue-name { font-weight: 600; font-size: 14px; }
.queue-meta { display: flex; gap: 16px; font-size: 12px; color: #757575; }
.queue-meta i { margin-right: 4px; }

/* ==================== EMPTY STATE ==================== */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h4 { margin: 12px 0 4px; color: #333; }
.empty-state p { color: var(--gray); font-size: 14px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.active { transform: translateX(0); }
    .main { margin-left: 0; }
    .header { padding: 0 16px; }
    .menu-toggle { display: block; }
    .header-title h1 { font-size: 18px; }
    .header-title span { display: none; }
    .header-date, .header-time { display: none; }
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .grid-2 { grid-template-columns: 1fr; }
    .card-body { padding: 16px; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 8px 10px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .header { height: 60px; }
}