/* PULSAR Lisans Sunucusu — koyu, sade, kurumsal arayüz. */
:root {
  --bg: #0a0c0f;
  --surface: #11151a;
  --surface-2: #161b22;
  --line: #232a33;
  --line-strong: #2f3843;
  --text: #f2f4f7;
  --text-2: #a9b2bf;
  --muted: #6c7684;
  --info: #2ec4c6;
  --accent: #ff7a1a;
  --accent-hover: #ff8c3a;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --danger: #ff5c5c;
  --radius: 8px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* --- Yerleşim --- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 4px 10px 20px; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.08em; }
.brand span { color: var(--muted); font-size: 12px; }
.nav a {
  display: block; padding: 8px 10px; margin-bottom: 2px;
  color: var(--text-2); border-radius: 6px; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.main { min-width: 0; }
.topbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 12px 28px; border-bottom: 1px solid var(--line); color: var(--text-2);
}
.topbar form { margin: 0; }
.content { padding: 24px 28px 48px; max-width: 1320px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.actions select, .actions input[type="text"], .actions input[type="email"] { width: auto; min-width: 150px; }

/* --- Bölümler --- */
.section { border-top: 1px solid var(--line); padding: 18px 0 8px; }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 24px; margin-bottom: 8px; }
.facts > div > span { display: block; color: var(--muted); font-size: 12px; }
.facts > div > strong { font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 12px 0; }

/* --- Tablolar --- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 8px 10px; border-bottom: 1px solid var(--line-strong);
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: rgba(255, 255, 255, 0.015); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-bottom: 0; font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* --- Formlar --- */
label { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], input[type="file"], select, textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 8px 10px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
textarea.tall { min-height: 320px; font-family: var(--mono); font-size: 13px; }
.field { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
/* Tek satır form: ilk alan form-grid sütunu genişliğinde (alttaki formlarla hizalı),
   kalan alan ve düğme satırın sonuna kadar; düğme giriş kutusuyla aynı yükseklikte. */
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
.form-row .field { margin-bottom: 0; min-width: 0; }
.form-row .fill { grid-column: 2 / -1; display: flex; gap: 16px; align-items: flex-end; min-width: 0; }
.form-row .fill .field { flex: 1 1 auto; }
.form-row .btn { padding-top: 8px; padding-bottom: 8px; }
.form-hint { margin: 6px 0 0; }
@media (max-width: 600px) { .form-row .fill { grid-column: 1 / -1; } }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 14px; margin-bottom: 8px; }
.check input { margin-top: 3px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input[type="text"], .inline-form input[type="number"] { width: 90px; padding: 5px 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
fieldset[disabled] { border: 0; padding: 0; margin: 0; }
fieldset[disabled] input, fieldset[disabled] select { border-color: transparent; background: transparent; color: var(--text); }
input.num-input { width: 110px; text-align: right; padding: 5px 8px; }
.inline-form input.wide-input { width: 220px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.inline-form .check { margin: 0; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; }
.module-list { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.trace { display: block; color: var(--muted); font-size: 11px; }
/* --- Sözleşme merkezi --- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 500; display: inline-flex; gap: 8px; align-items: center;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; }
.template-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.template-card:hover { border-color: var(--line-strong); border-left-color: var(--accent-hover); text-decoration: none; background: var(--surface-2); }
.template-card.passive { border-left-color: var(--line-strong); opacity: 0.7; }
.template-name { font-weight: 600; }
.template-meta { font-size: 12px; color: var(--muted); }
.template-tags { display: flex; gap: 6px; }
.section-panel { margin-top: 14px; }
.section-panel h3 { margin-bottom: 10px; }
textarea.doc-editor { font-family: var(--font); font-size: 13.5px; line-height: 1.65; min-height: 440px; }
.logo-panel { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: center; margin-top: 18px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.logo-panel h3 { margin-bottom: 6px; }
.logo-preview { background: #ffffff; border-radius: var(--radius); height: 96px; display: grid; place-items: center; padding: 12px; }
.logo-preview img { max-width: 100%; max-height: 72px; }
.wordmark { color: #1f2a44; font-weight: 700; letter-spacing: 0.08em; font-size: 22px; border-left: 5px solid #e8661a; padding-left: 10px; }
@media (max-width: 900px) { .logo-panel { grid-template-columns: 1fr; } }
.contract-text {
  white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13px; line-height: 1.6; max-height: 520px; overflow-y: auto; margin-bottom: 8px;
}
.total-row td { font-weight: 600; }
legend { color: var(--text-2); padding: 0 6px; }

/* --- Düğmeler --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 7px 14px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--text-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #140a02; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-info { border-color: var(--info); color: var(--info); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--info); padding: 0; cursor: pointer; font: inherit; }

/* --- Rozetler ve bildirimler --- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap;
}
.badge-info { border-color: rgba(46, 196, 198, 0.5); color: var(--info); }
.badge-ok { border-color: rgba(62, 207, 142, 0.5); color: var(--ok); }
.badge-warn { border-color: rgba(255, 176, 32, 0.55); color: var(--warn); }
.badge-danger { border-color: rgba(255, 92, 92, 0.55); color: var(--danger); }
.flash { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; border: 1px solid; }
.flash-ok { border-color: rgba(62, 207, 142, 0.45); color: var(--ok); background: rgba(62, 207, 142, 0.06); }
.flash-error { border-color: rgba(255, 92, 92, 0.5); color: var(--danger); background: rgba(255, 92, 92, 0.06); }
.flash-warn { border-color: rgba(255, 176, 32, 0.5); color: var(--warn); background: rgba(255, 176, 32, 0.06); }
.notice { border-left: 3px solid var(--info); padding: 8px 12px; background: var(--surface); color: var(--text-2); margin-bottom: 16px; }
.notice.warn { border-left-color: var(--warn); }
.secret-box {
  font-family: var(--mono); font-size: 20px; letter-spacing: 0.08em;
  padding: 14px 16px; border: 1px dashed var(--accent); border-radius: var(--radius);
  background: var(--surface); display: inline-block; user-select: all;
}

/* --- İş Masası --- */
.queue { display: grid; gap: 18px; }
.queue-block h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; }

/* --- Giriş --- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.qr { background: #fff; border-radius: 8px; padding: 8px; display: inline-block; }
.qr svg { display: block; width: 190px; height: 190px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px; }
  .brand { padding: 0 10px 0 4px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { margin: 0; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
