:root {
  --brand: #2b6cb0;
  --brand-dark: #1a365d;
  --brand-soft: #ebf3fb;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1a2435;
  --muted: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --brand: #4d9fe6;
  --brand-dark: #cfe2f5;
  --brand-soft: #1c2c40;
  --bg: #0e1726;
  --surface: #152032;
  --surface-2: #1b2740;
  --border: #2a3753;
  --text: #e8eef7;
  --muted: #94a3b8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

html {
  color-scheme: light dark;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4d9fe6;
    --brand-dark: #cfe2f5;
    --brand-soft: #1c2c40;
    --bg: #0e1726;
    --surface: #152032;
    --surface-2: #1b2740;
    --border: #2a3753;
    --text: #e8eef7;
    --muted: #94a3b8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  transition: filter 0.15s, background 0.15s, transform 0.05s;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field-optional { font-weight: 400; font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea.input { resize: vertical; min-height: 90px; }

.baslik-input { display: flex; flex-direction: column; gap: 8px; }
.baslik-input .baslik-custom[hidden] { display: none !important; }
.konu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.konu-row:last-child { border-bottom: none; }
.konu-add-form .toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.konu-add-form .toolbar .input { flex: 1; min-width: 180px; }

.phone-input {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.phone-input .phone-country {
  flex: 0 0 132px;
  width: 132px;
  min-width: 132px;
  padding-right: 28px;
  cursor: pointer;
}
.phone-input .phone-national {
  flex: 1;
  min-width: 0;
}
@media (max-width: 480px) {
  .phone-input { flex-direction: column; }
  .phone-input .phone-country { flex: 1; width: 100%; min-width: 0; }
}

.blok-input { display: flex; flex-direction: column; gap: 8px; }
.blok-input .blok-select { width: 100%; }

.randevu-panel { margin-top: 10px; }

.password-field {
  position: relative;
}
.password-field .input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); }
.password-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
}
.badge.acik { background: #e0f2fe; color: #0369a1; }
.badge.devam { background: #fef3c7; color: #b45309; }
.badge.tamam { background: #dcfce7; color: #15803d; }
.badge.iptal { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .badge.acik { background: #0c3a52; color: #7dd3fc; }
[data-theme="dark"] .badge.devam { background: #4a350c; color: #fcd34d; }
[data-theme="dark"] .badge.tamam { background: #14431f; color: #86efac; }
[data-theme="dark"] .badge.iptal { background: #4a1414; color: #fca5a5; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  object-fit: contain; display: block; flex-shrink: 0;
}
.brand b { font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav a .ic { width: 20px; text-align: center; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); padding: 14px 12px 6px; font-weight: 700; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; background: var(--brand-soft); color: var(--brand); }

/* ---------- Profile page ---------- */
.profile-stack { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.profile-card.danger { border-color: rgba(220, 38, 38, 0.35); }
.profile-card-head { display: flex; align-items: center; gap: 14px; }
.profile-card-head .meta { min-width: 0; }
.profile-card-head .name { font-weight: 700; font-size: 17px; margin: 0 0 2px; }
.profile-card-head .email { font-size: 13px; color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-section-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.profile-section-title.danger { color: var(--danger); }
.profile-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.profile-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-toggle:last-of-type { border-bottom: none; }
.profile-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.profile-segment { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-segment label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface-2); }
.profile-segment input { accent-color: var(--brand); }
.profile-segment label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.profile-status { font-size: 13px; margin: 4px 0 0; min-height: 18px; }
.profile-status.ok { color: var(--success); }
.profile-status.err { color: var(--danger); }
.profile-sticky-save { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.profile-sticky-save .btn { width: 100%; }

.user-chip .info { overflow: hidden; }
.user-chip .info b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .info span { font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.content { padding: 26px 30px; max-width: 1100px; width: 100%; margin: 0 auto; flex: 1; }

.bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 40;
  align-items: flex-end;
  gap: 0;
  padding: 18px 4px 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.06);
}
.bottom-nav-item,
.bottom-nav-fab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.bottom-nav-item .ic,
.bottom-nav-fab span:first-child { font-size: 20px; line-height: 1; }
.bottom-nav-item small,
.bottom-nav-fab small {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav-item.active { color: var(--brand); font-weight: 700; }
.bottom-nav-fab span:first-child {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-dark, #1a365d);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  transform: translateY(-8px);
}
.bottom-nav-fab { color: var(--muted); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .v { font-size: 28px; font-weight: 800; line-height: 1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat .ic { float: right; font-size: 22px; opacity: 0.5; }

/* ---------- Ticket list ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input { max-width: 280px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 18px; cursor: pointer; transition: border 0.15s, box-shadow 0.15s, background 0.15s;
  display: flex; align-items: flex-start; gap: 12px;
}
.ticket:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: var(--shadow); }
.ticket.pinned {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 14%, var(--surface)) 0%, var(--surface) 18%);
  box-shadow: inset 3px 0 0 var(--brand);
}
.ticket .t-pinned { margin-bottom: 6px; }
.ticket .pin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 999px; padding: 4px 10px;
}
.ticket .pin-badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent);
}
.ticket-pin-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.ticket-pin-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  color: var(--brand);
  background: var(--brand-soft);
}
.ticket-pin-btn.is-pinned {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.ticket-pin-btn:active { transform: scale(0.96); }
.ticket .t-main { min-width: 0; flex: 1; }
.ticket .t-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ticket .t-title { font-weight: 700; font-size: 15px; min-width: 0; flex: 1; }
.ticket .t-desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .t-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ticket .t-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.stars { color: #f59e0b; letter-spacing: 1px; }

/* ---------- Detail / chat ---------- */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.info-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; gap: 12px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--muted); display: flex; align-items: center; }
.info-row .v { font-weight: 600; text-align: right; }
.info-row-phone .phone-detail-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.phone-detail-number { font-weight: 600; }
.phone-detail-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }
.phone-detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--primary);
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s ease;
}
.phone-detail-action:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.info-icon { margin-right: 7px; opacity: 0.85; font-size: 13px; }
.detail-label { display: flex; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }

.rating-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: #fef3e2;
  border: 1px solid #fde3b8;
}
.rating-cta .icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--warning);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.rating-cta .body { flex: 1; min-width: 0; }
.rating-cta .body h4 { margin: 0; font-size: 14px; }
.rating-cta .body p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
[data-theme="dark"] .rating-cta { background: #2c2210; border-color: #4a350c; }

.rating-survey-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin: -4px -4px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #dd6b20, #f0a020);
  color: #fff;
}
.rating-survey-header p { margin: 4px 0 0; font-size: 13px; opacity: 0.92; }
.rating-survey-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.rating-survey-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.rating-survey-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.rating-survey-row:last-child { border-bottom: none; }
.rating-survey-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.rating-survey-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rating-star-btn {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #cbd5e0;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s, transform 0.15s;
}
.rating-star-btn:hover { transform: scale(1.08); }
.rating-star-btn.active { color: #f59e0b; }
.rating-survey-value {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
}
.rating-survey-comment { margin-top: 14px; }
.modal.wide .modal-box { max-width: 520px; }

.chat { display: flex; flex-direction: column; height: 520px; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--primary-dark, #1a365d);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.chat-header-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}
.chat-header-name.muted {
  font-weight: 600;
  opacity: 0.75;
}
.chat-header .pdot { flex-shrink: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg .who { font-size: 11px; font-weight: 700; margin-bottom: 3px; opacity: 0.8; }
.msg .time { font-size: 10px; opacity: 0.6; margin-top: 4px; text-align: right; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input .input { flex: 1; }

.resolve-card {
  margin-top: 18px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #38a169 0%, #276749 100%);
  box-shadow: 0 10px 28px rgba(39, 103, 73, 0.22);
}
.resolve-card-inner { padding: 20px 22px; }
.resolve-card-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: #fff;
}
.resolve-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}
.resolve-card-copy h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}
.resolve-card-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}
.resolve-btn {
  width: 100%;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #276749;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.resolve-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.resolve-btn:disabled { opacity: 0.7; cursor: wait; }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.file-item .fi { font-size: 18px; }
.proof-list { display: flex; flex-direction: column; gap: 10px; }
.proof-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.proof-item .proof-body { flex: 1; min-width: 0; }
.proof-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; color: #fff; }
.proof-badge.teknik { background: var(--primary); }
.proof-badge.musteri { background: var(--success, #16a34a); }
.eki-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.eki-cell { position: relative; }
.eki-thumb { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--surface-2); }
.eki-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eki-thumb-video, .eki-thumb-doc { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #e8edf3; color: var(--primary); }
.eki-thumb .proof-badge { position: absolute; top: 6px; left: 6px; }
.eki-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.eki-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proof-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-camera {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.btn-camera:hover { filter: brightness(1.05); }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 4px; }
.milestone { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.milestone .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); margin-top: 4px; flex: none; }
.milestone.done .dot { background: var(--success); }
.milestone .ms-body { flex: 1; }
.milestone .ms-title { font-weight: 600; font-size: 14px; }
.milestone .ms-time { font-size: 12px; color: var(--muted); }

.log-event { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.log-event .le-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 16px; border: none; background: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 14px; min-width: 240px;
  animation: slideIn 0.2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 12px; }

.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- Auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.auth-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); width: 100%; max-width: 410px; padding: 32px 30px; }
.auth-card .logo-lg { width: 88px; height: 88px; border-radius: 18px; object-fit: contain; display: block; margin: 0 auto 14px; }
.auth-card h2 { text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-info-links { text-align: center; margin-top: 10px; font-size: 14px; }
.auth-info-links a { font-weight: 600; color: var(--brand); text-decoration: none; }
.auth-info-links a:hover { text-decoration: underline; }
.auth-info-list { margin: 0; padding-left: 1.15rem; color: var(--text); }
.auth-info-list li { margin-bottom: 10px; line-height: 1.55; font-size: 14px; }
.auth-info-list li strong { color: var(--text); }
.auth-about-meta { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.auth-about-links { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.auth-about-links a { font-size: 14px; font-weight: 600; }

/* ---------- Mobile ---------- */
.menu-btn { display: none; background: none; border: none; font-size: 22px; color: var(--text); }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 40; }

/* Çevrimiçi durumu noktası */
.pdot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-left: 6px; vertical-align: middle; background: #9ca3af;
}
.pdot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.pdot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.14); }

@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%);
    transition: transform 0.22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; }
  .topbar { display: flex; }
  .menu-btn { display: block; }
  .content { padding: 18px 16px 96px; }
  .bottom-nav { display: flex; }
}

/* ---------- Onboarding (ilk giriş) ---------- */
.onboarding-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.onboarding-hero {
  position: relative;
  flex: 1;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand), #3182ce);
  padding: 24px;
}
.onboarding-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
}
.onboarding-icon-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
}
.onboarding-emoji {
  font-size: 52px;
  line-height: 1;
}
.onboarding-card {
  margin: -36px 20px 24px;
  padding: 24px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.onboarding-title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  color: var(--text);
}
.onboarding-body {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 16px;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.onboarding-dot.active {
  background: var(--brand);
  transform: scale(1.15);
}
.onboarding-next { margin-top: 4px; }

/* ---------- Interactive product tour ---------- */
.product-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.product-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  outline: none;
}
#productTourTooltip {
  z-index: 10000;
}
.product-tour-block {
  position: fixed;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.product-tour-ring {
  position: fixed;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
  pointer-events: none;
}
.product-tour-pass {
  position: fixed;
  z-index: 3;
  pointer-events: auto;
  background: transparent;
}
.product-tour-skip {
  display: block;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 4px;
  margin: 0;
  text-align: left;
}
.product-tour-tooltip {
  position: fixed;
  z-index: 9999;
  width: 280px;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}
.product-tour-tooltip:focus { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
.product-tour-tooltip h3 {
  margin: 6px 0 8px;
  font-size: 17px;
}
.product-tour-tooltip p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}
.product-tour-step {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}
.product-tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.product-tour-hint {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}
.product-tour-arrow,
.product-tour-done {
  border: none;
  cursor: pointer;
}
.product-tour-arrow {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  pointer-events: auto;
}
.product-tour-arrow:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.24);
}
.product-tour-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.product-tour-done {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  pointer-events: auto;
}

/* ---------- Landing (index.html) ---------- */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 6vw;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
[data-theme="dark"] .lp-nav {
  background: rgba(14, 23, 38, 0.88);
}
.lp-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--brand-dark); }
.lp-brand .logo { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; display: block; flex-shrink: 0; }
.hero { padding: 70px 6vw 60px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.1; margin: 0 0 18px; color: var(--brand-dark); }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 540px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-radius: 24px; padding: 34px; color: #fff; box-shadow: var(--shadow); }
.hero-art .mock { background: rgba(255, 255, 255, 0.13); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.hero-art .mock b { display: block; font-size: 15px; }
.hero-art .mock small { opacity: 0.8; }
.hero-art .pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 12px; font-weight: 700; }
.features { padding: 30px 6vw 60px; }
.features h2 { text-align: center; font-size: 30px; color: var(--brand-dark); margin-bottom: 8px; }
.features .sub { text-align: center; color: var(--muted); margin-bottom: 40px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.feat { padding: 24px; }
.feat .fic { font-size: 28px; margin-bottom: 12px; }
.feat h3 { margin: 0 0 8px; font-size: 17px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cta-band { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; text-align: center; padding: 56px 6vw; }
.cta-band h2 { font-size: 30px; margin: 0 0 12px; }
.cta-band p { opacity: 0.9; margin: 0 0 26px; }
.lp-foot { padding: 30px 6vw; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
.lp-foot a { margin: 0 10px; }
.btn.white { background: var(--surface); color: var(--brand-dark); }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero h1 { font-size: 32px; }
  .hero-art { order: -1; }
}

/* ---------- Legal / static pages ---------- */
.legal-page { font-family: system-ui, -apple-system, sans-serif; line-height: 1.6; max-width: 720px; margin: 0 auto; padding: 24px 20px; color: var(--text); background: var(--bg); min-height: 100vh; }
.legal-page h1 { font-size: 1.5rem; margin-bottom: 0.25rem; color: var(--brand-dark); }
.legal-page h2 { font-size: 1.1rem; margin-top: 1.75rem; color: var(--brand); }
.legal-page p, .legal-page li { font-size: 15px; }
.legal-page .meta { color: var(--muted); font-size: 14px; margin-bottom: 1.5rem; }
.legal-page ul, .legal-page ol { padding-left: 1.25rem; }
.legal-page .box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.legal-page .app-info { background: var(--brand-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 1.25rem; }
.legal-page .app-info strong { color: var(--brand-dark); }
.legal-page pre { background: var(--surface-2); padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; }
.legal-page .note { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 12px 16px; margin: 16px 0; font-size: 14px; }
.legal-page code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

/* ---------- Auth action page ---------- */
.auth-action-page {
  --auth-primary: #1e4d8c;
  --auth-primary-light: #2b6cb0;
  --auth-card: var(--surface);
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--auth-primary) 0%, var(--auth-primary-light) 45%, var(--bg) 45%);
  color: var(--text);
  padding: 24px 16px 48px;
}
[data-theme="dark"] .auth-action-page {
  --auth-primary: #1a365d;
  --auth-primary-light: #2b6cb0;
}
