/* Loading progress indicator */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1565C0;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto;
    color: #1565C0;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Cargando...");
}

/* Blazor error banner */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ha ocurrido un error.";
}

/* ── Sidebar layout ──────────────────────────────────────────────────────────
   The drawer content is managed by a self-contained flex column so the brand
   header is always at the top and the nav fills the rest, with no dependency
   on MudDrawerHeader's internal flex-grow behavior in MudBlazor 9.
   ────────────────────────────────────────────────────────────────────────── */
.sidebar-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Brand header: never grows, keeps its natural content height */
.sidebar-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Nav area: fills all remaining space and scrolls if the menu overflows */
.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* required so a flex-grow item can scroll */
}

/* ── AppBar gradient ─────────────────────────────────────────────────────────
   Replaces the flat navy with a subtle blue→indigo gradient.
   ────────────────────────────────────────────────────────────────────────── */
.mud-appbar {
    background: linear-gradient(135deg, #1E3A8A 0%, #312E81 100%) !important;
    box-shadow: 0 2px 16px rgba(30, 58, 138, 0.28) !important;
}

/* ── Sidebar brand header ────────────────────────────────────────────────────
   Subtle tinted top of the sidebar so the brand feels connected to the AppBar.
   ────────────────────────────────────────────────────────────────────────── */
.sidebar-header {
    background: linear-gradient(180deg, rgba(37,99,235,0.06) 0%, rgba(255,255,255,0) 100%);
    border-bottom: 1px solid rgba(37,99,235,0.08);
}

/* ── Dashboard hero banner ───────────────────────────────────────────────────
   Full-width gradient card used as the welcome header on the Dashboard page.
   ────────────────────────────────────────────────────────────────────────── */
.dash-hero {
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    border-radius: 16px;
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
}

/* Decorative blobs for depth */
.dash-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -30px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    pointer-events: none;
}
.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: 80px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

/* ── Module cards ────────────────────────────────────────────────────────────
   Used for the navigation cards in the Dashboard.
   ────────────────────────────────────────────────────────────────────────── */
.dash-module-card {
    border: 1px solid rgba(226,232,240,0.95) !important;
    border-radius: 14px !important;
    background: var(--mud-palette-surface) !important;
    transition:
        transform      0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow     0.22s cubic-bezier(0.4, 0, 0.2, 1),
        border-color   0.22s ease !important;
}
.dash-module-card:hover {
    transform:    translateY(-3px);
    box-shadow:   0 16px 40px rgba(37,99,235,0.11) !important;
    border-color: rgba(37,99,235,0.28) !important;
}

/* ── Gradient icon circles ───────────────────────────────────────────────────
   44×44 rounded squares used as icon containers on module cards.
   ────────────────────────────────────────────────────────────────────────── */
.dash-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-icon-blue    { background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%); }
.dash-icon-violet  { background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%); }
.dash-icon-emerald { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.dash-icon-sky     { background: linear-gradient(135deg, #0EA5E9 0%, #0891B2 100%); }
.dash-icon-teal    { background: linear-gradient(135deg, #0891B2 0%, #0369A1 100%); }
.dash-icon-slate   { background: linear-gradient(135deg, #64748B 0%, #475569 100%); }
.dash-icon-amber   { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }

/* ── Quick action buttons ────────────────────────────────────────────────────
   Outlined buttons shown below the module grid for common actions.
   ────────────────────────────────────────────────────────────────────────── */
.dash-action-btn {
    border-radius: 10px !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}
.dash-action-btn:hover {
    transform:  translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.15) !important;
}

/* ── Dashboard section labels ────────────────────────────────────────────────
   Overline-style text used above each section of the Dashboard.
   ────────────────────────────────────────────────────────────────────────── */
.dash-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(71,85,105,0.65);
    margin-bottom: 12px;
}

/* ── Comanda print page ──────────────────────────────────────────────────────
   Screen styles for /restaurante/pedidos/{id}/comanda.
   The .no-print class and @media print rules handle the actual printing.
   ────────────────────────────────────────────────────────────────────────── */

/* Toolbar (screen only) */
.comanda-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
    font-family: sans-serif;
}

.comanda-toolbar-info {
    margin-left: 8px;
    font-size: 13px;
    color: #555;
}

.comanda-btn {
    padding: 6px 18px;
    border-radius: 4px;
    border: 1px solid #999;
    cursor: pointer;
    font-size: 14px;
    font-family: sans-serif;
    transition: background 0.15s ease;
}

.comanda-btn-primary {
    background: #1565C0;
    color: white;
    border-color: #1565C0;
}
.comanda-btn-primary:hover { background: #1251A0; }

.comanda-btn-secondary {
    background: white;
    color: #333;
}
.comanda-btn-secondary:hover { background: #ebebeb; }

/* State messages */
.comanda-state {
    padding: 32px;
    text-align: center;
    font-family: sans-serif;
    font-size: 14px;
    color: #666;
}
.comanda-error { color: #c62828; }

/* Ticket container (screen preview) */
.print-ticket {
    font-family: monospace;
    font-size: 12px;
    width: 80mm;
    padding: 4mm;
    margin: 20px auto;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
    border-radius: 2px;
}

/* Header */
.ticket-header   { text-align: center; margin-bottom: 3mm; }
.ticket-title    { font-size: 15px; font-weight: bold; letter-spacing: 3px; margin-bottom: 2mm; }
.ticket-mesa     { font-size: 13px; font-weight: bold; }
.ticket-meta     { font-size: 11px; }
.ticket-fecha    { font-size: 10px; color: #555; margin-top: 1mm; }

/* Dividers */
.ticket-divider-solid  { border: none; border-top: 1px solid #000; margin: 3mm 0; }
.ticket-divider-dashed { border: none; border-top: 1px dashed #000; margin: 1.5mm 0; }

/* Groups */
.ticket-group      { margin-bottom: 3mm; }
.ticket-area-title { font-size: 13px; font-weight: bold; letter-spacing: 1px; margin-bottom: 0.5mm; }

/* Items */
.ticket-item    { display: flex; gap: 4px; margin: 2mm 0 0; font-size: 12px; }
.ticket-qty     { font-weight: bold; min-width: 18px; text-align: right; flex-shrink: 0; }
.ticket-x       { color: #666; flex-shrink: 0; }
.ticket-product { flex: 1; }
.ticket-notes   { margin: 0.5mm 0 1.5mm 24px; font-style: italic; font-size: 10px; color: #444; }

/* Footer */
.ticket-empty  { font-size: 11px; color: #888; text-align: center; padding: 4mm 0; }
.ticket-footer { text-align: center; font-size: 10px; margin-top: 1mm; }

/* ── Print media — 80mm ticket ───────────────────────────────────────────────
   Hides all chrome; prints only .print-ticket at 80mm width.
   ────────────────────────────────────────────────────────────────────────── */
@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    body {
        margin: 0;
        background: white !important;
    }

    .no-print {
        display: none !important;
    }

    .print-ticket {
        width: 80mm;
        padding: 4mm;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
        font-size: 12px;
    }
}
