/* Settings: the directory of cards, group forms and their pictures (meters, shift bar,
   sacks, paper and ID card previews). Builds on app.css; class prefix set-. */

/* ---------- Directory ---------- */
.set-search { flex: 1; justify-content: flex-end; }
.set-search-box { position: relative; display: flex; align-items: center; width: min(100%, 420px); }
.set-search-box .icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.set-search-box input { padding-left: 42px; border-radius: 999px; }

.set-hero { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(200px, 1fr)); gap: 16px; }
@media (max-width: 860px) { .set-hero { grid-template-columns: 1fr; } }
.set-hero > div { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow), var(--hairline); }
.set-hero-mill { flex-direction: row !important; align-items: center; justify-content: flex-start !important; gap: 14px !important; }
.set-hero-mill > div { display: flex; flex-direction: column; min-width: 0; }
.set-hero-name { font-size: 19px; line-height: 1.3; }
.set-hero-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 18px; overflow: hidden; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); }
.set-hero-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.set-hero-logo.is-mark, .set-paper-logo.is-mark, .set-logo-big.is-mark { background: linear-gradient(150deg, #E9C766, var(--gold)); color: #2A2410; box-shadow: inset 0 1px 0 rgba(255,255,255,.55); }
.set-hero-logo.is-mark .icon { width: 32px; height: 32px; }
.set-hero-value { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.set-hero-value small { font-size: 15px; font-weight: 600; color: var(--muted); }
.set-hero-when { font-size: 18px; font-weight: 700; }

.set-group { display: flex; flex-direction: column; gap: 12px; }
.set-group[hidden], .set-card[hidden] { display: none; }
.set-group-title { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.set-group-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--mint); color: var(--mint-ink); }
.set-group-icon .icon { width: 18px; height: 18px; }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.set-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius-lg); color: var(--ink); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow), var(--hairline); transition: transform .18s, box-shadow .18s; }
a.set-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover), var(--hairline); color: var(--ink); }
a.set-card:hover .set-card-go { transform: translateX(3px); color: var(--accent); }
.set-card.is-coming { background: var(--glass-soft); box-shadow: var(--hairline), inset 0 0 0 1px var(--line); }
.set-card-top { display: flex; align-items: flex-start; gap: 12px; }
.set-card-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 14px; background: var(--sunk-2); color: var(--accent); }
.set-card-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.set-card-title { font-size: 17px; line-height: 1.3; }
.set-card-about { font-size: 14px; color: var(--muted); line-height: 1.4; }
.set-card-go { width: 18px; height: 18px; color: var(--muted); margin-top: 4px; transition: transform .15s, color .15s; }
.set-card-now { font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 12px; background: var(--sunk); line-height: 1.4; }
.set-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.set-stat { display: flex; flex-direction: column; gap: 0; padding: 10px 12px; border-radius: 14px; background: var(--sunk); }
.set-stat-icon { width: 18px; height: 18px; color: var(--accent); }
.set-stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.set-stat-label { font-size: 12px; color: var(--muted); line-height: 1.3; }
.set-card-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.set-pill-icon { width: 14px; height: 14px; }
.pill .set-pill-icon + * { margin-left: 0; }
.set-card .pill::before, .page-actions .pill:has(.set-pill-icon)::before { display: none; }

/* ---------- Meters (SVG) ---------- */
.set-meters { display: flex; flex-direction: column; gap: 10px; }
.set-meters.is-big { gap: 16px; }
.set-meter-row { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.set-meter-row .set-meter-label { flex: 1 1 12em; min-width: 0; }
.set-meter-row .set-meter-value { margin-left: auto; }
.set-meter-row svg.set-meter { flex: 1 1 100%; }
.set-meter-over { margin-top: 2px; }
.set-meter-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.set-meter-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-big .set-meter-label { font-size: 15px; }
.is-big .set-meter-value { font-size: 17px; }
.set-meter-note { font-size: 14px; color: var(--muted); }
svg.set-meter { display: block; width: 100%; height: 10px; }
.is-big svg.set-meter { height: 14px; }
.set-meter-track { fill: var(--sunk-2); }
.set-meter-fill { fill: var(--ok); }
.set-tone-ok { fill: #3E8F5E; }
.set-tone-info { fill: #3B7DD8; }
.set-tone-gold { fill: var(--gold); }
.set-tone-bad { fill: var(--bad); }
.set-idle { display: flex; flex-direction: column; gap: 4px; }
.set-idle-scale { display: flex; justify-content: space-between; }

/* ---------- Shift bar and year ---------- */
.set-shifts { display: flex; flex-direction: column; gap: 8px; }
.set-shifts.is-big { gap: 14px; }
svg.set-shiftbar { display: block; width: 100%; height: auto; overflow: visible; }
.set-shift-track { fill: var(--sunk-2); }
.set-shift { stroke: var(--glass-strong); stroke-width: 1.2; }
.set-shift-0 { fill: #E9B949; }
.set-shift-1 { fill: #4E9B6B; }
.set-shift-2 { fill: #3D4E86; }
.set-shift-code { fill: #FFFFFF; font-size: 11px; font-weight: 700; }
.set-shift-tick { stroke: var(--line-strong); stroke-width: 1; }
.set-shift-hour { fill: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; }
.is-big .set-shift-code { font-size: 14px; }
.is-big .set-shift-hour { font-size: 9px; }
.set-shift-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.is-big .set-shift-list { font-size: 15px; }
.set-shift-list li { display: inline-flex; align-items: center; gap: 6px; }
.set-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
span.set-shift-0 { background: #E9B949; }
span.set-shift-1 { background: #4E9B6B; }
span.set-shift-2 { background: #3D4E86; }
.set-year-wrap { display: flex; flex-direction: column; gap: 6px; }
svg.set-year { display: block; width: 100%; max-width: 640px; height: auto; }
.set-month { fill: var(--sunk-2); }
.set-month.is-start { fill: var(--gold); }
.set-month-name { fill: var(--muted); font-size: 7px; }

/* ---------- Sacks ---------- */
svg.set-sacks { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
svg.set-sacks.is-big { max-width: 460px; }
.set-sack { stroke: rgba(60, 40, 10, .35); stroke-width: 1; }
.set-sack-0 { fill: #E6D3A3; }
.set-sack-1 { fill: #D9B66A; }
.set-sack-2 { fill: #F1E6C8; }
.set-sack-tie { stroke: #7A5A1E; stroke-width: 2; stroke-linecap: round; }
.set-sack-kg { fill: #4A3A12; font-size: 13px; font-weight: 700; }
.set-sack-label { fill: var(--ink-2); font-size: 10px; font-weight: 600; }
.set-sack-unit { fill: var(--muted); font-size: 9px; }
.set-sack-floor { stroke: var(--line-strong); stroke-width: 1; }

/* ---------- Paper preview ---------- */
.set-paper { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; border-radius: 10px; background: #FFFFFF; color: #1D1D1F; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.06); font-size: 11px; line-height: 1.35; }
.set-paper.is-big { max-width: 620px; width: 100%; margin: 0 auto; padding: 26px 30px 18px; font-size: 14px; }
.set-paper-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid #C99A2E; }
.set-paper-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; }
.set-paper-logo img { width: 100%; height: 100%; object-fit: contain; }
.set-paper-logo .icon { width: 18px; height: 18px; }
.is-big .set-paper-logo { width: 56px; height: 56px; border-radius: 14px; }
.is-big .set-paper-logo .icon { width: 30px; height: 30px; }
.set-paper-mill { display: flex; flex-direction: column; min-width: 0; color: #545A56; }
.set-paper-mill strong { color: #1D1D1F; font-size: 13px; }
.is-big .set-paper-mill strong { font-size: 20px; }
.set-paper-mill .mono { font-size: inherit; }
.set-paper-lines { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; flex: 1; }
.set-paper-lines i { display: block; height: 5px; border-radius: 3px; background: #ECEDE8; }
.is-big .set-paper-lines { gap: 12px; padding: 14px 0; }
.is-big .set-paper-lines i { height: 9px; }
.set-paper-lines i.is-short { width: 55%; }
.set-paper-signs { display: flex; justify-content: space-between; gap: 20px; padding-top: 14px; }
.set-paper-signs span { min-width: 30%; padding-top: 4px; border-top: 1px solid #8A8F8B; text-align: center; color: #3A3F3C; }
.set-paper-foot { min-height: 1em; padding-top: 6px; border-top: 1px dashed #D5D7D2; color: #6B706C; text-align: center; font-size: .9em; }

/* ---------- ID card preview ---------- */
.set-card-preview { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* Card shape follows a real ID card (CR80, 54 x 85.6 mm); content may make it taller, never shorter. */
.set-idc { display: flex; flex-direction: column; width: 220px; aspect-ratio: 54 / 85.6; border-radius: 12px; overflow: hidden; background: #FFFFFF; color: #1D1D1F; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 26px -14px rgba(0,0,0,.4), inset 0 0 0 1px rgba(0,0,0,.06); font-size: 10px; line-height: 1.35; }
.is-landscape .set-idc { width: 300px; aspect-ratio: 85.6 / 54; }
.is-big .set-idc { width: 280px; font-size: 13px; }
.is-big.is-landscape .set-idc { width: 440px; }
.set-idc-band { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: linear-gradient(120deg, #1F5E3B, #3E8F5E); color: #FFFFFF; }
.set-idc-mill { font-weight: 800; letter-spacing: .06em; }
.set-idc-title { font-weight: 600; text-align: right; }
.set-idc-body { flex: 1; align-content: center; display: grid; grid-template-columns: 1fr; justify-items: center; gap: 6px; padding: 10px; text-align: center; }
.is-landscape .set-idc-body { grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; text-align: left; }
.set-idc-photo { display: inline-flex; width: 54px; height: 64px; border-radius: 8px; background: #EEF1EC; align-items: flex-end; justify-content: center; overflow: hidden; }
.is-big .set-idc-photo { width: 76px; height: 90px; }
.set-idc-photo svg { width: 80%; height: 85%; fill: #B7C2B9; }
.set-idc-facts { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.set-idc-name { font-size: 1.25em; }
.set-idc-role { color: #545A56; }
.set-idc-code { font-weight: 700; font-size: 1.1em; color: #1F5E3B; }
.set-idc-row[hidden] { display: none; }
.set-idc-row b { font-weight: 600; }
canvas.set-idc-qr { width: 64px; height: 64px; image-rendering: pixelated; }
.is-big canvas.set-idc-qr { width: 92px; height: 92px; }
.set-idc-return { margin: 0; padding: 6px 10px; background: #F4F1E6; color: #5C5235; font-size: .9em; text-align: center; }

/* ---------- Group page ---------- */
.set-back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.set-back .icon { width: 16px; height: 16px; }
.set-picture { align-items: stretch; }
.set-picture > svg.set-sacks { max-width: 460px; }
.set-fields { display: flex; flex-direction: column; }
.set-field { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) minmax(180px, 1fr); gap: 8px 18px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.set-field:last-child { border-bottom: 0; }
@media (max-width: 900px) { .set-field { grid-template-columns: 1fr; } }
.set-field.is-changed .set-field-label .field-label::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--info); vertical-align: middle; }
.set-field-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; }
.set-field-input { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.set-field-meta { display: flex; flex-direction: column; gap: 3px; padding-top: 8px; font-size: 13px; color: var(--muted); }
.set-default-btn { align-self: flex-start; min-height: 32px; padding: 0 10px; font-size: 13px; }
.set-default-btn .icon { width: 15px; height: 15px; }
.set-unit-wrap { display: flex; align-items: center; gap: 8px; }
.set-unit-wrap input { max-width: 200px; }
.set-unit { font-weight: 600; color: var(--muted); white-space: nowrap; }
.set-seg { flex-wrap: wrap; align-self: flex-start; border-radius: 22px; }
.set-seg .seg { display: inline-flex; align-items: center; cursor: pointer; }
.set-seg .seg:has(input:checked) { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(0,0,0,.2), var(--hairline); }
.set-seg .seg:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-seg .seg:has(input:disabled) { cursor: not-allowed; }
.set-switch { min-height: 48px; }
.set-reason { max-width: 760px; }
.set-subform { padding: 14px; border-radius: var(--radius); background: var(--sunk); }

/* Logo */
.set-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.set-logo-big { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 22px; overflow: hidden; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.set-logo-big img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.set-logo-big .icon { width: 44px; height: 44px; }
.set-logo-info { display: flex; flex-direction: column; gap: 2px; }
.set-logo-pick { width: 96px; height: 96px; object-fit: contain; border-radius: 16px; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); padding: 6px; }
.set-logo-pick[hidden] { display: none; }
.set-subform input[type=file] { font: inherit; font-size: 15px; padding: 10px 0; }

@media print {
  .set-search, .set-card-go { display: none !important; }
}
