/* giris.mdemirbas.com — one quiet palette, light and dark. Accent only on the action
   a page exists for; colour otherwise only for state (ok, bad, off). */

:root {
  --bg: #f2efe9;
  --surface: #ffffff;
  --surface-2: #f8f6f2;
  --ink: #17191c;
  --ink-2: #44484f;
  --muted: #6d717a;
  --line: #e2ddd4;
  --line-2: #cfc8bc;
  --accent: #1f4fa3;
  --accent-ink: #ffffff;
  --accent-soft: #e6edf9;
  --ok: #1c7a52;
  --ok-soft: #e3f3ea;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --focus: #2f6fe0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 22, 17, 0.06), 0 4px 12px -5px rgba(26, 22, 17, 0.14);
  --bar-h: 56px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #181b21;
    --surface-2: #1f232a;
    --ink: #eceef2;
    --ink-2: #c3c7cf;
    --muted: #9298a3;
    --line: #2b3038;
    --line-2: #3a404a;
    --accent: #8fb3ff;
    --accent-ink: #0d1424;
    --accent-soft: #1d2a45;
    --ok: #6fd3a3;
    --ok-soft: #173327;
    --bad: #ff8f86;
    --bad-soft: #3a1d1b;
    --focus: #8fb3ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px -5px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; color: var(--ink-2); }
p { margin: 0 0 0.75rem; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── controls ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 44px; padding: 0 1.1rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-google { width: 100%; background: var(--surface); }
.g-mark { width: 18px; height: 18px; flex: none; }

.field {
  width: 100%; min-height: 44px; padding: 0.55rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit;
}
.field:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.field-sm { min-height: 36px; padding: 0.3rem 0.5rem; width: auto; }
.field-num { width: 7rem; }
.field.code { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.field-label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.stack { display: grid; gap: 0.9rem; }
select.field { appearance: auto; }

.alert, .notice { padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.95rem; }
.alert { background: var(--bad-soft); color: var(--bad); }
.notice { background: var(--ok-soft); color: var(--ok); }

/* ── the gate: sign-in pages ──────────────────────────────────────── */
.gate { min-height: 100vh; display: grid; place-content: center; padding: 2rem 1rem; gap: 1rem; }
.gate .brand { text-align: center; font-weight: 700; letter-spacing: 0.01em; color: var(--ink-2); margin: 0; }
.gate .card { width: min(420px, calc(100vw - 2rem)); }
.lead { color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.aside { margin-top: 1rem; font-size: 0.95rem; }
.dev { display: block; margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }
.langs { display: flex; justify-content: center; gap: 1rem; font-size: 0.9rem; }
.langs a { color: var(--muted); }
.langs a[aria-current] { color: var(--ink); font-weight: 600; }

/* Cards are separated by surface and a tight shadow; tables by a hairline frame. Never both. */
.card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }

/* ── the bar and pages ────────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 10; height: var(--bar-h);
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .brand { font-weight: 700; color: var(--ink); }
.bar-nav { display: flex; gap: 0.25rem; }
.bar-nav a { padding: 0.4rem 0.7rem; border-radius: 8px; color: var(--ink-2); }
.bar-nav a[aria-current] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.bar .who { margin-left: auto; color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
form.inline { margin: 0; }

.page { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.25rem 6rem; }
.empty { color: var(--muted); padding: 2rem 0; }
.crumbs { margin: 0 0 0.4rem; font-size: 0.92rem; }

/* the launcher */
.app-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.app-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 0.9rem; row-gap: 0.15rem;
  padding: 1.1rem 1.2rem; height: 100%;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink);
  outline: 2px solid transparent; transition: outline-color 0.16s, transform 0.16s;
}
.app-card:hover { text-decoration: none; outline-color: var(--accent); transform: translateY(-1px); }
.app-card:active { transform: scale(0.98); }
.app-mark {
  grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.2rem;
}
.app-name { font-weight: 700; font-size: 1.05rem; }
.app-desc { color: var(--ink-2); font-size: 0.92rem; }
.app-host { color: var(--muted); font-size: 0.82rem; }

/* ── admin ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.6rem 0.9rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.toolbar {
  position: sticky; top: var(--bar-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; margin-bottom: 0.5rem; background: var(--bg);
}
.toolbar .filter { max-width: 320px; }
.toolbar p { margin: 0; font-size: 0.9rem; }
details.add { position: relative; }
details.add > summary { list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > .card, details.add[open] > form { position: absolute; z-index: 20; top: calc(100% + 0.5rem); left: 0; width: min(420px, calc(100vw - 2.5rem)); }
.grants { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; display: grid; gap: 0.5rem; }
.grants legend { font-weight: 600; font-size: 0.92rem; color: var(--ink-2); padding: 0 0.3rem; }
.grant-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.table-frame { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tr.off { opacity: 0.55; }
.table tr.bad td:nth-child(2) { color: var(--bad); }
.person { display: grid; color: var(--ink); }
.person:hover { text-decoration: none; }
.person:hover strong { text-decoration: underline; }
.person .muted { font-size: 0.85rem; }
.matrix td { text-align: center; }
.matrix select.dirty { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.savebar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
}

.chip { display: inline-block; padding: 0.15rem 0.6rem; margin: 0.1rem 0.25rem 0.1rem 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-2); }
.chip-strong { border-color: var(--accent); color: var(--accent); }
button.chip { cursor: pointer; font: inherit; font-size: 0.88rem; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 6px; font-size: 0.78rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge-off { background: var(--surface-2); color: var(--muted); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 1rem; }
.wide-card { margin-top: 0.5rem; }
.sessions { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.5rem; font-size: 0.92rem; }
.sessions .ua { display: block; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.snippet { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; overflow-x: auto; font-size: 0.82rem; }

@media (max-width: 640px) {
  .bar { gap: 0.4rem; padding: 0 0.6rem; }
  .bar .who, .bar .brand, .hide-sm { display: none; }
  .bar form.inline { margin-left: auto; }
  .page { padding: 1.25rem 0.9rem 6rem; }
  .card { padding: 1.15rem; }
  .table th, .table td { padding: 0.6rem 0.65rem; }
  details.add[open] > .card, details.add[open] > form { position: fixed; left: 0.75rem; right: 0.75rem; top: calc(var(--bar-h) + 4rem); width: auto; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
