* { box-sizing: border-box; }

body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f2f3f5;
    color: #1c1c1e;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

header.topbar {
    background: #2d6a4f;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.topbar a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

header.topbar .title {
    font-weight: 600;
    font-size: 16px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.menu-list li {
    margin-bottom: 10px;
}

.menu-list a, .btn {
    display: block;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: #1c1c1e;
    font-size: 16px;
    text-align: center;
}

.menu-list a:active, .btn:active {
    background: #e8eef0;
}

.btn-primary {
    background: #2d6a4f;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 100%;
}

pre.report {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.5;
}

input[type=text], input[type=number], input[type=password], textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
}

textarea {
    min-height: 120px;
    font-family: inherit;
}

.flash {
    background: #fde2e1;
    color: #842029;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.flash-ok {
    background: #d1f0db;
    color: #18794e;
}

.pin-input {
    font-size: 28px;
    text-align: center;
    letter-spacing: 8px;
}

.task-card {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.task-card .meta {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

form.inline {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

form.inline input[type=number] {
    margin-bottom: 0;
}

.badge {
    display: inline-block;
    background: #e8eef0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 6px;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 100%;
}

/* PPEF visual language: graphite panels, blue actions and spacious cards. */
:root { color-scheme: dark; --bg:#0f1115; --panel:#1b1e26; --line:#303746; --text:#e6e6e6; --muted:#aab4c5; --accent:#4f8cff; }
body { background:var(--bg); color:var(--text); line-height:1.5; }
.container { max-width:1120px; padding:24px clamp(16px,3vw,36px) 64px; }
header.topbar { background:#171a21; border-bottom:1px solid var(--line); padding:12px clamp(16px,3vw,36px); gap:18px; flex-wrap:wrap; }
header.topbar a { color:var(--text); }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; font-size:18px!important; letter-spacing:.02em; white-space:nowrap; }
.brand small { display:block; color:var(--muted); font-size:10px; letter-spacing:.14em; }
.brand-mark { display:grid; place-items:center; background:var(--accent); color:#fff; width:40px; height:40px; border-radius:10px; }
.top-links { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-right:auto; }
.top-links a { padding:8px 10px; border-radius:8px; }
.top-links a:hover { background:#292e39; }
header.topbar .title { color:var(--muted); font-size:14px; }
.logout { white-space:nowrap; }
h1,h2,h3 { line-height:1.2; } h1 { font-size:clamp(27px,3vw,38px); margin:6px 0 8px; } h2 { font-size:22px; margin-top:34px; }
.eyebrow { color:var(--accent); font-size:12px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.muted,.page-heading p { color:var(--muted); }
.page-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px; margin-bottom:22px; }
.page-heading p { margin:0; }
.menu-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:12px; }
.menu-list li { margin:0; }
.menu-list a,.task-card,.stock-card,.login-card,.manual-report { background:var(--panel); border:1px solid var(--line); color:var(--text); border-radius:14px; }
.menu-list a { text-align:left; height:100%; min-height:66px; display:flex; align-items:center; font-weight:600; }
.menu-list a:hover,.menu-list a:focus-visible { border-color:var(--accent); background:#242b39; }
.task-card { padding:18px; margin-bottom:12px; }
.task-card.done { opacity:.77; }
.task-card .meta { color:var(--muted); }
.btn { display:inline-block; width:auto; border-color:var(--line); background:#282d38; color:var(--text); cursor:pointer; font-weight:600; }
.btn-primary { background:var(--accent); color:#fff; border:0; width:auto; }
.btn-secondary { background:#3b4352; width:auto; }
.btn:hover { filter:brightness(1.15); }
input[type=text],input[type=number],input[type=password],textarea,select { background:#11141a; color:#fff; border:1px solid #414958; }
input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
label { display:block; margin:10px 0 5px; color:var(--muted); font-size:14px; }
pre.report { background:#11141a; border-color:var(--line); color:var(--text); overflow-wrap:anywhere; }
.flash { background:#3b1e1e; color:#ffd8d8; border:1px solid #994e4e; }
.flash-ok { background:#183b2c; border-color:#388762; color:#d1f0db; }
.badge { background:#253755; color:#d1e1ff; }
.production-grid,.stock-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr)); gap:14px; }
.production-card { margin:0; } .production-card h3 { margin:8px 0 4px; font-size:18px; }
.progress-figures { display:flex; align-items:baseline; gap:10px; margin:12px 0 6px; flex-wrap:wrap; }
.progress-figures strong { font-size:26px; } .progress-figures span { color:var(--muted); }
progress { width:100%; height:9px; accent-color:var(--accent); }
.text-link { color:#8db6ff; text-decoration:none; font-weight:600; }
.text-link:hover { text-decoration:underline; }
.stock-card { padding:18px; } .stock-card > div { display:flex; justify-content:space-between; align-items:start; gap:12px; }
.stock-quantity { white-space:nowrap; font-size:22px; font-weight:700; } .stock-quantity small { font-size:13px; color:var(--muted); }
.deficit { color:#ff9b8d; }
details summary { cursor:pointer; color:#8db6ff; padding:12px 0 0; font-weight:600; }
.manual-report { margin-top:24px; padding:16px 20px; } .manual-report summary { padding:0; }
.history-row { margin-top:12px; } .history-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.history-head span { color:var(--muted); }
.history-pages { display:flex; justify-content:space-between; gap:20px; margin:24px 0; }
.login-head { text-align:center; margin:44px auto 24px; } .login-head p { color:var(--muted); }
.login-card { max-width:440px; margin:auto; padding:26px; } .login-card .btn { width:100%; }
@media(max-width:680px) { header.topbar { gap:8px; } .top-links { order:3; width:100%; justify-content:space-between; } header.topbar .title { margin-left:auto; } .container { padding-top:20px; } }

.task-card.done {
    opacity: 0.6;
}

/* Employee navigation keeps the primary actions reachable with one thumb. */
.worker-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:12px; margin:18px 0; }
.worker-actions a,.worker-row { display:flex; justify-content:space-between; gap:12px; color:var(--text); text-decoration:none; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:18px; }
.worker-actions a { flex-direction:column; min-height:96px; }
.worker-actions strong,.worker-row strong { display:block; font-size:17px; }
.worker-actions span,.worker-row small { display:block; color:var(--muted); margin-top:4px; }
.worker-list { display:grid; gap:10px; }
.worker-row { align-items:center; min-height:70px; }
.worker-row > span:last-child { flex:none; white-space:nowrap; font-weight:700; }
.worker-actions a:hover,.worker-row:hover { border-color:var(--accent); }
.worker-more { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:8px 18px 18px; margin:20px 0; }
.worker-more summary { padding:10px 0; }
.worker-more > a { display:block; padding:12px 0; color:var(--text); }
.worker-photo { display:block; width:100%; max-height:380px; object-fit:contain; background:#fff; border-radius:14px; margin:20px 0; }
.worker-tabbar,.manager-tabbar { display:none; }
@media(max-width:680px) {
  body:has(.manager-tabbar) { padding-bottom:calc(76px + env(safe-area-inset-bottom)); }
  .manager-tabbar { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;position:fixed;bottom:0;left:0;right:0;z-index:20;background:#171a21;border-top:1px solid var(--line);padding:7px 5px calc(7px + env(safe-area-inset-bottom)); }
  .manager-tabbar a { display:grid;place-items:center;min-height:48px;padding:3px 1px;color:var(--muted);font-size:11px;text-decoration:none;border-radius:9px;text-align:center; }
  .manager-tabbar a[aria-current="page"] { background:#253755;color:#fff;font-weight:700; }
}
@media(max-width:680px) {
  .container { padding-bottom:calc(105px + env(safe-area-inset-bottom)); }
  header.topbar .top-links,header.topbar .title { display:none; }
  header.topbar .logout { margin-left:auto; }
  .worker-tabbar { display:grid; grid-template-columns:repeat(4,1fr); position:fixed; bottom:0; left:0; right:0; z-index:20; background:#171a21; border-top:1px solid var(--line); padding:8px 5px calc(8px + env(safe-area-inset-bottom)); }
  .worker-tabbar a { display:grid; place-items:center; min-height:48px; color:var(--muted); font-size:13px; text-decoration:none; border-radius:9px; }
  .worker-tabbar a[aria-current="page"] { background:#253755; color:#fff; font-weight:700; }
  .worker-row { padding:14px; }
  .worker-row > span:first-child { min-width:0; overflow-wrap:anywhere; }
  .worker-actions { grid-template-columns:1fr; }
}


/* Shared project-analysis photos: private, bounded, no catalog guesses. */
.analysis-photo{display:block;min-width:0;max-width:520px;margin:0 0 16px;overflow-wrap:anywhere}
.analysis-photo a{display:block;color:inherit}
.analysis-photo img{display:block;width:100%;max-height:360px;object-fit:contain;background:#fff;border-radius:10px}
.analysis-photo img[hidden],.analysis-photo [hidden]{display:none}
.analysis-photo small{display:block;margin-top:5px;color:#aeb9c4}
.analysis-photo-empty,.analysis-photo-failed{display:grid;place-items:center;min-height:100px;padding:14px;background:#202733;border-radius:10px;color:#cbd5e1;text-align:center}
.analysis-photo-small{width:110px;flex:0 0 110px;margin-bottom:0}
.analysis-photo-small img{height:96px}
.analysis-photo-small .analysis-photo-empty,.analysis-photo-small .analysis-photo-failed{min-height:96px;font-size:12px;padding:8px}
.analysis-photo-small small{font-size:11px}
.analysis-photo-retry{margin-top:8px;min-height:44px}
.project-preview-strip{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.project-preview-strip .analysis-photo-small{width:72px;flex-basis:72px}
.project-preview-strip img{height:64px}
.project-preview-strip .analysis-photo-empty,.project-preview-strip .analysis-photo-failed{min-height:64px}
.project-with-photos{flex-wrap:wrap;justify-content:flex-start;gap:14px}
.project-with-photos>span:nth-child(2){flex:1 1 200px;min-width:0}
.project-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-bottom:18px}
.project-filters label{flex:1 1 180px;min-width:0}
.project-filters input,.project-filters select{width:100%;box-sizing:border-box}
.pour-photo-layout{display:grid;grid-template-columns:110px minmax(0,1fr);gap:14px;align-items:start}
.worker-row>span{min-width:0;overflow-wrap:anywhere}
@media(max-width:430px){.pour-photo-layout{grid-template-columns:1fr}.pour-photo-layout>.analysis-photo-small{width:100%;max-width:240px}.pour-photo-layout .analysis-photo-small img{height:160px}.project-with-photos>.project-preview-strip{flex-basis:100%}.worker-row .analysis-photo-small{width:88px;flex-basis:88px}}

.crm-language {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: .85rem;
}

.crm-language a,
.crm-language [aria-current] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  white-space: nowrap;
}

.crm-language [aria-current] {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}

.crm-language-login {
  display: flex;
  justify-content: flex-end;
  padding: 16px clamp(16px, 3vw, 36px) 0;
}
