/* UFS EBYS — eski arayüzün (Tailwind) tasarım dilinin CSP uyumlu, bağımlılıksız karşılığı.
   Renkler ve ölçüler Tailwind 3 paletinden birebir alınmıştır. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
  --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a; --slate-950: #020617;
  --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-500: #3b82f6; --blue-600: #2563eb; --blue-700: #1d4ed8;
  --indigo-50: #eef2ff; --indigo-100: #e0e7ff; --indigo-200: #c7d2fe; --indigo-600: #4f46e5; --indigo-700: #4338ca;
  --emerald-50: #ecfdf5; --emerald-100: #d1fae5; --emerald-200: #a7f3d0; --emerald-500: #10b981; --emerald-600: #059669; --emerald-700: #047857; --emerald-800: #065f46;
  --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-600: #d97706; --amber-800: #92400e;
  --rose-50: #fff1f2; --rose-100: #ffe4e6; --rose-200: #fecdd3; --rose-600: #e11d48; --rose-700: #be123c; --rose-800: #9f1239;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);
  --ring: 0 0 0 3px rgb(59 130 246 / .3);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5;
  background: var(--slate-50); color: var(--slate-900); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
h1, h2, h3 { margin: 0; color: var(--slate-900); letter-spacing: -.01em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
small, .small { font-size: 12px; }
.xs { font-size: 11px; }
.muted { color: var(--slate-500); }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 14px; height: 14px; }
.i.lg { width: 20px; height: 20px; }
[hidden] { display: none !important; }

/* ---- uygulama iskeleti ---- */
.app { min-height: 100vh; display: flex; }
.sidebar { width: 256px; flex-shrink: 0; background: var(--slate-900); color: var(--slate-200); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40; }
.sb-brand { height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--slate-800); }
.sb-brand a { display: flex; align-items: center; gap: 10px; color: inherit; }
.sb-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--blue-600); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.sb-logo .i { width: 20px; height: 20px; }
.sb-title { font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.25; font-size: 15px; }
.sb-sub { font-size: 11px; color: var(--slate-400); }
.sb-close { display: none; background: none; border: 0; color: var(--slate-400); padding: 4px; cursor: pointer; }
.sb-nav { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sb-sec { margin: 14px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-500); }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--slate-300); transition: background .15s, color .15s; }
.sb-link:hover { background: var(--slate-800); color: #fff; }
.sb-link[aria-current="page"] { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-sm); }
.sb-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { margin-left: auto; padding: 2px 6px; font-size: 10px; font-weight: 700; border-radius: 999px; background: var(--amber-500); color: var(--slate-950); }
.sb-foot { padding: 12px; border-top: 1px solid var(--slate-800); background: rgb(2 6 23 / .5); display: grid; gap: 8px; }
.sb-status { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--slate-400); }
.sb-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--emerald-500); margin-right: 6px; }
.sb-ver { padding: 2px 6px; border-radius: 4px; background: var(--slate-800); color: var(--slate-300); font-weight: 500; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--slate-200); padding: 0 24px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20; }
.tb-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tb-menu { display: none; padding: 8px; border-radius: 8px; color: var(--slate-600); background: none; border: 0; cursor: pointer; }
.tb-menu:hover { background: var(--slate-100); }
.tb-search { position: relative; flex: 1; max-width: 448px; }
.tb-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); }
.tb-search input { width: 100%; padding: 8px 12px 8px 36px; font-size: 14px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 8px; }
.tb-search input:focus { background: #fff; }
.tb-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tb-user { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--slate-200); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--slate-900); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase; }
.tb-name { line-height: 1.2; }
.tb-name a { display: block; font-size: 12px; font-weight: 700; color: var(--slate-900); }
.tb-name span { font-size: 10px; color: var(--slate-500); }
.tb-lock { margin-left: 4px; padding: 6px; border-radius: 8px; color: var(--slate-400); background: none; border: 0; cursor: pointer; display: flex; }
.tb-lock:hover { color: var(--rose-600); background: var(--rose-50); }
.content { flex: 1; padding: 24px; width: 100%; max-width: 1600px; margin: 0 auto; }
.backdrop { display: none; }

/* ---- sayfa başlığı ---- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead h1 { font-size: 20px; font-weight: 700; line-height: 1.3; }
.pagehead .sub { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.pagehead .sub strong { color: var(--slate-700); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 12px; color: var(--slate-500); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.crumb a { color: var(--slate-500); }
.crumb a:hover { color: var(--blue-600); }

/* ---- düğmeler ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 500; line-height: 20px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--slate-200); background: #fff; color: var(--slate-700);
  cursor: pointer; box-shadow: var(--shadow-sm); transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--slate-50); color: var(--slate-900); }
.btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn.primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn.indigo { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; font-weight: 600; }
.btn.indigo:hover { background: var(--indigo-700); }
.btn.emerald { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; font-weight: 600; }
.btn.emerald:hover { background: var(--emerald-700); }
.btn.soft { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.btn.soft:hover { background: var(--blue-100); }
.btn.ghost { box-shadow: none; }
.btn.danger { background: var(--rose-600); border-color: var(--rose-600); color: #fff; }
.btn.danger:hover { background: var(--rose-700); }
.btn.danger-soft { color: var(--rose-700); border-color: var(--rose-200); background: var(--rose-50); box-shadow: none; }
.btn.sm { font-size: 12px; padding: 4px 10px; line-height: 18px; }
.btn.xs { font-size: 11px; padding: 2px 8px; line-height: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- kartlar ---- */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }

.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.card-h h2, .card h2 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h h2 .i, .card > h2 .i { color: var(--indigo-600); }
.card-h .hint, .hint { font-size: 11px; color: var(--slate-500); }
.card.flush .card-h { padding: 16px 20px 0; margin-bottom: 12px; }
.section-desc { font-size: 12px; color: var(--slate-500); margin: -10px 0 16px; }

/* ---- düzenler ---- */
.grid-dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.colmain, .colside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.colmain > .card + .card, .colside > .card + .card { margin-top: 0; }

/* ---- istatistik kartları ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: block; background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow-sm); color: inherit; transition: border-color .15s; }
a.stat:hover { border-color: var(--blue-200); color: inherit; }
.stat .lbl { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--slate-500); }
.stat .val { font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--slate-900); line-height: 1.3; }
.stat .val.blue { color: var(--blue-600); }
.stat .val.emerald { color: var(--emerald-600); }
.stat .val.amber { color: var(--amber-600); }
.stat .sub { font-size: 11px; color: var(--slate-500); margin-top: 4px; }
.stat .sub.blue { color: var(--blue-600); }
.stat .sub.emerald { color: var(--emerald-600); }
.stat .sub.amber { color: var(--amber-600); }

/* ---- grafik ---- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--slate-500); }
.chart .grid { stroke: var(--slate-200); stroke-width: 1; }
.chart .val { font-size: 12px; font-weight: 700; fill: var(--slate-700); }

/* ---- rozetler ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap; line-height: 16px; }
.badge.kayitli { background: var(--amber-100); color: var(--amber-800); border-color: var(--amber-200); }
.badge.imzali { background: var(--emerald-100); color: var(--emerald-800); border-color: var(--emerald-200); }
.badge.arsiv { background: var(--slate-100); color: var(--slate-600); border-color: var(--slate-200); }
.badge.iptal { background: var(--rose-100); color: var(--rose-800); border-color: var(--rose-200); }
.badge.gelen { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.badge.giden { background: var(--indigo-50); color: var(--indigo-700); border-color: var(--indigo-100); }
.badge.ic { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.badge.warn { background: var(--rose-50); color: var(--rose-700); border-color: var(--rose-200); }
.badge.ok { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); }
.docno { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--blue-700); }
a.docno:hover { color: var(--blue-600); text-decoration: underline; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: var(--slate-100); color: var(--slate-800); border: 1px solid var(--slate-200); }

/* ---- klasör ağacı ve evrak kartları ---- */
.folders { display: grid; gap: 2px; }
.folder { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--slate-700); }
.folder .i { color: var(--amber-500); }
.folder:hover { background: var(--slate-50); color: var(--slate-900); }
.folder[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.folder[aria-current="page"] .i { color: var(--blue-600); }
.folder .n { margin-left: auto; font-size: 11px; color: var(--slate-400); font-weight: 600; }
.folder.child { padding-left: 26px; }
.doclist { display: grid; }
.docitem { display: block; padding: 12px 16px; border-bottom: 1px solid var(--slate-100); border-left: 3px solid transparent; color: inherit; transition: background .15s; }
.docitem:last-child { border-bottom: 0; }
.docitem:hover { background: var(--slate-50); color: inherit; }
.docitem .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.docitem .ttl { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--slate-900); }
.docitem .meta { margin-top: 2px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--slate-500); }

/* ---- tablolar ---- */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--slate-500);
  background: var(--slate-50); padding: 10px 16px; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--slate-50); }
.table td a:not(.btn) { color: var(--slate-900); font-weight: 500; }
.table td a:not(.btn):hover { color: var(--blue-600); }
.table td a.docno { color: var(--blue-700); font-weight: 700; }
.table.compact td { padding: 8px 16px; font-size: 12px; }
.table tr.dim td { opacity: .55; }
.table .actions-cell { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 32px 20px; text-align: center; color: var(--slate-500); font-size: 13px; }
.empty .i { display: block; margin: 0 auto 8px; width: 28px; height: 28px; color: var(--slate-300); }

/* ---- ayrıntı listesi ---- */
.meta { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13px; }
.meta dt { color: var(--slate-500); }
.meta dd { margin: 0; color: var(--slate-900); font-weight: 500; overflow-wrap: anywhere; }
.doc-title { font-size: 18px; font-weight: 700; margin: 4px 0 6px; line-height: 1.35; }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-sub { font-size: 12px; color: var(--slate-500); display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }

/* ---- formlar ---- */
.form { display: grid; gap: 16px; }
.stack { display: grid; gap: 12px; }
label, .lbl-t { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--slate-700); }
input, select, textarea { font: inherit; font-size: 14px; color: var(--slate-900); background: #fff; border: 1px solid var(--slate-200); border-radius: 8px;
  padding: 8px 12px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--ring); }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--blue-600); }
input[type="color"] { padding: 2px; height: 38px; width: 64px; }
input[type="file"] { padding: 6px; font-size: 13px; background: var(--slate-50); }
input[type="file"]::file-selector-button { font: inherit; font-size: 12px; font-weight: 600; border: 0; border-radius: 6px; padding: 4px 10px; margin-right: 8px;
  background: var(--slate-900); color: #fff; cursor: pointer; }
textarea { resize: vertical; line-height: 1.5; }
.req { color: var(--rose-600); }
.help { font-size: 11px; font-weight: 400; color: var(--slate-500); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.formfoot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.formfoot p { margin: 0 auto 0 0; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.seg legend { font-size: 12px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; padding: 0; }
.seg label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--slate-200); border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; background: #fff; }
.seg label:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); box-shadow: var(--ring); }
.upload { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--slate-200); }
.upload .help { grid-column: 1 / -1; }
form.inline { display: inline; }
.secret { background: var(--slate-900); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 14px; user-select: all; }

/* ---- uyarılar ve bildirimler ---- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert .i { margin-top: 1px; }
.alert.ok { background: var(--emerald-50); border-color: var(--emerald-200); color: var(--emerald-800); }
.alert.err { background: var(--rose-50); border-color: var(--rose-200); color: var(--rose-800); }
.alert.warn { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-800); }
.alert.info { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: 384px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--slate-200); border-left: 4px solid var(--emerald-500);
  border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 500; color: var(--slate-800); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  transition: opacity .3s, transform .3s; }
.toast .i { color: var(--emerald-600); margin-top: 1px; }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ---- zaman çizelgesi ---- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 12px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 999px; background: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--slate-200); }
.timeline li:last-child::after { display: none; }
.timeline .act { font-family: var(--mono); font-weight: 700; font-size: 11px; color: var(--slate-900); }
.timeline .det { color: var(--slate-500); overflow-wrap: anywhere; }

details.danger-zone { margin-top: 8px; border: 1px solid var(--rose-200); border-radius: 8px; background: var(--rose-50); }
details.danger-zone summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--rose-700); list-style: none; display: flex; align-items: center; gap: 6px; }
details.danger-zone summary::-webkit-details-marker { display: none; }
details.danger-zone form { padding: 0 12px 12px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--slate-200); font-size: 12px; color: var(--slate-500); }
.filterbar { display: grid; gap: 8px; }
.filterbar select { font-size: 13px; padding: 7px 10px; }

/* ---- giriş ---- */
body.bare { background: var(--slate-900); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, rgb(37 99 235 / .25), transparent), var(--slate-900); }
.login-card { width: 100%; max-width: 384px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-2xl); border: 1px solid var(--slate-200); padding: 24px; display: grid; gap: 16px; }
.login-head { text-align: center; display: grid; gap: 4px; justify-items: center; }
.login-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-600); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.login-icon .i { width: 24px; height: 24px; }
.login-head h1 { font-size: 18px; font-weight: 700; }
.login-head p { font-size: 12px; color: var(--slate-500); }
.login-card .btn.primary { padding: 10px; border-radius: 12px; font-weight: 600; }
.login-card .alert { margin: 0; }
.login-foot { text-align: center; font-size: 11px; color: var(--slate-400); }
.narrow { max-width: 480px; margin: 24px auto; }

/* ---- antetli yazı: A4 sayfa düzenleyicisi ---- */
.editor { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 84px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--slate-200);
  border-radius: 12px 12px 0 0; padding: 10px 14px; font-size: 12px; color: var(--slate-500); }
.desk { background: var(--slate-200); border: 1px solid var(--slate-200); border-top: 0; border-radius: 0 0 12px 12px; padding: 24px 16px; overflow-x: auto; }
.ruler { height: 22px; max-width: 794px; margin: 0 auto; background:
  repeating-linear-gradient(to right, var(--slate-300) 0, var(--slate-300) 1px, transparent 1px, transparent 37.8px),
  repeating-linear-gradient(to right, var(--slate-300) 0, var(--slate-300) 1px, transparent 1px, transparent 9.45px), #f8fafc;
  background-size: 100% 100%, 100% 45%; background-position: bottom left; background-repeat: no-repeat; border: 1px solid var(--slate-300); border-bottom: 0; }
.a4 { background: #fff; width: 100%; max-width: 794px; min-height: 1060px; margin: 0 auto; padding: 42px 52px 28px 76px; display: flex; flex-direction: column;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .06); font-family: "Times New Roman", "Liberation Serif", Tinos, serif; font-size: 16px; line-height: 1.5; color: #000; }
.a4-head { display: flex; align-items: center; gap: 16px; }
.a4-head img { height: 48px; width: auto; }
.a4-head svg { flex: 1; height: 2px; }
.a4-org { text-align: center; font-weight: 700; font-size: 17px; margin: 14px 0 22px; letter-spacing: .02em; }
.a4-row { display: grid; grid-template-columns: 52px 14px minmax(0, 1fr) auto; align-items: baseline; }
.a4-row b { font-weight: 700; }
.a4 .f { font: inherit; color: inherit; border: 1px dashed transparent; border-radius: 4px; background: transparent; padding: 2px 6px; margin: 0 -7px; width: calc(100% + 14px); box-shadow: none; }
.a4 .f:hover { border-color: var(--slate-300); background: var(--slate-50); }
.a4 .f:focus { border-color: var(--blue-500); background: var(--blue-50); box-shadow: none; }
.a4 .f::placeholder { color: var(--slate-400); font-style: italic; }
.a4-recipient { margin: 40px 0 0; text-align: center; text-transform: uppercase; }
.a4-recipient .f { text-align: center; text-transform: uppercase; }
.a4-refs { margin-top: 22px; }
.a4-body { margin-top: 22px; }
.a4-body .f { text-align: justify; min-height: 260px; text-indent: 47px; }
.a4-sign { margin: 44px 0 0 auto; width: 280px; text-align: center; }
.a4-sign .pfx { font-style: italic; font-size: 13px; color: var(--slate-600); }
.a4-sign .f { text-align: center; }
.a4-sign .name { font-weight: 700; }
.a4-lists { margin-top: 26px; display: grid; gap: 12px; }
.a4-lists b { display: block; }
.a4-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--slate-600); display: grid; grid-template-columns: auto 1.1fr 1fr 1fr; gap: 14px;
  align-items: start; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 1.4; color: var(--slate-700); }
.a4-foot img { height: 26px; width: auto; }
.a4-gap { height: 40px; }

.logoprev { max-width: 100%; max-height: 110px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--slate-200); display: block; }

/* ---- duyarlı düzen ---- */
@media (max-width: 1280px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-side { position: static; }
}
@media (max-width: 1100px) {
  .cols, .cols-left, .grid-dash { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .backdrop { display: block; position: fixed; inset: 0; background: rgb(15 23 42 / .5); z-index: 30; }
  .sb-close, .tb-menu { display: flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .tb-user .tb-name { display: none; }
}
@media (max-width: 640px) {
  .grid2, .grid3, .upload { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; gap: 2px 0; }
  .meta dd { margin-bottom: 8px; }
  .tb-right .btn span { display: none; }
  .a4 { padding: 24px 18px; min-height: 0; font-size: 15px; }
  .a4-foot { grid-template-columns: 1fr 1fr; }
  .a4-row { grid-template-columns: 44px 12px minmax(0, 1fr); }
  .a4-row .date { grid-column: 3; }
  .a4-sign { width: 100%; }
}

@media print {
  .sidebar, .topbar, .toasts, .editor-side, .toolbar, .ruler { display: none !important; }
  body { background: #fff; }
  .desk { padding: 0; border: 0; background: #fff; }
  .a4 { box-shadow: none; }
}
.sb-out { background: transparent; color: var(--slate-300); border-color: var(--slate-800); box-shadow: none; }
.sb-out:hover { background: var(--slate-800); color: #fff; }
.chart .c-blue { fill: var(--blue-600); } .chart .c-indigo { fill: var(--indigo-600); } .chart .c-slate { fill: var(--slate-500); }
.chart .c-amber { fill: var(--amber-600); } .chart .c-emerald { fill: var(--emerald-600); }
.chart rect { rx: 6px; }
.card-pad { margin: 0; padding: 16px 20px 20px; }
.tips { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.a4-refs { grid-template-columns: 52px 14px minmax(0, 1fr); }
.mt { margin-top: 16px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 11px; }
.act-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--indigo-50); color: var(--indigo-700); white-space: nowrap; }
.det-cell { max-width: 520px; overflow-wrap: anywhere; color: var(--slate-600); }
.a4 textarea.f { resize: none; overflow: hidden; }
.editor-side .meta { grid-template-columns: 56px minmax(0, 1fr); }
label { display: block; }
label > input, label > select, label > textarea { display: block; margin-top: 4px; }
label > input[type="radio"], label > input[type="checkbox"] { display: inline-block; margin-top: 0; }
.seg label { display: flex; }
.logoprev { max-height: 90px; }
.btn.amber { background: var(--amber-600); border-color: var(--amber-600); color: #fff; font-weight: 600; }
.btn.amber:hover { background: #b45309; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.part { border-top: 1px solid var(--slate-100); padding: 12px 20px; }
.part.cover { background: var(--indigo-50); }
.part.dim { opacity: .6; }
.part-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.part-k { font-size: 13px; font-weight: 700; color: var(--slate-900); margin-right: 4px; }
.pfiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.pfiles li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; font-size: 12px; }
.pf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kep { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--slate-200); background: var(--slate-50); }
.kep strong { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.kep .help { max-width: 460px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; }
.inline-form label { flex: 1; }
.signbox { border: 1px solid var(--emerald-200); background: var(--emerald-50); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.sign-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sign-h strong { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--emerald-800); }
.sign-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sign-row input { flex: 1; min-width: 180px; border-color: var(--emerald-200); }
.signbox .alert { margin: 0; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.ed-bar { justify-content: flex-start; gap: 6px; padding: 8px 10px; }
.ed-group { display: flex; gap: 2px; align-items: center; padding-right: 6px; border-right: 1px solid var(--slate-200); }
.ed-group.grow { flex: 1; border: 0; gap: 6px; }
.ed-group select { font-size: 12px; padding: 5px 8px; max-width: 220px; }
.ed-btn { min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--slate-700); }
.ed-btn:hover { background: var(--slate-100); border-color: var(--slate-200); }
.ed-btn.b { font-weight: 800; } .ed-btn.i { font-style: italic; font-family: Georgia, serif; } .ed-btn.u { text-decoration: underline; }
.ed-stats { margin-left: auto; font-size: 11px; color: var(--slate-400); }
.a4 .rich { min-height: 300px; outline: none; text-indent: 0; text-align: left; white-space: normal; }
.a4 .rich p { margin: 0 0 6px; text-indent: 47px; text-align: justify; }
.a4 .rich p.al-l { text-align: left; text-indent: 0; } .a4 .rich p.al-c { text-align: center; text-indent: 0; }
.a4 .rich p.al-r { text-align: right; text-indent: 0; } .a4 .rich p.al-j { text-align: justify; text-indent: 0; }
.a4 .rich li.al-c { text-align: center; } .a4 .rich li.al-r { text-align: right; }
.a4 .rich ul, .a4 .rich ol { margin: 0 0 6px; padding-left: 70px; }
.a4 .rich table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 15px; }
.a4 .rich td, .a4 .rich th { border: 1px solid var(--slate-500); padding: 4px 6px; vertical-align: top; text-align: left; }
.a4 .rich th { font-weight: 700; }
.a4 .rich hr { border: 0; border-top: 1px solid var(--slate-600); margin: 8px 0; }
.ed-group select { min-width: 170px; flex: 1; }
.login-card.verify { max-width: 520px; }
.login-card .meta { grid-template-columns: 130px minmax(0, 1fr); }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgb(15 23 42 / .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.viewer[hidden] { display: none; }
.viewer-box { background: #fff; border-radius: 16px; box-shadow: var(--shadow-2xl); width: min(1100px, 100%); height: min(92vh, 1000px); display: flex; flex-direction: column; overflow: hidden; }
.viewer-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--slate-200); flex-wrap: wrap; }
.viewer-h strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.viewer-body { flex: 1; display: flex; min-height: 0; background: var(--slate-100); }
.viewer-body iframe { flex: 1; border: 0; background: #fff; min-width: 0; }
.ocr { width: 380px; display: flex; flex-direction: column; border-left: 1px solid var(--slate-200); background: #fff; }
.ocr[hidden] { display: none; }
.ocr-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; color: var(--slate-600); border-bottom: 1px solid var(--slate-100); }
.ocr textarea { flex: 1; border: 0; border-radius: 0; resize: none; font-size: 13px; font-family: var(--mono); }
@media (max-width: 760px) { .viewer-body { flex-direction: column; } .ocr { width: auto; height: 40%; border-left: 0; border-top: 1px solid var(--slate-200); } }
.btn.dark { background: var(--slate-900); border-color: var(--slate-900); color: #fff; font-weight: 600; }
.btn.dark:hover { background: var(--slate-800); }
