/* === Design tokens === */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --accent: #0f172a;
    --accent-hover: #1f2937;
    --accent-active: #000000;
    --accent-light: #f1f5f9;
    --accent-on-light: #0f172a;

    --topbar-bg: #0f172a;
    --topbar-text: #ffffff;

    --success: #16a34a;
    --success-light: #ecfdf5;
    --success-light-text: #166534;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-light: #fee2e2;
    --danger-light-text: #991b1b;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --warning-light-text: #92400e;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.05), 0 12px 24px rgba(15, 23, 42, 0.10);

    --t-fast: 120ms ease-out;
    --t-base: 180ms ease-out;
}

/* === Base / Reset === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    letter-spacing: -0.005em;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
}

button { cursor: pointer; border: none; background: none; }

/* === App layout === */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg);
}

#topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    height: 56px;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    padding: 0 8px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.12);
}

#header-title {
    margin: 0;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    height: 44px;
    width: 44px;
    border-radius: var(--radius-sm);
    color: var(--topbar-text);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}
.icon-btn:hover, .icon-btn:active { background: rgba(255, 255, 255, 0.10); }
.icon-btn[hidden] { display: none; }

/* Language toggle (EN | ES) — sits in the top bar's right cell next to Home,
   so it's reachable on every screen including the login screen. */
#topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-right: 4px;
}
.lang-toggle {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.lang-toggle .lang-opt {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--topbar-text);
    opacity: 0.7;
    background: transparent;
    transition: background var(--t-fast), opacity var(--t-fast);
}
.lang-toggle .lang-opt:hover { background: rgba(255, 255, 255, 0.10); }
.lang-toggle .lang-opt.active {
    background: rgba(255, 255, 255, 0.92);
    color: var(--topbar-bg);
    opacity: 1;
}

#main {
    flex: 1;
    padding: 20px 16px;
    padding-bottom: 96px;
}

/* === Common components === */

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--text);
    letter-spacing: -0.005em;
}
.section-title:first-child { margin-top: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    transition: box-shadow var(--t-base), transform var(--t-fast);
}

.card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-base), border-color var(--t-base);
}
.card-row:hover { box-shadow: var(--shadow-md); }

.card-row .title { font-weight: 600; flex: 1; letter-spacing: -0.005em; }
.card-row .subtitle { color: var(--text-muted); font-size: 0.875rem; }

/* Checklists page rows: action buttons grouped so they can drop below the
   name on narrow screens (see the max-width: 700px rule). */
.cd-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Variant rows nest visually under their parent in the admin Checklists list */
.card-row-variant {
    margin-left: 28px;
    border-left: 4px solid var(--border-strong);
    background: var(--surface-2, #f8fafc);
}
.variant-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 4px;
}

.empty {
    text-align: center;
    padding: 56px 16px;
    color: var(--text-muted);
}
.empty .emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 14px;
    filter: grayscale(0.1);
    opacity: 0.85;
}
.empty p { margin: 4px 0; }

/* === Buttons === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    min-height: 48px;
    text-align: center;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
    width: auto;
    letter-spacing: -0.005em;
    box-shadow: 0 1px 2px rgba(67, 56, 202, 0.18);
}
.btn:hover { background: var(--accent-hover); box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25); }
.btn:active { background: var(--accent-active); transform: translateY(1px); }
.btn:disabled { background: var(--text-subtle); cursor: not-allowed; box-shadow: none; }

.btn-secondary {
    background: var(--surface);
    color: var(--accent);
    border: 1.5px solid var(--accent);
    box-shadow: none;
}
.btn-secondary:hover { background: var(--accent-light); box-shadow: none; }
.btn-secondary:active { background: var(--accent-light); }

.btn-danger { background: var(--danger); box-shadow: 0 1px 2px rgba(220, 38, 38, 0.18); }
.btn-danger:hover { background: var(--danger-hover); box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25); }

.btn-ghost { background: transparent; color: var(--accent); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-light); box-shadow: none; }

.btn-block { display: flex; width: 100%; }

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 0; }

.btn-row-wrap .btn { flex: 1 1 calc(50% - 4px); }

/* === Big buttons (home menu) === */

.big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 14px;
    min-height: 148px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.005em;
    transition: transform var(--t-fast), box-shadow var(--t-base), border-color var(--t-base);
}
.big-btn:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.big-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}
.big-btn .emoji {
    font-size: 2.4rem;
    margin-bottom: 10px;
    display: block;
}
.big-btn .sub {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
    margin-top: 4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* === Form fields === */
.field {
    margin-bottom: 14px;
}
.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.95rem;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    min-height: 48px;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.field .hint { color: var(--text-muted); font-size: 0.825rem; margin-top: 6px; line-height: 1.4; }

.inline-fields { display: flex; gap: 10px; }
.inline-fields .field { flex: 1; }

/* === Checklist items === */

.checklist-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-base);
}
.checklist-item:active { background: var(--surface-2); }

.checklist-item.checked {
    background: var(--success-light);
    border-color: #bbf7d0;
}
.checklist-item.checked .name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-item input[type="checkbox"] {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    accent-color: var(--success);
    cursor: pointer;
}

.checklist-item .name { flex: 1; font-weight: 500; font-size: 1rem; letter-spacing: -0.005em; }
.checklist-item .time {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}
/* "by Alex" line under a checked-off prep item. Rendered as a SIBLING of
   .name (not a child) so the .checked .name strikethrough doesn't bleed
   into it. flex-basis:100% makes it wrap onto its own line below the row;
   margin-left indents it past the checkbox so it lines up with the name. */
.checklist-item .prep-by {
    flex-basis: 100%;
    margin: 2px 0 0 40px;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Star button — worker marks a row as important for the print sheet. */
.star-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    color: #94a3b8;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.star-btn.starred {
    color: #ca8a04;
    border-color: #ca8a04;
    background: #fef9c3;
}
.star-btn:active { background: var(--surface-2); }

/* On-screen highlight for important rows (matches selection & sheet/complete views). */
.checklist-item.important {
    border-color: #ca8a04;
    box-shadow: 0 0 0 1px #ca8a04 inset;
    background: #fffbeb;
}
.card-row.important {
    border-color: #ca8a04;
    background: #fffbeb;
}

/* Quantity stepper used on the worker prep selection screen. */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    flex-shrink: 0;
}
.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qty-btn:active { background: var(--surface-2); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-value {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.checklist-item .badge {
    background: var(--accent-light);
    color: var(--accent-on-light);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.checklist-item .cl-value {
    width: 92px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    text-align: center;
    flex-shrink: 0;
    background: var(--surface);
    -moz-appearance: textfield;
    transition: border-color var(--t-fast);
}
.checklist-item .cl-value::-webkit-outer-spin-button,
.checklist-item .cl-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.checklist-item .cl-value:focus { border-color: var(--accent); outline: none; }
.checklist-item .cl-value:read-only { background: var(--surface-2); color: var(--text-muted); }
.checklist-item .cl-value-note { width: 160px; text-align: left; }
.checklist-item .cl-value-temp { width: 100px; }
.checklist-item .cl-value-bad {
    border-color: var(--danger);
    color: var(--danger-light-text);
    background: var(--danger-light);
}

/* Photo items: small thumbnail when checked, camera hint when unchecked. */
.checklist-item .cl-photo-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1.5px dashed var(--border);
    color: var(--text-muted);
    font-size: 1.25rem;
    flex-shrink: 0;
}
.checklist-item .cl-photo-view {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
.checklist-item .cl-photo-view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.checklist-item .cl-photo-view:active { transform: scale(0.97); }

/* Day-report photo thumbnail (admin view, inside stat-row). */
.dayreport-photo-view {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    overflow: hidden;
    vertical-align: middle;
}
.dayreport-photo-view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Full-size photo lightbox modal. */
.photo-lightbox { text-align: center; }
.photo-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

/* Title item: section header inside a checklist (no checkbox) */
.checklist-title,
.prep-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 22px 4px 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}
.checklist-title:first-child,
.prep-title:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 4px;
}
/* A blank visual gap between checklist tasks (kind: 'spacer'). No content,
   no checkbox — just breathing room the admin can drop in. */
.checklist-spacer {
    height: 28px;
}
.cl-large .checklist-spacer {
    height: 44px;
}

/* Sub-section header inside a category group on the prep sheet — softer than
   the all-caps category header above it. */
.prep-subtitle {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    padding: 8px 4px 4px;
    margin-top: 6px;
}

/* === Recurrence picker (checklist editor modal) === */
.recur-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.recur-row input[type="number"] {
    width: 70px;
    text-align: center;
    /* The global `.field input { width: 100%; min-height: 48px; padding: ... }`
       would otherwise make this a giant full-width box. Keep it compact. */
    min-height: 0;
    padding: 8px 10px;
}
.recur-row select {
    width: auto;
    min-width: 100px;
    min-height: 0;
    padding: 8px 10px;
}
.weekday-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.weekday-chip {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.weekday-chip.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.variant-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.variant-row:hover {
    background: var(--surface-2);
}
.variant-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.variant-row-emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.variant-row-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.variant-row-label {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.variant-row-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.variant-row-edit {
    font-weight: 600;
    color: var(--accent-on-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.ends-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ends-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    cursor: pointer;
}
/* Override the modal's global full-width input styling so the radio stays
   small and inline, and the date/number inputs sit right next to it. */
.ends-row input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    cursor: pointer;
}
.ends-row input[type="date"],
.ends-row input[type="number"] {
    width: auto;
    min-height: 0;
    padding: 8px 10px;
}
.ends-row input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.field .field-input-inline,
.field input[type="number"]#cd-month-day {
    /* Standalone day-of-month input — same compact treatment as above. */
    min-height: 0;
    padding: 8px 10px;
}

/* === Announcement audience picker === */
.audience-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    cursor: pointer;
}
.audience-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    cursor: pointer;
}
.audience-everyone {
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    padding-bottom: 12px;
}
.audience-list {
    max-height: 260px;
    overflow-y: auto;
    padding-left: 4px;
}

/* === Maintenance worker view ===
   Built for a worker with poor vision: full-width buttons, large text,
   high-contrast checked state. */
.maint-welcome { text-align: center; }
/* Beats `.welcome h2 { font-size: 1.5rem; }` defined earlier. */
.welcome.maint-welcome h2.maint-h2 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 8px;
}
.maint-intro {
    font-size: 1.15rem;
    color: var(--text-muted);
}
.maint-progress-line {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 12px;
}
.maint-empty-line  { font-size: 1.4rem; font-weight: 600; }
.maint-empty-sub   { font-size: 1.1rem; }

/* Single column of huge full-width buttons */
.maint-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}
.maint-task-btn {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 96px;
    padding: 18px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.maint-task-btn:active {
    transform: scale(0.98);
}
.maint-task-btn .emoji {
    font-size: 3rem;
    line-height: 1;
    flex: 0 0 auto;
}
.maint-task-btn .task-name {
    flex: 1;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
}
.maint-task-btn.maint-done {
    background: #f0fdf4;
    border-color: #16a34a;
}
.maint-task-btn.maint-done .task-name {
    color: #166534;
    text-decoration: line-through;
}

/* Section divider — kind=title in the worker maintenance view. Big, bold,
   no border, sits between rows. */
.maint-section {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 18px 4px 6px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
.maint-grid > .maint-section:first-child {
    border-top: none;
    padding-top: 4px;
    margin-top: 0;
}

/* Captured value badge on done items (number/note/temperature). */
.maint-value {
    flex: 0 0 auto;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}
.maint-value-note {
    font-weight: 500;
    background: #f1f5f9;
    color: #334155;
    max-width: 60%;
    white-space: normal;
}
.maint-value-bad {
    background: #fee2e2;
    color: #991b1b;
}

/* === Sticky bottom bar === */
.sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.sticky-bottom > .btn { flex: 1; }
.sticky-bottom .summary {
    text-align: center;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 6px;
    flex-basis: 100%;
}

/* === Stats / reports === */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: var(--text-muted); }
.stat-row .value { font-weight: 600; }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-tile .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
}
.stat-tile .label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-tile.good .value { color: var(--success); }
.stat-tile.bad .value { color: var(--danger); }
.stat-tile.warn .value { color: var(--warning); }

/* === Badges === */
.tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
}
.tag-green { background: var(--success-light); color: var(--success-light-text); }
.tag-red { background: var(--danger-light); color: var(--danger-light-text); }
.tag-yellow { background: var(--warning-light); color: var(--warning-light-text); }
.tag-gray { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.tag-blue { background: var(--accent-light); color: var(--accent-on-light); }

button.tag {
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
}
button.tag.tag-gray { border-color: var(--border); }
button.tag:hover {
    filter: brightness(0.95);
    border-color: var(--border-strong);
}
button.tag:disabled { opacity: 0.5; cursor: wait; }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    font-weight: 500;
    animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* === Modal === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
    animation: modal-fade-in var(--t-base);
}
.modal-backdrop[hidden],
.toast[hidden],
.icon-btn[hidden],
.qty-stepper[hidden],
.star-btn[hidden],
.card-row[hidden] { display: none !important; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 22px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modal-pop-in var(--t-base);
}
.modal h2 {
    margin-top: 0;
    letter-spacing: -0.015em;
    font-size: 1.2rem;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* === Print styles === */
@page { size: letter portrait; margin: 0.35in; }
@media print {
    body { background: white; }
    #topbar, .sticky-bottom, .no-print, .btn-row, button { display: none !important; }
    #app { max-width: none; }
    #main { padding: 0; padding-bottom: 0; }
    .card, .card-row, .checklist-item {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    .print-only { display: block !important; }
    .print-sheet {
        font-size: 9pt;
        line-height: 1.25;
        color: #000;
    }
    .print-sheet h1 { font-size: 14pt; margin: 0 0 2px; }
    .print-sheet .meta { color: #555; margin-bottom: 8px; font-size: 8.5pt; }
    /* Two-column flow so the whole sheet fits a single letter page for most prep lists. */
    .print-sheet .print-columns {
        column-count: 2;
        column-gap: 14px;
        column-rule: 1px solid #ddd;
    }
    .print-sheet .print-item {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 3px 0;
        border-bottom: 1px solid #eee;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .print-sheet .print-item .check-box {
        width: 12px;
        height: 12px;
        border: 1.5px solid #333;
        flex: 0 0 12px;
    }
    .print-sheet .print-item .name {
        flex: 1 1 auto;
        min-width: 0;
        word-wrap: break-word;
    }
    .print-sheet .print-item .qty {
        font-weight: 700;
        margin-right: 2px;
    }
    .print-sheet .print-item .time {
        color: #555;
        font-size: 8pt;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .print-sheet .print-title {
        column-span: all;
        font-weight: 700;
        font-size: 10pt;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        background: #eee;
        padding: 3px 6px;
        margin: 6px 0 3px;
        break-after: avoid;
        page-break-after: avoid;
    }
    .print-sheet .print-title:first-child { margin-top: 0; }
    .print-sheet .print-subtitle {
        font-weight: 600;
        font-size: 9.5pt;
        margin: 4px 0 2px;
        padding-left: 2px;
        border-left: 3px solid #888;
        padding-left: 6px;
        break-after: avoid;
        page-break-after: avoid;
    }
    /* Worker can flag a row as important — print it inside a heavy box. */
    .print-sheet .print-item.important {
        border: 2px solid #000;
        padding: 4px 6px;
        margin: 3px 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

.print-only { display: none; }

/* === Misc === */
.row-spread {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.welcome {
    text-align: center;
    margin-bottom: 28px;
}
.welcome h2 {
    font-size: 1.5rem;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    font-weight: 700;
}
.welcome p {
    color: var(--text-muted);
    margin: 0;
}

.danger-zone {
    margin-top: 32px;
    padding: 18px;
    border: 1.5px dashed #fecaca;
    border-radius: var(--radius-lg);
    background: #fef7f7;
}
.danger-zone h3 { margin-top: 0; color: var(--danger-light-text); }

/* === Banner (overdue notifications) === */
.banner {
    background: #fef2f2;
    border-bottom: 1.5px solid #fecaca;
    color: var(--danger-light-text);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: sticky;
    top: 56px;
    z-index: 8;
}
.banner[hidden] { display: none !important; }
.banner-icon { font-size: 1.4rem; line-height: 1.2; }
.banner-body { flex: 1; font-size: 0.9rem; }
.banner-body strong { display: block; margin-bottom: 2px; }
.banner-action {
    background: var(--danger-light-text);
    color: white;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    align-self: center;
    transition: background var(--t-fast);
}
.banner-action:hover { background: var(--danger-hover); }

/* Sandbox variant: yellow stripe across the top in localhost preview so
   it's unmistakable that DB writes are being blocked. */
.banner.sandbox {
    background: #fef3c7;
    border-bottom-color: #fbbf24;
    color: #78350f;
}

/* === Login screen === */
.login-row {
    min-height: 72px;
    padding: 18px 20px;
    font-size: 1.1rem;
    text-align: center;
}
.login-row.login-admin {
    background: var(--accent-light);
    border: 2px solid var(--accent);
    color: var(--accent-on-light);
}

/* === Emoji picker chips (in checklist modal) === */
.emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.emoji-chip {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.emoji-chip:hover { background: var(--accent-light); border-color: var(--accent); }

/* === Role checkboxes (in worker edit modal) === */
.role-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.role-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.role-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}
.role-check:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
}

/* === Announcement strip (worker home) === */
.announcement-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.announcement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    animation: announcement-in 0.25s ease-out;
}
@keyframes announcement-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.announcement-body { flex: 1; }
.announcement-title {
    font-weight: 600;
    color: var(--warning-light-text);
    letter-spacing: -0.005em;
}
.announcement-text {
    color: var(--text);
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.45;
}
.announcement-x {
    background: transparent;
    color: var(--warning-light-text);
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    line-height: 1;
    transition: background var(--t-fast);
}
.announcement-x:hover { background: rgba(217, 119, 6, 0.12); }

/* === Announcement modal (big, can't-miss-it overlay on worker home) === */
.announce-modal {
    text-align: center;
}
.announce-modal-head {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
}
.announce-modal-item {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 18px 18px;
    margin-bottom: 14px;
    text-align: left;
}
.announce-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warning-light-text);
    line-height: 1.25;
}
.announce-modal-text {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text);
    margin-top: 8px;
    white-space: pre-wrap;
}
.announce-modal-ack {
    margin-top: 8px;
    min-height: 56px;
    font-size: 1.15rem;
    font-weight: 700;
}

/* === Temperatures-from-lists section (admin Temp Logs page) === */
.temp-task-date {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 16px 0 4px;
    color: var(--text);
}
.temp-task-date:first-child { margin-top: 0; }
.temp-task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}
.temp-task-name { font-weight: 600; line-height: 1.3; }
.temp-task-val {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}
.temp-task-val.flagged { color: var(--danger); }

/* === Dashboard bars === */
.dash-bar {
    position: relative;
    width: 140px;
    height: 28px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;
}
.dash-bar-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width var(--t-base);
}
.dash-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    mix-blend-mode: difference;
    color: #fff;
}

/* === Temperature chart === */
.temp-chart {
    width: 100%;
    display: block;
}
.temp-chart .chart-bg {
    fill: var(--surface-2);
    stroke: var(--border);
    stroke-width: 1;
}
.temp-chart .chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.temp-chart .safe-line {
    stroke: var(--success);
    stroke-width: 1;
    stroke-dasharray: 4 3;
    opacity: 0.65;
}
.temp-chart .safe-label {
    fill: var(--success-light-text);
    font-size: 10px;
    font-weight: 600;
}
.temp-chart .axis-label {
    fill: var(--text-muted);
    font-size: 10px;
}
.temp-chart .dot-ok {
    fill: var(--accent);
}
.temp-chart .dot-bad {
    fill: var(--danger);
    stroke: white;
    stroke-width: 1;
    r: 4;
}

/* === New / Updated flag badges + heads-up banner === */
.tag-flag-new {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}
.tag-flag-updated {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.checklist-item.has-flag {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-sm), inset 3px 0 0 var(--accent);
}
.cl-flag {
    margin-left: 6px;
    vertical-align: middle;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}
.cl-headsup {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--warning-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    color: var(--warning-light-text);
    font-size: 0.92rem;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
}
.cl-headsup-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.cl-headsup strong { font-weight: 700; }

/* ---- Large-text accessibility mode (per-worker `large_text`) ----
   Views.workerChecklist wraps its output in .cl-large for flagged workers; the
   New/Updated pop-up adds .cl-large too when its viewer is a large-text worker.
   Everything here is scoped under .cl-large so no other screen or worker is
   affected. */
.cl-large .welcome h2 { font-size: 2rem; }
.cl-large .welcome .text-muted { font-size: 1.15rem; }
.cl-large .cl-headsup { font-size: 1.25rem; padding: 16px 18px; }
.cl-large .checklist-item { padding: 22px; gap: 18px; }
.cl-large .checklist-item .name { font-size: 1.6rem; line-height: 1.3; font-weight: 600; }
.cl-large .checklist-item input[type="checkbox"] { width: 40px; height: 40px; }
.cl-large .checklist-item .cl-value { width: 130px; font-size: 1.4rem; padding: 12px; }
.cl-large .checklist-item .cl-value-note { width: 200px; }
.cl-large .checklist-item .cl-value-temp { width: 140px; }
.cl-large .checklist-item .time { font-size: 1.1rem; }
.cl-large .checklist-item .cl-photo-hint { font-size: 2rem; }
.cl-large .checklist-item .cl-photo-view img { width: 64px; height: 64px; }
.cl-large .cl-flag { font-size: 1.05rem; padding: 6px 10px; }
.cl-large .checklist-item .tag { font-size: 1.05rem; }
.cl-large .checklist-title { font-size: 1.5rem; }
.cl-large .sticky-bottom .summary { font-size: 1.4rem; }
.cl-large .sticky-bottom .btn { font-size: 1.4rem; padding: 18px; }

/* Large-text variant of the New/Updated pop-up. */
.announce-modal.cl-large .announce-modal-head { font-size: 1.6rem; }
.announce-modal.cl-large .announce-modal-title { font-size: 1.35rem; }
.announce-modal.cl-large .announce-modal-text { font-size: 1.25rem; }
.announce-modal.cl-large .announce-modal-ack { font-size: 1.4rem; padding: 18px; }

/* === Drag-and-drop reorder === */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    color: var(--text-subtle);
    font-size: 1.1rem;
    line-height: 1;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    touch-action: none; /* don't scroll while dragging on touch */
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), color var(--t-fast);
}
.drag-handle:hover { background: var(--surface-2); color: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }
.search-bar {
    margin-bottom: 10px;
}
.search-bar input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}
.search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Typeahead dropdown that floats under the search input on add-from-library
   pages (Date Check order, future Inventory order). */
.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 320px;
    overflow-y: auto;
    z-index: 20;
}
.search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    color: var(--text);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result:focus { background: var(--surface-2); outline: none; }
.search-result-name { flex: 1; font-weight: 500; }
.search-result-add {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.search-result-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

/* Inline "insert below" panel under a Date Check order row. Indents in a
   little to show it's a child of the row above. */
.dc-insert-below-panel {
    margin: 4px 0 8px 36px;
    padding: 10px 12px;
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.dc-insert-below-panel .search-bar { margin-bottom: 0; }

/* "+" button on each Date Check row glows when its panel is open. */
.insert-below-dc.active {
    background: var(--accent);
    color: #fff !important;
}

.select-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--accent-light);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}
.select-bar-count {
    font-weight: 600;
    color: var(--text);
}
.select-bar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
#prep-items-list.select-mode .prep-item-row {
    cursor: pointer;
}
.prep-item-row.selected {
    background: var(--accent-light);
    border-color: var(--accent);
}
.select-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}
.prep-item-row.selected .select-box {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.card-row.dragging {
    box-shadow: var(--shadow-lg);
    opacity: 0.95;
    background: var(--surface);
    transition: none;
}
.drag-placeholder {
    border: 2px dashed var(--accent);
    background: var(--accent-light);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    box-sizing: border-box;
}

/* View-mode toggle (worker prep select) — looks like a segmented control */
.view-toggle .btn { padding: 11px 12px; min-height: 42px; font-size: 0.9rem; }

/* === Inventory (daily count with sections + totals) === */
.inv-shell { padding-bottom: 32px; }
.inv-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin: 12px 0;
    padding: 8px 0 0 0;
    overflow: hidden;
}
.inv-section-title {
    margin: 0;
    padding: 12px 16px 4px 16px;
    font-size: 1.05rem;
    color: var(--text);
}
.inv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}
.inv-row:first-of-type { border-top: 1px solid var(--border); }
.inv-row-name {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}
.inv-row-input {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.inv-input {
    width: 88px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 1.05rem;
    text-align: right;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}
.inv-input:focus { outline: 2px solid var(--accent-light); outline-offset: 1px; }
.inv-unit-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    min-width: 44px;
}
.inv-row-done { background: rgba(0,0,0,0.02); }
.inv-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0,0,0,0.03);
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}
.inv-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-top: 16px;
    background: var(--accent-light);
    color: var(--accent-on-light);
    border-radius: 14px;
    font-size: 1.1rem;
}
.inv-grand-total strong { font-size: 1.2rem; }
.inv-item-row .tag { margin-left: 6px; }

/* === Date Check (end-of-day fullscreen flow) === */
.dc-shell {
    padding: 8px 4px 24px;
}
.dc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.dc-undo {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.dc-undo:disabled {
    opacity: 0.35;
    cursor: default;
}
.dc-progress {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.dc-item-name {
    font-size: 2rem;
    text-align: center;
    margin: 12px 0 4px;
    letter-spacing: -0.01em;
    word-break: break-word;
}
.dc-prompt {
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 18px;
    font-size: 0.95rem;
}
.dc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.dc-btn {
    min-height: 92px;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.05s ease, filter 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 8px;
}
.dc-btn:active { transform: scale(0.98); }
.dc-btn-main {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
}
.dc-btn-sub {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
    letter-spacing: 0;
}
.dc-green {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.dc-yellow {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.dc-red {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.dc-footer {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}
.dc-footer .btn {
    min-width: 60%;
}

/* Summary screen */
.dc-summary {
    padding: 8px 0 24px;
}
.dc-summary h2 {
    margin-top: 4px;
}
.dc-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}
.dc-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}
.dc-stat-num {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}
.dc-stat-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}
.dc-stat-red .dc-stat-num { color: var(--danger); }
.dc-summary-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
.dc-summary-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.dc-summary-list li:last-child { border-bottom: none; }
.dc-summary-name {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-small {
    padding: 6px 10px;
    min-height: 0;
    font-size: 0.85rem;
}

/* === Small screens === */
/* On phones / narrow screens, stack the Checklists rows: name + info on top,
   the Copy / Edit / Items (and move arrows) in a roomy row below. */
@media (max-width: 700px) {
    .card-row.cd-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 18px;
    }
    .card-row.cd-row .cd-row-info { width: 100%; }
    .card-row.cd-row .cd-row-actions { width: 100%; flex-wrap: wrap; }
    .card-row.cd-row .cd-row-actions .btn { flex: 1 1 auto; min-height: 48px; }
    .card-row.cd-row .cd-row-actions .icon-btn { min-height: 48px; min-width: 48px; }
}

@media (max-width: 380px) {
    .big-btn { min-height: 124px; padding: 18px 8px; font-size: 0.95rem; }
    .big-btn .emoji { font-size: 2rem; }
    #main { padding: 14px 12px 96px; }
    .modal { padding: 18px; }
    .dash-bar { width: 100px; }
    .checklist-item .cl-value-note { width: 120px; }
    .dc-item-name { font-size: 1.6rem; }
    .dc-btn { min-height: 76px; padding: 8px 6px; }
    .dc-btn-main { font-size: 1.5rem; }
    .dc-btn-sub { font-size: 0.78rem; }
}
