/* ===== DoomFlood Admin — Global Styles ===== */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d21;
    --sidebar-text: #a0aec0;
    --sidebar-active: #3b82f6;
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --page-bg: #f1f5f9;
    --card-radius: 0.75rem;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* ===== Layout ===== */
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform var(--transition-normal);
    overflow-y: auto;
    overflow-x: hidden;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.app-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    background: var(--page-bg);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

/* ===== Sidebar Elements ===== */
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    color: #fff;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    opacity: 0.5;
    font-weight: 400;
}

.sidebar-section {
    padding: 1rem 0 0.25rem;
}

.sidebar-section-label {
    padding: 0 1.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem;
}

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

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar-nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #e2e8f0;
}

.sidebar-nav-link.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--sidebar-active);
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--sidebar-active);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
}

.sidebar-nav-link.active i {
    opacity: 1;
}

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

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.sidebar-footer a:hover {
    color: #ef4444;
}

/* ===== Mobile Sidebar Toggle ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--sidebar-bg);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform var(--transition-fast);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .app-content {
        margin-left: 0;
    }
}

/* ===== Page Content ===== */
.page-content {
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 1rem;
        padding-top: 4rem;
    }
}

/* ===== Page Headers ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* ===== Cards ===== */
.card {
    border-radius: var(--card-radius) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

/* Stat cards */
.stat-card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ===== Tables ===== */
.table {
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    border-bottom-width: 1px;
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.04) !important;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.btn:active {
    transform: scale(0.97);
}

.btn-white {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-white:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

/* ===== Badges ===== */
.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ===== Form Controls ===== */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== Shared Animations ===== */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Scrollbar ===== */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ===== Progress Bars ===== */
.progress {
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
}

/* ===== Modals ===== */
.modal-content {
    border-radius: 1rem !important;
    overflow: hidden;
}

/* ===== Form Switch ===== */
.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* ===== Utility ===== */
.cursor-pointer {
    cursor: pointer;
}

.font-monospace {
    font-size: 0.85em;
}

/* ===== Sticky Table Header ===== */
.sticky-top th {
    background-color: #f8fafc !important;
    box-shadow: 0 1px 0 #e2e8f0;
}

/* ===== Cashier Dashboard ===== */
.cashier-total-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.25);
}

.cashier-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.cashier-total-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.cashier-total-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.cashier-total-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.cashier-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ===== Blazor error UI ===== */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    border-radius: 0;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
}
