:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --primary: #1f5fae; --red: #d93a32; --green: #1f8a4c; --amber: #b86a0b; --brand: #f8433d;
  --radius: 12px; --tabs-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1b2027; --text: #e8ebf0; --muted: #98a1b2; --line: #2b323c; --primary: #5b9be6; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 21px; margin: 0; }
h2.sec { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 4px 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.neg { color: var(--red); } .pos { color: var(--green); } .warn { color: var(--amber); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #1d2330; color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.brand img { width: 26px; height: 24px; }
.me .link { color: #cfd5df; font-size: 13px; }
main { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; color: inherit; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; }
.back { display: inline-block; margin: 2px 0 10px; font-size: 14px; }

button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 14px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--primary); }
input, select, textarea { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--card); color: var(--text); min-height: 44px; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form h1 { margin-bottom: 14px; }

/* giriş */
.login { text-align: center; padding: 26px 18px; margin-top: 20px; }
.login p { margin: 8px 0 14px; }
.tag-draft { display: inline-block; background: #fff4e0; color: #8a5600; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.user-pick { display: grid; gap: 8px; margin: 6px 0 16px; text-align: left; }
.user-pick button { justify-content: space-between; width: 100%; }
.user-pick span { color: var(--muted); font-size: 13px; }

/* puantaj */
.clock { text-align: center; padding: 22px 16px; }
.clock.working { border-color: #9fd4b4; background: linear-gradient(180deg, #ecf8f1, var(--card) 70%); }
@media (prefers-color-scheme: dark) { .clock.working { background: linear-gradient(180deg, #16301f, var(--card) 70%); border-color: #2d5a3d; } }
.clock-state { color: var(--muted); }
.clock-time { font-size: 40px; font-weight: 700; margin: 6px 0 16px; font-variant-numeric: tabular-nums; }
.big-btn { width: 100%; min-height: 64px; font-size: 20px; font-weight: 700; border: none; border-radius: 14px; color: #fff; margin-bottom: 10px; }
#note-toggle { padding: 6px 4px; }
.clock-sub { margin: -14px 0 12px; }
.site-pick { text-align: left; margin-bottom: 12px; }
.site-pick select { font-size: 16px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: #e6effa; color: #1f5fae; }

.row .site { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #e6effa; color: #1f5fae; white-space: nowrap; align-self: center; }
.row .grow-r { flex: 1; text-align: right; }
.chip.office, .row .site.office { background: #eef0f4; color: #4b5363; }
.mini { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.big-btn.start { background: var(--green); }
.big-btn.stop { background: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 17px; }
.day-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.row.click, .click { cursor: pointer; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 3px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* görevler */
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; flex: 1; min-width: 140px; }
.filters .month { flex: 1; text-align: center; text-transform: capitalize; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: none; border-radius: 0; min-height: 40px; padding: 8px 14px; background: none; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: #fff; }
.seg.wide { display: flex; margin: 14px 0 4px; }
.seg.wide button { flex: 1; font-size: 14px; padding: 8px 6px; }
.seg button.on.s-bekliyor { background: #6b7385; } .seg button.on.s-devam { background: var(--primary); } .seg button.on.s-tamamlandi { background: var(--green); }
.task { border-left: 4px solid var(--line); }
.task.st-devam { border-left-color: var(--primary); } .task.st-tamamlandi { border-left-color: var(--green); opacity: .8; } .task.late { border-left-color: var(--red); }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.task-meta .who { color: var(--text); font-weight: 600; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef0f4; color: #4b5363; white-space: nowrap; }
.pill.hi { background: #fde8e7; color: var(--red); }
.pill.s-bekliyor { background: #eef0f4; color: #4b5363; } .pill.s-devam { background: #e6effa; color: #1f5fae; } .pill.s-tamamlandi { background: #e5f5ec; color: var(--green); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.desc { white-space: pre-wrap; margin: 12px 0 0; }
.row-actions { display: flex; gap: 8px; margin-top: 12px; }
.note-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-actions .btn-primary { margin-left: auto; }
.note img { display: block; max-width: 100%; border-radius: 8px; margin-top: 8px; }

/* yönetici */
.person { display: flex; align-items: center; gap: 12px; }
.person.passive { opacity: .55; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e6effa; color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.grow { flex: 1; min-width: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; padding: 4px 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
tr.click:active { background: var(--bg); }

/* alt sekme çubuğu */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabs-h); color: var(--muted); font-size: 12px; }
.tabs a i { font-style: normal; font-size: 19px; line-height: 1; }
.tabs a.on { color: var(--primary); font-weight: 600; }

/* modal ve bildirim */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 24, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 30;
  background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.filters .seg.wide { flex: 1; margin: 0; }
.day-head { gap: 10px; }
.day-head > :last-child { white-space: nowrap; }

.login-logo { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.login-err { background: #fde8e7; color: var(--red); border-radius: 8px; padding: 8px 10px; font-size: 14px; }

.quick { text-align: center; padding: 28px 18px; margin-top: 24px; }
.quick-icon { font-size: 52px; line-height: 1; margin-bottom: 8px; }
.quick h1 { font-size: 24px; }
.quick .btn { margin-top: 16px; }

.quick-pick { padding: 20px 16px; margin-top: 12px; text-align: center; }
.quick-pick h1 { font-size: 22px; }
.quick-pick p { margin: 6px 0 14px; }
.site-btn { width: 100%; min-height: 60px; margin-bottom: 10px; font-size: 18px; font-weight: 600; justify-content: space-between; text-align: left; border-radius: 12px; }
.site-btn small { font-size: 12px; font-weight: 500; color: var(--muted); }
.site-btn.last { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.site-btn:active { background: var(--bg); }

.push-banner { border-color: #c9dbf3; background: #f3f8fe; }
.push-banner .btn { margin-top: 10px; }
@media (prefers-color-scheme: dark) { .push-banner { background: #18222f; border-color: #2c4260; } }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.day-opt { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 14px; }
.day-opt input { width: auto; min-height: 0; margin: 0; }

.row.entry { align-items: center; color: inherit; }
.e-ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.photo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 14px; }
.photo-pick img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.tip-inline { background: #fff8e8; color: #6b4d00; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.tabs a i { font-size: 18px; }
.e-st { margin-top: 4px; }
