/*
 * MM Otomasyon paneli ve muhasebeci uygulaması (WebView) teması.
 * Görsel dil: mor üst bant ve dalgalı kenarlar, lavanta kartlar, hap biçimli giriş alanları ve düğmeler,
 * telefonda kavisli alt menü ve yan çekmece menü.
 */
:root {
  --accent: #4636c8; --accent-dark: #3a2bb0; --accent-2: #6a5ce0; --accent-text: #fff;
  --bg: #ffffff; --page: #f4f3fc; --soft: #ecebf8; --soft-2: #e2e0f5; --card: #fff;
  --text: #1f1d36; --muted: #6b6987; --line: #e2e0f2;
  --ok: #1e7a45; --warn: #8a5a00; --err: #b3261e;
  --ok-bg: #e3f4ea; --warn-bg: #fdf1d6; --err-bg: #fbe6e4; --info-bg: #ecebf8;
  --radius: 18px; --pill: 999px;
  --shadow: 0 6px 20px rgba(70, 54, 200, .10);
  --font: "Roboto", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--page); color: var(--text); }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 12px; font-weight: 500; line-height: 1.3; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }
code { font-size: 13px; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ---------- Üst çubuk ---------- */
.topbar {
  position: relative; color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 54px;
  background:
    radial-gradient(circle at 12% 40%, rgba(255,255,255,.07) 0 46px, transparent 47px),
    radial-gradient(circle at 88% 20%, rgba(255,255,255,.06) 0 60px, transparent 61px),
    radial-gradient(circle at 70% 90%, rgba(255,255,255,.05) 0 34px, transparent 35px),
    linear-gradient(160deg, var(--accent-2), var(--accent) 55%, var(--accent-dark));
}
.topbar-row { display: flex; align-items: center; gap: 8px; max-width: 1040px; margin: 0 auto; }
.topbar-title { flex: 1; margin: 0; font-size: 18px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-links { display: none; gap: 4px; }
.topbar-links a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: var(--pill); font-size: 14px; }
.topbar-links a:hover { background: rgba(255,255,255,.14); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn.bell { background: rgba(255,255,255,.16); }
.dot-count { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5a5f; color: #fff; font: 700 11px/18px var(--font); font-style: normal; text-align: center; }

/* İçerik kâğıdı: üst bandın üzerine biner (tasarımdaki gibi beyaz, üstü yuvarlak). */
main.sheet { position: relative; max-width: 1040px; margin: 0 auto; padding: 20px 16px 110px; background: var(--page); border-radius: 28px 28px 0 0; min-height: 60vh; }
.topbar ~ main.sheet { margin-top: -36px; }
body.bare main.sheet { margin: 0; padding: 0; border-radius: 0; max-width: none; }

/* ---------- Kartlar ---------- */
.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.soft, .tile { background: var(--soft); box-shadow: none; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title a { font-size: 14px; color: var(--muted); text-decoration: none; }

/* ---------- Form ---------- */
label { display: block; margin: 12px 0 6px; font-weight: 500; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 8px 0; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=search],
input[inputmode=decimal], select, textarea {
  width: 100%; max-width: 460px; padding: 12px 18px; border: 1px solid transparent; border-radius: var(--pill);
  background: var(--soft); color: var(--text); font: inherit; outline: none;
}
textarea { border-radius: 16px; max-width: 560px; min-height: 72px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); background: #fff; box-shadow: 0 0 0 3px rgba(70,54,200,.12); }
.field { position: relative; max-width: 460px; }
.field .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input { padding-left: 48px; }
.field .toggle-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > div { flex: 1 1 200px; }

/* ---------- Düğmeler ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; border-radius: var(--pill); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font: 500 15px var(--font); cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--accent-dark); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.ghost:hover, .btn.ghost:hover { background: var(--soft); }
button.danger { background: transparent; border-color: var(--err); color: var(--err); }
button.block, .btn.block { width: 100%; max-width: 460px; }
button.small, .btn.small { padding: 5px 14px; font-size: 13px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Rozetler, uyarılar ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: 12.5px; background: var(--soft); color: var(--accent); font-weight: 500; }
.badge.succeeded, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.failed, .badge.expired, .badge.error { background: var(--err-bg); color: var(--err); }
.badge.waiting_login, .badge.warning, .badge.cancelled { background: var(--warn-bg); color: var(--warn); }
.alert { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; background: var(--soft); }
.alert.error { background: var(--err-bg); color: var(--err); }
.note { border-left: 4px solid #e9a400; padding: 8px 12px; background: var(--warn-bg); border-radius: 10px; font-size: 14px; }
.pill { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: var(--pill); background: #fff; color: var(--accent); font-size: 12px; font-weight: 700; text-align: center; }

/* ---------- Tablolar ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.return .num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.return tr.sum td { font-weight: 700; }

/* ---------- Yan menü (çekmece) ---------- */
.drawer-toggle { position: absolute; opacity: 0; pointer-events: none; }
.drawer { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(320px, 84vw); padding: calc(18px + env(safe-area-inset-top)) 18px 24px; background: var(--accent); color: #fff; transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto; }
.drawer-shade { position: fixed; z-index: 39; inset: 0; background: rgba(20, 16, 60, .45); opacity: 0; pointer-events: none; transition: opacity .22s; }
.drawer-toggle:checked ~ .drawer { transform: none; }
.drawer-toggle:checked ~ .drawer-shade { opacity: 1; pointer-events: auto; }
.drawer-close { display: flex; justify-content: flex-end; cursor: pointer; color: #fff; }
.drawer-user { display: flex; gap: 12px; align-items: center; padding: 8px 0 18px; border-bottom: 1px solid rgba(255,255,255,.18); }
.drawer-mail { font-size: 13px; opacity: .8; }
.avatar { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; background: #fff; color: var(--accent); font-weight: 700; font-size: 19px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
.drawer nav a, .drawer-link { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 500; font-size: 15px; background: none; border: 0; width: 100%; justify-content: flex-start; }
.drawer nav a:hover, .drawer-link:hover, .drawer nav a.on { background: rgba(255,255,255,.14); }
.drawer nav hr { border-top-color: rgba(255,255,255,.18); }
.drawer nav .pill { margin-left: auto; }

/* ---------- Alt menü (telefon) ---------- */
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 42px; align-items: flex-end; height: calc(74px + env(safe-area-inset-bottom)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--accent); border-radius: 50% 50% 0 0 / 46px 46px 0 0; box-shadow: 0 -6px 24px rgba(70,54,200,.25); }
.bottom-nav a { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: rgba(255,255,255,.85); text-decoration: none; }
.bottom-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bottom-nav a.on { background: #fff; color: var(--accent); transform: translateY(-14px); box-shadow: 0 6px 16px rgba(20,16,60,.25); }
.bottom-nav .dot-count { top: 2px; right: 2px; }

/* Geniş ekranda: üst bağlantılar görünür, alt menü gizlenir (uygulamada her zaman alt menü). */
@media (min-width: 900px) {
  body:not(.is-app) .topbar-links { display: flex; }
  body:not(.is-app) .bottom-nav { display: none; }
  body:not(.is-app) main.sheet { padding-bottom: 40px; }
}

/* ---------- Ana sayfa ---------- */
.search { position: relative; max-width: 520px; margin: 14px auto 0; }
.search input { background: #fff; padding-right: 48px; box-shadow: 0 6px 20px rgba(20,16,60,.18); max-width: none; }
.search .icon { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.hscroll > * { scroll-snap-align: start; }
.stat { flex: 0 0 160px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.stat .icon-circle { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--soft); color: var(--accent); }
.stat strong { font-size: 24px; font-weight: 700; color: var(--text); }
.stat .muted { font-size: 13px; }
.stat .btn { padding: 4px 14px; font-size: 12.5px; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--soft); text-decoration: none; color: var(--text); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.list-item > .badge, .list-item > svg { flex-shrink: 0; }
.list-item .chev { color: var(--muted); }
.circle-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- Giriş / tanıtım (tam ekran) ---------- */
.auth-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(32px + env(safe-area-inset-top)) 18px 32px; color: #fff;
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,.06) 0 70px, transparent 71px),
    radial-gradient(circle at 90% 30%, rgba(255,255,255,.05) 0 90px, transparent 91px),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.05) 0 60px, transparent 61px),
    radial-gradient(circle at 85% 92%, rgba(255,255,255,.06) 0 80px, transparent 81px),
    linear-gradient(165deg, var(--accent-2), var(--accent) 50%, var(--accent-dark)); }
.auth-screen h1 { color: #fff; font-size: 22px; margin: 12px 0 18px; text-align: center; }
.auth-card { width: 100%; max-width: 400px; background: #fff; color: var(--text); border-radius: 26px; padding: 26px 22px; box-shadow: 0 20px 50px rgba(20,16,60,.25); }
.auth-card .field, .auth-card input { max-width: none; }
.auth-card .field + .field { margin-top: 14px; }
.auth-card .between { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin: 12px 4px 18px; }
.auth-card .between label { margin: 0; font-size: 13px; font-weight: 400; display: flex; gap: 6px; align-items: center; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .3px; }

.onboard { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.onboard-wave { position: relative; height: 150px; background: var(--accent); }
.onboard-wave svg { position: absolute; left: 0; bottom: -1px; width: 100%; height: 70px; }
.onboard-skip { position: absolute; right: 18px; top: calc(16px + env(safe-area-inset-top)); color: #fff; text-decoration: none; font-weight: 500; z-index: 2; }
.slides { flex: 1; display: flex; overflow: hidden; }
.slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 28px 0; transition: transform .3s ease; }
.slide .art { width: 210px; height: 190px; margin: 6px 0 18px; }
.slide h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.slide p { color: var(--muted); max-width: 320px; margin: 0; }
.onboard-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 24px calc(30px + env(safe-area-inset-bottom)); }
.onboard-count { color: var(--muted); font-size: 15px; }
.next-ring { position: relative; width: 72px; height: 72px; border: 0; background: none; padding: 0; color: var(--accent); }
.next-ring:hover { background: none; }
.next-ring svg { position: absolute; inset: 0; }
.next-ring span { position: absolute; inset: 12px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 500; }
.btn.dark { background: #1f1d36; border-color: #1f1d36; }

/* ---------- Profil, ayarlar, yardım ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.info-card { background: var(--soft); border-radius: var(--radius); padding: 18px; }
.info-card .info-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.info-card .info-row span:last-child { color: var(--muted); text-align: right; word-break: break-word; }
.settings-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.settings-item .icon-circle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; flex: none; }
.settings-item .grow { flex: 1; }
.settings-item .sub { font-size: 13px; color: var(--muted); }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 2px; }
details.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; color: var(--text); }
details.faq summary::after { content: "⌄"; color: var(--muted); }
details.faq[open] summary::after { content: "⌃"; }
details.faq p { color: var(--muted); margin: 10px 0 2px; font-size: 14px; }
.form-card { max-width: 460px; margin: 0 auto; }

/* ---------- Mevcut ekranların öğeleri ---------- */
.code { font: 700 32px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 6px; }
ul.events { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ul.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.events time { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.q-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.q-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.choices { display: grid; gap: 4px; margin: 8px 0; }
.choices select { max-width: 300px; padding: 8px 14px; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin: 6px 0; }
.address { padding: 8px 12px; border-radius: 12px; font-size: 14px; background: var(--soft); }
.address.mismatch { background: var(--warn-bg); }
.address.match { background: var(--ok-bg); }
/* Mevzuat notları (gider önerisi): uyarı sarı, bilgi açık mor. */
.legal-notes { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.legal-notes li { padding: 8px 12px; border-radius: 12px; font-size: 14px; background: var(--info-bg); }
.legal-notes li.warning { background: var(--warn-bg); }
.legal-notes details { margin-top: 4px; } .legal-notes summary { cursor: pointer; color: var(--muted); font-size: 13px; }
/* Karar defteri onayı (öneriden farklı ya da uyarılı karar). */
.ack-box { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); display: grid; gap: 6px; font-size: 14px; }
.ack-box input[type=text] { width: 100%; }
.bulk-ack { font-size: 13px; flex-basis: 100%; }
ol.steps { list-style: none; padding: 0; margin: 0; }
ol.steps h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.disabled-step { opacity: .65; }
.plan-entry { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ledger-select { min-width: 140px; max-width: 200px; padding: 8px 12px; }
.big-check { width: 22px; height: 22px; accent-color: var(--accent); }

/* Uzaktan Luca ekranı */
.screen-wrap { position: relative; background: #000; border-radius: 16px; overflow: auto; max-height: 75vh; touch-action: manipulation; }
.screen-wrap img { display: block; width: 100%; max-width: none; height: auto; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.screen-wrap .dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 3px solid #ffb000; border-radius: 50%; pointer-events: none; }
.screen-empty { padding: 48px 16px; text-align: center; color: #fff; }
.type-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.type-row input[type=text] { flex: 1 1 180px; max-width: none; font-size: 18px; letter-spacing: 1px; }
.zoom { display: inline-flex; align-items: center; gap: 4px; margin: 8px 0; }
.zoom button { padding: 5px 14px; }
.zoom button.on { background: var(--accent); color: var(--accent-text); }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.keys button { padding: 7px 14px; }

@media print { .topbar, .bottom-nav, .drawer, .disabled-step, .note + .note { display: none; } body { background: #fff; } main.sheet { margin: 0; padding: 0; } .card { box-shadow: none; } }

/* Defterler: satır kartları */
.ledger-row { align-items: flex-start; background: #fff; border: 1px solid var(--soft); }
.ledger-row .title { white-space: normal; }
.ledger-row .badge { margin-top: 6px; }
.ledger-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.ledger-controls .ledger-select { flex: 1 1 170px; max-width: none; }
.ledger-controls .ok-check { margin: 0; align-items: center; font-weight: 500; }
.sticky-save { position: sticky; bottom: 96px; z-index: 5; margin-top: 14px; }
@media (min-width: 900px) { body:not(.is-app) .sticky-save { bottom: 16px; } }
.dup-title { display: none; }

/* Sekmeler ve dönem hapları */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; margin-bottom: 14px; background: var(--soft); border-radius: 18px; }
.tabs a { flex: 1 1 auto; text-align: center; padding: 9px 10px; border-radius: var(--pill); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.tabs a.on { background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(70, 54, 200, .12); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -4px 0; padding: 0 4px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 16px; border-radius: var(--pill); background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.on { background: #fff; color: var(--accent); }

/* Mükellef: KDV sonucu */
.hero-card { position: relative; overflow: hidden; margin-bottom: 16px; padding: 20px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); box-shadow: 0 12px 28px rgba(70, 54, 200, .28); }
.hero-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.hero-top .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.hero-top .badge.ok { background: #fff; color: var(--ok); }
.hero-label { margin-top: 18px; font-size: 14px; opacity: .9; }
.hero-amount { font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; overflow-wrap: anywhere; }
.hero-amount small { font-size: 16px; font-weight: 500; opacity: .85; }
.hero-foot { margin-top: 12px; font-size: 13px; opacity: .85; }
.flow-rows { display: grid; gap: 4px; }
.flow-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.flow-row:last-child { border-bottom: 0; }
.flow-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.flow-row .sub { font-size: 13px; color: var(--muted); }
.flow-row .num { font-weight: 700; white-space: nowrap; }
.flow-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--soft); color: var(--accent); }
.flow-row.up .flow-icon { background: var(--warn-bg); color: var(--warn); }
.flow-row.up .num { color: var(--warn); }
.say-list { margin: 14px 0 0; padding: 14px 16px 14px 34px; background: var(--soft); border-radius: 16px; font-size: 14.5px; }
.say-list li + li { margin-top: 6px; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.tile .icon-circle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--accent); margin-bottom: 6px; }
.tile strong { font-size: 24px; }
.tile-sum { font-size: 13px; font-weight: 500; color: var(--accent); overflow-wrap: anywhere; }
.small-print { font-size: 12.5px; text-align: center; padding: 0 8px; }

/* Faturalar (açılır satır) */
details.invoice-item { display: block; padding: 0; }
details.invoice-item > summary { display: flex; gap: 12px; align-items: center; padding: 14px; cursor: pointer; list-style: none; }
details.invoice-item > summary::-webkit-details-marker { display: none; }
.invoice-item .amount { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.invoice-item .amount .sub { font-size: 12.5px; color: var(--muted); }
.invoice-more { padding: 0 14px 14px 62px; }
.invoice-more .info-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.invoice-more .info-row span:last-child { color: var(--muted); text-align: right; overflow-wrap: anywhere; }

/* Fişler */
.receipt-item .thumb { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 12px; background: #fff; }
.receipt-wrap { display: grid; gap: 6px; }
.receipt-wrap form { justify-self: end; }
.empty-state { text-align: center; }
.icon-circle.lg { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--accent); }
.photo-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 110px; padding: 14px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; text-align: center; }
.photo-btn.ghost { background: var(--soft); color: var(--accent); }
.previews { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.previews:empty { display: none; }
.previews figure { position: relative; margin: 0; }
.previews img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 14px; }
.previews .remove { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; }
.choice-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pills label { margin: 0; cursor: pointer; }
.choice-pills input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pills span { display: inline-block; padding: 9px 16px; border-radius: var(--pill); background: var(--soft); color: var(--text); font-size: 14px; font-weight: 500; }
.choice-pills input:checked + span { background: var(--accent); color: #fff; }
.choice-pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-strip { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; }
.photo-strip img { display: block; height: 260px; max-width: 80vw; object-fit: contain; border-radius: 14px; background: var(--soft); }

/* Karar ekranında kural kutusu */
.rule-box { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.rule-box > label.check { margin: 0; }
.rule-fields { display: grid; gap: 10px; margin-top: 10px; }
.rule-row { display: grid; gap: 2px; }
.rule-row label.check { margin: 4px 0; }
.rule-row select, .rule-row input[type=text] { margin-top: 4px; }
.rule-words { display: grid; gap: 6px; margin-top: 6px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.word-chip:hover { background: var(--soft); }
.word-chip.on, .word-chip.on:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.word-chip .n { color: var(--muted); font-size: 12px; }
.word-chip .tag:not(:empty) { margin-left: 4px; padding: 0 6px; border-radius: var(--pill); background: var(--soft); color: var(--muted); font-size: 11px; }
.word-chip.suggested { border: 2px solid var(--accent); font-weight: 600; }
.word-chip.suggested .tag { background: var(--accent); color: var(--accent-text); }
.word-chip.faint { opacity: .6; border-style: dashed; }
.word-chip.on .n, .word-chip.on .tag { color: inherit; background: transparent; }
.rule-check { display: grid; gap: 6px; margin: 8px 0; font-size: 14px; }
.rule-check p { margin: 0; }
.rule-check.loading { opacity: .55; }
.rule-check details summary { cursor: pointer; color: var(--accent); }
.rule-list-items { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; word-break: break-word; }
.warn-box { padding: 8px 12px; border-left: 4px solid #e9a400; border-radius: 10px; background: var(--warn-bg); color: var(--text); }
.warn-box .word-chips { margin-top: 4px; }
.rule-preview { margin: 0; padding: 8px 12px; border-radius: 12px; background: #fff; }
.rule-list .list-item { align-items: flex-start; background: #fff; border: 1px solid var(--soft); }
.rule-list .title { white-space: normal; }

/* Kayıt planı: Luca'ya giriş onayı */
.inline-check { display: inline-flex; margin: 0 8px 0 0; font-weight: 500; }
.post-confirm { margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--soft); }

/* Kullanım kılavuzu */
.guide ol, .guide ul { padding-left: 20px; margin: 8px 0; }
.guide li { margin: 6px 0; line-height: 1.55; }
.guide { scroll-margin-top: 16px; }

/* Kontör */
.low-balance { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); text-decoration: none; font-size: 14px; }
.drawer nav .pill.warn { background: #fdf1d6; color: #8a5a00; }
.tx-row strong { white-space: nowrap; }
.tx-row .neg, .neg { color: var(--warn); }
.tx-row .pos { color: var(--ok); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3px; overflow-wrap: anywhere; }
.guide-list { padding-left: 18px; margin: 10px 0 0; }
.guide-list li { margin: 4px 0; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.package { cursor: pointer; margin: 0; }
.package input { position: absolute; opacity: 0; pointer-events: none; }
.package-body { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; border: 2px solid var(--soft); background: #fff; height: 100%; }
.package input:checked + .package-body { border-color: var(--accent); background: var(--soft); }
.package input:focus-visible + .package-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.package-credits { font-size: 22px; font-weight: 700; color: var(--accent); }
.package-total { font-weight: 600; margin-top: 4px; }
.admin-tabs { flex-wrap: wrap; border-radius: 18px; }
.admin-tabs a { flex: 1 1 auto; }
.order-card .row form { flex: 1 1 260px; }
.package-form .row > div { flex: 1 1 120px; }
.list-item.stack { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 8px; }
/* Canlı iş ilerlemesi (aylık akış) */
.progress-box { border: 1px solid var(--line, #e3e1f3); border-radius: 16px; padding: 14px; margin: 12px 0; background: var(--soft); }
.progress-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress-bar { height: 10px; border-radius: 6px; background: #e3e1f3; overflow: hidden; margin: 12px 0 8px; }
.progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .6s ease; }
.progress-log { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; max-height: 160px; overflow: auto; }
.progress-log li { padding: 3px 0; border-top: 1px dashed #e3e1f3; }
.progress-log li span { color: var(--muted, #6b6890); margin-right: 6px; font-variant-numeric: tabular-nums; }
.progress-log li.warning { color: #a86500; } .progress-log li.error { color: var(--err); }
.spinner { width: 20px; height: 20px; border: 3px solid #d7d3f5; border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: mm-spin .8s linear infinite; flex: none; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
button .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
/* Toplu karar (sorulan faturalar) */
.bulk-table td:first-child, .bulk-table th:first-child { width: 36px; text-align: center; }
.bulk-table input[type=checkbox] { width: 20px; height: 20px; }
.bulk-bar { position: sticky; bottom: 72px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin: 12px 0; border-radius: 16px; background: var(--card, #fff); box-shadow: 0 4px 18px rgba(28, 26, 58, .18); }
.bulk-bar .bulk-cat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-bar select { max-width: 240px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.tabs .pill { background: var(--soft); margin-left: 4px; } .tabs a.on .pill { background: #fff; }

/* Soru ekranında faturanın mal/hizmet tablosu */
.mal-hizmet { margin: 10px 0; border: 1px solid var(--line, #e3e1f0); border-radius: 10px; overflow: hidden; }
.mal-hizmet-head { padding: 8px 12px; background: var(--soft); display: flex; gap: 8px; align-items: baseline; }
.mal-hizmet table.lines td, .mal-hizmet table.lines th { padding: 6px 10px; vertical-align: top; }
.mal-hizmet table.lines th { font-weight: 500; color: var(--muted, #666); border-bottom: 1px solid var(--line, #e3e1f0); }
.mal-hizmet table.lines tr + tr td { border-top: 1px solid var(--line, #eeedf5); }
.mal-hizmet details { padding: 0 12px 8px; }

/* Kural ön izlemesinde denetim dökümü */
.audit-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line, #e3e1f0); border-radius: 10px; background: var(--soft); }
.audit-box .audit-facts { margin: 6px 0; padding-left: 18px; }
.audit-box .warn-box { margin-top: 8px; }

/* Tür seçimi: arama kutulu pencere (layout.blade.php) */
.type-pick { display: block; width: 100%; max-width: 300px; padding: 10px 40px 10px 16px; border: 1px solid transparent; border-radius: var(--pill);
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6987' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-pick:hover { background-color: var(--soft-2); }
.type-pick:focus { border-color: var(--accent-2); outline: none; box-shadow: 0 0 0 3px rgba(70,54,200,.12); }
.type-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: 16px auto auto; padding: 0; border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); display: none; flex-direction: column; color: var(--text); }
.type-dialog[open] { display: flex; }
.type-dialog::backdrop { background: rgba(31,29,54,.45); }
.type-dialog-head { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.type-dialog-head input { flex: 1; max-width: none; }
.type-dialog-list { overflow-y: auto; padding: 4px 0 12px; }
.type-group { padding: 12px 16px 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.type-item { display: block; width: 100%; padding: 12px 16px 12px 28px; border: 0; border-radius: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.type-item:hover, .type-item.best { background: var(--soft); }
.type-item.on { color: var(--accent); font-weight: 500; }
.type-none { padding: 16px; margin: 0; }

/* Banka ekstresi gönderme (mükellef) */
.steps-list { margin: 0 0 12px; padding-left: 20px; }
.steps-list li { margin: 4px 0; }
.file-pick { margin: 8px 0 16px; min-height: 90px; }
.file-pick span { overflow-wrap: anywhere; }
.movements td:nth-child(2) { min-width: 200px; }
/* Banka hareketi: karşı hesap seçimi (panel) */
.mv-list { display: grid; gap: 8px; margin-top: 10px; }
.mv-row { padding: 10px 12px; border-radius: 12px; background: var(--soft); display: grid; gap: 6px; }
.mv-row.missing { box-shadow: inset 3px 0 0 #e9a400; }
.mv-head { display: flex; justify-content: space-between; gap: 8px; }
.mv-in { color: var(--ok); }
.mv-out { color: var(--text); }
.mv-desc { overflow-wrap: anywhere; }
.mv-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mv-edit .mv-acc { max-width: 180px; }
.mv-rule { font-size: 13px; flex-wrap: wrap; }
.mv-rule input[type=text], .mv-rule input:not([type]) { max-width: 200px; padding: 4px 10px; }
details.fis { margin: 6px 0; }
details.fis summary { cursor: pointer; padding: 6px 0; font-weight: 500; }
/* Kural kutusu: müşterinin adresi ve fatura adresi alt alta */
.address-compare { display: grid; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.address-compare > div { display: grid; gap: 2px; }
.address-compare strong { font-weight: 500; overflow-wrap: anywhere; }
.address-compare.mismatch { background: var(--warn-bg); }
.address-compare.match { background: var(--ok-bg); }
.address-verdict { font-weight: 500; }
