/* Crossova Yönetim — desktop-first, light / dark, same tokens as crossova.app (mercan = action, turkuaz = connection). */
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-latin.woff2') format('woff2');
  font-weight: 500 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF;
}
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-latin-ext.woff2') format('woff2');
  font-weight: 500 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4;
}

:root {
  --paper: #ffffff; --panel: #f6fafa; --mist: #eaf4f4; --ink: #15212b; --muted: #4b5a66; --line: #d3e0e2;
  --coral: #ff6b47; --coral-ink: #b83a18; --teal: #12a5a8; --teal-ink: #0a6e71; --focus: #0a6e71;
  --ok-bg: #e2f5ef; --ok-ink: #11643f; --warn-bg: #fff2d6; --warn-ink: #7a4d00; --bad-bg: #ffe3dc; --bad-ink: #a12a0c;
  --display: 'Bricolage', ui-rounded, system-ui, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r: 10px; --r-l: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #10181e; --panel: #131e25; --mist: #182630; --ink: #e6edf0; --muted: #9eafb9; --line: #263740;
    --coral: #ff7a57; --coral-ink: #ff9a7a; --teal: #2fc2c4; --teal-ink: #5fd6d8; --focus: #5fd6d8;
    --ok-bg: #12352b; --ok-ink: #7fe0b8; --warn-bg: #3a2c0c; --warn-ink: #ffd27a; --bad-bg: #431a10; --bad-ink: #ffb19c;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #10181e; --panel: #131e25; --mist: #182630; --ink: #e6edf0; --muted: #9eafb9; --line: #263740;
  --coral: #ff7a57; --coral-ink: #ff9a7a; --teal: #2fc2c4; --teal-ink: #5fd6d8; --focus: #5fd6d8;
  --ok-bg: #12352b; --ok-ink: #7fe0b8; --warn-bg: #3a2c0c; --warn-ink: #ffd27a; --bad-bg: #431a10; --bad-ink: #ffb19c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 0.9375rem/1.5 var(--text); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin-top: 1.25rem; }
a { color: var(--teal-ink); }
code, kbd { font-family: var(--mono); font-size: 0.85em; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.35em; background: var(--panel); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.pad { padding: 1rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.danger-text { color: var(--bad-ink); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 50; background: var(--ink); color: var(--paper); padding: 0.5rem 0.8rem; border-radius: var(--r); }
.skip:focus { left: 0.5rem; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0.75rem; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-size: 1.05rem; padding: 0 0.4rem; }
.brand b { color: var(--coral-ink); font-weight: 750; }
.logo { position: relative; width: 26px; height: 26px; flex: none; }
.logo i { position: absolute; left: 50%; top: -2px; width: 5px; height: 30px; border-radius: 3px; transform-origin: center; }
.logo .l1 { background: var(--teal); transform: translateX(-50%) rotate(45deg); }
.logo .l2 { background: var(--coral); transform: translateX(-50%) rotate(-45deg); }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: var(--r); color: var(--ink); text-decoration: none; font-weight: 550; }
.nav a:hover { background: var(--mist); }
.nav a[aria-current] { background: var(--ink); color: var(--paper); }
.nav a[aria-current] kbd { background: transparent; color: inherit; border-color: currentColor; opacity: 0.6; }
.nav .ico { width: 1.2rem; text-align: center; opacity: 0.8; }
.nav kbd { margin-left: auto; font-size: 0.72rem; }
.side-foot { margin-top: auto; display: grid; gap: 0.6rem; padding: 0.6rem 0.4rem 0; border-top: 1px solid var(--line); font-size: 0.85rem; }
.content { padding: 1.5rem 2rem 4rem; min-width: 0; outline: none; }
.page-head { margin-bottom: 1rem; }
.page-head p { margin: 0; max-width: 70ch; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; font: 600 0.875rem/1 var(--text); padding: 0.55rem 0.85rem;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; min-height: 36px; }
.btn:hover { background: var(--mist); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--coral); border-color: var(--coral); color: #15212b; }
.btn.danger:hover { filter: brightness(0.96); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--mist); }
.btn.small { padding: 0.35rem 0.6rem; min-height: 30px; font-size: 0.8rem; }
.btn.wide { width: 100%; }
.btn kbd { border-color: currentColor; background: transparent; color: inherit; opacity: 0.65; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 0.5rem 0.65rem; min-height: 36px; }
textarea { width: 100%; resize: vertical; line-height: 1.45; }
input[type='checkbox'] { min-height: 0; width: 1rem; height: 1rem; accent-color: var(--teal-ink); }
label { display: block; font-weight: 600; font-size: 0.85rem; margin: 0.8rem 0 0.3rem; }
label.check { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 500; }
.row { display: flex; align-items: center; gap: 0.5rem; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.toolbar input[type='search'] { min-width: 240px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--mist); border-radius: calc(var(--r) + 3px); }
.tab { font: 600 0.85rem/1 var(--text); padding: 0.5rem 0.8rem; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected='true'], .tab[aria-pressed='true'] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.tabs.small .tab { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.form-error { color: var(--bad-ink); min-height: 1.2em; margin: 0.4rem 0; font-weight: 600; }
.presets { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.4rem; }

/* ---------------------------------------------------------------- chips, tags, callouts */
.chip { display: inline-block; font: 650 0.75rem/1 var(--text); padding: 0.3rem 0.5rem; border-radius: 999px; background: var(--mist); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.danger { background: var(--bad-bg); color: var(--bad-ink); }
.chip.small { margin-left: 0.35rem; font-size: 0.7rem; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.45rem; border-radius: 6px; background: var(--mist); margin: 0 0.25rem 0.2rem 0; }
.tag.ai { background: transparent; border: 1px dashed var(--teal); color: var(--teal-ink); }
.tag.ghost { background: transparent; border: 1px solid var(--line); }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--teal); background: var(--panel); border-radius: var(--r); padding: 0.75rem 1rem; margin: 0.75rem 0; }
.callout.danger { border-left-color: var(--coral); }
.callout p { margin: 0 0 0.4rem; }
.quote { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 0.75rem 0.9rem; margin: 0.75rem 0; }
.empty { color: var(--muted); padding: 2rem 1rem; text-align: center; }
details > summary { cursor: pointer; font-weight: 600; margin: 0.5rem 0; }
.howto { font-size: 0.85rem; max-width: 60ch; }
.facts { margin: 0.25rem 0; padding-left: 1.1rem; }
.facts li { margin: 0.15rem 0; }
dl.facts { padding: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
dl.facts.grid2 { grid-template-columns: max-content 1fr max-content 1fr; }
.secret { display: block; padding: 0.5rem; background: var(--panel); border-radius: var(--r); overflow-wrap: anywhere; user-select: all; }
.evidence { margin: 0.25rem 0; font-size: 0.82rem; color: var(--muted); }

/* ---------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.tile { display: grid; gap: 0.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--paper); color: var(--ink); text-decoration: none; position: relative; }
a.tile:hover { border-color: var(--teal); }
.tile::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.tile.ok::before { background: var(--teal); }
.tile.warn::before { background: #e0a400; }
.tile.danger { border-color: var(--coral); background: var(--bad-bg); }
.tile.danger::before { background: var(--coral); }
.tile-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.tile-value { font: 750 2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.tile-value.small { font-size: 1.1rem; }
.tile-sub { font-size: 0.82rem; color: var(--muted); }
.tile.danger .tile-sub, .tile.danger .tile-label { color: var(--bad-ink); }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.table td { padding: 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: var(--panel); }
.table tr.sub td { border-top: 0; padding-top: 0; }
.table.compact td { padding: 0.35rem 0.5rem; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .btn { margin-left: 0.25rem; }
.bars .barcell { width: 40%; }
.bar { display: block; height: 0.6rem; border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--coral)); min-width: 2px; }
.cities { margin-bottom: 1rem; }

/* ---------------------------------------------------------------- split list / detail */
.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.list { display: grid; gap: 0.35rem; max-height: calc(100vh - 13rem); overflow: auto; padding: 2px; }
.item { display: grid; gap: 0.3rem; text-align: left; width: 100%; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.item:hover { border-color: var(--teal); }
.item.sel { border-color: var(--teal-ink); box-shadow: 0 0 0 2px var(--teal-ink) inset; }
.item.critical { border-left: 4px solid var(--coral); }
.item .excerpt { font-size: 0.85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.item .meta { font-size: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.detail { border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.25rem; min-height: 320px; background: var(--paper); position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.actions.sticky { position: sticky; bottom: -1.25rem; background: var(--paper); padding: 0.75rem 0; border-top: 1px solid var(--line); }
.ctx { margin: 0.25rem 0; padding-left: 1.2rem; font-size: 0.85rem; }
.ctx li { margin: 0.2rem 0; overflow-wrap: anywhere; }

/* support thread */
.thread { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.5rem; }
.thread li { display: grid; gap: 0.15rem; max-width: 78%; }
.thread li.team { justify-self: end; text-align: right; }
.thread .bubble { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.55rem 0.8rem; border-radius: 14px; background: var(--mist); text-align: left; }
.thread li.team .bubble { background: var(--teal-ink); color: #fff; }
.thread li.divider { max-width: none; justify-self: center; font-size: 0.75rem; color: var(--muted); }
.reply { display: grid; gap: 0.5rem; margin: 0.5rem 0 1rem; }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem; grid-column: 1 / -1; background: radial-gradient(circle at 20% 10%, var(--mist), transparent 50%), var(--paper); }
.auth .card { width: min(420px, 100%); border: 1px solid var(--line); border-radius: var(--r-l); padding: 2rem; background: var(--paper); box-shadow: 0 10px 40px rgb(0 0 0 / 0.06); }
.auth .brand { margin-bottom: 1.5rem; padding: 0; }
.auth input { width: 100%; font-size: 1.05rem; }
.auth #code, .auth #totp { letter-spacing: 0.4em; text-align: center; font-family: var(--mono); }
.auth .btn.wide { margin-top: 0.75rem; min-height: 44px; }
.enrol img { margin: 0.75rem auto; background: #fff; padding: 8px; border-radius: var(--r); }

/* ---------------------------------------------------------------- modal + toasts */
.modal { width: min(560px, calc(100vw - 2rem)); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.5rem; background: var(--paper); color: var(--ink); }
.modal::backdrop { background: rgb(10 16 20 / 0.55); }
.modal input, .modal select { width: 100%; }
.modal-form .row.end { margin-top: 1rem; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 100; }
.toast { padding: 0.7rem 1rem; border-radius: var(--r); background: var(--ink); color: var(--paper); box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); max-width: 420px; font-weight: 550; }
.toast.error { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--coral); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav ul { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .detail { position: static; max-height: none; }
  .content { padding: 1rem; }
  .grid2, dl.facts.grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
