:root {
    --gutter:         0.75rem;
    --header-h:       4rem;
    --container-flow: 800px;
    --container-page: 950px;
    --color-bg:       #f5f5f3;
    --sidebar-w:      270px;
    --radius:         4px;
    --border-subtle:  #c9cdd4;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 0;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.page-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-bg);
    border-bottom: 1px solid #d6d5d5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--header-h);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    margin-bottom: 0;
}

.page-header > button,
.page-header > a {
    flex-shrink: 0;
    white-space: nowrap;
}

.page-header > button:last-child,
.page-header > a:last-child {
    margin-left: auto;
}

.page-header h1 {
    flex-shrink: 0;
    width: 11rem;
    white-space: nowrap;
    overflow: hidden;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.page-header-search {
    flex: 1 1 auto;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.page-header-search .input-group {
    max-width: 380px;
    width: 100%;
}

/* No-filter variant: widen by one button (~38px) so the text input area
   matches pages that have the ≡ filter button */
.page-header-search.search-no-filter .input-group {
    max-width: 418px;
}

/* Three-zone header: start (left) | search (center) | end (right) */
/* Both start and end take equal flex-grow so the search is truly centered. */
.page-header-start,
.page-header-end {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header-end {
    justify-content: flex-end;
}

/* h1 inside a start zone doesn't need a fixed width — the zone itself is the anchor */
.page-header-start h1 {
    width: auto;
}

.page-header-start .btn-group {
    margin-left: 30px;
    margin-right: 30px;
}

/* When the start zone has a tab toggle, prevent it from shrinking below its content
   width so the search bar can never overlap the toggle buttons. */
.page-header-start:has(.btn-group) {
    min-width: max-content;
}

/* When the three-zone structure is used, the search is fixed-width rather than growing */
.page-header-start ~ .page-header-search {
    flex: 0 0 auto;
    width: min(380px, 40%);
}

.filter-chips-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    background-color: var(--color-bg);
    border-bottom: 1px solid #d6d5d5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.4rem var(--gutter);
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
}


.app-notification-banner {
    position: sticky;
    top: var(--header-h);  /* sits immediately below the page-header */
    z-index: 25;           /* below page-header (30) but above sticky thead (10) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem var(--gutter);
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    font-size: 0.875rem;
}

.app-notification-error {
    background-color: #f8d7da;
    border-bottom: 1px solid #f1aeb5;
    color: #58151c;
}

.app-notification-warning {
    background-color: #fff3cd;
    border-bottom: 1px solid #ffe69c;
    color: #664d03;
}

.app-notification-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
    padding: 0 0.25rem;
}

.app-notification-dismiss:hover { opacity: 1; }

.full-bleed-table {
    margin-top: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    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 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1005;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

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

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

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            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 0.2rem;
}

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

code {
    color: #c02d76;
}

/* ── Layout system ── */
/* Wide workspace (default): full-width, left-aligned — used for all table/data-dense pages */
/* Constrained flow: left-aligned, max-width 800px — used for form/task/input-heavy screens */
.flow-container {
    max-width: var(--container-flow);
}

.flow-container > .card {
    border-radius: var(--radius);
}

/* ── Craft type picker ── */
.craft-type-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
    transition: background 0.1s, border-color 0.1s;
}

.craft-type-btn:hover {
    background: #f0f0ef;
    border-color: #c0c2c5;
}

.craft-type-btn.selected {
    border-color: #0d6efd;
    background: #eef3ff;
}

.craft-type-btn .craft-emoji {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.craft-type-btn .craft-name {
    font-weight: 600;
}

.picker-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* Scrollable picker container */
.craft-type-picker-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.craft-type-picker-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: #fff;
}

.craft-type-picker-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 0.625rem;
}

/* Last button in picker list — remove bottom margin so list padding is flush */
.craft-type-picker-list .craft-type-btn:last-child {
    margin-bottom: 0;
}

/* Wide workspace — fills available content area; overall page cap comes from .page { max-width } */
.page-container {
    border-radius: var(--radius);
    padding-top: var(--gutter);
}

.table-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    width: 100%;
    overflow: auto;
    max-height: calc(100vh - var(--header-h) - var(--gutter));
    overflow-anchor: none;
}

.table-card > table {
    table-layout: fixed;
    margin-bottom: 0;
    width: 100%;
    min-width: var(--container-page);
    border-collapse: separate;
    border-spacing: 0;
}

/* ── Shared table styles ── */
.sticky-thead tr {
    height: 2.625rem; /* lock the header row to a fixed height */
}

/* Lock all tbody rows to the same height regardless of cell content.
   Rows containing btn-sm buttons naturally reach ~47px; this minimum
   raises plain-text rows to match so the table is visually uniform. */
.table-card table tbody tr {
    height: 3rem;
}

.sticky-thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-subtle);
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1.125rem;
    padding-right: 1.125rem;
    vertical-align: middle;
}

/* Column gutter: horizontal breathing room between data columns */
.table-card table th:not(:first-child),
.table-card table td:not(:first-child) {
    padding-left: 1.125rem;
    padding-right: 1.125rem;
}

/* Checkbox column: equal padding both sides, horizontally centered */
.table-card table th:first-child,
.table-card table td:first-child {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    text-align: center;
}

/* Second column: padding wide enough for the 12px stock-dot badge to sit in the gutter */
.table-card table th:nth-child(2),
.table-card table td:nth-child(2) {
    padding-left: 0.75rem;
}

/* Group header rows: left-align the label cell; skip first-child so checkbox stays centered */
.table-card table tbody .group-divider-row td:not(:first-child) {
    text-align: left;
}

.group-divider-row {
    cursor: pointer;
    user-select: none;
}

.group-divider-row td {
    position: sticky;
    top: 2.625rem;
    z-index: 5;
    background-color: #e2e3e5;
}

/* Detail side panel */
.detail-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1003;
}

@keyframes panel-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes panel-slide-out {
    from { transform: translateX(0); }
    to   { transform: translateX(100%); }
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 540px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 1004;
    display: flex;
    flex-direction: column;
    animation: panel-slide-in 0.15s ease-in-out forwards;
}

.detail-panel.panel-closing {
    animation: panel-slide-out 0.15s linear forwards;
}

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #fff;
    z-index: 1;
}

.detail-panel-body {
    padding: 1.25rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.detail-panel-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
}

.detail-panel-close:hover {
    color: #111827;
}

/* Stock chip in detail panel header — hover swaps label to "Restock" with no layout shift */
.panel-stock-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    padding: 0.4rem 0.75rem;
    margin-right: 30px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1.3;
}
.panel-stock-chip.text-success         { background: #dcfce7; }
.panel-stock-chip.text-success:hover   { background: #bbf7d0; }
.panel-stock-chip.text-warning         { background: #fef9c3; }
.panel-stock-chip.text-warning:hover   { background: #fef08a; }
.panel-stock-chip.text-danger          { background: #fee2e2; }
.panel-stock-chip.text-danger:hover    { background: #fecaca; }
.panel-stock-chip.text-secondary       { background: #f3f4f6; }
.panel-stock-chip.text-secondary:hover { background: #e5e7eb; }
.panel-stock-label {
    position: relative;
    display: inline-block;
}
.panel-stock-default {
    display: inline-block;
    transition: opacity 0.12s;
}
.panel-stock-action {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.12s;
}
.panel-stock-chip:hover .panel-stock-default { opacity: 0; }
.panel-stock-chip:hover .panel-stock-action  { opacity: 1; }

/* Stock status indicator dots — clickable, used in Materials/Recipes/Products tables */
.stock-dot {
    width: 12px !important;
    height: 12px !important;
    display: inline-block !important;
    padding: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}
.stock-dot:hover {
    outline: 2px solid #6c757d;
    outline-offset: 2px;
}
/* Custom tooltip — appears after 0.25s, avoids the ~1s native title delay */
.stock-dot[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.4;
    font-weight: 400;
    white-space: nowrap;
    padding: 2px 7px;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    transition-delay: 0s;
    z-index: 500;
}
.stock-dot[data-tooltip]:hover::after {
    opacity: 1;
    transition-delay: 0.25s;
}
/* Allow stock-dot tooltip to escape table-cell clipping */
td:has(.stock-dot:hover),
tr:has(.stock-dot:hover) {
    overflow: visible !important;
    position: relative;
    z-index: 50;
}

/* Settings two-panel layout */
.settings-layout {
    display: flex;
    gap: 1.5rem;
    padding-top: var(--gutter);
    align-items: flex-start;
}

.settings-sidenav {
    width: var(--sidebar-w);
    flex-shrink: 0;
}

/* Matches primary nav link dimensions exactly */
.settings-sidenav-item {
    display: flex;
    align-items: center;
    height: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.settings-sidenav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #111827;
    text-decoration: none;
}

.settings-sidenav-item.active {
    background-color: rgba(0, 0, 0, 0.07);
    color: #111827;
    text-decoration: none;
}

/* Icon placeholder — same dimensions as .bi in primary nav */
.settings-nav-icon {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    flex-shrink: 0;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

/* Dashboard — two-column layout (main cards + right panels) */
.dashboard-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.dashboard-col {
    flex: 0 0 680px;
    display: flex;
    flex-direction: column;
    gap: var(--gutter);
    padding-right: var(--gutter);
}

.dashboard-col > .card,
.dashboard-right-col > .card {
    margin-bottom: 0;
}

.dashboard-right-col {
    flex: 1 1 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--gutter);
}

/* Batch Status tiles */
.batch-tiles {
    display: flex;
    gap: 0.5rem;
}

.batch-tile {
    flex: 0 0 calc((100% - 1rem) / 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-align: center;
}

.batch-tile:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.batch-tile-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #111827;
}

.batch-tile-label {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: #6b7280;
    line-height: 1.3;
}

/* Production tiles */
.production-tiles {
    display: flex;
    gap: 0.625rem;
}

.prod-tile {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
    min-height: 6.5rem;
}

.prod-tile-ready {
    flex: 0 0 42%;
    background: #f0fdf4;
    border-color: #86efac;
}

.prod-tile-ready:hover {
    background: #dcfce7;
    border-color: #4ade80;
    box-shadow: 0 2px 10px rgba(22,163,74,0.14);
}

.prod-tile-inprogress {
    flex: 1;
    background: #eff6ff;
    border-color: #93c5fd;
}

.prod-tile-inprogress:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    box-shadow: 0 2px 10px rgba(37,99,235,0.14);
}

.prod-tile-curing {
    flex: 1;
    background: #fffbeb;
    border-color: #fcd34d;
}

.prod-tile-curing:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    box-shadow: 0 2px 10px rgba(217,119,6,0.14);
}

.prod-tile-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.prod-tile-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    line-height: 1;
}

.prod-tile-ready .prod-tile-icon     { color: #16a34a; }
.prod-tile-inprogress .prod-tile-icon { color: #2563eb; }
.prod-tile-curing .prod-tile-icon    { color: #d97706; }

.prod-tile-count {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.prod-tile-ready .prod-tile-count     { color: #15803d; }
.prod-tile-inprogress .prod-tile-count { color: #2563eb; }
.prod-tile-curing .prod-tile-count    { color: #d97706; }

.prod-tile-label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}

.prod-tile-ready .prod-tile-label     { color: #15803d; }
.prod-tile-inprogress .prod-tile-label { color: #1d4ed8; }
.prod-tile-curing .prod-tile-label    { color: #b45309; }

.prod-tile-sub {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.3;
}

.prod-tile-hint {
    font-size: 0.72rem;
    color: #16a34a;
    font-weight: 500;
    margin-top: auto;
}

.prod-tile-arrow {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: auto;
    align-self: flex-end;
    opacity: 0.5;
}

.prod-tile-inprogress .prod-tile-arrow { color: #2563eb; }
.prod-tile-curing .prod-tile-arrow    { color: #d97706; }

.prod-tile:hover .prod-tile-arrow { opacity: 0.9; }

.prod-tile-zero {
    opacity: 0.55;
}

.prod-tile-zero:hover {
    opacity: 0.8;
}

.prod-tile-zero-hint {
    font-style: italic;
    margin-top: 0.1rem;
}

/* Attention Needed panel */
.attention-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}
.attention-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.attention-section-title.attention-urgent {
    color: #b91c1c;
}
.attention-section-title.attention-warning {
    color: #b45309;
}
.attention-show-more {
    font-size: 0.775rem;
    color: #6b7280;
    padding: 0.3rem 1rem 0.3rem calc(1rem + 12px);
    margin: 0.05rem -1rem 0;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color 0.1s;
}
.attention-show-more:hover {
    color: #374151;
    background: #f3f4f6;
}
.attention-card-body {
    max-height: 487px;
    overflow-y: auto;
}

.attention-ok-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}
.attention-item {
    padding: 0.3rem 1rem 0.3rem calc(1rem + 12px);
    margin: 0 -1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
}
.attention-item + .attention-item {
    margin-top: 0.05rem;
}
.attention-item:hover {
    background: #f3f4f6;
}
.attention-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.attention-item-detail {
    font-size: 0.775rem;
    color: #9ca3af;
    margin-top: 0.05rem;
    line-height: 1.3;
}

.gs-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.gs-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    transition: background 0.1s;
}

.gs-item:hover {
    background: #f3f4f6;
}

.gs-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    background: transparent;
}

.gs-done .gs-check {
    background: #16a34a;
    border-color: #16a34a;
}

.gs-done {
    color: #6b7280;
    text-decoration: line-through;
    text-decoration-color: #9ca3af;
}

/* Batch status sub-section heading */
.batch-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding-top: 0.5rem;
    padding-bottom: 0.1rem;
}

/* Stock Status grouped layout */
.stock-status-groups {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.stock-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.stock-group-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stock-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter 0.15s;
    text-align: center;
}

.stock-tile:hover {
    filter: brightness(0.92);
}

.stock-tile-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stock-tile-label {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.85;
    line-height: 1.3;
}

.stock-tile-in {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.stock-tile-low {
    background-color: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.stock-tile-out {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Focus mode — cross-screen contextual highlighting */
/* Backdrop: dims page content below the target; sits above normal content
   but below sticky headers (z-index 30) and side panels (z-index 400). */
.focus-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

/* Kanban card focus: elevated above page backdrop (z-index 15). */
.focus-target {
    position: relative !important;
    z-index: 16 !important;
    box-shadow: 0 0 0 3px #0d6efd, 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}
/* Elevation only — use when a pulse animation owns box-shadow and focus-target would conflict. */
.focus-elevated {
    position: relative !important;
    z-index: 16 !important;
}

/* Panel section focus: blue ring on the highlighted section. */
.panel-focus-target {
    box-shadow: 0 0 0 3px #0d6efd, 0 8px 24px rgba(0, 0, 0, 0.22);
    border-radius: 4px;
}

/* Dim everything in the panel except the focused section. */
.panel-focus-active .detail-panel-header {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s;
}
.panel-focus-active .detail-panel-body > *:not(.panel-focus-target) {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s;
}
.panel-focus-active .detail-panel-body {
    cursor: pointer;
}

/* ── Empty State ── */
.empty-state-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}

.empty-state-container {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.empty-state-icon {
    color: #9ca3af;
    margin-bottom: 1.25rem;
}

.empty-state-headline {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-supporting {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.empty-state-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-state-secondary {
    font-size: 0.875rem;
    padding: 0;
    color: #6b7280;
}

.empty-state-hint {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0;
}

/* Onboarding — button highlight (Pattern 1) */
@keyframes onboarding-btn-glow {
    0%   { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.55); }
    40%  { box-shadow: 0 0 0 7px rgba(13, 110, 253, 0.28); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}
.onboarding-btn-highlight {
    animation: onboarding-btn-glow 1.5s ease forwards;
}
.onboarding-btn-wrap {
    position: relative;
    display: inline-block;
}
.btn-group-sm > .onboarding-btn-wrap > .btn {
    padding: .25rem .5rem;
    font-size: .875rem;
    border-radius: 0 .2rem .2rem 0;
    margin-left: -1px;
}
.onboarding-btn-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #0d6efd;
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
}

/* Onboarding — first-category add-row pulse (Pattern 2) */
@keyframes onboarding-row-pulse {
    0%   { background-color: transparent; }
    35%  { background-color: rgba(13, 110, 253, 0.09); }
    100% { background-color: transparent; }
}
.onboarding-row-pulse {
    animation: onboarding-row-pulse 1.5s ease forwards;
}
.onboarding-helper-text {
    font-size: 0.72rem;
    color: #adb5bd;
    padding: 1px 4px 0;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.onboarding-helper-text.fading {
    opacity: 0;
}

/* Auth layout (login / register pages) */
.auth-layout {
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-page {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}
.auth-card {
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.auth-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #111827;
}
.auth-switch-link {
    font-size: 0.875rem;
    color: #6b7280;
}
