/* =========================================================
   Müşteri Takip Sistemi · Stil dosyası
   ========================================================= */

/* ---------- Temel ---------- */
* { box-sizing: border-box; }
body { margin: 0; background: #f3f6f9; color: #203044; font: 14px 'Segoe UI', Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
textarea { border: 1px solid #dce4e9; border-radius: 7px; padding: 10px; resize: vertical; }
button { cursor: pointer; }
select, input { border: 1px solid #dce4e9; border-radius: 7px; background: white; padding: 10px; color: #203044; }
h1 { font-size: 27px; margin: 0 0 7px; letter-spacing: -.7px; }
h2 { font-size: 17px; margin: 0; }
p { line-height: 1.6; }

/* ---------- Kenar çubuğu ---------- */
aside { position: fixed; width: 224px; height: 100vh; background: #112e3b; color: #b4c9d2; padding: 30px 18px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { color: white; font-size: 30px; font-weight: 700; padding: 0 14px 34px; }
.brand span { color: #60d3c1; }
.nav { border: 0; color: inherit; background: transparent; text-align: left; padding: 14px 16px; border-radius: 8px; margin: 3px 0; }
.nav:hover { background: #1b3f4c; }
.nav.active { background: #24505b; color: #fff; }
.nav[hidden] { display: none; }
.asidefoot { margin-top: auto; padding: 15px; font-size: 12px; line-height: 1.8; }
.data-tools { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.side-btn { border: 1px solid #2c5562; background: transparent; color: #cfe1e6; border-radius: 6px; padding: 7px 10px; text-align: left; font-size: 12px; }
.side-btn:hover { background: #1b3f4c; }
.side-btn.danger { color: #f2b8b0; border-color: #5a3a3a; }

/* ---------- Ana alan ---------- */
main { margin-left: 224px; padding: 28px 38px; max-width: 1700px; }
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dde5eb; padding-bottom: 22px; }
.muted { color: #7a8899; font-size: 13px; }
.topright { display: flex; align-items: center; gap: 15px; }
.demo { background: #fff4d8; color: #856324; border: 1px solid #f1dfad; padding: 10px 15px; border-radius: 8px; margin: 20px 0; font-size: 12px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 22px; }

/* ---------- Butonlar ---------- */
.primary { background: #087e80; border: 0; border-radius: 7px; color: #fff; padding: 11px 17px; }
.primary:hover { background: #066a6c; }
.secondary { background: white; border: 1px solid #dce4e9; border-radius: 7px; padding: 9px 13px; color: #365467; }
.rowbtn { border: 0; background: #edf7f6; color: #087e80; padding: 7px 11px; border-radius: 6px; white-space: nowrap; }
.rowbtn:hover { background: #dcf0ee; }

/* ---------- Kartlar / istatistik ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 23px; }
.card { background: white; border: 1px solid #e0e7ed; border-radius: 12px; padding: 22px; }
/* ---------- Parçalı tarih girişi (GG . AA . YYYY  SS : DD) ---------- */
.seg-date { position: relative; display: inline-flex; align-items: center; gap: 1px; width: fit-content; max-width: 100%; border: 1px solid #dce4e9; border-radius: 7px; background: #fff; padding: 3px 4px 3px 8px; }
.seg-date:focus-within { border-color: #087e80; box-shadow: 0 0 0 3px #087e8022; }
.seg-date.seg-invalid { border-color: #d64541; box-shadow: 0 0 0 3px #d6454122; }
.seg-date .seg { border: 0; background: transparent; padding: 6px 1px; text-align: center; font-variant-numeric: tabular-nums; outline: none; border-radius: 4px; color: #203044; }
.seg-date .seg:focus { background: #e7f6f3; }
.seg-date .seg::placeholder { color: #a9b5c0; }
.seg-date .seg-d, .seg-date .seg-m, .seg-date .seg-h, .seg-date .seg-i { width: 2.3em; }
.seg-date .seg-y { width: 3.6em; }
.seg-sep { color: #8a97a4; user-select: none; }
.seg-gap { width: 10px; }
.seg-cal { border: 0; background: transparent; cursor: pointer; padding: 4px 6px; font-size: 14px; line-height: 1; border-radius: 5px; }
.seg-cal:hover { background: #edf7f6; }
/* Asıl tarih alanı görünmez ama form doğrulaması ve takvim için yerinde durur */
.seg-date .seg-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; padding: 0 !important; border: 0 !important; margin: 0 !important; min-width: 0 !important; }

/* Başlangıç rehberi */
.guide-card { margin-bottom: 22px; border-color: #b8dedb; }
.guide-step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #edf1f4; }
.guide-step > div { flex: 1; }
.guide-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #edf1f4; color: #536576; }
.guide-step.current .guide-num { background: #087e80; color: #fff; }
.guide-step.ok .guide-num { background: #1f9d55; color: #fff; }
.guide-step.ok b { color: #7a8899; text-decoration: line-through; }

/* Günlük paket bilgisi */
.batch-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 16px 20px; border-color: #b8dedb; background: #f4fbfa; }

/* Tıklanabilir özet kutuları */
.stat-card { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat-card:hover, .stat-card:focus-visible { border-color: #087e80; box-shadow: 0 6px 20px #087e801f; transform: translateY(-1px); outline: none; }
.stat-go { position: absolute; top: 18px; right: 18px; font-size: 11px; color: #087e80; opacity: 0; transition: opacity .15s; }
.stat-card:hover .stat-go, .stat-card:focus-visible .stat-go { opacity: 1; }
.statnum { font-size: 32px; font-weight: 650; margin: 12px 0 8px; }
.small { font-size: 12px; }
.green { color: #188b73; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.bar { height: 7px; background: #e5edf0; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.bar i { display: block; height: 100%; background: #15998b; }

/* ---------- Tablolar ---------- */
table { border-collapse: collapse; width: 100%; text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #8a97a4; font-weight: 600; background: #f8fafb; }
td, th { padding: 15px 11px; border-bottom: 1px solid #edf1f4; }
td { font-size: 13px; }
.person { font-weight: 600; }
.sub { display: block; color: #8793a1; font-size: 11px; margin-top: 5px; }
.badge { display: inline-block; border-radius: 5px; padding: 5px 8px; font-size: 11px; background: #eaf5f1; color: #19846c; }
.badge.warn { background: #fff0de; color: #ae7427; }
.badge.red { background: #fdeceb; color: #ba6256; }
.listrow { padding: 15px 0; border-bottom: 1px solid #edf1f4; display: flex; justify-content: space-between; gap: 12px; }
.search { width: 300px; }
.tools { display: flex; gap: 10px; align-items: center; }
.empty { padding: 30px; color: #7a8899; text-align: center; }

/* ---------- Diyalog / form ---------- */
dialog { border: 0; border-radius: 16px; padding: 28px; width: 560px; max-width: 95vw; max-height: 92vh; box-shadow: 0 20px 100px #112e3b40; }
dialog::backdrop { background: #102c3d70; }
/* Kart başlığı (ad + ✕ kapat) kaydırırken üstte sabit kalır */
dialog > .cardhead:first-child, dialog > .sheet-toolbar {
  position: sticky; top: -28px; z-index: 20;
  margin: -28px -28px 18px; padding: 20px 28px 14px;
  background: #fff; border-bottom: 1px solid #edf1f4;
  border-radius: 16px 16px 0 0;
}
dialog > .cardhead:first-child button[aria-label="Kapat"] { flex: none; font-size: 16px; width: 40px; height: 40px; padding: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.fields label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.full { grid-column: 1 / -1; }
.foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast { position: fixed; bottom: 24px; right: 28px; background: #123d40; color: white; padding: 16px 24px; border-radius: 10px; display: none; z-index: 1000; max-width: calc(100vw - 32px); }
.progressline { display: flex; justify-content: space-between; font-size: 12px; }
.info { background: #f1f8f8; padding: 14px; border-radius: 8px; color: #477271; font-size: 12px; line-height: 1.7; }
.quota { width: 70px; }

/* ---------- Dikkat sekmeleri ---------- */
.attention-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.attention-tab { border: 1px solid #e0e7ed; border-radius: 9px; background: #f8fafb; padding: 16px; text-align: left; color: #536576; }
.attention-tab b { display: block; font-size: 26px; margin-bottom: 5px; color: #223c49; }
.attention-tab.selected { border-color: #078486; background: #edf9f7; }
.attention-tab span { font-size: 12px; }

/* ---------- Servis formu ---------- */
.sheet-dialog { width: 850px; }
.sheet-toolbar { display: flex; justify-content: space-between; margin-bottom: 24px; }
.sheet-heading { display: flex; justify-content: space-between; border-bottom: 2px solid #254851; padding-bottom: 18px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.sheet-grid small { color: #657780; }
.sheet-box { border: 1px solid #dce4e9; padding: 12px; min-height: 55px; }
.service-sheet { color: #172c37; background: white; }
.service-sheet h2 { font-size: 16px; }
.service-sheet p { margin: 8px 0 16px; }
.service-sheet td, .service-sheet th { border: 1px solid #cfd8dc; }
#printSheet { display: none; }

/* ---------- Akıllı arama ---------- */
.smart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 22px; }
.smart-sidebar { position: static; width: auto; height: auto; display: block; color: #203044; background: white; padding: 22px; align-self: start; }
.smart-context { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 24px; }
.smart-context h2 { font-size: 14px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.quick-action { border: 1px solid #d8e5e7; background: white; border-radius: 8px; padding: 12px; color: #365467; }
.quick-action.selected { background: #e7f6f3; border-color: #087e80; color: #087e80; font-weight: 600; }
.quick-label { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; font-size: 13px; }
.quick-label[hidden] { display: none; }

/* ---------- v2 eklemeleri ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select, .toolbar input { padding: 8px 10px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.chip { border: 1px solid #dce4e9; background: #fff; border-radius: 20px; padding: 7px 13px; color: #365467; }
.chip.selected { background: #e7f6f3; border-color: #087e80; color: #087e80; font-weight: 600; }
tr.group td { background: #f1f8f8; font-weight: 600; color: #365467; font-size: 12px; padding: 9px 11px; }
.danger-btn { background: #fff; border: 1px solid #f0c9c3; color: #b0473a; border-radius: 7px; padding: 9px 13px; }
.danger-btn:hover { background: #fdf1ef; }
.linkbtn { display: inline-block; text-decoration: none; background: #edf7f6; color: #087e80; padding: 7px 11px; border-radius: 6px; font-size: 13px; }
.linkbtn.wa { background: #e8f8ee; color: #1b8a4a; }
.inline-input { padding: 7px 9px; width: 100%; min-width: 120px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.form-row input { flex: 1; min-width: 160px; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.settings-fields label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.admin-box { border: 1px dashed #dce4e9; border-radius: 10px; padding: 14px; margin-top: 24px; }
tr.inactive td { opacity: .55; }
.attention-tabs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- Giriş ekranı ---------- */
#auth { display: none; }
body.locked > aside, body.locked > main { display: none; }
body.locked #auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: #112e3b; padding: 16px; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px; width: 420px; max-width: 100%; box-shadow: 0 20px 80px #0005; }
.auth-brand { font-size: 24px; font-weight: 700; color: #112e3b; }
.auth-brand span { color: #15998b; }
.auth-card h2 { margin: 18px 0 6px; }
.auth-card label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; margin: 12px 0; }
.auth-card input { width: 100%; }
.auth-btn { width: 100%; margin-top: 8px; padding: 13px; }
.auth-error { color: #b33; min-height: 1.2em; margin: 6px 0; font-size: 13px; }
.start-choice { border: 1px solid #dce4e9; border-radius: 10px; padding: 4px 12px; margin: 14px 0 4px; }
.start-choice label { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-size: 13px !important; margin: 8px 0 !important; cursor: pointer; }
.start-choice input { width: auto !important; margin-top: 3px; }
.userchip { background: #edf7f6; color: #087e80; border-radius: 20px; padding: 7px 13px; font-size: 12px; font-weight: 600; }
.perm-list { border: 1px solid #edf1f4; border-radius: 10px; padding: 4px 14px; margin: 10px 0; }
.perm-list label { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 10px 0; border-bottom: 1px solid #edf1f4; cursor: pointer; }
.perm-list label:last-child { border-bottom: 0; }
.perm-list input { margin-top: 3px; }

/* Personel görünümünde metin seçme kapalı (kopyalamaya karşı caydırıcı) */
body.no-copy { -webkit-user-select: none; user-select: none; }
body.no-copy input, body.no-copy textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Bildirim rozeti, parça tablosu, kampanya ---------- */
.nav-new { background: #15998b33; color: #e6f4f6; font-weight: 600; margin-bottom: 10px; }
.nav-new:hover { background: #15998b55; }
.nav-badge { display: inline-block; background: #e5534b; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: 6px; font-weight: 700; }
.nav-badge[hidden] { display: none; }
.badge.new { background: #e5534b; color: #fff; }
.note-cell { max-width: 260px; font-size: 12px; color: #536576; }
.note-cell b { color: #223c49; font-weight: 600; }
/* Müşteri kartı: sağdan açılan çekmece */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(720px, 100vw) !important; max-width: 100vw !important; height: 100dvh; max-height: 100dvh !important; border-radius: 16px 0 0 16px; animation: drawerIn .22s ease-out; }
dialog.drawer::backdrop { background: rgba(16, 24, 40, .25); }
dialog.drawer > .cardhead:first-child { border-radius: 16px 0 0 0; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.drawer-nav { display: flex; align-items: center; gap: 6px; }
.drawer-nav button { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.drawer-nav button:disabled { opacity: .4; cursor: default; }
/* Hızlı sayfa geçişi */
.pager-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-btns button { min-width: 36px; padding: 6px 10px; font-size: 16px; line-height: 1; }
.pager-num { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #667085; }
.pager-num input { width: 70px; padding: 6px 8px; text-align: center; }
/* Müşteriler: son servis yılı kutucukları */
.year-filter { margin: 4px 0 12px; }
.year-filter > .muted { display: block; margin-bottom: 6px; }

/* Servis geçmişi: yıl kutucukları ve işlem kartları */
.year-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; margin-bottom: 6px; }
.year-tab { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 76px; padding: 8px 12px; border: 1px solid #e4e7ec; border-radius: 10px; background: #fff; color: #344054; cursor: pointer; text-align: left; font: inherit; }
.year-tab b { font-size: 15px; }
.year-tab span { font-size: 11.5px; color: #667085; }
.year-tab:hover { border-color: #b7dcd8; }
.year-tab.selected { background: #0e6f6e; border-color: #0e6f6e; color: #fff; }
.year-tab.selected span { color: #d6efec; }
.year-group { margin: 8px 0 14px; }
.year-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #e4e7ec; margin-bottom: 8px; }
.year-head b { font-size: 16px; }
.year-head span { font-size: 12.5px; color: #667085; }
.svc-item { border: 1px solid #eef0f3; border-radius: 10px; padding: 11px 13px; margin: 0 0 8px; background: #fcfcfd; }
.svc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-top b { font-size: 14px; }
.svc-actor { margin-left: auto; }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .stats.stats-3 { grid-template-columns: 1fr; } }
.svc-price { font-size: 12.5px; font-weight: 700; color: #101828; background: #fef6e7; border: 1px solid #f5dfb3; padding: 1px 8px; border-radius: 6px; }
.year-total { margin-left: auto; font-weight: 700; color: #101828; font-size: 13.5px; }
.money { color: #101828; }
.svc-type { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #eef1f4; color: #475467; }
.svc-type.periodic { background: #e8f3f2; color: #0e6f6e; }
.svc-type.repair { background: #fdeceb; color: #b42318; }
.svc-parts { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 2px; }
.part-chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; background: #fff; border: 1px solid #d0e6e4; color: #0e6f6e; }
.part-chip.extra { border-color: #e4e7ec; color: #475467; }
.svc-note { margin: 6px 0 6px; font-size: 13px; color: #344054; line-height: 1.45; word-break: break-word; }
.svc-item .row-actions { margin-top: 4px; }
.svc-item .linkbtn { padding: 5px 10px; font-size: 12.5px; }

/* Randevu: ziyaret nedeni ve götürülecek parçalar */
.visit-fields { display: flex; flex-direction: column; gap: 7px; font-size: 12px; border: 1px solid #b8dedb; background: #f4fbfa; border-radius: 10px; padding: 12px 14px; margin: 6px 0; }
.visit-fields[hidden] { display: none !important; }
.visit-fields .parts-check { background: #fff; }
.visit-cell b { color: #087e80; }
/* Ücret: tutar ve altında ödeme şekli listesi (alt alta) */
.price-fields { display: flex; flex-direction: column; gap: 10px; }
.price-fields > label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
/* Birden çok kutucuk içeren alan grubu (iç içe label olmaması için div) */
.fields .field-group { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.parts-check { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; border: 1px solid #dce4e9; border-radius: 8px; }
.parts-check label { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 13px !important; cursor: pointer; }
.part-row-late td { background: #fdf3f1; }
.wa-preview { white-space: pre-wrap; background: #e8f8ee; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #1d3b2a; }

/* =========================================================
   Renk kodları · Görüşme / takip durumları
   Rengi değiştirmek için yalnızca aşağıdaki değişkenleri düzenle.
   ========================================================= */
:root {
  --st-aranacak: #2f6fd0;     /* Aranacak: mavi */
  --st-ulasilamadi: #d64541;  /* Ulaşılamadı / telefonu açmadı: kırmızı */
  --st-tekrar: #e08a1e;       /* Tekrar aranacak: turuncu */
  --st-randevu: #1f9d55;      /* Randevu alındı: yeşil */
  --st-istemedi: #7d4dbb;     /* Bakım istemedi: mor */
  --st-tamam: #0f8a85;        /* Bakım tamamlandı: camgöbeği */
  --st-bekleniyor: #7a8899;   /* Bakım bekleniyor: gri */
  --due-late: #d64541;        /* Bakım tarihi geçmiş */
  --due-today: #e08a1e;       /* Bakım bugün */
}
/* Varsayılan renk önce gelir; aşağıdaki durum sınıfları onu ezer */
.st { --c: #7a8899; }
.st-aranacak { --c: var(--st-aranacak); }
.st-ulasilamadi { --c: var(--st-ulasilamadi); }
.st-tekrar { --c: var(--st-tekrar); }
.st-randevu { --c: var(--st-randevu); }
.st-istemedi { --c: var(--st-istemedi); }
.st-tamam { --c: var(--st-tamam); }
.st-bekleniyor { --c: var(--st-bekleniyor); }

/* Durum rozeti: renkli nokta + yazı */
.st { display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; padding: 5px 9px; font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }

/* Tablo satırının solunda durum şeridi */
tr[class*="row-st-"] td:first-child { box-shadow: inset 4px 0 0 var(--c); }
tr.row-st-ulasilamadi td { background: color-mix(in srgb, var(--st-ulasilamadi) 4%, white); }

/* Son görüşme / açıklama hücresi durum rengiyle */
.note-cell .st-text { color: var(--c); font-weight: 700; }

/* Bakım tarihi rengi */
.due-late { color: var(--due-late); font-weight: 700; }
.due-today { color: var(--due-today); font-weight: 700; }

/* Görüşme geçmişi: soldan renkli çizgi */
.call-item { border-left: 4px solid var(--c, #dce4e9); padding-left: 12px; }
.call-item b { color: var(--c); }

/* Akıllı arama sonuç düğmeleri kendi renginde */
.quick-action[class*="st-"] { border-color: color-mix(in srgb, var(--c) 40%, white); color: var(--c); }
.quick-action[class*="st-"].selected { background: var(--c); border-color: var(--c); color: #fff; }

/* Renk açıklaması */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; align-items: center; }

/* =========================================================
   Müşteri etiketleri (renkleri Ayarlar sayfasından seçilir)
   ========================================================= */
.tag { --tag: #7a8899; display: inline-flex; align-items: center; gap: 5px; border-radius: 12px; padding: 3px 9px; font-size: 11px; font-weight: 600; color: var(--tag); background: color-mix(in srgb, var(--tag) 13%, white); border: 1px solid color-mix(in srgb, var(--tag) 35%, white); margin: 4px 4px 0 0; white-space: nowrap; }
.tags { display: block; }
.tag-check { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid #dce4e9; border-radius: 8px; }
.tag-check label { flex-direction: row !important; align-items: center; gap: 6px !important; cursor: pointer; }
.tag-check input:checked + .tag { background: var(--tag); color: #fff; }
input[type="color"] { width: 46px; height: 34px; padding: 2px; cursor: pointer; }

/* ---------- Duyarlı tasarım ---------- */
@media (max-width: 1100px) {
  .grid, .smart-grid { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  main { padding: 20px; margin-left: 185px; }
  aside { width: 185px; }
}

@media (max-width: 760px) {
  aside { position: static; width: auto; height: auto; padding: 14px 16px; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; align-items: center; }
  .brand { font-size: 16px !important; padding: 0 10px 0 0; white-space: nowrap; }
  .brand br, .brand .small { display: none; }
  .nav { white-space: nowrap; padding: 10px 12px; }
  .asidefoot { margin: 0; padding: 0 0 0 8px; line-height: 1.4; }
  .asidefoot > :not(.data-tools), .asidefoot br { display: none; }
  .data-tools { flex-direction: row; margin: 0; }
  .side-btn { white-space: nowrap; }
  main { margin-left: 0; padding: 16px; }
  header { flex-wrap: wrap; gap: 10px; }
  .topright { flex-wrap: wrap; }
  .heading { flex-wrap: wrap; }
  .stats, .attention-tabs { grid-template-columns: 1fr 1fr; }
  .fields, .smart-context, .quick-actions, .sheet-grid, .two-col, .settings-fields { grid-template-columns: 1fr; }
  .toolbar > * { flex: 1 1 140px; }
  .parts-check { grid-template-columns: 1fr; }
  .topright .muted { display: none; }
  .cardhead { flex-wrap: wrap; }
  .search { width: 100%; }
  .card { padding: 16px; overflow-x: auto; }
  dialog { padding: 18px; }
  dialog > .cardhead:first-child, dialog > .sheet-toolbar { top: -18px; margin: -18px -18px 14px; padding: 14px 18px 10px; }
}

/* ---------- Yazdırma ---------- */
@media print {
  aside, header, .demo, .heading button, .tools, .toast { display: none !important; }
  main { margin: 0; padding: 0; }
  .card { border: 0; }
  button { display: none; }
  @page { size: A4; margin: 12mm; }
  body.printing-sheet > * { display: none !important; }
  body.printing-sheet > #printSheet { display: block !important; }
  body.printing-sheet dialog { display: none !important; }
  .service-sheet { font-size: 11px; break-inside: avoid; }
  .service-sheet h1 { font-size: 23px; }
  .service-sheet h2 { font-size: 14px; }
  .sheet-toolbar { display: none; }
  /* Personel görünümünde servis formu dışında yazdırma yapılmaz */
  body.no-copy:not(.printing-sheet) > * { display: none !important; }
}

/* =========================================================
   GÖRÜNÜM KATMANI
   Renk, yazı ve yerleşim kuralları. Renkleri değiştirmek için
   yalnızca :root içindeki değişkenleri düzenleyin.
   ========================================================= */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e4e7ec;
  --line-soft: #eef0f3;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --accent: #0e6f6e;
  --accent-hover: #0b5958;
  --accent-soft: #e8f3f2;
  --side: #0f2129;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .1);
  --side-text: #a7b8bf;
  --side-muted: #6e858d;
  --radius: 10px;
  --gutter: 32px;
  --side-w: 240px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.2px; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; display: block; }

/* Form alanları */
select, input, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 111, 110, .12); }
.seg-date .seg:focus { box-shadow: none; }
.seg-date:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 111, 110, .12); }
.seg-cal { color: var(--muted); display: inline-flex; }
.seg-cal .ico { width: 16px; height: 16px; }

/* Kenar çubuğu */
aside { width: var(--side-w); background: var(--side); padding: 18px 12px; color: var(--side-text); }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; font-size: inherit !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark .ico { width: 19px; height: 19px; }
.brand-text b { display: block; color: #fff; font-size: 16px; font-weight: 650; letter-spacing: .1px; }
.brand-text small { display: block; color: var(--side-muted); font-size: 11.5px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--side-muted); padding: 16px 12px 6px; }
.nav-label[hidden] { display: none; }
.nav { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; margin: 1px 0; border-radius: 8px; font-size: 13.5px; color: var(--side-text); }
.nav .ico { width: 17px; height: 17px; opacity: .85; }
.nav:hover { background: var(--side-hover); color: #fff; }
.nav.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav.active .ico { opacity: 1; color: #5ec9bd; }
.nav-new { justify-content: center; background: var(--accent); color: #fff; font-weight: 600; margin: 0 0 6px; }
.nav-new:hover { background: var(--accent-hover); }
.nav-new .ico { opacity: 1; }
.nav-badge { margin-left: auto; background: #e5534b; padding: 0 7px; border-radius: 10px; font-size: 11px; line-height: 18px; }
.asidefoot { padding: 14px 8px 4px; margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: var(--side-muted); line-height: 1.5; }
.data-tools { margin-bottom: 10px; }
.side-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid rgba(255, 255, 255, .12); color: var(--side-text); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.side-btn .ico { width: 15px; height: 15px; }
.side-btn:hover { background: var(--side-hover); color: #fff; }

/* Üst çubuk ve sayfa başlığı */
main { margin-left: var(--side-w); padding: 0 var(--gutter) 48px; max-width: none; }
header { position: sticky; top: 0; z-index: 30; height: 60px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); background: rgba(246, 247, 249, .92); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.crumb { font-weight: 600; color: var(--text-2); font-size: 13.5px; }
#todayLabel { display: none; }
.topright { gap: 8px; }
.userchip { display: inline-flex; align-items: center; gap: 9px; background: transparent; color: var(--text); padding: 0 10px 0 0; font-size: 13px; font-weight: 600; line-height: 1.2; border-radius: 0; margin-right: 4px; }
.userchip small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn-icon .ico { width: 16px; height: 16px; }
.heading { margin: 26px 0 20px; }
.heading .muted { font-size: 13.5px; }
.eyebrow { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }

/* Düğmeler */
.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; font-weight: 600; box-shadow: var(--shadow); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary:disabled { opacity: .5; cursor: default; }
.secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; font-weight: 500; box-shadow: var(--shadow); }
.secondary:hover { background: #f9fafb; border-color: #d0d5dd; }
.rowbtn { background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.rowbtn:hover { background: var(--accent-soft); border-color: #b7dcd8; color: var(--accent); }
.danger-btn { border-radius: 8px; padding: 8px 13px; }
dialog button[aria-label="Kapat"] { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; }
dialog button[aria-label="Kapat"] .ico { width: 18px; height: 18px; }
.chip { border-radius: 999px; padding: 6px 13px; font-size: 13px; border-color: var(--line); color: var(--text-2); }
.chip.selected { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Kartlar */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.cardhead { margin-bottom: 16px; }
.info { background: #f8fafb; border: 1px solid var(--line-soft); color: var(--text-2); border-radius: 8px; }
.stats { gap: 16px; margin-bottom: 20px; }
.stat-card { display: block; padding: 18px; }
.stat-card:hover, .stat-card:focus-visible { border-color: #c9d2da; box-shadow: 0 4px 14px rgba(16, 24, 40, .06); transform: none; }
.stat-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-label { color: var(--muted); font-size: 13px; }
.statnum { font-size: 28px; font-weight: 650; letter-spacing: -.5px; margin: 2px 0 2px; }
.stat-sub { color: var(--muted); font-size: 12.5px; }
.bar { height: 6px; background: #eef1f4; }
.bar i { background: var(--accent); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.mini-stats span { background: #f9fafb; border: 1px solid var(--line-soft); border-radius: 8px; padding: 9px 10px; font-size: 12px; color: var(--muted); }
.mini-stats b { display: block; font-size: 17px; color: var(--text); }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice > div { flex: 1; }
.notice b { display: block; font-size: 13.5px; }
.notice span { color: var(--muted); font-size: 12.5px; }
.notice-warn { background: #fffaf2; border-color: #f4dcb5; }
.notice-warn > .ico { color: #b54708; }
.fresh-card { margin-bottom: 20px; border-left: 3px solid var(--accent); }
.title-ico { display: flex; align-items: center; gap: 8px; }
.title-ico .ico { color: var(--accent); }
.count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.batch-card { background: var(--surface); border-color: var(--line); }
.batch-card b { display: block; font-size: 16px; }

/* Kurulum adımları */
.guide-card { border-color: var(--line); }
.guide-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.guide-step { display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; border-top: 1px solid var(--line); cursor: pointer; }
.guide-step:hover:not(:disabled) { border-color: #b7dcd8; background: #fbfdfd; }
.guide-step.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.guide-step:disabled { cursor: default; opacity: .65; }
.guide-step b { font-size: 13px; display: block; }
.guide-num { width: 26px; height: 26px; font-size: 12px; }
.guide-num .ico { width: 14px; height: 14px; }
.guide-step.ok b { text-decoration: none; }

/* Tablolar */
th { background: #f9fafb; color: var(--muted); font-size: 11.5px; letter-spacing: .04em; font-weight: 600; }
td, th { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
tbody tr:hover td { background: #fafbfc; }
.person { font-weight: 600; }
.badge { border-radius: 6px; font-weight: 500; }
.listrow { border-bottom: 1px solid var(--line-soft); }
.search { width: 280px; }

th { white-space: nowrap; }
main .card { overflow-x: auto; }
.inline-input { min-width: 140px; padding: 7px 9px; }
.quota { width: 70px; padding: 7px 9px; }
dialog { width: 640px; }
.listrow > span:last-child, .listrow > .muted:last-child { white-space: nowrap; }
table.compact td { padding: 10px 12px; }

/* Arama ekranı */
.caller-name { font-size: 24px; font-weight: 650; margin: 0 0 4px; }
.caller-phone { font-size: 22px; font-weight: 650; color: var(--accent); letter-spacing: .3px; margin: 8px 0 2px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 0; padding: 14px; background: #f9fafb; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.facts dt { color: var(--muted); font-size: 11.5px; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.quick-action { border-radius: 8px; font-weight: 500; }

/* Müşteri kartı */
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.card-actions .row-actions { margin: 0 !important; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b7dcd8; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 7px 12px; font-weight: 500; }
.linkbtn .ico { width: 15px; height: 15px; }
.linkbtn.wa { border-color: #bfe5cd; }
.facts-3 { grid-template-columns: repeat(3, 1fr); margin: 0; }
.facts .span-2 { grid-column: span 2; }
.facts .span-3 { grid-column: 1 / -1; }
.appt-box { margin-top: 12px; padding: 12px 14px; border: 1px solid #b7dcd8; background: #f4fbfa; border-radius: var(--radius); }
.appt-box .title-ico { gap: 8px; }
.appt-box p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.section-title { margin: 22px 0 10px; }
dialog details summary { padding: 10px 0; border-top: 1px solid var(--line-soft); }

/* Ayarlar */
.check-row { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 13px !important; }
.check-row input { width: auto; }
.spec-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.spec-list li { background: #f9fafb; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 500; }
.spec-list span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-bottom: 2px; }

/* Pencereler ve bildirim */
dialog { border-radius: 14px; padding: 24px; box-shadow: 0 24px 64px rgba(16, 24, 40, .2); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
dialog > .cardhead:first-child, dialog > .sheet-toolbar { top: -24px; margin: -24px -24px 16px; padding: 18px 24px 14px; border-radius: 14px 14px 0 0; }
.toast { background: #101828; border-radius: 10px; font-size: 13.5px; box-shadow: 0 12px 32px rgba(16, 24, 40, .25); }

/* Giriş ekranı */
body.locked #auth { background: radial-gradient(1200px 600px at 20% 0%, #17424b 0%, #0f2129 55%); }
.auth-card { width: 400px; padding: 34px; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { color: #fff; }
.auth-brand b { display: block; font-size: 16px; color: var(--text); }
.auth-brand small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.auth-card h2 { font-size: 20px; margin: 0 0 4px; }
.auth-btn { padding: 11px; font-size: 14px; }
.auth-foot { text-align: center; margin: 14px 0 0; }

/* Menü düğmesi (yalnızca telefonda görünür) ve arka perde */
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; align-items: center; justify-content: center; color: var(--text); flex: none; }
.menu-btn .ico { width: 20px; height: 20px; }
.scrim { display: none; }

/* Randevu yazdırma */
.print-day { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.print-day .seg-date { background: var(--surface); }
.appt-sheet table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }
.appt-sheet th, .appt-sheet td { border: 1px solid #cfd8dc; padding: 7px 8px; vertical-align: top; font-size: 12px; }
.appt-sheet h2 { margin: 16px 0 4px; }
.appt-sheet .nowrap { white-space: nowrap; }
.appt-sheet .check-cell { text-align: center; font-size: 16px; width: 60px; }
tr[onclick] { cursor: pointer; }
.staff-add input[name="quota"] { max-width: 90px; flex: 0 0 90px; }

/* Duyarlı yerleşim (görünüm katmanı) */
@media (max-width: 1100px) {
  :root { --gutter: 20px; --side-w: 200px; }
  aside { width: var(--side-w); }
  main { margin-left: var(--side-w); padding: 0 var(--gutter) 40px; }
  .guide-steps { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
/* =========================================================
   TELEFON (≤ 760 px)
   Menü soldan açılan çekmece olur, tablolar karta dönüşür,
   pencereler tam ekran açılır, dokunma alanları büyür.
   ========================================================= */
@media (max-width: 760px) {
  :root { --gutter: 14px; }
  html, body { overflow-x: hidden; }
  body { font-size: 14.5px; }

  /* Menü çekmecesi */
  aside { position: fixed !important; top: 0; left: 0; bottom: 0; width: 270px !important; height: 100dvh !important; z-index: 60; padding: 16px 12px !important;
    flex-direction: column !important; overflow-y: auto !important; overflow-x: hidden !important; align-items: stretch !important;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.menu-open aside { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .brand { padding: 2px 8px 18px !important; }
  .brand-text { display: block !important; }
  .nav-label { display: block !important; }
  .nav-label[hidden] { display: none !important; }
  .nav { width: 100% !important; padding: 12px 12px !important; font-size: 15px; white-space: normal !important; }
  .nav-new { margin: 0 0 6px !important; }
  .asidefoot { display: block !important; margin-top: auto !important; border-top: 1px solid rgba(255, 255, 255, .07) !important; padding: 14px 8px 4px !important; }
  .asidefoot > * { display: block !important; }
  .data-tools { flex-direction: column !important; }

  /* Üst çubuk */
  main { margin-left: 0 !important; padding: 0 var(--gutter) 40px !important; }
  header { height: 56px; padding: 0 var(--gutter) !important; gap: 10px; flex-wrap: nowrap !important; }
  .menu-btn { display: inline-flex; }
  .crumb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
  .topright { gap: 6px; flex-wrap: nowrap !important; }
  .userchip { margin: 0; padding: 0; }
  .userchip > span:not(.avatar) { display: none; }
  #pwBtn, #logoutBtn { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 0; }
  #pwBtn .ico, #logoutBtn .ico { width: 18px; height: 18px; }

  /* Sayfa başlığı ve düğmeler */
  .heading { margin: 18px 0 14px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .heading .row-actions { width: 100%; }
  .heading .row-actions > * { flex: 1 1 auto; }
  .heading select, .heading input { width: 100%; }
  h1 { font-size: 20px; }
  .primary, .secondary { min-height: 40px; }
  .rowbtn { min-height: 34px; padding: 6px 12px; }
  .print-day { width: 100%; }
  .print-day > * { flex: 1 1 100%; }
  .print-day .seg-date { width: 100%; }

  /* Kartlar ve ızgaralar */
  .card { padding: 14px; border-radius: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-ico { width: 30px; height: 30px; margin-bottom: 8px; }
  .statnum { font-size: 22px; }
  .grid, .smart-grid, .two-col, .fields, .settings-fields, .smart-context, .quick-actions, .sheet-grid { grid-template-columns: 1fr !important; }
  .attention-tabs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .attention-tab { padding: 12px; }
  .attention-tab b { font-size: 20px; }
  .guide-steps, .spec-list { grid-template-columns: 1fr; }
  .facts, .facts-3 { grid-template-columns: 1fr 1fr; }
  .facts .span-2, .facts .span-3 { grid-column: 1 / -1; }
  .mini-stats { grid-template-columns: repeat(3, 1fr); }
  .toolbar { gap: 8px; }
  .toolbar > * { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .toolbar .search { flex-basis: 100%; }
  .search { width: 100%; }
  .form-row > * { flex: 1 1 100%; }
  .staff-add input[name="quota"] { max-width: none; flex: 1 1 100%; }
  .batch-card .bar { width: 100% !important; }
  .notice { flex-wrap: wrap; }
  .notice > button { width: 100%; }
  .caller-name { font-size: 21px; }
  .caller-phone { font-size: 20px; }
  .smart-sidebar { order: 2; }

  /* Tablolar → kartlar */
  table.rtable, table.rtable tbody { display: block; width: 100%; }
  table.rtable thead { display: none; }
  table.rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  table.rtable tr.group { display: block; padding: 8px 12px; border: 0; background: transparent; margin: 6px 0 4px; }
  table.rtable tr.group td { padding: 0; background: transparent; }
  table.rtable td { display: block; padding: 0; border: 0; min-width: 0; font-size: 13.5px; }
  table.rtable td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
  table.rtable td:not([data-label])::before { display: none; }
  table.rtable .cell-main { grid-column: 1 / -1; }
  table.rtable .cell-action { grid-column: 1 / -1; }
  table.rtable .cell-action .rowbtn { width: 100%; }
  table.rtable .note-cell { grid-column: 1 / -1; max-width: none; order: 6; }
  table.rtable .cell-action { order: 7; }
  table.rtable tr[class*="row-st-"] { border-left: 4px solid var(--c); }
  table.rtable tr[class*="row-st-"] td:first-child { box-shadow: none; }
  table.rtable tbody tr:hover td { background: transparent; }
  .hide-m { display: none !important; }
  /* Randevu tablosu sütun başlıkları */
  .appt-table td:nth-child(1) { grid-column: 1 / -1; }
  .appt-table td:nth-child(2)::before { content: 'Saat'; display: block; }
  .appt-table td:nth-child(3)::before { content: 'Servis'; display: block; }
  .appt-table td:nth-child(4) { grid-column: 1 / -1; }
  .appt-table td:nth-child(4)::before { content: 'Yapılacak iş'; display: block; }
  .appt-table td:nth-child(5) { grid-column: 1 / -1; }
  .appt-table td:nth-child(n)::before { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
  /* Diğer geniş tablolar kendi içinde yatay kayar */
  main .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Pencereler tam ekran */
  dialog { width: 100vw !important; max-width: 100vw !important; height: 100dvh; max-height: 100dvh !important; margin: 0; border-radius: 0; padding: 16px; }
  dialog > .cardhead:first-child, dialog > .sheet-toolbar { top: -16px !important; margin: -16px -16px 14px !important; padding: 12px 16px 10px !important; border-radius: 0 !important; }
  dialog.drawer { border-radius: 0; inset: 0; }
  dialog.drawer > .cardhead:first-child { flex-wrap: nowrap; align-items: flex-start; }
  .drawer-nav span { display: none; }
  .year-filter .year-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
  .pager { flex-direction: column; align-items: stretch; }
  .pager-btns { justify-content: space-between; }
  .card-actions > * { flex: 1 1 auto; }
  .parts-table th:nth-child(4), .parts-table td:nth-child(4) { display: none; }
  .parts-table td, .parts-table th { padding: 9px 8px; font-size: 13px; }
  dialog table { width: 100%; }
  dialog .listrow { flex-wrap: wrap; }
  .parts-check, .tag-check { grid-template-columns: 1fr 1fr; }
  .seg-date { width: 100%; }
  .seg-date .seg-d, .seg-date .seg-m, .seg-date .seg-h, .seg-date .seg-i { width: 2.6em; }
  .toast { left: 12px; right: 12px; bottom: 12px; text-align: center; }
  .auth-card { padding: 24px; }
}
@media (max-width: 380px) {
  .stats, .attention-tabs, .facts, .facts-3 { grid-template-columns: 1fr; }
  .parts-check { grid-template-columns: 1fr; }
}
@media print {
  main { margin: 0 !important; padding: 0 !important; }
  header { display: none !important; }
}

/* ---------- Randevular: görünüm sekmeleri ---------- */
.view-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tab { border: 0; background: none; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; border-radius: 0; }
.view-tab:hover { color: var(--accent); }
.view-tab.selected { color: var(--accent); border-bottom-color: var(--accent); }
.count.warn { background: #fdeceb; color: #b42318; }
.rowbtn.strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.rowbtn.strong:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.rowbtn.danger-text { color: #b42318; }
.rowbtn.danger-text:hover { background: #fdeceb; border-color: #f4c7c3; color: #b42318; }
.badge.plain { background: #f2f4f7; color: var(--text-2); }

/* İptal edilen randevular */
.cancel-box { border: 1px solid #f4c7c3; background: #fff8f7; border-radius: 10px; padding: 12px 14px; }
.cancel-box[hidden] { display: none !important; }
.cancel-alert { border-color: #f4c7c3; background: #fff8f7; }
.cancel-alert .title-ico svg { color: #b42318; }
.reason-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; }
.reason-summary > span:first-child { margin-right: 4px; }
.reason-chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: #f2f4f7; color: var(--text-2); }
.reason-chip b { color: var(--text); margin-left: 3px; }
.cancel-table tr.resolved td { color: var(--muted); }
.cancel-table .row-actions, .debt-table .row-actions { flex-wrap: wrap; gap: 6px; }

/* Haftalık takvim */
.week-bar .week-label { font-size: 15px; padding: 0 4px; }
.week-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: -4px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-item b { color: var(--text); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; min-height: 220px; display: flex; flex-direction: column; min-width: 0; }
.week-day .week-head { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.week-day .week-head b { font-size: 13px; text-transform: capitalize; }
.week-day .week-head span:not(.count) { grid-column: 1; font-size: 11.5px; color: var(--muted); }
.week-day .week-head .count { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.week-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #f4fbfa; }
.week-day.today .week-head b { color: var(--accent); }
.week-day.past { background: #f6f7f8; }
.week-day.past .week-item { opacity: .8; }
.week-items { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.week-item { display: flex; flex-direction: column; gap: 1px; text-align: left; width: 100%; border: 1px solid var(--line); border-left: 4px solid var(--tc); background: #fff; border-radius: 7px; padding: 7px 8px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.week-item:hover { border-color: var(--tc); box-shadow: 0 2px 6px rgba(16, 24, 40, .08); }
.week-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-time { font-weight: 700; font-size: 13px; color: var(--tc); }
.wi-name { font-weight: 600; font-size: 13px; }
.wi-sub, .wi-tech { font-size: 11.5px; color: var(--muted); }
.wi-price { font-size: 11.5px; font-weight: 700; color: var(--text); margin-top: 2px; }
.week-empty { margin: 4px 2px; font-size: 12px; color: var(--muted); }
@media (max-width: 1200px) { .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Ücret: senet / vade alanları ve taksitler */
.term-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 10px 12px; border: 1px dashed #cfd8dd; border-radius: 8px; background: #fff; }
.term-fields[hidden] { display: none !important; }
.term-fields > label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.term-fields p { grid-column: 1 / -1; margin: 0; }
.plan-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px; }
.plan-row { display: grid; grid-template-columns: 70px 92px 90px 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 8px; border-radius: 7px; background: #f8fafb; border: 1px solid var(--line-soft); }
.plan-row .plan-state { color: var(--muted); }
.plan-row.late { background: #fff6f5; border-color: #f4c7c3; }
.plan-row.late .plan-state { color: #b42318; font-weight: 600; }
.plan-row.paid { background: #f1f8f5; }
.plan-row.paid .plan-state { color: #1f7a45; }
.plan-row .rowbtn { padding: 3px 9px; }
.debt { color: #b42318; }
.debt-table tr.debt-late td:first-child { box-shadow: inset 3px 0 0 #d64541; }
.stat-alert { border-color: #f4c7c3; background: #fff8f7; }
.stat-alert .statnum { color: #b42318; }
.notice-danger { background: #fff8f7; border-color: #f4c7c3; }
.notice-danger svg { color: #b42318; }

@media (max-width: 760px) {
  .view-tab { padding: 10px 11px; font-size: 13.5px; }
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .week-bar .week-label { flex-basis: 100%; order: -1; text-align: center; }
  .week-meta { margin-top: 0; }
  .term-fields { grid-template-columns: 1fr; }
  .plan-row { grid-template-columns: 1fr auto; }
  .plan-row .plan-state { grid-column: 1 / -1; }
  .plan-row .rowbtn { grid-column: 1 / -1; width: 100%; }
  .cancel-table .row-actions > *, .debt-table .row-actions > * { flex: 1 1 calc(50% - 6px); text-align: center; }
  .debt-table tr.debt-late { border-left: 4px solid #d64541; }
  .debt-table tr.debt-late td:first-child { box-shadow: none; }
}
@media (max-width: 760px) {
  /* Telefonda boş günler tek satır kalsın */
  .week-day:not(:has(.week-item)) .week-items { display: none; }
  .week-day:not(:has(.week-item)) .week-head { border-bottom: 0; }
}

/* ---------- Cihaz iptali, pasif müşteriler, numara sorgulama ---------- */
:root { --st-iptal: #475467; }
.st-iptal { --c: var(--st-iptal); }
tr.row-st-iptal td { color: var(--muted); }
.device-alert { border-color: #d0d5dd; background: #f6f7f9; }
.device-alert .title-ico svg { color: #475467; }
.device-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 12px 14px; border: 1px dashed #e4b4ae; border-radius: var(--radius); background: #fffafa; }
.device-zone b { display: block; font-size: 13.5px; }
.device-quick { margin: 0 0 12px; }
.lookup-card { padding: 20px; }
.lookup-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.lookup-input { width: 100%; font-size: 22px; letter-spacing: .5px; padding: 14px 16px; border-radius: 10px; border: 1.5px solid var(--line); }
.lookup-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.lookup-card p { margin: 8px 0 0; }
#lookupResults { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
#lookupResults > p { margin: 0; }
.lookup-empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lookup-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.lookup-item.is-inactive { border-left-color: #98a2b3; background: #fbfbfc; }
.lookup-item.is-deleted { border-left-color: #b42318; }
.lookup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lookup-head b { font-size: 16px; }
.lookup-head .sub { display: block; }
.lookup-note { margin: 10px 0 0; font-size: 13px; padding: 7px 10px; border-radius: 7px; }
.lookup-note.danger { background: #fdeceb; color: #912018; }
.lookup-facts { margin-top: 12px; }
.inactive-table .row-actions { flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .device-zone { flex-direction: column; align-items: stretch; }
  .device-zone .rowbtn { width: 100%; }
  .device-quick { width: 100%; }
  .lookup-input { font-size: 19px; }
  .inactive-table .row-actions > * { flex: 1 1 calc(50% - 6px); text-align: center; }
}

/* Kurtarma ekranı: kayıtlı veri okunamadığında */
.storage-error { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(15, 33, 41, .72); }
.storage-error-card { max-width: 560px; width: 100%; background: var(--surface); border-radius: 14px; padding: 24px; border-top: 4px solid #b42318; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.storage-error-card h1 { font-size: 20px; margin: 0 0 10px; color: #912018; }
.storage-error-card p, .storage-error-card li { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.storage-error-card ol { padding-left: 20px; margin: 12px 0 18px; }

/* Doğrudan randevu (arıza / ek iş) */
.book-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafb; }
@media (max-width: 760px) { .book-row .rowbtn { width: 100%; } }

/* Ön üç filtre: parça seçiminde tek kutu, tam satır */
.parts-check .front3 { grid-column: 1 / -1; font-weight: 600; padding-bottom: 6px; border-bottom: 1px dashed #dce4e9; }
.parts-check .front3 small { font-weight: 400; margin-left: 4px; }

/* Sunucu kipi: bağlantı / kayıt durumu şeridi */
.net-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1000; max-width: min(640px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 10px; background: #fff4d6; color: #6b4a00; border: 1px solid #f0d58a; box-shadow: 0 6px 24px rgba(0,0,0,.12); font-size: 14px; line-height: 1.4; }
.net-banner.bad { background: #fde8e8; color: #8a1c1c; border-color: #f3b4b4; }
.net-banner[hidden] { display: none; }
