:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --border: #e3e5e3;
  --text: #1a1c1a;
  --muted: #6b6f6b;
  --accent: #2f7d5a;
  --accent-soft: #eaf4ef;
  --ok: #2f7d5a;
  --warn: #b07d18;
  --err: #c0392b;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191a;
    --surface: #1f2223;
    --border: #323638;
    --text: #e8eae9;
    --muted: #9aa09d;
    --accent: #4fb388;
    --accent-soft: #1d2f27;
    --ok: #4fb388;
    --warn: #d9a441;
    --err: #e0705f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card + .card { margin-top: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-head h2 { font-size: 14px; margin: 0; font-weight: 600; }
.card-body { padding: 18px; }
button {
  font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .12s, border-color .12s;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.link { border: none; background: none; color: var(--muted); padding: 4px 6px; text-decoration: underline; }
button.link:hover { color: var(--text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; padding: 11px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.info-icon { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 6px; border: 1px solid currentColor; border-radius: 50%; font: italic 700 9px/1 Georgia, serif; text-transform: none; letter-spacing: 0; cursor: help; vertical-align: 1px; opacity: .75; }
.info-icon:hover, .info-icon:focus { opacity: 1; color: var(--text); outline: none; }
.info-icon:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
#tip { position: fixed; z-index: 1000; display: none; max-width: min(300px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 7px; background: var(--text); color: var(--surface); font-size: 12.5px; line-height: 1.45; font-weight: 400; text-transform: none; letter-spacing: 0; box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
.name { font-weight: 600; }
.url { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.s-ok   { background: var(--ok); }
.s-warn { background: var(--warn); }
.s-err  { background: var(--err); }
.s-none { background: var(--muted); }
.status-text { font-size: 13px; }
.when { color: var(--muted); font-size: 12px; }
  td.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions a.btn { display: inline-flex; }
button.sm { font-size: 12px; padding: 5px 10px; border-radius: 6px; min-width: 64px; white-space: nowrap; }
button.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
button.danger:hover:not(:disabled) { background: var(--err); border-color: var(--err); color: #fff; }

/* --- onay penceresi */
dialog {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; max-width: 420px; width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog h3 { margin: 0 0 10px; font-size: 16px; }
dialog p { margin: 0 0 8px; font-size: 14px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
form.add { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
form .full { grid-column: 1 / -1; }
input, textarea, select {
  font: inherit; font-size: 13px; width: 100%; padding: 8px 10px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg { font-size: 13px; padding: 9px 12px; border-radius: 7px; margin-top: 12px; display: none; }
.msg.show { display: block; }
.msg.ok { background: var(--accent-soft); color: var(--ok); }
.msg.err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
details.setup { margin-top: 20px; }
details.setup summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; }
pre {
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  padding: 14px; overflow-x: auto; font-size: 12px; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 10px 0 0;
}
.empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.hist { margin-top: 10px; font-size: 12px; }
.hist div { padding: 5px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; }
.hist div:last-child { border-bottom: none; }
.hist .h-when { color: var(--muted); min-width: 130px; }
@media (max-width: 720px) {
  form.add { grid-template-columns: 1fr; }
  .wrap { padding-top: 20px; }
}

/* --- ust menu */
nav.top { display: flex; gap: 14px; margin: 0 0 20px; font-size: 13px; }
nav.top a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
nav.top a.active { color: var(--text); border-bottom-color: var(--accent); }
a.btn { display: inline-block; text-decoration: none; }
nav.top .auth-links { margin-left: auto; }
button.logout { display: inline-flex; align-items: center; gap: 6px; color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
button.logout:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 12%, transparent); border-color: var(--err); }
.login-wrap { max-width: 420px; }
form.login { display: grid; gap: 12px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; }
.pass-wrap button.eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; padding: 5px; border: none; background: none; color: var(--muted); }
.pass-wrap button.eye:hover { color: var(--text); }

/* --- ozet sayaclari */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 2px; }
.stat .v.small { font-size: 14px; }
.stat .d { font-size: 12px; color: var(--muted); }

/* --- gun secici */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { min-width: 44px; padding: 6px 10px; white-space: nowrap; }
/* "Her gun / Hicbiri" gun degil; gunlerden biraz ayrilir. */
.days button[data-day="all"] { margin-left: 8px; color: var(--muted); }
.days button[data-day="all"]:hover { color: var(--text); }
.days button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- form ipuclari ve secenekler */
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hint.warn { color: var(--warn); }
.hint.info { color: var(--accent); }
.radios { display: flex; gap: 14px; font-size: 13px; }
.radios label { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--text); }
input[type="time"], select { width: auto; }
input[type="checkbox"], input[type="radio"] { width: auto; }
input[readonly] { opacity: .6; }
.secret { display: flex; gap: 8px; align-items: stretch; }
.secret input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.secret button { flex: none; }
.empty a { color: var(--accent); }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
