/* ==========================================================
   L'Étoile d'Or — Yönetim Paneli Arayüzü
   ========================================================== */
:root {
  --ink: #06080e; --ink-2: #0a0e18; --navy: #0d1524; --navy-2: #131f36;
  --gold: #c9a96a; --gold-2: #e8cf9a; --gold-deep: #9a7a3f;
  --cream: #f0e7d5; --dim: rgba(240, 231, 213, 0.62); --faint: rgba(240, 231, 213, 0.4);
  --line: rgba(201, 169, 106, 0.2); --line-soft: rgba(201, 169, 106, 0.1);
  --danger: #e2685c; --ok: #7fbf9a; --warn: #e3b25f; --info: #7fa8d9;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--ink); color: var(--cream); font-family: var(--sans); font-size: 14.5px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(1000px 600px at 85% -10%, rgba(23,37,66,.5), transparent 60%); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }

/* ---------- giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: min(430px, 100%); padding: 42px 38px; border-radius: 20px;
  background: linear-gradient(165deg, rgba(19,31,54,.65), rgba(9,13,22,.85));
  border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(16px); text-align: center; }
.login-card h1 { font-size: 1.9rem; margin: 14px 0 4px; }
.login-card .sub { color: var(--faint); font-size: 12px; letter-spacing: .28em; text-transform: uppercase; }
.login-card form { margin-top: 30px; display: grid; gap: 14px; text-align: left; }
.demo-creds { margin-top: 22px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 12px; color: var(--dim); text-align: left; }
.demo-creds b { color: var(--gold-2); }

/* ---------- alan bileşenleri ---------- */
.field label { display: block; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(240,231,213,.045); color: var(--cream);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold-2); }
.field select option { background: var(--navy); color: var(--cream); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .f-row, .f-row3 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 20px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--gold); color: #14100a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 60%, var(--gold-deep));
  transition: transform .2s, filter .2s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--gold-2); border-color: rgba(201,169,106,.45); }
.btn.ghost:hover { background: rgba(201,169,106,.09); }
.btn.danger { background: linear-gradient(135deg, #e8907f, #c05a4c); border-color: #c05a4c; color: #1c0d09; }
.btn.sm { min-height: 34px; padding: 5px 14px; font-size: 11px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- kabuk ---------- */
.shell { display: none; grid-template-columns: 250px 1fr; min-height: 100vh; position: relative; z-index: 1; }
.shell.on { display: grid; }
.sidebar { border-right: 1px solid var(--line-soft); background: rgba(8,11,19,.7); padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 20px; }
.side-brand b { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.side-brand small { display: block; font-size: 9px; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; }
.side-nav { display: grid; gap: 2px; }
.side-nav button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--dim); padding: 11px 12px; border-radius: 10px; font-size: 13.5px; transition: all .15s; }
.side-nav button:hover { background: rgba(201,169,106,.07); color: var(--cream); }
.side-nav button.on { background: rgba(201,169,106,.14); color: var(--gold-2); font-weight: 600; }
.side-nav .ic { width: 20px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--faint); }

.main { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.9rem; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--dim); }
.role-badge { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold-2); }

@media (max-width: 900px) {
  .shell.on { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 30% 0 0; transform: translateX(-100%); transition: transform .3s; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .main { padding: 18px 16px 60px; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--cream); border-radius: 10px; width: 42px; height: 42px; }

/* ---------- kartlar ve tablolar ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(19,31,54,.5), rgba(9,13,22,.7)); }
.stat .k { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-family: var(--serif); font-size: 2rem; color: var(--gold-2); margin-top: 4px; line-height: 1.1; }
.stat .s { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.panel { border: 1px solid var(--line-soft); border-radius: 16px; background: linear-gradient(165deg, rgba(19,31,54,.42), rgba(9,13,22,.66)); padding: 20px; margin-bottom: 20px; }
.panel h3 { margin-bottom: 14px; color: var(--gold-2); font-size: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th { text-align: left; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding: 12px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(8,11,19,.6); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid rgba(240,231,213,.05); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(201,169,106,.05); }
.tbl tr.clickable { cursor: pointer; }

.chip { display: inline-block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.chip.confirmed, .chip.paid, .chip.sent, .chip.active, .chip.refunded { color: var(--ok); border-color: rgba(127,191,154,.4); }
.chip.payment_pending, .chip.pending, .chip.refund_pending, .chip.cancellation_requested { color: var(--warn); border-color: rgba(227,178,95,.4); }
.chip.cancelled, .chip.no_show, .chip.failed, .chip.out_of_service, .chip.inactive { color: var(--danger); border-color: rgba(226,104,92,.4); }
.chip.seated, .chip.completed { color: var(--info); border-color: rgba(127,168,217,.4); }
.chip.expired, .chip.draft, .chip.maintenance { color: var(--faint); border-color: rgba(240,231,213,.2); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 220px; }

/* huni */
.funnel { display: grid; gap: 10px; }
.fun-row { display: grid; grid-template-columns: 160px 1fr 60px; gap: 12px; align-items: center; font-size: 12.5px; }
.fun-bar { height: 26px; border-radius: 7px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); min-width: 3px; box-shadow: 0 4px 14px rgba(201,169,106,.25); }
.fun-row b { text-align: right; color: var(--gold-2); }

/* çekmece */
.drawer-back { position: fixed; inset: 0; background: rgba(3,4,8,.6); backdrop-filter: blur(3px); z-index: 60; display: none; }
.drawer-back.on { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 96vw); z-index: 61; transform: translateX(102%);
  transition: transform .32s cubic-bezier(.2,.8,.25,1); background: linear-gradient(180deg, #0d1524, #0a0e18);
  border-left: 1px solid var(--line); box-shadow: var(--shadow); overflow-y: auto; padding: 26px; }
.drawer.on { transform: none; }
.drawer h2 { font-size: 1.5rem; margin-bottom: 4px; }
.drawer .close { position: absolute; top: 18px; right: 18px; background: none; border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; color: var(--cream); font-size: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; margin: 16px 0; }
.kv dt { color: var(--faint); } .kv dd { color: var(--cream); }
.allergy-flag { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(227,178,95,.5); background: rgba(227,178,95,.08); color: #f0d9a8; font-size: 13px; margin: 12px 0; }
.hist { font-size: 12px; color: var(--dim); border-left: 2px solid var(--line); padding-left: 12px; display: grid; gap: 6px; margin-top: 8px; }

/* 2B plan */
.plan2d { position: relative; border: 1px solid var(--line-soft); border-radius: 14px; background:
  radial-gradient(600px 300px at 50% 0%, #14203a, #080b13 75%); overflow: hidden; }
.plan2d svg { display: block; width: 100%; height: auto; }
.plan2d .tnode { cursor: pointer; }
.plan2d .tnode:hover circle, .plan2d .tnode:hover rect { stroke: var(--gold-2); stroke-width: 2; }

/* modal (yeniden kimlik doğrulama vb.) */
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(3,4,8,.66); backdrop-filter: blur(4px); display: none; place-items: center; padding: 20px; }
.modal-back.on { display: grid; }
.modal { width: min(440px, 100%); border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(170deg, #101b30, #0a0e18); box-shadow: var(--shadow); padding: 28px; }
.modal h3 { color: var(--gold-2); margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--dim); margin-bottom: 16px; }

/* toast */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 13px 18px; border-radius: 13px; border: 1px solid var(--line); background: rgba(10,14,24,.96); box-shadow: var(--shadow); font-size: 13.5px; animation: tin .3s ease; }
.toast.err { border-color: rgba(226,104,92,.5); }
.toast.ok { border-color: rgba(127,191,154,.5); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

.muted { color: var(--faint); font-size: 12px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
code.mini { background: rgba(201,169,106,.1); border: 1px solid var(--line-soft); padding: 1px 7px; border-radius: 7px; font-size: 12px; color: var(--gold-2); }
details.json { font-size: 11.5px; }
details.json pre { white-space: pre-wrap; word-break: break-all; background: rgba(0,0,0,.3); border-radius: 8px; padding: 10px; margin-top: 6px; max-height: 200px; overflow: auto; color: var(--dim); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
