/* Staff Task Manager — styles */
:root {
  --brand: #0f9d58;
  --brand-600: #0b8a4c;
  --brand-50: #e8f6ee;
  --ink: #1b2430;
  --ink-2: #4a5565;
  --ink-3: #7b8594;
  --line: #e4e8ee;
  --line-2: #eef1f5;
  --bg: #f5f7fa;
  --card: #ffffff;
  --side: #111827;
  --side-2: #1f2937;
  --red: #d93025;   --red-50: #fdecea;
  --amber: #b45309; --amber-50: #fef3c7;
  --blue: #1a73e8;  --blue-50: #e8f0fe;
  --gray-50: #f1f3f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.18);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Gujarati", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-600); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* boot */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, #0f9d58 0%, #0b7a45 55%, #075c34 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 34px; line-height: 1.15; max-width: 420px; }
.login-art p { opacity: .85; max-width: 420px; line-height: 1.6; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 10px; align-items: center; opacity: .95; }
.login-art li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' stroke='white' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/14px no-repeat; flex: none; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .field { margin-top: 18px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 240px, transparent 240px); }
.side { background: var(--side); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 650; line-height: 1.25; }
.brand .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand small { display: block; color: #94a3b8; font-weight: 500; font-size: 11px; }
.nav { padding: 8px 10px; display: grid; gap: 2px; overflow-y: auto; }
.nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #cbd5e1; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: rgba(15,157,88,.18); color: #fff; }
.nav a.active svg { color: #34d399; opacity: 1; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid #1f2937; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: #94a3b8; }
.icon-btn { background: transparent; border: 0; color: #94a3b8; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--side-2); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 20px 28px 0; flex-wrap: wrap; }
.topbar .title { flex: 1; min-width: 200px; }
.topbar .title p { margin: 4px 0 0; color: var(--ink-3); }
.content { padding: 20px 28px 40px; display: grid; gap: 20px; }
.btn.menu-toggle { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; left: -260px; transition: left .2s; }
  .side.open { left: 0; box-shadow: var(--shadow-lg); }
  .shell { background: none; }
  .btn.menu-toggle { display: inline-grid; }
  table.t td .ttl { min-width: 200px; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h2 { flex: 1; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .grid.cols-2 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .value small { font-size: 14px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.kpi .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.kpi.good .value { color: var(--brand-600); }
.kpi.bad .value { color: var(--red); }
.kpi.warn .value { color: var(--amber); }

.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-label); width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.bar { height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.warn > i { background: #f59e0b; } .bar.bad > i { background: var(--red); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--gray-50); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-50); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; border: 1px solid #d5dbe3; border-radius: 8px; padding: 9px 11px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,157,88,.15); }
textarea.input { resize: vertical; min-height: 70px; }
.input.sm { padding: 6px 9px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--gray-50); padding: 4px; border-radius: 9px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: #fbfcfd; }
table.t tr.done td .ttl { color: var(--ink-3); text-decoration: line-through; }
.ttl { font-weight: 600; }
.desc { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-50); color: var(--ink-2); }
.pill.green { background: var(--brand-50); color: var(--brand-600); }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.amber { background: var(--amber-50); color: var(--amber); }
.pill.blue { background: var(--blue-50); color: var(--blue); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

select.status { appearance: none; border: 0; border-radius: 20px; padding: 4px 26px 4px 11px; font-weight: 600; font-size: 12.5px; cursor: pointer; background-repeat: no-repeat; background-position: right 8px center; background-size: 10px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); }
select.status.pending { background-color: var(--gray-50); color: var(--ink-2); }
select.status.in_progress { background-color: var(--blue-50); color: var(--blue); }
select.status.done { background-color: var(--brand-50); color: var(--brand-600); }
select.status.blocked { background-color: var(--red-50); color: var(--red); }
select.status:disabled { cursor: default; background-image: none; padding-right: 11px; opacity: 1; }

.remark { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 8px; width: 100%; min-width: 160px; font-size: 13px; }
.remark:hover { border-color: var(--line); }
.remark:focus { border-color: var(--brand); background: #fff; outline: none; }
.remark.saving { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' stroke='%23a0aab8' stroke-width='2' fill='none' stroke-dasharray='20 20'/%3E%3C/svg%3E") right 8px center/12px no-repeat; padding-right: 26px; }
.remark.saved { border-color: var(--brand); background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' stroke='%230b8a4c' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 8px center/12px no-repeat; padding-right: 26px; transition: background-color .3s; }
.remark.err { border-color: var(--red); background: var(--red-50); }

/* one-tap tick */
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #c5ccd6; background: #fff; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: all .15s; }
.tick svg { width: 17px; height: 17px; }
.tick:hover:not(:disabled) { border-color: var(--brand); color: #b7e4cb; }
.tick.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tick:disabled { cursor: default; opacity: .55; }
.tick:active:not(:disabled) { transform: scale(.92); }

/* checklist rows */
.time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.cat { font-size: 12px; color: var(--ink-3); }

/* people progress */
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { background: var(--brand-50); color: var(--brand-600); width: 30px; height: 30px; font-size: 12px; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .when { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* work log grid (like the printed daily schedule) */
.wl-head { background: var(--brand); color: #fff; padding: 18px 22px; border-radius: var(--radius) var(--radius) 0 0; display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.wl-head h2 { font-size: 22px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.wl-head .sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.wl-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wl-head .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.wl-head .btn:hover { background: rgba(255,255,255,.25); }
.wl-head .input { background: #fff; color: var(--ink); width: auto; min-width: 170px; }
.wl { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 860px; }
.wl th { padding: 14px 6px 10px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); text-transform: uppercase; border-bottom: 1px solid var(--line); background: #fff; }
.wl th .d { display: block; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; text-transform: none; }
.wl th.today { color: var(--brand-600); }
.wl th.today .d { color: var(--brand-600); }
.wl th .fill { display: block; margin-top: 4px; font-weight: 600; font-size: 11px; text-transform: none; }
.wl td { height: 44px; border-right: 1px solid var(--line); border-bottom: 1px solid #fff; padding: 4px 8px; font-size: 12.5px; vertical-align: top; overflow: hidden; }
.wl tr:nth-child(even) td { background: #f3f4f6; }
.wl tr:nth-child(odd) td { background: #fff; }
.wl td.slot { width: 82px; text-align: right; color: var(--ink-2); font-size: 12px; padding-top: 8px; border-right: 1px solid var(--line); background: #fafafa !important; font-variant-numeric: tabular-nums; }
.wl td.cell { cursor: default; line-height: 1.35; position: relative; }
.wl td.cell.editing.editing { padding: 0; box-shadow: inset 0 0 0 2px var(--brand); background: #fff !important; }
.wl-input { display: block; width: 100%; height: 100%; min-height: 60px; border: 0; resize: none; padding: 5px 8px 16px; font: inherit; font-size: 12.5px; line-height: 1.35; background: transparent; outline: none; }
.wl-status { position: absolute; right: 6px; bottom: 3px; font-size: 10.5px; color: var(--ink-3); pointer-events: none; }
.wl-status.ok { color: var(--brand-600); font-weight: 600; }
.wl-status.err { color: var(--red); font-weight: 600; }
.wl td.cell .note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wl td.cell.miss { background: #fdf0ef !important; }
.wl td.cell.miss .note { color: var(--red); font-style: italic; opacity: .75; }
.wl td.cell.edit { cursor: pointer; }
.wl td.cell.edit:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.wl td.cell.off { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f2f2f2 6px, #f2f2f2 12px) !important; }
.wl td.cell.now { box-shadow: inset 0 0 0 2px #f59e0b; }
.wl td.cell .src { float: right; font-size: 10px; color: var(--ink-3); margin-left: 4px; }
.wl-legend { display: flex; gap: 16px; padding: 12px 18px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; border-top: 1px solid var(--line-2); }
.wl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; border: 1px solid var(--line); }

/* quick-fill chips */
.quick-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #f7fbf9; font-size: 13px; }
.quick-bar b { margin-right: 4px; color: var(--ink-2); }
.chip { border: 1px solid #cfe7da; background: #fff; color: var(--brand-600); border-radius: 20px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.chip:hover { background: var(--brand-50); }
.chip:active { transform: scale(.96); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-h { padding: 18px 22px 0; display: flex; align-items: center; }
.modal-h h2 { flex: 1; font-size: 18px; }
.modal-b { padding: 18px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }

/* toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 80; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 360px; animation: fade .2s; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--brand-600); }

/* PC app page */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; }
.steps b { display: block; margin-bottom: 2px; }
.popup-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 420px; box-shadow: var(--shadow-lg); }
.popup-preview .bar-top { background: var(--brand); color: #fff; padding: 12px 16px; font-weight: 600; }
.popup-preview .body { padding: 14px 16px; display: grid; gap: 10px; background: #fff; }
.popup-preview .row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.popup-preview .fake { border: 1px solid #d5dbe3; border-radius: 6px; height: 30px; }
code, .code { font-family: ui-monospace, Consolas, monospace; background: var(--gray-50); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }

@media print {
  .side, .topbar .actions, .wl-head .tools, #toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
