/*
  Tasarım sistemi: saf CSS (derleme aracı yok). Firma renkleri çalışma zamanında --brand-primary / --brand-secondary
  değişkenlerine yazılır (MainLayout). Mobil öncelikli; 768px üstü masaüstü düzeni.
*/

:root {
  --brand-primary: #1d4ed8;
  --brand-secondary: #0f766e;

  --color-primary: var(--brand-primary);
  --color-primary-fg: #ffffff;
  --color-primary-soft: color-mix(in srgb, var(--color-primary) 10%, transparent);
  --color-secondary: var(--brand-secondary);
  --color-surface: #f8fafc;
  --color-card: #ffffff;
  --color-fg: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-overlay: rgb(15 23 42 / 0.5);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --touch: 3rem;           /* mobilde en az 48px dokunma hedefi */
  --sidebar-width: 15rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-fg);
  background: var(--color-surface);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
#app { min-height: 100%; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.125rem; margin: 0 0 0.5rem; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--color-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; align-items: center; gap: 0.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.grid-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

/* Açılış ekranı */
.boot { display: grid; place-content: center; justify-items: center; gap: 0.75rem; min-height: 100vh; color: var(--color-muted); }
.boot-logo { width: 3rem; height: 3rem; border-radius: 0.75rem; background: var(--color-primary); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

#blazor-error-ui {
  position: fixed; inset: auto 0 0 0; z-index: 100; padding: 0.75rem 1rem;
  background: var(--color-danger); color: #fff;
}
#blazor-error-ui a { color: #fff; margin-left: 0.5rem; text-decoration: underline; }

/* --- Düğme */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.75rem; padding: 0 1rem; border: 1px solid transparent; border-radius: var(--radius-lg);
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-primary { background: var(--color-primary); color: var(--color-primary-fg); }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-secondary { background: var(--color-card); color: var(--color-fg); border-color: var(--color-border); }
.btn-secondary:hover:not(:disabled) { background: var(--color-surface); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-fg); }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface); }
.btn-lg { height: 3rem; padding: 0 1.25rem; font-size: 1rem; }
.btn-xl { height: 4rem; padding: 0 1.5rem; font-size: 1.125rem; font-weight: 600; }
.btn-block { width: 100%; }

.spinner { width: 1.25rem; height: 1.25rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Kart, rozet, istatistik */
.card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.card-title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; }

.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: var(--color-surface); color: var(--color-muted); border: 1px solid var(--color-border); }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary); border-color: transparent; }
.badge-success { background: color-mix(in srgb, var(--color-success) 12%, transparent); color: var(--color-success); border-color: transparent; }
.badge-warning { background: color-mix(in srgb, var(--color-warning) 14%, transparent); color: var(--color-warning); border-color: transparent; }
.badge-danger { background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); border-color: transparent; }

.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { text-decoration: none; border-color: var(--color-primary); }
.stat-label { font-size: 0.75rem; color: var(--color-muted); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-warning { border-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 8%, var(--color-card)); }
.stat-danger { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 8%, var(--color-card)); }
.stat-danger .stat-value { color: var(--color-danger); }

/* --- Form */
.field { display: block; }
.field-label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 500; }
.field-required { color: var(--color-danger); margin-left: 0.125rem; }
.field-hint { margin-top: 0.25rem; font-size: 0.75rem; color: var(--color-muted); }
.field-error { margin-top: 0.25rem; font-size: 0.75rem; color: var(--color-danger); }
.input, .select, .textarea {
  display: block; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-card); color: var(--color-fg); font: inherit;
}
.textarea { min-height: 6rem; resize: vertical; }
.input.invalid, .input.modified.invalid, .select.invalid, .textarea.invalid { border-color: var(--color-danger); }
.validation-message { margin-top: 0.25rem; font-size: 0.75rem; color: var(--color-danger); }

.alert { padding: 0.75rem; border-radius: var(--radius-lg); border: 1px solid var(--color-border); font-size: 0.875rem; }
.alert-danger { border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); background: color-mix(in srgb, var(--color-danger) 6%, transparent); color: var(--color-danger); }
.alert-success { border-color: color-mix(in srgb, var(--color-success) 40%, transparent); background: color-mix(in srgb, var(--color-success) 6%, transparent); }
.alert-warning { border-color: color-mix(in srgb, var(--color-warning) 40%, transparent); background: color-mix(in srgb, var(--color-warning) 8%, transparent); }

.empty { padding: 2rem 1rem; text-align: center; color: var(--color-muted); }

/* --- Diyalog ve bildirim */
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: var(--color-overlay); }
.dialog { width: min(32rem, 100%); max-height: 90vh; overflow: auto; background: var(--color-card); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); }
.dialog-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

.toasts { position: fixed; z-index: 60; right: 1rem; bottom: 5rem; display: grid; gap: 0.5rem; max-width: min(24rem, calc(100vw - 2rem)); }
.toast { padding: 0.75rem 1rem; border-radius: var(--radius-lg); background: var(--color-fg); color: #fff; font-size: 0.875rem; box-shadow: 0 4px 12px rgb(0 0 0 / 0.2); }
.toast-success { background: var(--color-success); }
.toast-danger { background: var(--color-danger); }
.toast-warning { background: var(--color-warning); }

.offline-banner { padding: 0.5rem 1rem; text-align: center; font-size: 0.875rem; background: var(--color-warning); color: #fff; }

/* --- Sekmeler */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.tab { padding: 0.625rem 0.875rem; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 0.875rem; color: var(--color-muted); cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* --- Tablo (masaüstü) / kart listesi (mobil) */
.table-wrap { overflow-x: auto; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 0.625rem 0.75rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { font-weight: 600; color: var(--color-muted); background: var(--color-surface); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover { background: var(--color-surface); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cards { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.75rem; font-size: 0.875rem; }

/* --- Düzen */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { display: none; }
.topbar-mobile {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem; height: 3.5rem;
  padding: env(safe-area-inset-top, 0) 1rem 0; background: var(--color-card); border-bottom: 1px solid var(--color-border);
}
.brand-mark { flex: none; width: 2rem; height: 2rem; border-radius: 0.375rem; background: var(--color-primary); object-fit: contain; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 1rem; min-width: 0; }
.bottom-tabs {
  position: sticky; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom, 0); background: var(--color-card); border-top: 1px solid var(--color-border);
}
.bottom-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; min-height: var(--touch); font-size: 0.75rem; color: var(--color-muted); text-decoration: none; }
.bottom-tab:hover { text-decoration: none; }
.bottom-tab.active { color: var(--color-primary); }
.bottom-tab svg { width: 1.5rem; height: 1.5rem; }

.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; color: var(--color-fg); text-decoration: none; }
.nav-link:hover { background: var(--color-surface); text-decoration: none; }
.nav-link.active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 500; }
.nav-link.sub { padding-left: 2.25rem; }
.nav-group { margin: 0.75rem 0 0.25rem; padding: 0 0.75rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted); }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(24rem, 100%); }

@media (min-width: 768px) {
  .app { flex-direction: row; }
  .topbar-mobile, .bottom-tabs { display: none; }
  .sidebar {
    display: flex; flex-direction: column; flex: none; width: var(--sidebar-width);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--color-card); border-right: 1px solid var(--color-border);
  }
  .sidebar-head { display: flex; align-items: center; gap: 0.75rem; height: 4rem; padding: 0 1rem; border-bottom: 1px solid var(--color-border); }
  .sidebar nav { flex: 1; padding: 0.75rem; display: grid; gap: 0.25rem; align-content: start; }
  .sidebar-foot { padding: 0.75rem; border-top: 1px solid var(--color-border); font-size: 0.875rem; }
  .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .content { padding: 1.5rem; }
  .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Dar ekranda tablo yerine kart listesi */
@media (max-width: 767px) {
  .table-wrap.responsive { display: none; }
  .cards { display: grid; gap: 0.75rem; }
  .row-card { display: block; color: inherit; text-decoration: none; }
  .row-card:hover { text-decoration: none; }
  .row-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; font-size: 0.875rem; }
  .row-card dt { color: var(--color-muted); }
  .row-card dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
}

/* --- Sayfa başlığı, açıklama listesi, form bölümleri */
.page-header { margin-bottom: 1rem; }
.page-header h1 { margin: 0; overflow-wrap: anywhere; }
.page-back { display: inline-block; margin-bottom: 0.25rem; font-size: 0.875rem; color: var(--color-muted); }
.page-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; font-size: 0.875rem; color: var(--color-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; }

.desc-list { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: 0.5rem 1rem; margin: 0; font-size: 0.875rem; }
.desc-list dt { color: var(--color-muted); }
.desc-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

.form-section { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.form-section legend { padding: 0; margin-bottom: 0.75rem; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.form-grid .span-2 { grid-column: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.filters .span-2 { grid-column: span 2; }
.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; }
.check input { margin-top: 0.2rem; width: 1.125rem; height: 1.125rem; flex: none; }
.list-cards { display: grid; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }

@media (min-width: 768px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .filters { grid-template-columns: 2fr 1fr 1fr; }
  .filters .span-2 { grid-column: auto; }
  .list-cards { grid-template-columns: 1fr 1fr; }
}
.danger-text { color: var(--color-danger); }

/* --- Arama kutulu seçim (LookupSelect) */
.lookup { position: relative; }
.lookup-backdrop { position: fixed; inset: 0; z-index: 29; }
.lookup-list { position: absolute; z-index: 30; left: 0; right: 0; margin: 0.25rem 0 0; padding: 0; max-height: 15rem; overflow-y: auto; list-style: none; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); }
.lookup-info { padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--color-muted); }
.lookup-item { display: flex; flex-direction: column; width: 100%; padding: 0.5rem 0.75rem; border: 0; background: none; font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.lookup-item:hover { background: var(--color-surface); }
.lookup-item.selected { background: var(--color-primary-soft); }

/* --- Kurulum ipucu / rehberi */
.setup-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; padding: 0.375rem 0.5rem; border-radius: var(--radius-lg); font-size: 0.75rem; background: color-mix(in srgb, var(--color-warning) 10%, transparent); color: var(--color-warning); }
.setup-hint.info { background: var(--color-primary-soft); color: var(--color-primary); }
.setup-hint .icon { width: 1rem; height: 1rem; }
.setup-guide { padding: 1rem; margin-bottom: 0.75rem; border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--color-primary) 5%, transparent); }
.setup-guide h3 { margin: 0 0 0.5rem; font-size: 0.875rem; }
.setup-guide ol { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.setup-guide li p { margin: 0.25rem 0 0; }
@media (min-width: 768px) { .setup-guide ol { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.select-box { width: 1.25rem; height: 1.25rem; accent-color: var(--color-primary); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; } @media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* --- Sözleşme: bitiş özeti çipleri ve asansör satırları */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.75rem; }
.chip { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem; border: 1px solid var(--color-border); border-radius: 999px; background: none; font: inherit; cursor: pointer; }
.chip.active { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); }
.rows-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rows-table th { padding: 0.25rem 0; text-align: left; font-size: 0.75rem; color: var(--color-muted); }
.rows-table td { padding: 0.25rem 0; border-top: 1px solid var(--color-border); }
.rows-table .price { width: 10rem; }
.link-list { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.link-list li { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-top: 1px solid var(--color-border); }
.link-list li:first-child { border-top: 0; }
.visually-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* --- Yetkili görsel, imza tuvali, not onayı, bakım listeleri */
.auth-image-placeholder { background: var(--color-surface); animation: pulse 1.2s ease-in-out infinite; }
.signature-pad { width: 100%; border: 1px dashed var(--color-border); border-radius: var(--radius-lg); background: #fff; touch-action: none; }
.note-raw { margin: 0.25rem 0 0; padding: 0.5rem; border-radius: var(--radius); background: var(--color-surface); font-size: 0.875rem; white-space: pre-wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
.photo-grid img, .photo-grid .auth-image-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0.25rem; }
.result-list { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.result-list li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; padding: 0.375rem 0; border-top: 1px solid var(--color-border); }
.result-list li:first-child { border-top: 0; }
.result-list .grow { flex: 1; min-width: 0; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: 2fr 1fr; } }
.signature-image { width: 100%; height: 5rem; object-fit: contain; border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; }
.dashed-box { padding: 0.5rem; border: 1px dashed var(--color-border); border-radius: var(--radius-lg); }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline dotted; cursor: pointer; }

/* --- Bakım takvimi */
.segmented { display: inline-flex; gap: 0.125rem; padding: 0.125rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); font-size: 0.875rem; }
.segmented button { padding: 0.25rem 0.75rem; border: 0; border-radius: var(--radius); background: none; font: inherit; cursor: pointer; }
.segmented button.active { background: var(--color-primary); color: var(--color-primary-fg); }
.cal-month { display: none; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-border); }
.cal-head { padding: 0.25rem 0.5rem; background: var(--color-surface); font-size: 0.75rem; font-weight: 500; color: var(--color-muted); }
.cal-cell { min-height: 6rem; padding: 0.25rem; background: var(--color-card); }
.cal-cell.dim { opacity: 0.4; }
.cal-day { display: inline-block; margin-bottom: 0.25rem; font-size: 0.75rem; color: var(--color-muted); }
.cal-day.today { padding: 0 0.375rem; border-radius: 999px; background: var(--color-primary); color: var(--color-primary-fg); }
.cal-plan { display: block; width: 100%; padding: 0 0.25rem; border: 0; background: none; font: inherit; font-size: 0.6875rem; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-radius: 0.25rem; }
.cal-plan:hover { background: var(--color-surface); }
.cal-more { border: 0; background: none; padding: 0; font: inherit; font-size: 0.6875rem; color: var(--color-primary); cursor: pointer; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.25rem; border-radius: 50%; background: var(--color-muted); }
.dot-success { background: var(--color-success); } .dot-warning { background: var(--color-warning); } .dot-danger { background: var(--color-danger); } .dot-primary { background: var(--color-primary); }
.plan-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-card); font: inherit; text-align: left; cursor: pointer; }
.plan-card:active { background: var(--color-surface); }
@media (min-width: 768px) {
  .cal-month { display: grid; }
  .cal-list-mobile { display: none; }
}
.order-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); font-size: 0.75rem; font-weight: 600; }

/* --- Checklist doldurma (mobil, tek elle) */
.narrow { max-width: 32rem; margin: 0 auto; }
.run { max-width: 42rem; margin: 0 auto; padding-bottom: 6rem; }
.run-bar { position: sticky; top: 3.5rem; z-index: 10; margin: 0 -1rem; padding: 0.25rem 1rem 0.5rem; background: var(--color-card); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.run-progress { height: 0.375rem; margin-top: 0.25rem; overflow: hidden; border-radius: 0.25rem; background: var(--color-surface); }
.run-progress > div { height: 100%; background: var(--color-primary); transition: width 0.2s; }
.run-group > summary, .run-group-head { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.75rem; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.run-item { padding: 0.75rem; border-top: 1px solid var(--color-border); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
.choices.two { grid-template-columns: repeat(2, 1fr); }
.choice { height: 3rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-card); color: var(--color-fg); font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer; }
.choice:active { background: var(--color-surface); }
.choice.active { color: #fff; }
.choice-success { background: var(--color-success); border-color: var(--color-success); }
.choice-danger { background: var(--color-danger); border-color: var(--color-danger); }
.choice-neutral { background: var(--color-muted); border-color: var(--color-muted); }
.run-actions { position: fixed; left: 0; right: 0; bottom: 4.25rem; z-index: 20; padding: 0 1rem env(safe-area-inset-bottom, 0); }
.run-actions > div { display: flex; gap: 0.5rem; max-width: 42rem; margin: 0 auto; }
.thumb { width: 2.75rem; height: 2.75rem; object-fit: cover; border-radius: 0.25rem; }
.tech-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.tech-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; height: 7rem; border-radius: 1rem; font-size: 0.875rem; font-weight: 600; text-align: center; text-decoration: none; background: var(--color-card); border: 1px solid var(--color-border); color: var(--color-fg); }
.tech-tile.primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-fg); }
.tech-tile:hover { text-decoration: none; }
.tech-tile .count { position: absolute; top: 0.5rem; right: 0.5rem; padding: 0 0.5rem; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 0.75rem; }
.scan-frame { position: relative; overflow: hidden; border-radius: 1rem; background: #000; }
.scan-frame video { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.scan-guide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.scan-guide > div { width: 14rem; height: 14rem; border: 4px solid rgb(255 255 255 / 0.8); border-radius: 0.75rem; box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.35); }
.scan-caption { position: absolute; left: 0; right: 0; bottom: 0.75rem; text-align: center; font-size: 0.75rem; color: rgb(255 255 255 / 0.9); }

/* --- Finans: satır şeritleri, özet kartları, hareket tablosu */
.table tr.band-orange > td:first-child, .row-card.band-orange { box-shadow: inset 4px 0 0 #f97316; }
.table tr.band-yellow > td:first-child, .row-card.band-yellow { box-shadow: inset 4px 0 0 #facc15; }
.table tr.band-red > td:first-child, .row-card.band-red { box-shadow: inset 4px 0 0 #dc2626; }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.75rem; color: var(--color-muted); }
.legend i { display: inline-block; width: 0.25rem; height: 0.75rem; border-radius: 2px; margin-right: 0.25rem; vertical-align: middle; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-value.md { font-size: 1.25rem; }
.stat-success { border-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 8%, var(--color-card)); }
.stat-success .stat-value { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.reversed { opacity: 0.5; text-decoration: line-through; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (min-width: 768px) { .method-grid { grid-template-columns: repeat(3, 1fr); } }
.method-grid button { min-height: 3rem; text-align: left; padding: 0 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-card); color: var(--color-fg); font: inherit; font-weight: 500; cursor: pointer; }
.method-grid button[aria-checked="true"] { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.dialog.wide { width: min(44rem, 100%); }
.filter-banner { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; padding: 0.375rem 0.75rem; border: 1px solid var(--color-primary); border-radius: var(--radius-lg); background: var(--color-primary-soft); font-size: 0.75rem; }
.checklist { max-height: 8rem; overflow-y: auto; margin: 0 0 0.75rem; padding: 0.5rem; list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius-lg); font-size: 0.75rem; }
.checklist li { display: flex; justify-content: space-between; padding: 0.125rem 0; }
.sum-box { padding: 0.5rem; border-radius: var(--radius-lg); background: var(--color-surface); font-size: 0.875rem; }

/* --- Kullanıcı ve rol ekranları: izin matrisi */
.perm-module { margin: 0 0 0.25rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--color-muted); }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.perm-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0.5rem; text-align: left; font: inherit; font-size: 0.875rem; color: inherit; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); cursor: pointer; }
.perm-btn:disabled { cursor: default; }
.perm-btn.perm-grant { border-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, var(--color-card)); }
.perm-btn.perm-deny { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, var(--color-card)); }
.perm-btn.perm-role { border-color: color-mix(in srgb, var(--color-primary) 30%, transparent); background: var(--color-primary-soft); }
.perm-code { font-family: ui-monospace, monospace; font-size: 0.6875rem; color: var(--color-muted); background: var(--color-surface); padding: 0 0.375rem; border-radius: 4px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* --- Ayarlar: marka */
.brand-preview { display: grid; place-items: center; width: 6rem; height: 6rem; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.brand-preview.small { width: 3rem; height: 3rem; }
.brand-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-input { width: 3.5rem; height: 2.75rem; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: none; }
.swatch { flex: 1; height: 2.5rem; border-radius: var(--radius-lg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.tab { text-decoration: none; display: inline-block; }

/* --- Hızlı kayıt sihirbazı */
.steps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: 0.875rem; }
.step { padding: 0.25rem 0.75rem; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-muted); }
.step.active { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); font-weight: 500; }

/* --- Checklist şablon editörü */
.cl-items { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; }
.cl-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; border-top: 1px solid var(--color-border); }
.cl-item:first-child { border-top: 0; }
.dim { opacity: 0.55; }

/* --- QR yönetimi */
.qr-img { width: 13rem; height: 13rem; object-fit: contain; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; }
.qr-img.compact { width: 8rem; height: 8rem; }

/* --- Arıza servisleri: ilerleme adımları */
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; font-size: 0.875rem; }
.progress-step { display: flex; align-items: flex-start; gap: 0.75rem; }
.progress-dot { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; border: 1px solid var(--color-border); border-radius: 50%; font-size: 0.6875rem; font-weight: 700; color: var(--color-muted); }
.progress-step.done .progress-dot { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.fw-medium { font-weight: 500; }

/* --- Dashboard */
.stat-orange { border-color: #f97316; background: color-mix(in srgb, #f97316 8%, var(--color-card)); }

/* --- Bildirim zili */
.bell { position: relative; display: inline-block; }
.bell-btn { position: relative; padding: 0.5rem; min-width: 2.75rem; min-height: 2.75rem; }
.bell-btn .icon { width: 1.75rem; height: 1.75rem; }
.bell-count { position: absolute; top: 0.125rem; right: 0.125rem; min-width: 1.125rem; padding: 0 0.25rem; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 0.625rem; font-weight: 600; text-align: center; line-height: 1rem; }
.bell-backdrop { position: fixed; inset: 0; z-index: 44; }
.bell-panel { position: fixed; z-index: 45; top: 3.5rem; right: 1rem; width: min(22rem, calc(100vw - 2rem)); max-height: 70vh; overflow: auto; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgb(0 0 0 / 0.18); }
.bell-head { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border); font-size: 0.875rem; }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-item { display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; padding: 0.5rem 0.75rem; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.bell-item:hover { background: var(--color-surface); }
.bell-item.read { opacity: 0.7; }
.bell-dot { flex: none; width: 0.5rem; height: 0.5rem; margin-top: 0.375rem; border-radius: 50%; background: var(--color-primary); }

/* --- Denetim zaman çizelgesi */
.audit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.audit-item { padding: 0.75rem; font-size: 0.875rem; }
.audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.audit-diff { font-size: 0.75rem; margin-top: 0.5rem; }

/* --- Bildirim zili: her sayfada sağ üstte, büyük; okunmamış bildirim varsa kırmızı ve yanıp söner */
.topbar-desktop { display: none; }
@media (min-width: 768px) {
  .topbar-desktop { display: flex; justify-content: flex-end; align-items: center; position: sticky; top: 0; z-index: 30; padding: 0.5rem 1.5rem 0; pointer-events: none; }
  .topbar-desktop .bell { pointer-events: auto; }
}
.bell-alert { color: var(--color-danger); }
.bell-alert .icon { fill: currentColor; fill-opacity: 0.18; animation: bell-blink 1s ease-in-out infinite; }
@keyframes bell-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .bell-alert .icon { animation: none; } }
