/* AurumPOS — ortak arayüz sistemi. Satır içi stil kullanılmaz (CSP: style-src 'self'). */
:root {
    --cream-50: #fffbf4;
    --cream-100: #f7f1e6;
    --cream-200: #efe4d2;
    --forest-900: #153628;
    --forest-800: #1f4a3a;
    --forest-600: #2f6b52;
    --forest-100: #dcebe3;
    --burgundy-800: #6b2d2d;
    --burgundy-700: #8a3a3a;
    --burgundy-100: #f5e1e1;
    --gold-700: #9a7b1a;
    --gold-500: #d4af37;
    --gold-400: #e0c15a;
    --gold-200: #f0df9a;
    --gold-100: #faf1c9;
    --ink: #2a2118;
    --muted: rgba(42, 33, 24, 0.62);
    --line: rgba(42, 33, 24, 0.12);
    --surface: rgba(255, 252, 246, 0.9);
    --stroke: rgba(212, 175, 55, 0.38);
    --shadow: 0 18px 50px rgba(90, 60, 20, 0.12);
    --radius: 14px;
    --radius-lg: 22px;
    --font-display: "Cormorant Garamond", "Times New Roman", serif;
    --font-ui: "Outfit", "Segoe UI", system-ui, sans-serif;
    --focus: 0 0 0 3px rgba(47, 107, 82, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-ui);
    color: var(--ink);
    background:
        radial-gradient(ellipse 80% 50% at 85% -10%, rgba(212, 175, 55, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 45% at 0% 100%, rgba(47, 107, 82, 0.1), transparent 50%),
        linear-gradient(165deg, var(--cream-50), var(--cream-100) 45%, var(--cream-200));
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5rem; line-height: 1.15; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-family: var(--font-ui); font-weight: 600; }
p { margin: 0 0 .75rem; line-height: 1.5; }
a { color: var(--forest-600); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--forest-800); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---- Yerleşim ---- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack--sm { gap: .5rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--center { justify-content: center; }
.grid { display: grid; gap: 1rem; }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 14px 28px; border-bottom: 1px solid var(--stroke);
    background: rgba(255, 252, 246, 0.7); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark { width: 14px; height: 14px; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold-200), var(--gold-500)); box-shadow: 0 0 16px rgba(212, 175, 55, .5); }
.brand__name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.brand__sub { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.userbar { display: flex; align-items: center; gap: 1rem; }
.userbar__name { font-weight: 500; }

.page { max-width: 1100px; margin: 0 auto; padding: 28px; }
.page--narrow { max-width: 460px; }
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }

.card {
    background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 24px;
}
.card--flat { box-shadow: none; }
.card__title { margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--forest-800); }
.stat__label { color: var(--muted); font-size: .9rem; }

/* ---- Form ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: .9rem; font-weight: 500; }
.input, .select, .textarea {
    font: inherit; padding: 12px 14px; min-height: 46px; border: 1px solid rgba(42, 33, 24, .25);
    border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
.input:focus, .select:focus, .textarea:focus, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--forest-600); }
.input--code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
.hint { font-size: .85rem; color: var(--muted); }
.form-error { background: var(--burgundy-100); color: var(--burgundy-800); border: 1px solid rgba(138, 58, 58, .35); border-radius: 10px; padding: 10px 14px; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--forest-600); }

/* ---- Düğmeler ---- */
.btn {
    font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
    text-decoration: none; background: #fff; color: var(--ink); border-color: rgba(42, 33, 24, .25);
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--cream-100); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: linear-gradient(180deg, var(--forest-600), var(--forest-800)); color: #fff; border-color: var(--forest-800); }
.btn--primary:hover { background: var(--forest-800); }
.btn--danger { background: var(--burgundy-700); color: #fff; border-color: var(--burgundy-800); }
.btn--danger:hover { background: var(--burgundy-800); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--forest-800); }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn--lg { min-height: 64px; padding: 14px 28px; font-size: 1.2rem; border-radius: 14px; }
.btn--block { width: 100%; }

/* ---- Tablo ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td .stack-trace { white-space: pre-wrap; word-break: break-word; font-size: .8rem; max-height: 22rem; overflow: auto; margin: 8px 0 0; }
.table td { overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: none; }
.table__actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; background: var(--cream-200); color: var(--ink); }
.badge--ok { background: var(--forest-100); color: var(--forest-800); }
.badge--warn { background: var(--gold-100); color: var(--gold-700); }
.badge--danger { background: var(--burgundy-100); color: var(--burgundy-800); }
.badge--muted { background: rgba(42, 33, 24, .08); color: var(--muted); }

/* ---- Bildirim ve diyalog ---- */
.toast-region { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--forest-900); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; }
.toast--error { background: var(--burgundy-800); }
.toast--warn { background: var(--gold-700); }
.dialog { border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 24px; max-width: 440px; width: calc(100vw - 40px); box-shadow: var(--shadow); background: var(--cream-50); color: var(--ink); }
.dialog::backdrop { background: rgba(21, 54, 40, .45); }
.dialog__actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ---- Tek seferlik gizli bilgi paneli ---- */
.secret-panel { border: 2px dashed var(--gold-500); background: var(--gold-100); border-radius: var(--radius); padding: 18px 20px; }
.secret-panel__value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 700; letter-spacing: .15em; word-break: break-all; }
.secret-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.secret-list dt { color: var(--muted); }
.secret-list dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; word-break: break-all; }

/* ---- Tablet (Tezgahtar) ---- */
.tablet { min-height: 100dvh; display: flex; flex-direction: column; }
.tablet__body { flex: 1; padding: 28px; max-width: 1100px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.staff-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 130px;
    text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--stroke);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); font-size: 1.25rem; font-weight: 500; padding: 16px;
}
.staff-tile:hover { background: #fff; border-color: var(--gold-500); }
.staff-tile__avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--forest-100); color: var(--forest-800); font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.pin { max-width: 340px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; align-items: stretch; }
.pin__dots { display: flex; justify-content: center; gap: 16px; min-height: 28px; }
.pin__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--forest-600); }
.pin__dot[data-filled="true"] { background: var(--forest-600); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pinpad__key { min-height: 68px; font: inherit; font-size: 1.6rem; font-weight: 500; border-radius: 16px; border: 1px solid var(--stroke); background: #fff; cursor: pointer; color: var(--ink); }
.pinpad__key:active { background: var(--gold-100); }
.pinpad__key--ghost { background: transparent; border-color: transparent; font-size: 1rem; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.action-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 28px; min-height: 180px;
    border-radius: var(--radius-lg); border: 1px solid var(--stroke); background: var(--surface); box-shadow: var(--shadow);
    font: inherit; color: var(--ink); text-align: left;
}
.action-card__kicker { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.action-card__name { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; }
.session-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--surface); }
.session-bar__title { font-weight: 600; }

/* ---- Müşteri tableti (boşta) ---- */
.idle { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 32px; position: relative; overflow: hidden; }
.idle__glow { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .22), transparent 60%); animation: breathe 7s ease-in-out infinite; }
.idle__content { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.idle__title { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.idle__note { font-size: 1.1rem; color: var(--muted); }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1.05); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .idle__glow { animation: none; } .btn { transition: none; } }

/* ---- Giriş / karşılama ---- */
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 1.25rem; }
.auth-card .brand { justify-content: center; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.landing-tile { display: flex; flex-direction: column; gap: 4px; padding: 22px; text-decoration: none; color: var(--ink); border-radius: var(--radius-lg); border: 1px solid var(--stroke); background: var(--surface); box-shadow: var(--shadow); }
.landing-tile:hover { border-color: var(--gold-500); background: #fff; }
.landing-tile__name { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.error-page__code { font-family: var(--font-display); font-size: 5rem; color: var(--gold-700); line-height: 1; }

/* ---- Sipariş akışı (tezgah, müşteri tableti, fatura, ödeme sayfası) ---- */
/* Dikey düzende flex-wrap, iç kartların yüksekliğini yanlış hesaplatıp taşırıyordu; grid kullanılıyor. */
.session-bar--column { display: grid; align-items: stretch; align-content: start; gap: 12px; min-width: 0; flex-shrink: 0; }
.tablet__body > * { flex-shrink: 0; }
.order-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.order-card { display: flex; flex-direction: column; align-content: start; gap: .4rem; min-width: 0; overflow-wrap: anywhere; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--cream-50); }
.order-card--alert { border-color: var(--gold-700); box-shadow: 0 0 0 3px var(--gold-100); animation: pulse-border 1.6s ease-in-out infinite; }
.order-card .row { flex-wrap: wrap; gap: .5rem; }
@keyframes pulse-border { 50% { box-shadow: 0 0 0 6px var(--gold-100); } }

.choice-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.choice { min-height: 72px; padding: 12px 16px; font: inherit; font-size: 1.15rem; font-weight: 500; border-radius: 14px; border: 1px solid var(--stroke); background: var(--surface); color: var(--ink); cursor: pointer; }
.choice:hover { border-color: var(--forest-600); }
.choice:focus-visible { outline: none; box-shadow: var(--focus); }
.choice--selected { border-color: var(--forest-800); background: var(--forest-100); color: var(--forest-800); }
.sale-form { max-width: 720px; }
.input--xl { min-height: 64px; font-size: 1.5rem; }

.customer-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.customer-card { width: min(920px, 100%); background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.customer-amount { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 700; margin: 0; }
.payment-layout { display: grid; gap: 24px; grid-template-columns: 1fr auto; align-items: start; }
@media (max-width: 760px) { .payment-layout { grid-template-columns: 1fr; } }
.account-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--cream-50); align-items: flex-start; }
.account-card__iban { font-size: 1.25rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 260px; text-align: center; }
.qr-box canvas { border: 1px solid var(--stroke); border-radius: 12px; background: #fff; max-width: 100%; }

.kvkk-box { max-height: 200px; overflow-y: auto; padding: 14px 16px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--cream-50); }
.kvkk-box h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 1.05rem; }
.check input { width: 24px; height: 24px; flex: none; margin-top: 2px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* ---- Alış akışı: Ödeme paneli ---- */
.order-row { display: flex; flex-direction: column; gap: .4rem; color: inherit; text-decoration: none; }
.order-row:hover { border-color: var(--forest-600); }
.order-row:focus-visible { outline: none; box-shadow: var(--focus); }
.payout-amount { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }

/* ---- Tezgah sihirbazı: adımlar tek kartın içinde ---- */
.wizard-card { gap: 1.25rem; }
.wizard-card h2 { font-size: 1.15rem; margin-bottom: .75rem; }
.wizard-step[hidden] { display: none; }
.wizard-step + .wizard-step { border-top: 1px solid var(--stroke); padding-top: 1.25rem; }

/* ---- Müşteri tableti: ekran geçişi ---- */
.idle--welcome .idle__content { animation: welcome-in .7s ease-out both; }
.customer-screen:not([hidden]) { animation: screen-in .45s ease-out both; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .idle--welcome .idle__content, .customer-screen:not([hidden]) { animation: none; } }

/* Bitmiş işlem ekranları (iptal / teşekkür) de bekleme ekranındaki altın ışıltıyı taşır. */
.customer-screen--glow { position: relative; overflow: hidden; }
.customer-screen--glow::before { content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .22), transparent 60%); animation: breathe 7s ease-in-out infinite; pointer-events: none; }
.customer-screen--glow > * { position: relative; }
@media (prefers-reduced-motion: reduce) { .customer-screen--glow::before { animation: none; } }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem 1rem; align-items: end; }
.form-grid .field:first-child { grid-column: 1 / -1; }
.field--action { align-self: end; }

/* ---- Müşteri tableti: yalnızca QR ---- */
.pay-qr-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 8px; }
.pay-qr { padding: 4px; border-radius: 34px; background: linear-gradient(135deg, var(--gold-200), var(--gold-500) 55%, var(--gold-700)); box-shadow: 0 24px 60px rgba(90, 60, 20, .22), 0 0 0 8px rgba(212, 175, 55, .12); }
.pay-qr__inner { padding: 18px; border-radius: 30px; background: #fff; }
.pay-qr__canvas { display: block; width: min(288px, 62vw); height: auto; aspect-ratio: 1; }
.pay-qr__title { margin: 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--forest-900); }
.pay-qr__hint { max-width: 38ch; margin: 0; }
