/* Monokrom (sicak notr) tema — marka: Onmasa; gorsel referans tryestera.com.
   Token ADLARI tarihsel: --navy-* / --blue / --gold artik renk degil, koyuluk
   basamagi ve "marka aksani" anlaminda. Yeniden adlandirmak 600+ satirlik CSS'i
   ve app.js'i bosuna dolasirdi. Durum renkleri (--green/--red/--orange) BILINCLI
   olarak korunuyor: panelde onayli/iptal/bekliyor anlami tasiyorlar. */
:root {
  --navy-950: #030303;
  --navy-900: #1c1d1f;
  --navy-800: #2e2e30;
  --navy-700: #45454a;
  --ink: #1c1d1f;
  --muted: #6b6b68;
  --muted-2: #9a9a96;
  --line: #e6e5e2;
  --line-strong: #d8d8d6;
  --canvas: #f9f8f6;
  --surface: #ffffff;
  --blue: #45454a;
  --blue-soft: #f5f5f3;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --green: #2d8150;
  --green-soft: #e8f4eb;
  --orange: #a86d1d;
  --orange-soft: #fff2dc;
  --red: #b24e45;
  --red-soft: #fbeceb;
  --shadow-sm: none;  /* landing dili: kart yuzeyleri duz, ayrim hairline cerceveyle */
  --shadow-md: 0 12px 28px rgba(0, 0, 0, .07);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }

button, a, select { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(28, 29, 31, .28);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app-shell { display: flex; min-height: 100vh; }

#login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.login-card {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.02em;
}

.login-brand .brand-mark { flex: 0 0 auto; }
.login-brand .brand-copy small { color: var(--muted); }
.login-heading h1 { margin: 0; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.login-heading p { margin: 8px 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 16px; }
.login-card .form-input { min-height: 46px; }
.login-card .form-input:focus { border-color: var(--navy-700); outline: 0; box-shadow: 0 0 0 4px rgba(28, 29, 31, .12); }
.login-status { min-height: 20px; margin: 0; padding: 9px 11px; border-radius: 8px; color: var(--muted); background: #f5f5f3; font-size: 12px; }
.login-status.error { color: var(--red); background: var(--red-soft); }
.login-status.success { color: var(--green); background: var(--green-soft); }
.login-submit { width: 100%; min-height: 46px; margin-top: 2px; }

#sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex: 0 0 264px;
  flex-direction: column;
  width: 264px;
  min-height: 100vh;
  padding: 22px 14px 18px;
  color: #e8e7e3;
  background: var(--navy-900);
}

/* Mobil menü karartması — yalnızca ≤820px'te görünür (sidebar z:20, topbar z:10). */
.sidebar-scrim { display: none; }

#main-content { flex: 1; min-width: 0; }

#topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 216, 214, .85);
  background: rgba(249, 248, 246, .94);
  backdrop-filter: blur(12px);
}

#view { max-width: 1480px; margin: 0 auto; padding: 32px clamp(20px, 4vw, 48px) 56px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* Logo tam sahne (robot + laptop + saksi, daire cerceve). 34px'te tamami
   okunmuyor; bu yuzden CSS ile robotun yuzune zoom-crop yapilir — ayri bir
   kirpilmis dosya tutmaya gerek yok. Buyuk kullanimlar (landing hero) tam
   gorseli <img> ile gosterir. */
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #fff url("/static/logo.webp") no-repeat 52% 34%;
  background-size: 210%;
  text-indent: -9999px;
  overflow: hidden;
}

.brand-copy small { display: block; margin-top: 1px; color: #9a9a94; font-size: 10px; font-weight: 500; letter-spacing: .04em; }

.sidebar-section { margin: 12px 0 18px; }

.sidebar-label {
  padding: 0 10px 7px;
  color: #8a8a84;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: #c8c7c1;
  background: transparent;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.nav-link.active { color: #fff; background: var(--navy-700); box-shadow: inset 3px 0 #fff; }
.nav-link-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nav-icon { display: grid; width: 20px; place-items: center; color: #9a9a94; font-size: 15px; }
.nav-link.active .nav-icon { color: #fff; }
.nav-count { min-width: 21px; padding: 2px 6px; border-radius: 999px; color: #fff; background: var(--red); font-size: 11px; font-weight: 700; text-align: center; }

.sidebar-bottom { margin-top: auto; }

.salon-context { padding: 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(0, 0, 0, .26); }
.salon-context label { display: block; margin-bottom: 6px; color: #9a9a94; font-size: 11px; font-weight: 700; }
.salon-context strong { display: block; overflow: hidden; color: #f4f3ef; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.salon-context small { display: block; overflow: hidden; margin-top: 3px; color: #9a9a94; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.topbar-start, .topbar-end { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { min-width: 0; }
.topbar-title small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.topbar-title strong { display: block; overflow: hidden; color: var(--ink); font-size: 18px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.topbar-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mobile-menu { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--navy-800); background: var(--surface); font-size: 19px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0; color: var(--ink); font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.page-head p { max-width: 660px; margin: 8px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.section-title a, .text-link { border: 0; color: var(--ink); background: none; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.section-title a:hover, .text-link:hover { text-decoration: underline; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #45454a;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.button:hover { border-color: var(--navy-900); color: #fff; background: var(--navy-900); transform: translateY(-1px); }
.button.primary { border-color: var(--navy-900); color: #fff; background: var(--navy-900); box-shadow: 0 4px 10px rgba(0, 0, 0, .14); }
.button.primary:hover { border-color: var(--navy-950); background: var(--navy-950); }
.button.ghost { border-color: transparent; background: transparent; }
.button.danger { border-color: #efc7c3; color: var(--red); background: var(--red-soft); }
.button.danger:hover { border-color: var(--red); color: #fff; background: var(--red); }
.button.warn:hover { border-color: #93430a; background: #93430a; color: #fff; }
.button.ghost:hover { border-color: transparent; color: var(--ink); background: #f0efec; }
.button.warn { background: #b45309; color: #fff; }
.button.small { min-height: 34px; padding: 6px 14px; border-radius: 999px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.card-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line);
}
.metric-card { min-width: 0; min-height: 124px; padding: 18px; border: 0; border-radius: 0; background: var(--surface); }
.metric-card .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 13px; color: var(--ink); font-size: 31px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
/* Uzun takvim ID'si gibi kırılamayan değerler kartı taşırmasın. */
.metric-card .field-help { overflow-wrap: anywhere; }
.metric-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 16px; }
.metric-icon.warn { color: var(--orange); background: var(--orange-soft); }
.metric-icon.danger { color: var(--red); background: var(--red-soft); }
.metric-icon.success { color: var(--green); background: var(--green-soft); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; align-items: start; }
.workspace-main, .workspace-side { min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 14px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: -.015em; }
.panel-header small { color: var(--muted); }
.panel-body { padding: 16px 18px; }

.list { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 13px 18px; border-bottom: 1px solid #eeede9; }
.list-row:last-child { border-bottom: 0; }
.list-row-main { min-width: 0; }
.list-row-title { display: block; overflow: hidden; color: var(--ink); font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { flex: 0 0 auto; text-align: right; }
.list-row-time { display: block; color: var(--muted); font-size: 11px; }

.badge { display: inline-flex; min-height: 23px; align-items: center; padding: 3px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.badge.warn { color: var(--orange); background: var(--orange-soft); }
.badge.danger { color: var(--red); background: var(--red-soft); }
.badge.neutral { color: #6b6b68; background: #f0efec; }
.badge.sandbox { color: #73501c; background: #fff0c9; }
.badges { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.channel-list { display: grid; min-width: 0; gap: 4px; }
.channel-row { display: grid; min-width: 0; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid #eeede9; }
.channel-row:last-child { border-bottom: 0; }
.channel-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.channel-status-dot.warn { background: var(--orange); }
.channel-status-dot.off { background: var(--muted-2); }
.channel-row strong { display: block; font-size: 13px; }
.channel-row small { display: block; min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.quick-info { display: grid; min-width: 0; gap: 0; }
.quick-info-row { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #eeede9; }
.quick-info-row:last-child { border-bottom: 0; }
.quick-info-row span:first-child { color: var(--muted); font-size: 12px; }
.quick-info-row span:last-child { min-width: 0; max-width: 64%; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 750; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.toolbar-start, .toolbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-select, .form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}
.filter-select { width: auto; min-width: 146px; min-height: 38px; padding: 7px 14px; border-radius: 999px; color: #56565a; font-size: 12px; }
.form-textarea { min-height: 92px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: #a8a8a3; }
.field { display: grid; gap: 6px; }
.field label, .field-label { color: #56565a; font-size: 12px; font-weight: 750; }
.field-help { margin: 0; color: var(--muted); font-size: 11px; }
.field-error { margin: 0; color: var(--red); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.form-section + .form-section { margin-top: 14px; }
.form-section-head { margin-bottom: 16px; }
.form-section-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.form-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 14px; color: var(--muted); background: #f5f5f3; font-size: 11px; font-weight: 600; letter-spacing: .11em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px; border-top: 1px solid #eeede9; color: var(--ink); vertical-align: middle; }
.data-table tr:hover td { background: #fbfaf8; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }

.agenda-date-strip { display: grid; grid-template-columns: repeat(5, minmax(76px, 1fr)); gap: 8px; margin-bottom: 12px; }
.date-button { min-height: 60px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 11px; text-align: center; }
.date-button strong { display: block; margin-top: 3px; color: var(--ink); font-size: 15px; }
/* Secili gun: eskiden mavi zeminle ayrisirdi; notr palette zemin farki
   gorunmez kaldigi icin ayrim koyu cerceve + kalin metne tasindi. */
.date-button.active { border-color: var(--ink); color: var(--ink); background: #f0efec; font-weight: 600; }
.date-button.active strong { color: var(--ink); }
.agenda { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.agenda-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 74px; padding: 12px 18px; border-bottom: 1px solid #eeede9; }
.agenda-row:last-child { border-bottom: 0; }
.agenda-time { color: var(--ink); font-size: 14px; font-weight: 800; }
.agenda-client strong { display: block; color: var(--ink); }
.agenda-client small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.agenda-actions { display: inline-flex; grid-column: 4; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.empty-slot { color: var(--muted); }
.empty-slot strong { color: #6b6b68; font-weight: 650; }
.week-grid { display: grid; grid-template-columns: 74px repeat(7, minmax(100px, 1fr)); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.week-cell { min-height: 78px; padding: 9px; border-right: 1px solid #eeede9; border-bottom: 1px solid #eeede9; }
.week-head { min-height: 54px; color: var(--muted); background: #faf9f7; font-size: 11px; font-weight: 750; text-align: center; }
.week-head strong { display: block; margin-top: 2px; color: var(--ink); font-size: 15px; }
.week-time { color: var(--muted); font-size: 11px; }
.week-event { margin-top: 4px; padding: 6px; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.week-event.blue { color: var(--blue); background: var(--blue-soft); }
.week-event.warn { color: var(--orange); background: var(--orange-soft); }

.inbox-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 650px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.conversation-list { overflow-y: auto; border-right: 1px solid var(--line); }
.conversation-list-head { padding: 16px; border-bottom: 1px solid var(--line); }
.conversation-list-head h2 { margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.conversation-search { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); }
.conversation-item { display: block; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid #eeede9; color: var(--ink); background: var(--surface); text-align: left; }
.conversation-item:hover { background: #fbfaf8; }
.conversation-item.active { border-left: 3px solid var(--ink); padding-left: 13px; background: var(--blue-soft); }
.conversation-item-head, .conversation-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item-preview { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item-meta { margin-top: 8px; color: var(--muted-2); font-size: 11px; }
.thread-panel { display: flex; min-width: 0; flex-direction: column; }
.thread-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.thread-header h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.thread-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.thread-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.message-list { flex: 1; min-height: 390px; max-height: 590px; overflow-y: auto; padding: 22px 20px; background: #faf9f7; }
.message { display: flex; flex-direction: column; max-width: min(76%, 620px); margin: 0 0 14px; }
.message.user { align-items: flex-start; }
.message.assistant, .message.human { align-items: flex-end; margin-left: auto; }
.message.tool { max-width: 100%; }
.message-bubble { padding: 10px 12px; border-radius: 13px; color: var(--ink); background: #efeeea; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant .message-bubble { border-bottom-right-radius: 4px; color: #245b39; background: var(--green-soft); }
.message.human .message-bubble { border-bottom-right-radius: 4px; color: #254e78; background: var(--blue-soft); }
.message.tool .message-bubble { width: 100%; border: 1px dashed var(--line-strong); color: #6b6b68; background: #faf9f7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.message-meta { margin: 4px 3px 0; color: var(--muted-2); font-size: 10px; }
.composer { padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.composer-row { display: flex; align-items: flex-end; gap: 9px; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; }
.human-mode-panel { padding: 12px; border: 1px solid #d8d8d6; border-radius: 9px; color: #45454a; background: #f5f5f3; font-size: 12px; }
/* Telefon kanali panelden gizlendi (urun su an yalnizca WhatsApp); geri acmek icin yorumu kaldir. */
/* .phone-handoff { margin: 20px; padding: 16px; border: 1px solid #efd5aa; border-radius: 10px; color: #79521c; background: var(--orange-soft); } */

.schedule-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf8; }
.schedule-row { display: grid; grid-template-columns: 120px 42px minmax(100px, 1fr) minmax(100px, 1fr); align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid #eceae6; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.off { color: var(--muted-2); background: #f7f6f3; }
.schedule-row input[type="time"] { min-height: 36px; }
.toggle { position: relative; width: 34px; height: 20px; margin: 0; appearance: none; border: 0; border-radius: 999px; background: #cfceca; cursor: pointer; transition: background .16s ease; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; content: ""; transition: transform .16s ease; }
.toggle:checked { background: #57a570; }
.toggle:checked::after { transform: translateX(14px); }
.schedule-status { color: var(--muted); font-size: 12px; }
.toggle:checked ~ .schedule-status { color: var(--green); }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-option { position: relative; }
.chip-option input { position: absolute; opacity: 0; pointer-events: none; }
.chip-option label { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 10px; border: 1px solid #d8d8d6; border-radius: 999px; color: #45454a; background: #f5f5f3; font-size: 12px; font-weight: 700; cursor: pointer; }
.chip-option input:checked + label { border-color: #45454a; color: #fff; background: var(--blue); }

.empty-state { display: grid; min-height: 210px; place-items: center; padding: 28px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.empty-state p { max-width: 420px; margin: 0 auto 14px; font-size: 13px; }
.loading-state { display: grid; min-height: 240px; place-items: center; color: var(--muted); }
.error-state { padding: 18px; border: 1px solid #f0c6c2; border-radius: 10px; color: var(--red); background: var(--red-soft); }
.inline-error { padding: 10px 12px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 12px; }

#toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid var(--navy-700); border-radius: 10px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow-md); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
#toast.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#toast.error { border-color: #8f3f39; background: #722e2a; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3, 3, 3, .45); }
.modal { width: min(560px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.modal-body { padding: 20px; }

/* WhatsApp Bağlantısı (Baileys bridge) */
.wa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wa-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.wa-qr-wrap { min-width: 0; }
.wa-actions { display: flex; flex-direction: column; gap: 8px; }
.wa-status { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.wa-status.warn { color: var(--orange); background: var(--orange-soft); }
.wa-status.neutral { color: #6b6b68; background: #f0efec; }
.wa-status.danger { color: var(--red); background: var(--red-soft); }
.qr-box { width: 220px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.qr-box svg { display: block; width: 100%; height: auto; }

/* Mesaj Filtresi — ignore listesi */
.radio-list { display: flex; flex-wrap: wrap; gap: 7px; }
.ignore-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.ignore-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf8; font-size: 13px; font-weight: 650; }
.ignore-add { display: flex; gap: 8px; margin-top: 10px; }
.ignore-add .form-input { flex: 1; min-width: 0; }

/* Handoff bildirim zili + açılır paneli */
.handoff-bell { position: relative; }
.handoff-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(340px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 120px));
  max-height: min(420px, calc(100dvh - 120px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.handoff-item { padding: 10px; border-bottom: 1px solid #eeede9; }
.handoff-item:last-child { border-bottom: 0; }
.handoff-item-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 750; }
.handoff-item-preview { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.handoff-item-meta { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.handoff-item-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Panel AI Asistanı — sağ altta FAB + sağdan açılan sohbet çekmecesi */
.assistant-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--navy-700);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
.assistant-fab:hover { filter: brightness(1.08); }
.assistant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100%);
  z-index: 61;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .07);
}
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.assistant-head strong { color: var(--ink); }
.assistant-msgs { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 14px; background: #faf9f7; }
.assistant-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.assistant-msg { display: flex; max-width: 85%; flex-direction: column; }
.assistant-msg.user { align-self: flex-end; }
.assistant-msg.assistant { align-self: flex-start; }
.assistant-bubble { padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-msg.user .assistant-bubble { color: #fff; background: var(--navy-900); border-bottom-right-radius: 4px; }
.assistant-msg.assistant .assistant-bubble { color: var(--ink); background: #f1f0ec; border-bottom-left-radius: 4px; }
.assistant-confirm { display: flex; margin-top: 8px; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.assistant-confirm strong { font-size: 13px; }
.assistant-confirm span { color: var(--muted); font-size: 12px; }
.assistant-confirm-actions { display: flex; gap: 8px; }
.assistant-confirm-status { margin-top: 8px; padding: 6px 10px; border-radius: 8px; color: var(--muted); background: #f1f0ec; font-size: 12px; font-weight: 750; }
.assistant-confirm-status.ok { color: var(--green); background: var(--green-soft); }
.assistant-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.assistant-input .form-input { flex: 1; min-width: 0; }
.assistant-input .button { flex: 0 0 auto; }

@keyframes assistant-in { from { opacity: 0; transform: translateX(14px); } }

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .workspace-side .panel + .panel { margin-top: 0; }
}

@media (max-width: 820px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, calc(100vw - 48px)); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  #sidebar.open { transform: translateX(0); }
  #sidebar.open ~ .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(3, 3, 3, .42); }
  #topbar { min-height: 70px; padding: 12px 20px; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar-status { display: none; }
  #view { padding-top: 24px; }
  .inbox-layout { grid-template-columns: 1fr; min-height: auto; }
  .conversation-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-list { min-height: 300px; max-height: none; }
  .workspace-side { grid-template-columns: 1fr; }
  .workspace-side .panel + .panel { margin-top: 14px; }
}

@media (max-width: 680px) {
  #login-screen { padding: 16px; }
  .login-card { padding: 24px; }
  .login-brand { margin-bottom: 28px; }
  #topbar { padding: 10px 12px; }
  .topbar-start, .topbar-end { gap: 8px; min-width: 0; }
  .topbar-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-title small { overflow: hidden; text-overflow: ellipsis; }
  .topbar-end .button { min-width: 0; }
  #view { padding: 22px 14px calc(88px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; margin-bottom: 20px; }
  .page-actions, .page-actions .button { width: 100%; }
  .page-actions .button { flex: 1; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 108px; padding: 13px; }
  .metric-card strong { margin-top: 9px; font-size: 26px; }
  .metric-card .metric-top { font-size: 10px; }
  .metric-icon { width: 27px; height: 27px; font-size: 13px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar-start, .toolbar-end { width: 100%; }
  .filter-select, .toolbar .button { flex: 1; min-width: 0; }
  /* iOS odakta sayfayı zoom'lamasın: mobilde giriş alanları 16px. */
  .form-input, .form-select, .form-textarea, .conversation-search, .filter-select, .composer textarea { font-size: 16px; }
  .button { min-height: 44px; }
  .button.small { min-height: 40px; }
  .chip-option label { min-height: 40px; }
  .agenda-date-strip { overflow-x: auto; grid-template-columns: repeat(5, 76px); padding-bottom: 3px; }
  .agenda-row { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding: 12px; }
  .agenda-row > .badges, .agenda-row > .button, .agenda-row > .agenda-actions { grid-column: 2; justify-self: start; }
  .thread-header { flex-direction: column; }
  .thread-actions { justify-content: flex-start; }
  .composer-row { align-items: stretch; flex-direction: column; }
  .composer-row .button { width: 100%; }
  .schedule-row { grid-template-columns: 88px 36px 1fr 1fr; gap: 5px; padding: 9px 7px; }
  .schedule-row .form-input { min-width: 0; padding: 7px 4px; }
  .data-table { min-width: 640px; }
  .data-table th, .data-table td { padding: 10px 8px; }
  /* Asistan telefonlarda tam ekran sayfa olur; klavye/URL barı için
     --assistant-h/--assistant-top app.js tarafından visualViewport'tan gelir. */
  .assistant-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); transition: transform 150ms ease-out; }
  .assistant-fab:active { transform: scale(.96); }
  .assistant-drawer {
    left: 0;
    right: 0;
    width: 100%;
    top: var(--assistant-top, 0);
    bottom: auto;
    height: 100vh;                 /* fallback: dvh desteklemeyen tarayıcılar */
    height: 100dvh;                /* dinamik viewport */
    height: var(--assistant-h, 100dvh);  /* JS visualViewport senkronu */
    border-left: 0;
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
    animation: assistant-in .18s ease-out;
  }
  .assistant-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  body.assistant-open { overflow: hidden; }
  #toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Küçük telefonlarda yenile düğmesi yalnızca ikon kalır (çıkış metin kalır). */
@media (max-width: 480px) {
  .topbar-end { gap: 6px; }
  .topbar-end .btn-label { display: none; }
  /* Sandbox rozeti topbar'da salon adini "Tema Ko..." haline dusuruyordu;
     bilgi zaten Ayarlar'da duruyor, dar ekranda gizlenir. */
  #topbar .badge.sandbox { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-drawer { animation: none; }
}

.muted { color: var(--muted); font-size: 12px; }
