/* =====================================================================
   Auravia Panel — tasarım sistemi
   Marka: auraviaesthetic.com (ink #14110E, cream #FBF8F3, sand, gold #B8985C)
   Yazı: Cormorant Garamond (başlık, hasta adı) + Jost (arayüz, tablo, rakam)
   ===================================================================== */

@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); 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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); 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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-600-normal.woff2") format("woff2"); 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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); 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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); 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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #14110E;
  --ink-2: #221D17;
  --ink-3: #342D24;
  --paper: #FAF7F2;
  --surface: #FFFFFF;
  --sand: #F2EBE1;
  --sand-2: #E7DCCC;
  --gold: #B8985C;
  --gold-lt: #D9C296;
  --gold-dp: #7D6334;
  --text: #2A241D;
  --muted: #6A6257;
  --line: rgba(20, 17, 14, .12);
  --line-2: rgba(20, 17, 14, .2);

  --ok: #2F6B4F; --ok-bg: #E6F0E9;
  --warn: #85560F; --warn-bg: #FAEED8;
  --bad: #9A2B2B; --bad-bg: #F7E3E1;
  --info: #2C4E6B; --info-bg: #E3ECF3;
  --neutral: #5A5248; --neutral-bg: #EFEAE2;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r-ctl: 4px;
  --r-panel: 8px;
  --side: 252px;
  --top: 60px;
  --gap: 20px;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold-dp);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 14px/1.5 var(--font-ui); font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-dp); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 { font: 600 30px/1.15 var(--font-display); letter-spacing: -.01em; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
h2 { font: 600 15px/1.3 var(--font-ui); }
h3 { font: 600 14px/1.3 var(--font-ui); }
p { margin: 0 0 .75em; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 15px; height: 15px; flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-ctl); }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-ctl); z-index: 100; }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Kabuk */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--side), transparent var(--side)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: #E9E2D6; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: baseline; gap: 10px; padding: 22px 22px 18px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border: 1px solid var(--gold); border-radius: 50%;
  display: grid; place-items: center; font: 600 17px/1 var(--font-display); color: var(--gold-lt); align-self: center;
}
.brand-name { font: 600 22px/1 var(--font-display); letter-spacing: .14em; }
.brand-sub { font-size: 11px; color: #A69B8B; letter-spacing: .04em; }
.nav { padding: 6px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 16px 10px 6px; font-size: 11.5px; color: #8E8576; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-ctl);
  color: #DCD3C5; text-decoration: none; position: relative;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--ink-3); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--gold); border-radius: 0 2px 2px 0; }
.nav .count { margin-left: auto; font-size: 11.5px; background: var(--gold-dp); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding: 14px 22px 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; color: #A69B8B; }
.sidebar-foot strong { display: block; color: #F2EBE1; font-weight: 500; font-size: 13.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: rgba(250, 247, 242, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.global-search { position: relative; flex: 1; max-width: 460px; }
.global-search input[type=search] { width: 100%; padding-left: 38px; background: var(--surface); }
.global-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-ctl);
  color: var(--text); background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 20px; color: var(--text); text-decoration: none; }
.user-chip:hover { background: var(--sand); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sand-2); color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }

.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- Paneller */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel + .panel { margin-top: var(--gap); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: var(--gap); }

/* ---------------------------------------------------------------- Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 500 13.5px/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { background: var(--sand); border-color: var(--line-2); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #FBF8F3; }
.btn-primary:hover { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.btn-gold { background: var(--gold-dp); border-color: var(--gold-dp); color: #fff; }
.btn-gold:hover { background: #6A5428; color: #fff; }
.btn-danger { color: var(--bad); border-color: rgba(154, 43, 43, .35); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-dp); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- Formlar */
label, .label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 5px; color: var(--ink); }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=datetime-local],
input[type=number], input[type=search], input[type=month], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--text); font: 400 14px/1.4 var(--font-ui);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dp); box-shadow: 0 0 0 3px rgba(125, 99, 52, .18); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.field { margin-bottom: 16px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--bad); font-size: 12.5px; margin: 5px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.fieldset legend { font: 600 18px/1.3 var(--font-display); color: var(--ink); padding: 0; margin-bottom: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.input-group { display: flex; }
.input-group > * + * { margin-left: -1px; }
.input-group input { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); background: var(--sand); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font-size: 13px; color: var(--muted); }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); overflow: hidden; }
.segmented label { margin: 0; padding: 7px 13px; cursor: pointer; font-weight: 500; font-size: 13px; border-left: 1px solid var(--line-2); }
.segmented label:first-child { border-left: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--ink); color: #fff; }
.segmented label:has(input:focus-visible) { box-shadow: inset var(--focus); }

/* ---------------------------------------------------------------- Tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-weight: 500; font-size: 12.5px; color: var(--muted); background: #FCFAF6; position: sticky; top: 0; white-space: nowrap; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--ink); }
.table tbody tr:hover { background: #FBF8F2; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .strike td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(20, 17, 14, .35); }
.table .strike td.keep { text-decoration: none; }
.table tfoot td { font-weight: 600; background: #FCFAF6; }
.row-link { color: var(--ink); text-decoration: none; font-weight: 500; }
.row-link:hover { text-decoration: underline; color: var(--ink); }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- Rozetler */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-neutral { color: var(--neutral); background: var(--neutral-bg); }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 12px; color: var(--text); background: var(--surface); }
.pill-cur { display: inline-block; min-width: 38px; text-align: center; padding: 1px 6px; border-radius: 3px; background: var(--sand); font-size: 11.5px; font-weight: 600; color: var(--ink-3); }

/* ---------------------------------------------------------------- Bildirimler */
.flash-stack { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--ink); color: #FBF8F3; box-shadow: 0 16px 40px -18px rgba(20, 17, 14, .55); }
.flash-error { background: var(--bad); }
.flash-info { background: var(--info); }
.flash .x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .8; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-panel); border: 1px solid; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-warn { background: var(--warn-bg); border-color: rgba(133, 86, 15, .25); color: #5E3D0A; }
.alert-bad { background: var(--bad-bg); border-color: rgba(154, 43, 43, .25); color: #6E1F1F; }
.alert-info { background: var(--info-bg); border-color: rgba(44, 78, 107, .2); color: #1F3A52; }
.alert-ok { background: var(--ok-bg); border-color: rgba(47, 107, 79, .2); color: #1F4A36; }

/* ---------------------------------------------------------------- Boş durum */
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 600 19px/1.3 var(--font-display); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- Filtre çubuğu */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters .f { min-width: 150px; }
.filters .f-grow { flex: 1; min-width: 200px; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 16px; font-size: 12.5px; color: var(--text); text-decoration: none; background: var(--surface); }
.chip:hover { background: var(--sand); color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- Dashboard */
.today-strip { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); margin-bottom: var(--gap); }
.figure { padding: 16px 18px; text-decoration: none; color: inherit; border-left: 1px solid var(--line); display: block; }
.figure:first-child { border-left: 0; }
a.figure:hover { background: #FBF8F2; }
.figure .k { font-size: 12.5px; color: var(--muted); }
.figure .v { font: 500 30px/1.15 var(--font-ui); color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.figure .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.figure .v.alert-num { color: var(--bad); }
.money-rows { list-style: none; margin: 0; padding: 0; }
.money-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.money-rows li:last-child { border-bottom: 0; }
.money-rows .amt { font-weight: 600; font-size: 15px; color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.list .when { width: 64px; flex: none; font-weight: 600; color: var(--ink); font-size: 13px; }
.list .grow { flex: 1; min-width: 0; }
.list .title { color: var(--ink); font-weight: 500; text-decoration: none; }
.list a.title:hover { text-decoration: underline; }
.panel-head a.more { font-size: 12.5px; text-decoration: none; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity .meta { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- Hasta başlığı (dosya bandı) */
.dossier { background: var(--ink); color: #EDE6DA; border-radius: var(--r-panel); padding: 22px 24px 0; margin-bottom: var(--gap); position: relative; overflow: hidden; }
.dossier::after { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent 70%); }
.dossier-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dossier h1 { color: #fff; font-size: 34px; }
.dossier .ids { margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #B9AE9C; }
.dossier .ids span { display: inline-flex; align-items: center; gap: 6px; }
.dossier .ids a { color: #E9DCC2; }
.dossier .quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.dossier .btn { background: transparent; color: #F2EBE1; border-color: rgba(255, 255, 255, .22); }
.dossier .btn:hover { background: var(--ink-3); color: #fff; }
.dossier .btn-gold { background: var(--gold-dp); border-color: var(--gold-dp); }
.dossier-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); }
.dossier-facts > div { padding: 13px 16px 15px 0; }
.dossier-facts > div + div { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .1); }
.dossier-facts .k { font-size: 12px; color: #9F9483; }
.dossier-facts .v { color: #fff; font-weight: 500; margin-top: 2px; }
.dossier-facts .v.money { font-weight: 600; }
.dossier-facts .v .neg { color: #F0B9A8; }
.dossier-facts .v .pos { color: #BFE0C9; }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 0 -24px; padding: 0 18px; border-top: 1px solid rgba(255, 255, 255, .08); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px 12px 13px; color: #B9AE9C; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; font-size: 13.5px; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.tabs .n { font-size: 11.5px; color: #8E8576; margin-left: 4px; }

/* İmza öğe: tedavi yolculuğu çizgisi (ziyaretler) */
.journey { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 4px; }
.journey .stop { flex: 0 0 auto; min-width: 150px; position: relative; padding-top: 22px; padding-right: 22px; }
.journey .stop::before { content: ""; position: absolute; top: 7px; left: 14px; right: 0; height: 2px; background: var(--sand-2); }
.journey .stop:last-child::before { display: none; }
.journey .stop.estimated::before { background: repeating-linear-gradient(90deg, var(--sand-2) 0 6px, transparent 6px 11px); }
.journey .node { position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold-dp); background: var(--surface); }
.journey .done .node { background: var(--gold-dp); }
.journey .active .node { background: var(--gold); box-shadow: 0 0 0 4px rgba(184, 152, 92, .25); }
.journey .estimated .node { border-style: dashed; }
.journey .cancelled .node { border-color: var(--muted); background: var(--neutral-bg); }
.journey .seq { font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
.journey .seq a { color: inherit; text-decoration: none; }
.journey .seq a:hover { text-decoration: underline; }
.journey .when { font-size: 13px; color: var(--text); }
.journey .when.est { font-style: italic; color: var(--muted); }
.journey .add { padding-top: 22px; }

/* Finans özet */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.ledger > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.ledger > div:first-child { border-left: 0; }
.ledger .k { font-size: 12.5px; color: var(--muted); }
.ledger .v { font: 600 22px/1.2 var(--font-ui); color: var(--ink); margin-top: 3px; letter-spacing: -.01em; }
.ledger .v.due { color: var(--bad); }
.ledger .v.credit { color: var(--ok); }
.ledger .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meter { height: 6px; background: var(--sand); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--gold-dp); width: 0; }

/* Tanım listesi */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* Zaman çizelgesi (geçmiş) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline .change { font-size: 13px; }
.timeline .change del { color: var(--muted); }

/* ---------------------------------------------------------------- Belgeler */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-panel); padding: 26px; text-align: center; background: #FCFAF6; transition: background .15s, border-color .15s; }
.dropzone.drag { background: var(--sand); border-color: var(--gold-dp); }
.dropzone p { margin: 6px 0 0; color: var(--muted); }
.upload-queue { list-style: none; margin: 14px 0 0; padding: 0; }
.upload-queue li { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.upload-queue .thumb { width: 54px; height: 54px; border-radius: var(--r-ctl); background: var(--sand) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.upload-queue .meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.upload-queue progress { width: 100%; height: 6px; margin-top: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--sand); }
.upload-queue progress::-webkit-progress-bar { background: var(--sand); border-radius: 3px; }
.upload-queue progress::-webkit-progress-value { background: var(--gold-dp); border-radius: 3px; }
.upload-queue progress::-moz-progress-bar { background: var(--gold-dp); }
.upload-queue .state { font-size: 12.5px; }
.upload-queue .state.ok { color: var(--ok); }
.upload-queue .state.bad { color: var(--bad); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.doc-card { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.doc-card .thumb { aspect-ratio: 4 / 3; background: var(--sand); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.doc-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .body { padding: 10px 12px; font-size: 13px; flex: 1; }
.doc-card .name { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.doc-card .acts { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
.lock-note { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--warn); }

/* ---------------------------------------------------------------- Before / after */
.ba-compare { position: relative; overflow: hidden; border-radius: var(--r-panel); background: var(--ink); aspect-ratio: 4 / 3; user-select: none; touch-action: pan-y; }
.ba-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ba-compare .after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.ba-compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--gold-lt); transform: translateX(-1px); }
.ba-compare .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold-lt); background: rgba(20, 17, 14, .6); transform: translate(-50%, -50%); }
.ba-compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-compare .lbl { position: absolute; top: 10px; padding: 2px 9px; border-radius: 10px; background: rgba(20, 17, 14, .7); color: #fff; font-size: 12px; }
.ba-compare .lbl.l { left: 10px; }
.ba-compare .lbl.r { right: 10px; }
.ba-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba-side figure { margin: 0; background: var(--ink); border-radius: var(--r-panel); overflow: hidden; }
.ba-side img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.ba-side figcaption { padding: 6px 10px; font-size: 12.5px; color: #D8CDBB; }
.consent-state { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--sand); font-size: 13px; }

/* ---------------------------------------------------------------- Takvim */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-title { font: 600 24px/1.2 var(--font-display); color: var(--ink); min-width: 200px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-month .dow { padding: 8px 10px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FCFAF6; }
.cal-month .day { min-height: 118px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cal-month .day.out { background: #FBF9F5; }
.cal-month .day.out .d { color: #B5AC9F; }
.cal-month .day.today .d { background: var(--ink); color: #fff; }
.cal-month .d { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 500; margin-bottom: 3px; text-decoration: none; color: var(--ink); }
.ev { display: block; padding: 2px 6px; margin-top: 2px; border-radius: 3px; font-size: 12px; line-height: 1.35; text-decoration: none; color: var(--ink); background: var(--sand); border-left: 3px solid var(--gold-dp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev:hover { background: var(--sand-2); color: var(--ink); }
.ev.appt { background: var(--info-bg); border-left-color: var(--info); }
.ev.stay { background: transparent; border-left-color: var(--sand-2); color: var(--muted); }
.ev.cancelled, .ev.postponed { text-decoration: line-through; opacity: .6; }
.cal-more { font-size: 11.5px; color: var(--muted); padding: 2px 6px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-week .col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); min-height: 300px; min-width: 0; }
.cal-week .col.today { border-color: var(--gold); }
.cal-week .col-h { padding: 10px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.cal-week .col-b { padding: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend .l-arr { background: var(--sand); border-left: 3px solid var(--gold-dp); }
.legend .l-appt { background: var(--info-bg); border-left: 3px solid var(--info); }
.legend .l-stay { border-left: 3px solid var(--sand-2); }

/* ---------------------------------------------------------------- Dialog */
dialog { border: 0; border-radius: var(--r-panel); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 40px 90px -30px rgba(20, 17, 14, .55); color: var(--text); }
dialog::backdrop { background: rgba(20, 17, 14, .45); }
dialog .panel-head { position: sticky; top: 0; background: var(--surface); }
dialog form { margin: 0; }

/* ---------------------------------------------------------------- Teklif / plan editörü */
.items-table td { padding: 6px 8px; }
.items-table input { min-height: 34px; }
.items-table .qty { width: 90px; }
.items-table .price { width: 150px; }
.items-table .line { width: 140px; text-align: right; }
.totals { margin-left: auto; width: min(380px, 100%); }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; gap: 10px; }
.totals .row.total { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 10px; font-weight: 600; font-size: 16px; color: var(--ink); }
.quote-card { border: 1px solid var(--line); border-radius: var(--r-panel); }
.quote-card.approved { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.quote-card + .quote-card { margin-top: 12px; }
.quote-card summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.quote-card summary::-webkit-details-marker { display: none; }
.quote-card .qv { font: 600 15px/1 var(--font-ui); color: var(--ink); }
.quote-card .qbody { padding: 0 16px 14px; }
.reason { padding: 8px 12px; background: var(--sand); border-radius: var(--r-ctl); font-size: 13px; margin: 8px 0; }

/* ---------------------------------------------------------------- Giriş */
.guest { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.guest-art { background: var(--ink); color: #E9E2D6; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.guest-art .brand { padding: 0; }
.guest-art blockquote { margin: 0; font: 500 30px/1.25 var(--font-display); color: #F2EBE1; max-width: 420px; }
.guest-art .route { position: absolute; right: -60px; bottom: 110px; width: 460px; opacity: .5; color: var(--gold); }
.guest-art .foot { font-size: 12.5px; color: #8E8576; }
.guest-form { display: grid; place-items: center; padding: 40px 24px; }
.guest-card { width: min(380px, 100%); }
.guest-card h1 { margin-bottom: 6px; }
.guest-card .sub { color: var(--muted); margin-bottom: 26px; }
.otp { font: 600 24px/1 var(--font-ui); letter-spacing: .4em; text-align: center; }

/* ---------------------------------------------------------------- Makbuz (yazdırma) */
.receipt { max-width: 720px; margin: 0 auto; background: #fff; padding: 40px 44px; border: 1px solid var(--line); }
.receipt-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 22px; }
.receipt h1 { font-size: 26px; }
.receipt .big { font: 600 30px/1.2 var(--font-ui); color: var(--ink); margin: 6px 0 18px; }
.receipt .foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- Yardımcılar */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.kbd { font-size: 11.5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; color: var(--muted); }
.loading { position: relative; pointer-events: none; opacity: .65; }
.qr { width: 196px; height: 196px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.qr svg { width: 100%; height: 100%; }
.codes { columns: 2; font: 500 14px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px 16px; background: var(--sand); border-radius: var(--r-ctl); }

/* ---------------------------------------------------------------- Duyarlı düzen */
@media (max-width: 1200px) {
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .22s var(--ease); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 17, 14, .45); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 80px; }
  .today-strip, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .dossier-facts, .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dossier-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .ledger > div:nth-child(3) { border-left: 0; }
  .ledger > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dossier-facts > div:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-week .col { min-height: 0; }
  .guest { grid-template-columns: 1fr; }
  .guest-art { display: none; }
  .user-chip .name { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .dossier { padding: 18px 16px 0; }
  .dossier h1 { font-size: 28px; }
  .tabs { margin: 0 -16px; padding: 0 10px; }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .figures { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .figure .v { font-size: 27px; }
  .cal-month .day { min-height: 74px; padding: 3px; }
  .cal-month .ev { font-size: 10.5px; padding: 1px 3px; }
  .cal-month .dow { padding: 6px 4px; font-size: 11px; }
  /* Mobilde tablolar kart görünümüne geçer */
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
  .table.stack-sm td.primary { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  .table.stack-sm td.primary::before { content: none; }
  .table.stack-sm td.actions { justify-content: flex-end; }
  .table.stack-sm td.actions::before { content: none; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .ba-side { grid-template-columns: 1fr; }
  .receipt { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .no-print, .flash-stack { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; }
  .receipt { border: 0; padding: 0; }
}

/* ---------------------------------------------------------------- Ek bileşenler */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(320px, 90vw); z-index: 30; box-shadow: 0 24px 50px -24px rgba(20, 17, 14, .45); }
.thumb-sm { width: 52px; height: 52px; border-radius: var(--r-ctl); background: var(--sand); overflow: hidden; display: block; flex: none; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.focus-row { background: var(--warn-bg) !important; }
.totals .neg { color: var(--bad); }
dialog .panel-body h2 { font: 600 20px/1.3 var(--font-display); }
.sort-chips { align-items: center; }

.grid > .panel, .today-strip > .panel, .grid > section, .grid > form { margin-top: 0; }
.grid-main-side > .stack .dl, .grid-main-side > div > .panel .dl { grid-template-columns: minmax(100px, 38%) 1fr; }
.table .right, .table th.right, .table td.right { text-align: right; }
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }
input[type=file]::file-selector-button { font: 500 13px var(--font-ui); border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-ctl); padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--sand); }
.empty strong, .fieldset legend, .cal-title, dialog .panel-body h2, .guest-art blockquote { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
@media (max-width: 640px) {
  .table.stack-sm tfoot { display: none; }
  .table.stack-sm td { flex-wrap: wrap; }
  .table.stack-sm td .cell-sub { width: 100%; text-align: right; }
  .table.stack-sm td.primary .cell-sub { text-align: left; }
}
