:root {
  --bg: #f5f7f9; --panel: #fff; --text: #1f2933; --muted: #6b7a88; --line: #e1e6eb;
  --green: #14a800; --green-soft: #e3f6df; --yellow: #f2c94c; --red: #d64545; --blue: #1f6feb;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--blue); }
.hidden { display: none !important; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 16px; }
.logo { color: var(--green); }
nav a { margin-right: 16px; color: var(--muted); text-decoration: none; font-weight: 500; padding: 18px 0; display: inline-block; border-bottom: 2px solid transparent; }
nav a.active { color: var(--text); border-bottom-color: var(--green); }
.user { margin-left: auto; color: var(--muted); display: flex; gap: 12px; align-items: center; }
main { max-width: 1200px; margin: 24px auto; padding: 0 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button, .btn { background: var(--green); color: #fff; border: 0; border-radius: 20px; padding: 8px 16px; font-weight: 600; cursor: pointer; font-size: 13px; }
button.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--red); }
button.link { background: none; color: var(--blue); padding: 0; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; min-width: 120px; }
textarea { width: 100%; min-height: 70px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { display: flex; flex-direction: column; }
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef1f4; color: var(--muted); }
.pill.green { background: var(--green-soft); color: #0e7a00; }
.pill.yellow { background: #fdf3d0; color: #8a6d00; }
.pill.red { background: #fde3e3; color: #a82020; }
.stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat b { font-size: 18px; display: block; }
.legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* Work diary */
.diary { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.hour-row { display: grid; grid-template-columns: 56px 1fr; border-bottom: 1px solid var(--line); }
.hour-row:last-child { border-bottom: 0; }
.hour-label { padding: 10px 6px; text-align: center; color: var(--muted); font-weight: 600; background: #fafbfc; border-right: 1px solid var(--line); }
.hour-body { padding: 8px; }
.hour-bar { height: 10px; display: grid; gap: 2px; margin-bottom: 6px; }
.hour-bar span { background: #eef1f4; border-radius: 2px; }
.hour-bar span.tracked { background: var(--green); }
.hour-bar span.manual { background: var(--yellow); }
.hour-bar span.deleted { background: #f5c6c6; }
.cells { display: grid; gap: 6px; }
.cell { border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; min-height: 118px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.cell.empty { cursor: default; background: #fff; border-style: dashed; }
.cell.deleted { opacity: .6; }
.cell img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #ddd; display: block; }
.cell .noshot { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; background: #eef1f4; text-align: center; padding: 4px; }
.cell .meta { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 11px; color: var(--muted); }
.cell .memo { padding: 0 6px 6px; font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: inline-flex; gap: 1px; }
.bars i { width: 4px; height: 10px; background: #dfe4e8; display: inline-block; border-radius: 1px; }
.bars i.on { background: var(--green); }
.bars i.low { background: var(--yellow); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal .box { background: #fff; border-radius: var(--radius); max-width: 980px; width: 100%; max-height: 95vh; overflow: auto; padding: 20px; }
.modal img.full { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #ddd; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; padding: 10px 18px; border-radius: 20px; z-index: 60; }
.toast.error { background: var(--red); }
.login { max-width: 380px; margin: 60px auto; }
.login .field { margin-bottom: 12px; }
.login input { width: 100%; }
pre.notice { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); padding: 14px; border-radius: 6px; font: inherit; }
.week { display: grid; grid-template-columns: 180px repeat(7, 1fr) 90px; }
.week > div { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.week .head { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.week .total { font-weight: 700; }
.banner { background: #fdf3d0; border: 1px solid #f2c94c; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.banner.green { background: var(--green-soft); border-color: #a9e39f; }
@media (max-width: 800px) { .hour-row { grid-template-columns: 40px 1fr; } .week { grid-template-columns: 120px repeat(7, 1fr) 70px; font-size: 12px; } nav a { margin-right: 10px; } }
