/* ====== Global Styles ====== */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #a8b2c1;
    --sidebar-active: #e74c3c;
    --topbar-height: 56px;
    --primary: #e74c3c;
    --font: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: #f4f6f9;
    color: #2d3748;
    margin: 0;
    padding: 0;
}

/* ====== Sidebar ====== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2d3748 transparent;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #2d3748; }

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    border-bottom: 1px solid #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.sidebar-brand i { color: var(--sidebar-active); }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.nav-section-title {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #4a5568;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

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

.nav-item.active {
    color: white;
    background: rgba(231,76,60,0.15);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }

.sidebar-footer {
    border-top: 1px solid #2d3748;
    padding: 0.5rem 0;
}

/* ====== Main Content ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.topbar-title { flex: 1; font-weight: 600; font-size: 1rem; color: #1a202c; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.content-area {
    flex: 1;
    padding: 1.25rem;
}

/* ====== Cards ====== */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
}

/* ====== Stat Cards ====== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid #f0f0f0;
}

.stat-icon {
    width: 48px !important;
    min-width: 48px;
    max-width: 48px;
    height: 48px !important;
    min-height: 48px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #1a202c;
}

.stat-label {
    font-size: 0.78rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* ====== Tables ====== */
.table th { font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.table td { vertical-align: middle; }

/* ====== Buttons ====== */
.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 5px;
}

/* ====== Badges ====== */
.role-badge-admin { background: #dc3545; color: white; padding: 0.25em 0.6em; border-radius: 4px; font-size: 0.75rem; }
.role-badge-manager { background: #fd7e14; color: white; padding: 0.25em 0.6em; border-radius: 4px; font-size: 0.75rem; }
.role-badge-cashier { background: #0dcaf0; color: #000; padding: 0.25em 0.6em; border-radius: 4px; font-size: 0.75rem; }
.role-badge-server { background: #198754; color: white; padding: 0.25em 0.6em; border-radius: 4px; font-size: 0.75rem; }
.role-badge-chef { background: #6f42c1; color: white; padding: 0.25em 0.6em; border-radius: 4px; font-size: 0.75rem; }

/* ====== Avatar ====== */
.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #fd7e14);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #fd7e14);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
}

/* ====== Status dots ====== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ====== Toast notifications ====== */
.toast-container-custom {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-custom {
    min-width: 280px;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-custom.success { background: #28a745; }
.toast-custom.danger { background: #dc3545; }
.toast-custom.warning { background: #fd7e14; }
.toast-custom.info { background: #17a2b8; }

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

/* ====== Utilities ====== */
.fw-600 { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stat-card { padding: 0.875rem; }
    .stat-value { font-size: 1.5rem; }
}

/* ====== Print ====== */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin: 0; }
    .content-area { padding: 0; }
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }
