/* welt.PRO — dark theme based on the original app.weltpro.co.uk design.
   Plain CSS, no build step (works on shared hosting). */
:root {
    --bg: #050606;
    --sidebar-bg: #070808;
    --panel: #0b0d0d;
    --panel-2: #0f1111;
    --input-bg: #101313;
    --hover: #101414;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .14);
    --text: #f4f5f3;
    --text-2: #d9ddda;
    --muted: #9ba29e;
    --dim: #818b86;
    --green: #38c98d;
    --green-soft: #71dda9;
    --blue: #4fa5ff;
    --amber: #f0a44c;
    --red: #ef6b69;
    --red-soft: #ef8b87;
    --purple: #a487ff;
    --sidebar: 250px;
    --radius: 14px;      /* cards, tables, panels */
    --radius-sm: 10px;   /* buttons, inputs, alerts */
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    color: var(--text);
    color-scheme: dark;
    --text-strong: #ffffff;
    --text-3: #b4bbb7;
    --nav-text: #b9c0bc;
    --placeholder: #5d6561;
    --btn-bg: #f1f4f2;
    --btn-text: #060707;
    --guest-glow: #0c1412;
    --success-text: #bfeed8;
    --info-text: #8cc4ff;
    --warning-text: #f5bf7f;
    --danger-text: #ff9b98;
    --shadow: none;
    --nav-group-bg: rgba(255, 255, 255, .03);
    --stat-tint: .07;
}

/* Light theme (chosen per user in the sidebar, or following the computer when set to Auto). */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f2f4f3;
    --sidebar-bg: #ffffff;
    --panel: #ffffff;
    --panel-2: #f5f7f6;
    --input-bg: #ffffff;
    --hover: #edf2ef;
    --line: rgba(20, 40, 30, .11);
    --line-strong: rgba(20, 40, 30, .2);
    --text: #152019;
    --text-2: #26312b;
    --text-strong: #0a110d;
    --text-3: #3b4640;
    --muted: #56615b;
    --dim: #67716c;
    --nav-text: #3f4a44;
    --placeholder: #98a19c;
    --green: #13875a;
    --green-soft: #0e6f49;
    --blue: #1f6ccc;
    --amber: #b5670f;
    --red: #c73836;
    --red-soft: #b3302e;
    --purple: #6446d0;
    --btn-bg: #14201a;
    --btn-text: #ffffff;
    --guest-glow: #dcebe3;
    --success-text: #0c6641;
    --info-text: #1a5aab;
    --warning-text: #8a4b06;
    --danger-text: #a52a28;
    --shadow: 0 1px 2px rgba(20, 40, 30, .05), 0 2px 8px rgba(20, 40, 30, .04);
    --nav-group-bg: #f4f7f5;
    --stat-tint: .09;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-soft); }
h1 { font-size: 30px; margin: 8px 0 0; font-weight: 500; letter-spacing: -.03em; }
h2 { font-size: 19px; margin: 4px 0 16px; font-weight: 500; }

/* Brand: welt.PRO with the green dot */
.brand { font-size: 30px; letter-spacing: -.04em; font-weight: 600; color: var(--text); line-height: 1; }
.brand span { color: var(--green); }
.brand b { font-size: 11px; letter-spacing: .14em; margin-left: 6px; font-weight: 700; }
.brand-tag { font-size: 10px; letter-spacing: .25em; color: var(--dim); margin-top: 8px; }
.eyebrow, .section-label { font-size: 10.5px; letter-spacing: .28em; color: var(--dim); font-weight: 700; text-transform: uppercase; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar-bg); border-right: 1px solid var(--line); padding: 24px 16px 18px; display: flex; flex-direction: column; }
.sidebar .brand-wrap { padding: 0 10px 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; display: block; }
.sidebar .brand-wrap:hover { text-decoration: none; }
.sidebar nav { display: grid; gap: 4px; align-content: start; flex: 1; }
.sidebar .nav-section { padding: 18px 14px 6px; }
.sidebar nav a { display: block; padding: 9px 14px; color: var(--nav-text); border-radius: var(--radius-sm); font-size: 14px; border-left: 2px solid transparent; }
.sidebar nav a:hover { background: var(--hover); color: var(--text-strong); }
.sidebar nav a.active { background: var(--hover); color: var(--text-strong); border-left-color: var(--green); }
.sidebar .account { margin-top: 14px; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar .account .who { display: flex; gap: 9px; align-items: flex-start; }
.status-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; margin-top: 4px; flex-shrink: 0; box-shadow: 0 0 10px rgba(56, 201, 141, .4); }
.sidebar .account .name { color: var(--text); font-weight: 500; }
.sidebar .account .meta { color: var(--dim); margin: 4px 0 10px; }
.sidebar .account button { background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-3); padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.sidebar .account button:hover { border-color: rgba(56, 201, 141, .3); color: var(--text-strong); }
.main { min-width: 0; padding: 34px 40px 70px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.topbar .sub { color: var(--muted); margin-top: 8px; font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Cards & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-2 > .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { --tint: var(--line-strong); position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-height: 120px; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tint); }
.stat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--tint), transparent 70%); opacity: var(--stat-tint); pointer-events: none; }
.stat .label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { display: block; font-size: 28px; font-weight: 600; margin: 16px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--dim); font-size: 13px; }
.stat.accent { --tint: var(--green); }
.stat.info { --tint: var(--blue); }
.stat.warning { --tint: var(--amber); }
.stat.danger { --tint: var(--red); }
.stat.neutral { --tint: var(--line-strong); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 26px 0 14px; }
.section-head h2 { margin: 4px 0 0; }
dl.details { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; }
dl.details dt, dl.details dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.details dt { color: var(--muted); font-size: 13px; }
dl.details dd { font-variant-numeric: tabular-nums; }
dl.details dt:last-of-type, dl.details dd:last-of-type { border-bottom: 0; }
.note { color: var(--dim); font-size: 13px; line-height: 1.55; margin-top: 12px; font-weight: 400; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; }

/* Tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
td { color: var(--text-2); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .code, a.code { font-size: 11px; letter-spacing: .16em; color: var(--green); }
.negative { color: var(--red-soft) !important; }
.positive { color: var(--green-soft) !important; }
.empty { padding: 30px; text-align: center; color: var(--dim); }
pre.json { margin: 0; font-size: 12px; white-space: pre-wrap; max-width: 420px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Pills / badges */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); color: var(--muted); letter-spacing: .02em; }
.badge-success { color: var(--green-soft); border-color: rgba(56, 201, 141, .25); background: rgba(56, 201, 141, .06); }
.badge-info { color: var(--info-text); border-color: rgba(79, 165, 255, .25); background: rgba(79, 165, 255, .06); }
.badge-warning { color: var(--warning-text); border-color: rgba(240, 164, 76, .25); background: rgba(240, 164, 76, .06); }
.badge-danger { color: var(--danger-text); border-color: rgba(239, 107, 105, .25); background: rgba(239, 107, 105, .05); }
.badge-neutral { color: var(--text-2); border-color: var(--line-strong); }
.badge-muted { color: var(--dim); }

/* Forms & buttons */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 20px; }
.field label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-bottom: 7px; }
.field .hint { color: var(--dim); font-size: 12px; margin-top: 6px; }
.field.full { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 11px 12px; background: var(--input-bg); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; outline: none; border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { border-color: rgba(56, 201, 141, .35); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.filters input, .filters select { width: auto; min-width: 220px; }
textarea { min-height: 110px; resize: vertical; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 12px; top: 11px; color: var(--dim); }
.money-input input { padding-left: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { accent-color: var(--green); width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; background: var(--btn-bg); color: var(--btn-text); border: 0; border-radius: var(--radius-sm); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--text-strong); color: var(--btn-text); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text-3); border: 1px solid var(--line); font-weight: 500; }
.btn-secondary:hover { background: transparent; border-color: rgba(56, 201, 141, .3); color: var(--text-strong); }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.error { color: var(--red-soft); font-size: 12px; margin-top: 6px; }
.alert { padding: 12px 15px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.alert-success { color: var(--success-text); border-color: rgba(56, 201, 141, .25); background: rgba(56, 201, 141, .05); }
.alert-error { color: var(--danger-text); border-color: rgba(239, 107, 105, .25); background: rgba(239, 107, 105, .05); }
.pagination ul { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px 0 0; }
.pagination li a, .pagination li span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-3); font-size: 13px; }
.pagination li.disabled span { color: var(--placeholder); }

/* Guest (login) */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at top, var(--guest-glow) 0%, var(--bg) 60%); }
.guest-box { width: 100%; max-width: 390px; }
.guest-box .brand-wrap { text-align: center; margin-bottom: 28px; }
.guest-box .brand { font-size: 40px; }
.guest-box .card { padding: 30px; border-top: 2px solid var(--green); }
.guest-box .field { margin-bottom: 18px; }
.guest-box .btn { width: 100%; min-height: 48px; }
.guest-box .links { margin-top: 18px; text-align: center; font-size: 13px; }

@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 14px; }
    .sidebar .brand-wrap { padding-bottom: 14px; margin-bottom: 10px; }
    .sidebar nav { grid-template-columns: repeat(2, 1fr); }
    .sidebar .nav-section { display: none; }
    .sidebar .nav-group { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); }
    .main { padding: 22px 14px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    h1 { font-size: 24px; }
    dl.details { grid-template-columns: 1fr; }
    dl.details dt { border-bottom: 0; padding-bottom: 0; }
}

/* People by project (dashboard) */
.people { padding: 6px 22px; }
.people-row { display: grid; grid-template-columns: minmax(240px, 1.2fr) 90px 2fr; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.people-row:last-child { border-bottom: 0; }
.people-project { display: flex; gap: 14px; align-items: center; }
.people-project b, .worker-chip b { display: block; font-size: 14px; font-weight: 500; }
.people-project small, .worker-chip small { display: block; color: var(--dim); font-size: 12px; margin-top: 3px; }
.headcount { text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.headcount strong { font-size: 24px; font-weight: 500; }
.headcount span { display: block; font-size: 11px; color: var(--dim); }
.people-workers { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.worker-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid rgba(56, 201, 141, .24); color: var(--green); font-size: 11px; font-weight: 600; flex-shrink: 0; }
@media (max-width: 900px) { .people-row { grid-template-columns: 1fr auto; } .people-workers { grid-column: 1 / -1; } .headcount { border: 0; } }

/* Totals row in tables */
tr.total-row td { border-top: 1px solid var(--line-strong); color: var(--text); font-weight: 600; background: var(--hover); }
table.compact th, table.compact td { padding: 11px 7px; font-size: 12.5px; }
table.compact .cell-sub { max-width: 180px; }
table.compact th { letter-spacing: .04em; font-size: 10px; }

/* Dashboard tabs */
.tabs { display: flex; gap: 6px; margin: -6px 0 20px; padding: 4px; background: var(--panel); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 9px 16px; border-radius: var(--radius-sm); color: var(--nav-text); font-size: 14px; white-space: nowrap; }
.tab:hover { color: var(--text-strong); background: var(--hover); }
.tab.active { background: var(--hover); color: var(--text-strong); box-shadow: inset 0 -2px 0 var(--green); }
.avatar-late { border-color: rgba(240, 164, 76, .55); color: var(--amber); }
.people-row.empty-site { opacity: .55; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.danger-zone { border-color: rgba(239, 107, 105, .25); }
.btn-danger { background: transparent; color: var(--danger-text); border: 1px solid rgba(239, 107, 105, .35); font-weight: 500; }
.btn-danger:hover { background: rgba(239, 107, 105, .08); color: var(--danger-text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Variations: photo thumbnails and inline text buttons */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line, var(--line)); background: var(--panel); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-button { background: none; border: 0; padding: 0; margin-left: 10px; color: var(--red, var(--red)); cursor: pointer; font: inherit; }
.link-button:hover { text-decoration: underline; }

/* Compact inline action forms inside table cells (subcontract stages) */
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; padding: 6px 8px; font-size: 13px; }
.btn-small { padding: 6px 12px; font-size: 13px; }

/* Sidebar groups (Workforce, Fleet, Administration) in a soft rounded box */
.sidebar { overflow-y: auto; }
.sidebar nav { gap: 2px; }
.sidebar .nav-group { display: grid; gap: 1px; margin-top: 10px; padding: 5px; background: var(--nav-group-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.sidebar .nav-group .nav-section { padding: 7px 10px 4px; }
.sidebar .nav-group a { padding: 7px 12px; }
.sidebar nav a.active { font-weight: 600; }

/* Theme switch (Light / Dark / Auto) */
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.sidebar .account .theme-switch button { width: 100%; border: 0; padding: 6px 4px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.sidebar .account .theme-switch button:hover { color: var(--text-strong); }
.sidebar .account .theme-switch button.on { background: var(--panel); color: var(--text-strong); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.account-actions { display: grid; gap: 8px; }

/* Light theme: tables get a soft header band, the sidebar a subtle edge */
:root[data-theme="light"] thead th { background: var(--panel-2); }
:root[data-theme="light"] .sidebar { box-shadow: 1px 0 0 var(--line); }

/* Budget meter (dashboard % spent): green < 80 %, amber 80–100 %, red over budget */
.meter { display: block; width: 72px; height: 5px; margin: 6px 0 0 auto; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.meter-warn i { background: var(--amber); }
.meter-over i { background: var(--red); }
.sidebar .account .account-actions > form:last-child button { width: 100%; }
.package-form { display: flex; margin-top: 6px; }
.package-form select { width: auto; max-width: 190px; padding: 5px 8px; font-size: 12.5px; }
.percent-input { position: relative; display: inline-block; width: 120px; }
.percent-input input { padding-right: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.percent-input span { position: absolute; right: 11px; top: 11px; color: var(--dim); }

/* Dashboard "Needs attention" */
.attention { padding-bottom: 12px; }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.attention-list li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.attention-list li:last-child { border-bottom: 0; }
.attention-list a { color: var(--text-2); }
.attention-list a:hover { color: var(--text-strong); text-decoration: underline; }
.attention-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transform: translateY(-1px); }
.attention-danger .attention-dot { background: var(--red); }
.attention-warning .attention-dot { background: var(--amber); }
.split { display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: minmax(180px, 1fr) 180px 28px; gap: 8px; align-items: center; }
.split-row .link-button { margin: 0; color: var(--muted); }
/* Invoice check: document on the left, form on the right */
.draft-layout { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(520px, 1.15fr); gap: 18px; align-items: start; }
.draft-preview { position: sticky; top: 16px; padding: 8px; height: calc(100vh - 140px); min-height: 520px; }
.draft-preview iframe, .draft-preview img { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); object-fit: contain; background: #fff; }
@media (max-width: 1100px) { .draft-layout { grid-template-columns: 1fr; } .draft-preview { position: static; height: 70vh; } }
.upload-card { padding: 0; }
.upload-drop { display: grid; gap: 4px; padding: 20px 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; text-align: center; }
.upload-drop:hover { border-color: var(--green); }
.upload-drop span { color: var(--muted); font-size: 13px; }
.upload-drop input { justify-self: center; margin-top: 8px; }

/* Project page: big section buttons and collapsible sections */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 22px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { display: grid; gap: 4px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); min-height: 78px; }
.tile:hover { border-color: var(--green); color: var(--text-strong); text-decoration: none; }
.tile b { font-size: 15px; font-weight: 600; }
.tile span { color: var(--muted); font-size: 13px; }
.tile-flag { color: var(--warning-text); font-style: normal; font-weight: 600; }
details.fold { margin: 0 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 18px; }
details.fold[open] { padding-bottom: 18px; }
details.fold > summary.fold-head { list-style: none; cursor: pointer; margin: 0; padding: 16px 0; align-items: center; gap: 14px; }
details.fold > summary.fold-head::-webkit-details-marker { display: none; }
details.fold > summary.fold-head::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 8px; transition: transform .15s; flex-shrink: 0; }
details.fold[open] > summary.fold-head::after { transform: rotate(-135deg); margin-bottom: -4px; }
details.fold > summary.fold-head > div:first-child { flex: 1; }
.fold-meta { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fold-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
details.fold .table-wrap, details.fold .card { box-shadow: none; }
details.fold .section-head { margin-top: 18px; }

/* Confirmation window after saving (partials/saved-dialog) */
.saved-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.saved-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.saved-dialog-head { display: flex; gap: 14px; align-items: flex-start; }
.saved-dialog-head h2 { margin: 0 0 4px; font-size: 18px; color: var(--text-strong); }
.saved-dialog-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.saved-dialog-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(56, 201, 141, .14); color: var(--green); font-weight: 700; }
.saved-dialog-icon.is-neutral { background: var(--panel-2); color: var(--muted); }
.saved-dialog-changes { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 13.5px; }
.saved-dialog-changes th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.saved-dialog-changes td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.saved-dialog-changes td.old { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(239, 107, 105, .6); }
.saved-dialog-changes td.new { color: var(--success-text); font-weight: 600; }
:root[data-theme="light"] .saved-dialog { box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }

/* Site reports: photos */
.report-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.report-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.worker-photo { width: 72px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); float: right; margin-left: 12px; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--amber); color: #1a0f02; font-size: 11px; font-weight: 700; }
