/* ===== Custom Styles for Pembagian Ruangan App ===== */

:root {
    --sidebar-width: 270px;
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #7209b7;
    --accent: #f72585;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-body: #f0f2f5;
    --text-light: #e0e0e0;
    --text-muted: #94a3b8;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-body);
    margin: 0;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-sidebar) 100%);
    color: var(--text-light);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.sidebar-header .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.sidebar-header .brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-header .brand-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.sidebar-header .brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 14px 6px;
    margin-top: 12px;
}

.sidebar-nav .nav-item {
    margin: 2px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    transform: translateX(3px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(247, 37, 133, 0.1));
    color: white;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-nav .nav-link .icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-footer .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer .nav-link .icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 30px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.page-header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card .stat-label {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
}

.stat-card.bg-gradient-primary { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.stat-card.bg-gradient-success { background: linear-gradient(135deg, #06d6a0, #0d9e7a); }
.stat-card.bg-gradient-warning { background: linear-gradient(135deg, #ffa726, #f57c00); }
.stat-card.bg-gradient-info { background: linear-gradient(135deg, #26c6da, #0097a7); }
.stat-card.bg-gradient-danger { background: linear-gradient(135deg, #ef476f, #c62828); }

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 13.5px;
    color: #334155;
    border-color: #f0f0f0;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(67, 97, 238, 0.04);
}

.table .badge {
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 18px;
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-success {
    background: linear-gradient(135deg, #06d6a0, #0d9e7a);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef476f, #c62828);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726, #f57c00);
    border: none;
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #26c6da, #0097a7);
    border: none;
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* ===== FORMS ===== */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.form-control, .form-select {
    border-radius: 10px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* ===== SEATING GRID (preview) ===== */
.seat-grid {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.seat-cell {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    background: white;
    transition: var(--transition);
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.seat-cell:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
    transform: scale(1.02);
}

.seat-cell .seat-num {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 3px;
}

.seat-cell .seat-name {
    font-weight: 600;
    font-size: 10px;
    color: #1e293b;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seat-cell .seat-info {
    font-size: 9px;
    color: #94a3b8;
}

.seat-cell.empty {
    background: #f8fafc;
    border-style: dashed;
    color: #cbd5e1;
}

.seat-depan {
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #64748b;
    background: #e2e8f0;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 13.5px;
    padding: 14px 20px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    .sidebar.open {
        width: var(--sidebar-width);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block !important;
    }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* ===== SCROLLBAR ===== */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
