/* Shell-only styles that the demo theme (app-theme.css) doesn't cover:
   Blazor error UI, reconnect modal, and initial load indicator. */

#blazor-error-ui {
    color: var(--text);
    background: var(--bg-elev-2);
    border-top: 1px solid var(--danger);
    bottom: 0;
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1050;
    font-size: 0.85rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.1rem;
    top: 0.7rem;
}

#blazor-error-ui .reload {
    color: var(--brand-blue);
}

.blazor-error-boundary {
    background: var(--danger);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 10px;
}

/* Initial app load splash */
.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-mute);
    gap: 0.75rem;
    font-size: 0.9rem;
}

.app-loading .spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: app-spin 0.8s linear infinite;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

/* ===== Login screen ===== */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(1, 151, 237, 0.10), transparent 60%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.auth-logo { height: 40px; width: auto; }
.auth-sub { font-size: 0.78rem; color: var(--text-mute); letter-spacing: 0.06em; text-transform: uppercase; }

.auth-form { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; margin-top: 0.6rem; }
.auth-form .input { min-width: 0; width: 100%; }
.auth-submit { margin-top: 1.25rem; width: 100%; justify-content: center; }
.auth-error {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
    border-radius: 9px;
    font-size: 0.82rem;
}

/* ===== Drawer helpers (not in the demo theme) ===== */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; font-size: 0.85rem; }
.dgrid > div { display: flex; flex-direction: column; gap: 0.15rem; }
.dlabel { color: var(--text-mute); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

.group-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.group-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    width: 100%;
    color: var(--text);
    font-family: inherit; font-size: 0.85rem;
}
.group-item.current { border-color: var(--brand-blue); }
button.group-item:hover { background: var(--bg-elev-3); }

.drawer-note-info, .drawer-note-warn {
    padding: 0.6rem 0.85rem; border-radius: 9px; font-size: 0.8rem; margin: 0.5rem 0;
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
}
.drawer-note-info { background: rgba(1, 151, 237, 0.10); border: 1px solid rgba(1, 151, 237, 0.30); color: #7cc4f5; }
.drawer-note-warn { background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.30); color: #fbbf24; }

.task-item { padding-left: 0.65rem; margin-bottom: 0.9rem; }
.task-done { text-decoration: line-through; color: var(--text-mute); }
.task-overdue { color: var(--danger); font-weight: 600; }
.task-note-box {
    font-size: 0.8rem; border: 1px solid var(--border); border-radius: 7px;
    padding: 0.35rem 0.6rem; margin-top: 0.35rem; background: var(--bg-elev-2);
}
.task-edit-form, .task-add-form {
    display: flex; flex-direction: column; gap: 0.35rem;
    border: 1px solid var(--border); border-radius: 9px; padding: 0.6rem; margin-top: 0.5rem;
}
.task-add-form { margin-top: 0.75rem; }

.history-item { border-left: 3px solid var(--border-strong); padding-left: 0.6rem; margin-bottom: 0.55rem; font-size: 0.82rem; }

/* Dashboard share bar */
.share-bar { width: 100%; height: 8px; background: var(--bg-elev-3); border-radius: 999px; overflow: hidden; min-width: 80px; }
.share-bar > span { display: block; height: 100%; border-radius: 999px; }

/* ===== Supplier stock (Stany u dostawców) =====
   The demo theme already styles .wh-* (tiles, source badges, table). These three are ours: the demo
   coloured stock levels with inline styles, and it had no server-side sorting to indicate. */
.wh-table td.stock-ok  { color: var(--success); font-weight: 600; }
.wh-table td.stock-low { color: var(--warning); font-weight: 600; }
.wh-table th.sorted    { color: var(--text); }

/* ===== Order number =====
   Shown next to the quote number when Lightspeed converted the quote into an order.
   Uses the theme's --success (the same green as a positive margin) so "there is an order"
   reads as good news at a glance. */
.quote-order-number {
    color: var(--success);
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
    margin-left: 0.3rem;
}

/* ===== Perf overrides (backdrop-filter blur causes scroll jank when the drawer
   scrolls over it; keep the look with a solid translucent overlay instead) ===== */
.drawer-backdrop { backdrop-filter: none; background: rgba(5, 10, 22, 0.62); }
.drawer {
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.35);
    will-change: transform;            /* keep the panel on its own GPU layer */
}
.topbar { backdrop-filter: none; }     /* the gradient background is enough */
