:root {
  color-scheme: light;
  --ink: #19241f;
  --muted: #66726c;
  --paper: #f4f3ed;
  --panel: #fffefa;
  --line: #dedfd7;
  --green: #155f4c;
  --green-soft: #dceae2;
  --orange: #e56934;
  --shadow: 0 20px 60px rgba(30, 45, 38, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: "Yu Gothic UI", "Hiragino Sans", sans-serif; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: radial-gradient(circle at 80% 10%, #f4b28a 0, transparent 28%), linear-gradient(135deg, #163f35, #0d2a25 55%, #102f27); }
.login-card { width: min(520px, 100%); padding: 48px; border-radius: 28px; background: rgba(255, 254, 250, 0.97); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28); }
.login-card h1 { margin: 8px 0 16px; font-size: clamp(32px, 6vw, 48px); line-height: 1.2; letter-spacing: -0.04em; }
.lead { color: var(--muted); line-height: 1.8; }
.eyebrow { margin: 0; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: 0.17em; }
form label { display: grid; gap: 7px; margin: 18px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(21, 95, 76, 0.12); }
button { border: 0; border-radius: 12px; padding: 13px 18px; background: var(--green); color: white; font-weight: 800; }
button:hover { filter: brightness(1.06); }
button:disabled { cursor: wait; opacity: 0.6; }
.login-card form > button { width: 100%; margin-top: 8px; }
.form-error { min-height: 22px; margin-bottom: 0; color: #b63131; font-weight: 700; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px; background: #123b31; color: white; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 34px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--orange); font-family: Georgia, serif; font-size: 22px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }.brand small { margin-top: 3px; color: #a9c5bc; font-size: 11px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { padding: 13px 16px; text-align: left; background: transparent; color: #b9d1c9; }
.nav-item.active { background: rgba(255,255,255,.11); color: white; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-footer span { display: block; overflow: hidden; color: #b9d1c9; font-size: 12px; text-overflow: ellipsis; }
.text-button { margin-top: 8px; padding: 6px 0; background: transparent; color: white; font-size: 12px; }

.content { min-width: 0; padding: 38px clamp(24px, 5vw, 72px) 64px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 5px 0 0; font-size: 34px; letter-spacing: -.04em; }
.date-control { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.date-control input { width: 170px; background: var(--panel); }
.global-message { min-height: 24px; margin-top: -16px; color: var(--green); font-size: 13px; font-weight: 700; }
.global-message[data-kind="error"] { color: #b63131; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.metric-card { min-height: 160px; padding: 24px; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 13px; font-weight: 800; }.metric-card strong { display: block; margin: 20px 0 8px; font-size: 32px; }.metric-card small { font-size: 11px; }
.metric-card.accent { background: var(--green); color: white; }.metric-card.accent span, .metric-card.accent small { color: #c8ddd6; }
.analysis-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; }
.panel-heading, .detail-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel h2, .detail-header h2 { margin: 5px 0 0; }
.bar-list { display: grid; gap: 18px; min-height: 260px; padding-top: 26px; }
.bar-label { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 7px; font-size: 13px; }.bar-label span { color: var(--muted); }
.bar-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8e9e3; }.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #56a584); }
.empty-state { display: grid; place-items: center; min-height: 180px; color: var(--muted); text-align: center; }

.employees-layout { display: grid; grid-template-columns: minmax(330px, .78fr) minmax(420px, 1.35fr); gap: 18px; align-items: start; }
.compact-button { padding: 10px 14px; font-size: 12px; }.secondary { background: #e9ebe6; color: var(--ink); }
.employee-form { margin: 20px 0; padding: 18px; border-radius: 16px; background: #f1f2ed; }.employee-form input, .employee-form select { margin-bottom: 10px; }.form-actions { display: flex; gap: 8px; }
.employee-list { display: grid; gap: 6px; margin-top: 20px; }
.employee-row { display: grid; grid-template-columns: 40px 1fr auto 8px; gap: 11px; align-items: center; width: 100%; padding: 13px; background: transparent; color: var(--ink); text-align: left; }
.employee-row:hover, .employee-row.selected { background: #edf2ed; filter: none; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--green-soft); color: var(--green); }
.employee-copy { min-width: 0; }.employee-copy strong, .employee-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }.employee-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }.device-count { color: var(--muted); font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #36a16d; }.status-dot.disabled { background: #a9aca7; }
.detail-placeholder { min-height: 500px; display: grid; place-content: center; text-align: center; color: var(--muted); }.detail-placeholder h2 { color: var(--ink); }.placeholder-mark { margin: auto; font-size: 36px; color: var(--orange); }
.detail-header { padding-bottom: 20px; border-bottom: 1px solid var(--line); }.detail-header p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.enrollment-result { display: grid; gap: 8px; margin: 18px 0; padding: 18px; border: 1px solid #b8d7c8; border-radius: 15px; background: #edf7f1; }.enrollment-result span, .enrollment-result small { color: var(--muted); font-size: 11px; }.enrollment-result strong { font: 800 24px ui-monospace, monospace; letter-spacing: .1em; }
.timeline-heading { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; }.timeline-heading h3 { margin: 0; }.timeline-heading span { color: var(--muted); font-size: 12px; }
.capture-list { display: grid; gap: 10px; }
.capture-row { display: grid; grid-template-columns: 112px 1fr; gap: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; }
.capture-thumb { display: block; height: 76px; overflow: hidden; border-radius: 10px; background: #e5e6e1; }.capture-thumb img { width: 100%; height: 100%; object-fit: cover; }
.capture-meta { display: flex; flex-wrap: wrap; gap: 6px; }.capture-meta > * { padding: 3px 7px; border-radius: 99px; background: #eef0eb; color: var(--muted); font-size: 10px; }
.capture-copy h4 { margin: 8px 0 5px; font-size: 13px; line-height: 1.5; }.capture-copy p { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; }.sidebar nav { grid-template-columns: 1fr 1fr; }.sidebar-footer { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }.analysis-grid, .employees-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .content { padding: 24px 16px 40px; }.page-header { align-items: stretch; flex-direction: column; }.date-control input { width: 100%; }.metric-grid { grid-template-columns: 1fr; }.login-card { padding: 30px 24px; }.capture-row { grid-template-columns: 84px 1fr; }
}
