@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Envanter UI v2 — Tasarım Sistemi
   --------------------------------------------------------------------------
   1.  Token'lar (light)
   2.  Token'lar (dark)
   3.  Bootstrap değişken köprüsü
   4.  Temel / tipografi
   5.  Layout kabuğu (sidebar, topbar, içerik)
   6.  Sidebar
   7.  Topbar
   8.  Sayfa başlığı & breadcrumb
   9.  Kartlar (.app-card)
   10. KPI ızgarası (.stat-grid / .stat-card)
   11. Tablolar (.table-wrap / .table-app)
   12. Filtre çubuğu (.filter-bar)
   13. Butonlar & .btn-icon / .toolbar
   14. Formlar & .form-footer
   15. Durum rozetleri (.status-badge)
   16. Boş durum (.empty-state)
   17. Detay listesi (.detail-list)
   18. Sekmeler (.tabs-app)
   19. Avatar
   20. Zaman çizelgesi (.timeline)
   21. Dropzone / imza alanı / QR kutusu
   22. Sayfalama
   23. Toast / alert / modal
   24. Boş kabuk (login, hata sayfaları)
   25. Yardımcı sınıflar
   26. Duyarlı (responsive) kurallar
   27. Yazdırma güvenli varsayılanlar
   ========================================================================== */

/* ==========================================================================
   1. Token'lar (light)
   ========================================================================== */
:root {
  --app-bg: #f4f6fa;
  --app-surface: #ffffff;
  --app-surface-2: #f8fafc;
  --app-border: #e3e8ef;
  --app-text: #0f172a;
  --app-text-muted: #64748b;

  --app-primary: #0f766e;
  --app-primary-hover: #115e59;
  --app-primary-soft: #ccfbf1;
  --app-primary-contrast: #ffffff;

  --app-accent: #d97706;
  --app-success: #16a34a;
  --app-warning: #d97706;
  --app-danger: #dc2626;
  --app-info: #2563eb;

  --app-success-soft: #dcfce7;
  --app-warning-soft: #fef3c7;
  --app-danger-soft: #fee2e2;
  --app-info-soft: #dbeafe;
  --app-muted-soft: #e2e8f0;

  --app-sidebar-bg: #0f172a;
  --app-sidebar-text: #cbd5e1;
  --app-sidebar-active: rgba(45, 212, 191, .16);
  --app-sidebar-border: rgba(148, 163, 184, .14);

  --app-radius: 12px;
  --app-radius-sm: 8px;
  --app-radius-pill: 999px;
  --app-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --app-shadow-lg: 0 8px 32px rgba(15, 23, 42, .14);

  --app-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --app-font-size: 14px;
  --app-line-height: 1.5;

  --app-sidebar-w: 264px;
  --app-topbar-h: 60px;
  --app-content-max: 1400px;
  --app-gap: 24px;
  --app-gap-sm: 16px;

  --app-focus-ring: 0 0 0 .2rem rgba(15, 118, 110, .25);
  --app-transition: .18s ease;
}

/* ==========================================================================
   2. Token'lar (dark)
   ========================================================================== */
[data-bs-theme="dark"] {
  --app-bg: #0b1220;
  --app-surface: #111a2e;
  --app-surface-2: #172136;
  --app-border: #243149;
  --app-text: #e5e9f0;
  --app-text-muted: #94a3b8;

  --app-primary: #2dd4bf;
  --app-primary-hover: #5eead4;
  --app-primary-soft: #134e4a;
  --app-primary-contrast: #06231f;

  --app-accent: #fbbf24;
  --app-success: #4ade80;
  --app-warning: #fbbf24;
  --app-danger: #f87171;
  --app-info: #60a5fa;

  --app-success-soft: #14532d;
  --app-warning-soft: #4a3208;
  --app-danger-soft: #4c1d1d;
  --app-info-soft: #1e3a5f;
  --app-muted-soft: #243149;

  --app-sidebar-bg: #0a0f1c;
  --app-sidebar-text: #cbd5e1;
  --app-sidebar-active: rgba(45, 212, 191, .16);
  --app-sidebar-border: rgba(148, 163, 184, .12);

  --app-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --app-shadow-lg: 0 10px 34px rgba(0, 0, 0, .55);

  --app-focus-ring: 0 0 0 .2rem rgba(45, 212, 191, .3);
  color-scheme: dark;
}

/* ==========================================================================
   3. Bootstrap değişken köprüsü
   Bootstrap 5.3 bileşenleri token'lara bu blok üzerinden bağlanır.
   ========================================================================== */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--app-text);
  --bs-body-font-family: var(--app-font);
  --bs-body-font-size: var(--app-font-size);
  --bs-body-line-height: var(--app-line-height);
  --bs-secondary-color: var(--app-text-muted);
  --bs-tertiary-color: var(--app-text-muted);
  --bs-emphasis-color: var(--app-text);
  --bs-border-color: var(--app-border);
  --bs-border-color-translucent: var(--app-border);
  --bs-border-radius: var(--app-radius);
  --bs-border-radius-sm: var(--app-radius-sm);
  --bs-border-radius-lg: var(--app-radius);
  --bs-border-radius-pill: var(--app-radius-pill);
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-primary-hover);
  --bs-secondary-bg: var(--app-surface-2);
  --bs-tertiary-bg: var(--app-surface-2);
  --bs-heading-color: var(--app-text);
  --bs-code-color: var(--app-accent);
}

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

/* Kart */
.card {
  --bs-card-bg: var(--app-surface);
  --bs-card-color: var(--app-text);
  --bs-card-border-color: var(--app-border);
  --bs-card-border-radius: var(--app-radius);
  --bs-card-inner-border-radius: calc(var(--app-radius) - 1px);
  --bs-card-cap-bg: var(--app-surface-2);
  --bs-card-cap-color: var(--app-text);
  --bs-card-spacer-x: 20px;
  --bs-card-spacer-y: 16px;
  box-shadow: var(--app-shadow);
}

/* Form kontrolleri */
.form-control,
.form-select {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
  border-radius: var(--app-radius-sm);
  padding: .5rem .75rem;
  font-size: var(--app-font-size);
  transition: border-color var(--app-transition), box-shadow var(--app-transition);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--app-surface);
  border-color: var(--app-primary);
  color: var(--app-text);
  box-shadow: var(--app-focus-ring);
}
.form-control::placeholder { color: var(--app-text-muted); opacity: .8; }
.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--app-surface-2);
  color: var(--app-text-muted);
}
.form-control-sm, .form-select-sm { border-radius: var(--app-radius-sm); font-size: 13px; }
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: .3rem;
}
.form-text { color: var(--app-text-muted); font-size: 12.5px; }
.form-check-input { background-color: var(--app-surface); border-color: var(--app-border); }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.form-check-input:focus { box-shadow: var(--app-focus-ring); border-color: var(--app-primary); }
.input-group-text {
  background-color: var(--app-surface-2);
  border-color: var(--app-border);
  color: var(--app-text-muted);
  border-radius: var(--app-radius-sm);
}
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--app-danger); }
.invalid-feedback { color: var(--app-danger); }

/* Butonlar */
.btn {
  --bs-btn-border-radius: var(--app-radius-sm);
  --bs-btn-font-size: var(--app-font-size);
  --bs-btn-font-weight: 500;
  --bs-btn-padding-x: .9rem;
  --bs-btn-padding-y: .45rem;
  transition: background-color var(--app-transition), border-color var(--app-transition),
              color var(--app-transition), box-shadow var(--app-transition);
}
.btn:focus-visible { box-shadow: var(--app-focus-ring); }
.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-color: var(--app-primary-contrast);
  --bs-btn-hover-bg: var(--app-primary-hover);
  --bs-btn-hover-border-color: var(--app-primary-hover);
  --bs-btn-hover-color: var(--app-primary-contrast);
  --bs-btn-active-bg: var(--app-primary-hover);
  --bs-btn-active-border-color: var(--app-primary-hover);
  --bs-btn-active-color: var(--app-primary-contrast);
  --bs-btn-disabled-bg: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
  --bs-btn-disabled-color: var(--app-primary-contrast);
}
.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
  --bs-btn-hover-color: var(--app-primary-contrast);
  --bs-btn-active-bg: var(--app-primary);
  --bs-btn-active-border-color: var(--app-primary);
  --bs-btn-active-color: var(--app-primary-contrast);
  --bs-btn-disabled-color: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
}
.btn-secondary,
.btn-light {
  --bs-btn-bg: var(--app-surface);
  --bs-btn-border-color: var(--app-border);
  --bs-btn-color: var(--app-text);
  --bs-btn-hover-bg: var(--app-surface-2);
  --bs-btn-hover-border-color: var(--app-border);
  --bs-btn-hover-color: var(--app-text);
  --bs-btn-active-bg: var(--app-surface-2);
  --bs-btn-active-border-color: var(--app-border);
  --bs-btn-active-color: var(--app-text);
  --bs-btn-disabled-bg: var(--app-surface-2);
  --bs-btn-disabled-border-color: var(--app-border);
  --bs-btn-disabled-color: var(--app-text-muted);
}
.btn-outline-secondary {
  --bs-btn-color: var(--app-text-muted);
  --bs-btn-border-color: var(--app-border);
  --bs-btn-hover-bg: var(--app-surface-2);
  --bs-btn-hover-border-color: var(--app-border);
  --bs-btn-hover-color: var(--app-text);
  --bs-btn-active-bg: var(--app-surface-2);
  --bs-btn-active-border-color: var(--app-border);
  --bs-btn-active-color: var(--app-text);
}
.btn-danger {
  --bs-btn-bg: var(--app-danger);
  --bs-btn-border-color: var(--app-danger);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--app-danger);
  --bs-btn-hover-border-color: var(--app-danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--app-danger);
  --bs-btn-active-border-color: var(--app-danger);
  --bs-btn-disabled-bg: var(--app-danger);
  --bs-btn-disabled-border-color: var(--app-danger);
  --bs-btn-disabled-color: #fff;
}
.btn-outline-danger {
  --bs-btn-color: var(--app-danger);
  --bs-btn-border-color: var(--app-danger);
  --bs-btn-hover-bg: var(--app-danger);
  --bs-btn-hover-border-color: var(--app-danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--app-danger);
  --bs-btn-active-border-color: var(--app-danger);
}
.btn-success {
  --bs-btn-bg: var(--app-success);
  --bs-btn-border-color: var(--app-success);
  --bs-btn-hover-bg: var(--app-success);
  --bs-btn-hover-border-color: var(--app-success);
}
.btn-warning {
  --bs-btn-bg: var(--app-warning);
  --bs-btn-border-color: var(--app-warning);
  --bs-btn-hover-bg: var(--app-warning);
  --bs-btn-hover-border-color: var(--app-warning);
}
.btn-info {
  --bs-btn-bg: var(--app-info);
  --bs-btn-border-color: var(--app-info);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--app-info);
  --bs-btn-hover-border-color: var(--app-info);
  --bs-btn-hover-color: #fff;
}

/* Tablo */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
  --bs-table-striped-bg: var(--app-surface-2);
  --bs-table-striped-color: var(--app-text);
  --bs-table-hover-bg: var(--app-surface-2);
  --bs-table-hover-color: var(--app-text);
}

/* Dropdown */
.dropdown-menu {
  --bs-dropdown-bg: var(--app-surface);
  --bs-dropdown-color: var(--app-text);
  --bs-dropdown-border-color: var(--app-border);
  --bs-dropdown-border-radius: var(--app-radius);
  --bs-dropdown-link-color: var(--app-text);
  --bs-dropdown-link-hover-bg: var(--app-surface-2);
  --bs-dropdown-link-hover-color: var(--app-text);
  --bs-dropdown-link-active-bg: var(--app-primary-soft);
  --bs-dropdown-link-active-color: var(--app-text);
  --bs-dropdown-header-color: var(--app-text-muted);
  --bs-dropdown-divider-bg: var(--app-border);
  --bs-dropdown-padding-y: .35rem;
  --bs-dropdown-padding-x: .35rem;
  box-shadow: var(--app-shadow-lg);
}
.dropdown-item { border-radius: var(--app-radius-sm); padding: .45rem .75rem; }

/* Modal & offcanvas */
.modal {
  --bs-modal-bg: var(--app-surface);
  --bs-modal-color: var(--app-text);
  --bs-modal-border-color: var(--app-border);
  --bs-modal-border-radius: var(--app-radius);
  --bs-modal-header-border-color: var(--app-border);
  --bs-modal-footer-border-color: var(--app-border);
}
.modal-content { box-shadow: var(--app-shadow-lg); }
.offcanvas {
  --bs-offcanvas-bg: var(--app-sidebar-bg);
  --bs-offcanvas-color: var(--app-sidebar-text);
  --bs-offcanvas-border-color: var(--app-sidebar-border);
  --bs-offcanvas-width: var(--app-sidebar-w);
  --bs-offcanvas-padding-x: 0;
  --bs-offcanvas-padding-y: 0;
}

/* Sekmeler */
.nav-tabs {
  --bs-nav-tabs-border-color: var(--app-border);
  --bs-nav-tabs-link-active-bg: var(--app-surface);
  --bs-nav-tabs-link-active-color: var(--app-primary);
  --bs-nav-tabs-link-active-border-color: var(--app-border) var(--app-border) var(--app-surface);
  --bs-nav-link-color: var(--app-text-muted);
  --bs-nav-link-hover-color: var(--app-text);
}

/* Sayfalama */
.pagination {
  --bs-pagination-bg: var(--app-surface);
  --bs-pagination-color: var(--app-text);
  --bs-pagination-border-color: var(--app-border);
  --bs-pagination-border-radius: var(--app-radius-sm);
  --bs-pagination-hover-bg: var(--app-surface-2);
  --bs-pagination-hover-color: var(--app-text);
  --bs-pagination-hover-border-color: var(--app-border);
  --bs-pagination-focus-bg: var(--app-surface-2);
  --bs-pagination-focus-color: var(--app-text);
  --bs-pagination-focus-box-shadow: var(--app-focus-ring);
  --bs-pagination-active-bg: var(--app-primary);
  --bs-pagination-active-border-color: var(--app-primary);
  --bs-pagination-active-color: var(--app-primary-contrast);
  --bs-pagination-disabled-bg: var(--app-surface);
  --bs-pagination-disabled-color: var(--app-text-muted);
  --bs-pagination-disabled-border-color: var(--app-border);
}
.page-link { font-size: 13px; }

/* Badge / alert / list-group / progress / toast / tooltip */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: var(--app-radius-pill); }
.alert { --bs-alert-border-radius: var(--app-radius); border-width: 1px; }
.list-group {
  --bs-list-group-bg: var(--app-surface);
  --bs-list-group-color: var(--app-text);
  --bs-list-group-border-color: var(--app-border);
  --bs-list-group-border-radius: var(--app-radius);
  --bs-list-group-action-hover-bg: var(--app-surface-2);
  --bs-list-group-action-hover-color: var(--app-text);
  --bs-list-group-active-bg: var(--app-primary);
  --bs-list-group-active-border-color: var(--app-primary);
  --bs-list-group-active-color: var(--app-primary-contrast);
}
.progress {
  --bs-progress-bg: var(--app-surface-2);
  --bs-progress-bar-bg: var(--app-primary);
  --bs-progress-border-radius: var(--app-radius-pill);
}
.toast {
  --bs-toast-bg: var(--app-surface);
  --bs-toast-color: var(--app-text);
  --bs-toast-border-color: var(--app-border);
  --bs-toast-border-radius: var(--app-radius);
  --bs-toast-header-bg: var(--app-surface);
  --bs-toast-header-color: var(--app-text);
  --bs-toast-header-border-color: var(--app-border);
  box-shadow: var(--app-shadow-lg);
}
.tooltip { --bs-tooltip-bg: var(--app-text); --bs-tooltip-color: var(--app-bg); }
.breadcrumb {
  --bs-breadcrumb-divider-color: var(--app-text-muted);
  --bs-breadcrumb-item-active-color: var(--app-text-muted);
}

/* ==========================================================================
   4. Temel / tipografi
   ========================================================================== */
* { -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: var(--app-font);
  font-size: var(--app-font-size);
  line-height: var(--app-line-height);
  background-color: var(--app-bg);
  color: var(--app-text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, .h1 { font-size: 24px; font-weight: 600; line-height: 1.25; }
h2, .h2 { font-size: 18px; font-weight: 600; line-height: 1.3; }
h3, .h3 { font-size: 16px; font-weight: 600; }
h4, .h4 { font-size: 15px; font-weight: 600; }
h5, .h5, h6, .h6 { font-size: 14px; font-weight: 600; }
small, .small { font-size: 12.5px; }

hr { border-color: var(--app-border); opacity: 1; }

::selection { background: var(--app-primary-soft); color: var(--app-text); }

:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }

/* İnce kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--app-border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--app-border);
  border-radius: var(--app-radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--app-text-muted); background-clip: content-box; }

/* ==========================================================================
   5. Layout kabuğu
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--app-content-max);
  margin: 0 auto;
  padding: var(--app-gap);
}

.app-footer {
  padding: 12px var(--app-gap) 24px;
  color: var(--app-text-muted);
  font-size: 12.5px;
  text-align: center;
}

/* ==========================================================================
   6. Sidebar
   ========================================================================== */
.app-sidebar {
  width: var(--app-sidebar-w);
  flex: 0 0 var(--app-sidebar-w);
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--app-sidebar-border);
  z-index: 1030;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--app-topbar-h);
  flex: 0 0 var(--app-topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--app-sidebar-border);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.sidebar-brand:hover { color: #fff; text-decoration: none; }
.sidebar-brand .brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--app-radius-sm);
  background: linear-gradient(135deg, #0f766e, #2dd4bf);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-brand .brand-sub { font-size: 11px; font-weight: 400; color: var(--app-sidebar-text); opacity: .7; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 10px 18px;
}

.nav-group + .nav-group { margin-top: 14px; }

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, .55);
  padding: 6px 10px;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--app-radius-sm);
  color: var(--app-sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--app-transition), color var(--app-transition);
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-decoration: none;
}
.sidebar-link i { font-size: 16px; width: 20px; text-align: center; flex: 0 0 20px; opacity: .9; }
.sidebar-link.active {
  background: var(--app-sidebar-active);
  color: #5eead4;
  position: relative;
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2dd4bf;
}
.sidebar-link .sidebar-badge {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, .1);
  padding: 1px 7px;
  border-radius: var(--app-radius-pill);
}

.sidebar-user {
  flex: 0 0 auto;
  border-top: 1px solid var(--app-sidebar-border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar { background: rgba(45, 212, 191, .18); color: #5eead4; }
.sidebar-user-info { min-width: 0; line-height: 1.25; }
.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11.5px; color: rgba(203, 213, 225, .7); }
.sidebar-user .btn-icon {
  margin-left: auto;
  color: var(--app-sidebar-text);
  border-color: transparent;
  background: transparent;
}
.sidebar-user .btn-icon:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: transparent;
}

/* Offcanvas içindeki sidebar (<992px) */
.offcanvas .app-sidebar {
  position: static;
  height: 100%;
  width: 100%;
  flex: 1 1 auto;
  border-right: 0;
}

/* ==========================================================================
   7. Topbar
   ========================================================================== */
.app-topbar {
  height: var(--app-topbar-h);
  flex: 0 0 var(--app-topbar-h);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--app-gap);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-search { position: relative; width: 260px; max-width: 34vw; }
.topbar-search i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--app-text-muted);
  font-size: 14px;
  pointer-events: none;
}
.topbar-search .form-control {
  padding-left: 32px;
  background: var(--app-surface-2);
  border-radius: var(--app-radius-pill);
  height: 36px;
}
.topbar-search .form-control:focus { background: var(--app-surface); }

/* JS yokken gösterilen yerel <select> yedeği (base.html <noscript>). */
.topbar-location-fallback { display: flex; align-items: center; gap: 6px; }
.topbar-location-fallback .form-select {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: var(--app-radius-pill);
  background-color: var(--app-surface-2);
  font-size: 13px;
  max-width: 200px;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  width: 36px;
  height: 36px;
  border-radius: var(--app-radius-sm);
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { background: var(--app-surface-2); }

/* Topbar sağ aksiyon kuşağı — lokasyon seçici, (ileride) dil seçici,
   kullanıcı menüsü. Yeni bir denetim buraya eklenir; bkz. base.html. */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* ==========================================================================
   8. Sayfa başlığı & breadcrumb
   ========================================================================== */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: var(--app-gap);
}
.page-header-main { min-width: 0; flex: 1 1 320px; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 600; }
.page-header .page-subtitle {
  margin: 4px 0 0;
  color: var(--app-text-muted);
  font-size: 13px;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.app-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--app-text-muted);
}
.app-breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.app-breadcrumb li + li::before { content: "/"; color: var(--app-border); }
.app-breadcrumb a { color: var(--app-text-muted); }
.app-breadcrumb a:hover { color: var(--app-primary); }
.app-breadcrumb .active { color: var(--app-text); font-weight: 500; }

/* ==========================================================================
   9. Kartlar
   ========================================================================== */
.app-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}
.app-card + .app-card { margin-top: var(--app-gap-sm); }

.app-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}
.app-card-header h2,
.app-card-header h3,
.app-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--app-text);
}
.app-card-header .app-card-sub {
  font-size: 12.5px;
  color: var(--app-text-muted);
  margin: 2px 0 0;
  width: 100%;
}
.app-card-header .toolbar { margin-left: auto; }

.app-card-body { padding: 20px; }
.app-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-2);
}
.app-card-muted { background: var(--app-surface-2); }

/* Bölümlenmiş form kartı */
.app-fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.app-fieldset:last-child { margin-bottom: 0; }
.app-fieldset > legend {
  float: none;
  width: auto;
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--app-text-muted);
  padding: 0 0 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--app-border);
}

/* ==========================================================================
   10. KPI ızgarası
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--app-gap-sm);
  margin-bottom: var(--app-gap);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform var(--app-transition), box-shadow var(--app-transition), border-color var(--app-transition);
}
a.stat-card:hover {
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
  box-shadow: var(--app-shadow-lg);
  border-color: var(--app-primary);
}
.stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--app-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--app-muted-soft);
  color: var(--app-text-muted);
}
.stat-body { min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--app-text-muted); font-weight: 500; margin: 0; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 2px 0 0; color: var(--app-text); }
.stat-hint { font-size: 12px; color: var(--app-text-muted); margin: 2px 0 0; }

.stat-card[data-tone="primary"] .stat-icon { background: var(--app-primary-soft); color: var(--app-primary); }
.stat-card[data-tone="success"] .stat-icon { background: var(--app-success-soft); color: var(--app-success); }
.stat-card[data-tone="warning"] .stat-icon { background: var(--app-warning-soft); color: var(--app-warning); }
.stat-card[data-tone="danger"]  .stat-icon { background: var(--app-danger-soft);  color: var(--app-danger); }
.stat-card[data-tone="info"]    .stat-icon { background: var(--app-info-soft);    color: var(--app-info); }
.stat-card[data-tone="muted"]   .stat-icon { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* ==========================================================================
   11. Tablolar
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-app {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  color: var(--app-text);
}
.table-app thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--app-surface-2);
  color: var(--app-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
}
.table-app thead th a { color: inherit; }
.table-app thead th a:hover { color: var(--app-primary); text-decoration: none; }
.table-app tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}
.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr { transition: background-color var(--app-transition); }
.table-app tbody tr:hover { background: var(--app-surface-2); }
.table-app tbody tr.is-selected { background: var(--app-primary-soft); }
.table-app .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table-app .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table-app .cell-strong { font-weight: 600; color: var(--app-text); }
.table-app .cell-sub { font-size: 12px; color: var(--app-text-muted); }
.table-app td a { color: var(--app-text); font-weight: 500; }
.table-app td a:hover { color: var(--app-primary); }
.table-app caption {
  caption-side: bottom;
  padding: 10px 14px;
  color: var(--app-text-muted);
  font-size: 12.5px;
}

.table-app.table-compact tbody td,
.table-app.table-compact thead th { padding: 7px 10px; }

/* Tablo kart içindeyken kenar boşlukları kartla hizalansın */
.app-card > .table-wrap > .table-app thead th:first-child,
.app-card > .table-wrap > .table-app tbody td:first-child { padding-left: 20px; }
.app-card > .table-wrap > .table-app thead th:last-child,
.app-card > .table-wrap > .table-app tbody td:last-child { padding-right: 20px; }

/* ==========================================================================
   12. Filtre çubuğu
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  margin-bottom: var(--app-gap-sm);
}
.filter-bar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  flex: 1 1 160px;
}
.filter-bar .filter-field.filter-grow { flex: 2 1 240px; }
.filter-bar .filter-field > label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-text-muted);
  margin: 0;
}
.filter-bar .filter-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.filter-bar .form-control,
.filter-bar .form-select { height: 38px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--app-gap-sm); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--app-radius-pill);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  color: var(--app-text-muted);
  font-size: 12.5px;
  text-decoration: none;
}
.filter-chip:hover,
.filter-chip.active {
  background: var(--app-primary-soft);
  border-color: var(--app-primary);
  color: var(--app-primary);
  text-decoration: none;
}

/* ==========================================================================
   13. Butonlar & araç çubuğu
   ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.toolbar-end { margin-left: auto; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--app-radius-sm);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text-muted);
  font-size: 15px;
  line-height: 1;
  transition: background-color var(--app-transition), color var(--app-transition), border-color var(--app-transition);
}
.btn-icon:hover {
  background: var(--app-surface-2);
  color: var(--app-primary);
  border-color: var(--app-primary);
  text-decoration: none;
}
.btn-icon:focus-visible { box-shadow: var(--app-focus-ring); outline: none; }
.btn-icon.btn-icon-danger:hover { color: var(--app-danger); border-color: var(--app-danger); }
.btn-icon.btn-icon-ghost { border-color: transparent; background: transparent; }
.btn-icon.btn-icon-lg { width: 38px; height: 38px; font-size: 17px; }
.btn-icon[disabled], .btn-icon.disabled { opacity: .5; pointer-events: none; }

.btn-group-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }

/* ==========================================================================
   14. Formlar & sabit form alt çubuğu
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.form-grid .form-col-full { grid-column: 1 / -1; }

.form-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  margin-top: var(--app-gap-sm);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
}
.form-footer .form-footer-end { margin-left: auto; display: flex; gap: 8px; }
.form-footer .form-footer-note { font-size: 12.5px; color: var(--app-text-muted); }

.field-error { color: var(--app-danger); font-size: 12.5px; margin-top: 4px; }
.required-mark { color: var(--app-danger); margin-left: 2px; }

/* components/field.html — widget'a form-control sınıfı eklenmemiş olsa da
   (Django varsayılan render'ı) doğru görünsün. */
.form-field > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.form-field > select,
.form-field > textarea {
  display: block;
  width: 100%;
  background-color: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  font-family: inherit;
  font-size: var(--app-font-size);
  line-height: var(--app-line-height);
  padding: .5rem .75rem;
  transition: border-color var(--app-transition), box-shadow var(--app-transition);
}
.form-field > input:focus,
.form-field > select:focus,
.form-field > textarea:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: var(--app-focus-ring);
}
.form-field > textarea { min-height: 96px; resize: vertical; }
.form-field > select[multiple] { min-height: 140px; }
.form-field.has-error > input,
.form-field.has-error > select,
.form-field.has-error > textarea { border-color: var(--app-danger); }
.form-field > ul { list-style: none; padding: 0; margin: 0; }
.form-field > ul li label { font-size: 13.5px; font-weight: 400; margin-left: 4px; }

/* ==========================================================================
   15. Durum rozetleri
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--app-radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--app-muted-soft);
  color: var(--app-text-muted);
  border: 1px solid transparent;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.status-badge.no-dot::before { display: none; }

/* Ton yardımcıları — data-status eşleşmezse sayfalar bunu kullanabilir */
.status-badge[data-tone="primary"], .status-badge.is-primary { background: var(--app-primary-soft); color: var(--app-primary); }
.status-badge[data-tone="success"], .status-badge.is-success { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-tone="warning"], .status-badge.is-warning { background: var(--app-warning-soft); color: var(--app-warning); }
.status-badge[data-tone="danger"],  .status-badge.is-danger  { background: var(--app-danger-soft);  color: var(--app-danger); }
.status-badge[data-tone="info"],    .status-badge.is-info    { background: var(--app-info-soft);    color: var(--app-info); }
.status-badge[data-tone="muted"],   .status-badge.is-muted   { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* Varlık durumları */
.status-badge[data-status="Stokta"]     { background: var(--app-info-soft);    color: var(--app-info); }
.status-badge[data-status="Kullanımda"] { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-status="Arızalı"]    { background: var(--app-danger-soft);  color: var(--app-danger); }
.status-badge[data-status="Serviste"]   { background: var(--app-warning-soft); color: var(--app-warning); }
.status-badge[data-status="Hurda"]      { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* Personel durumları */
.status-badge[data-status="Aktif"]         { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-status="İzinli"]        { background: var(--app-warning-soft); color: var(--app-warning); }
.status-badge[data-status="İşten Ayrıldı"] { background: var(--app-muted-soft);   color: var(--app-text-muted); }
.status-badge[data-status="Pasif"]         { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* Bakım & servis durumları */
.status-badge[data-status="Beklemede"]  { background: var(--app-warning-soft); color: var(--app-warning); }
.status-badge[data-status="Tamamlandı"] { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-status="İptal"]      { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* QR etiket durumları (model kodları küçük harfli) */
.status-badge[data-status="beklemede"] { background: var(--app-info-soft);    color: var(--app-info); }
.status-badge[data-status="atandi"]    { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-status="iptal"]     { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* Zimmet durumları */
.status-badge[data-status="Zimmetli"] { background: var(--app-success-soft); color: var(--app-success); }
.status-badge[data-status="İade"]     { background: var(--app-muted-soft);   color: var(--app-text-muted); }

/* ==========================================================================
   16. Boş durum
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--app-text-muted);
}
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--app-surface-2);
  color: var(--app-text-muted);
  border: 1px solid var(--app-border);
  margin-bottom: 14px;
}
.empty-state .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--app-text);
  margin: 0 0 4px;
}
.empty-state .empty-text { font-size: 13px; margin: 0 0 16px; max-width: 460px; }
.empty-state .empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.empty-state-sm { padding: 26px 16px; }
.empty-state-sm .empty-icon { width: 46px; height: 46px; font-size: 20px; margin-bottom: 10px; }

/* ==========================================================================
   17. Detay listesi
   ========================================================================== */
.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 0;
  margin: 0;
}
.detail-list > dt {
  padding: 9px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--app-text-muted);
  border-bottom: 1px solid var(--app-border);
}
.detail-list > dd {
  padding: 9px 0;
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border);
  word-break: break-word;
}
.detail-list > dt:last-of-type,
.detail-list > dd:last-of-type { border-bottom: 0; }

.detail-list-inline { grid-template-columns: 1fr; }
.detail-list-inline > dt { border-bottom: 0; padding-bottom: 0; }
.detail-list-inline > dd { padding-top: 2px; }

/* ==========================================================================
   18. Sekmeler
   ========================================================================== */
.tabs-app {
  border-bottom: 1px solid var(--app-border);
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-app::-webkit-scrollbar { display: none; }
.tabs-app .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 14px;
  color: var(--app-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
}
.tabs-app .nav-link:hover { color: var(--app-text); border-bottom-color: var(--app-border); }
.tabs-app .nav-link.active {
  color: var(--app-primary);
  background: transparent;
  border-bottom-color: var(--app-primary);
}
.tabs-app .nav-link .tab-count {
  margin-left: 6px;
  font-size: 11px;
  background: var(--app-surface-2);
  color: var(--app-text-muted);
  border-radius: var(--app-radius-pill);
  padding: 1px 7px;
}
.tabs-app .nav-link.active .tab-count { background: var(--app-primary-soft); color: var(--app-primary); }

.tab-content > .tab-pane { padding-top: var(--app-gap-sm); }

/* ==========================================================================
   19. Avatar
   ========================================================================== */
.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 20px; }
.avatar-xl { width: 76px; height: 76px; flex-basis: 76px; font-size: 26px; }
.avatar-muted { background: var(--app-muted-soft); color: var(--app-text-muted); }

.avatar-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-row .avatar-meta { min-width: 0; line-height: 1.3; }
.avatar-row .avatar-meta strong { display: block; font-size: 13.5px; font-weight: 600; }
.avatar-row .avatar-meta span { font-size: 12px; color: var(--app-text-muted); }

/* ==========================================================================
   20. Zaman çizelgesi
   ========================================================================== */
.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--app-border);
}
.timeline-item { position: relative; padding: 0 0 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--app-surface);
  border: 3px solid var(--app-border);
}
.timeline-item[data-tone="primary"]::before { border-color: var(--app-primary); }
.timeline-item[data-tone="success"]::before { border-color: var(--app-success); }
.timeline-item[data-tone="warning"]::before { border-color: var(--app-warning); }
.timeline-item[data-tone="danger"]::before  { border-color: var(--app-danger); }
.timeline-item[data-tone="info"]::before    { border-color: var(--app-info); }
.timeline-time { font-size: 11.5px; color: var(--app-text-muted); }
.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--app-text); margin: 2px 0; }
.timeline-text { font-size: 13px; color: var(--app-text-muted); margin: 0; }

/* ==========================================================================
   21. Dropzone / imza alanı / QR kutusu
   ========================================================================== */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 28px 20px;
  border: 2px dashed var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-2);
  color: var(--app-text-muted);
  cursor: pointer;
  transition: border-color var(--app-transition), background-color var(--app-transition);
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}
.dropzone i { font-size: 30px; }
.dropzone .dropzone-title { font-size: 14px; font-weight: 600; color: var(--app-text); }
.dropzone .dropzone-hint { font-size: 12.5px; }
.dropzone input[type="file"] { display: none; }
.dropzone-preview { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

.signature-pad {
  position: relative;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #ffffff;
  overflow: hidden;
  touch-action: none;
}
.signature-pad canvas { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; }
.signature-pad .signature-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.signature-pad.has-ink .signature-hint { display: none; }
.signature-actions { display: flex; gap: 8px; margin-top: 10px; }

.qr-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}
.qr-box img,
.qr-box canvas,
.qr-box svg { display: block; width: 150px; height: 150px; }
.qr-box .qr-caption {
  font-size: 12px;
  color: #475569;
  text-align: center;
  word-break: break-all;
  max-width: 160px;
}

/* ==========================================================================
   22. Sayfalama
   ========================================================================== */
.app-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 4px 0;
}
.app-pagination .pagination { margin: 0; }
.app-pagination .page-info { font-size: 12.5px; color: var(--app-text-muted); }

/* ==========================================================================
   23. Toast / alert / onay kutuları
   ========================================================================== */
.toast-stack {
  position: fixed;
  top: calc(var(--app-topbar-h) + 12px);
  right: 16px;
  z-index: 1085;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast-app { border-left: 4px solid var(--app-primary); }
.toast-app[data-tone="success"] { border-left-color: var(--app-success); }
.toast-app[data-tone="warning"] { border-left-color: var(--app-warning); }
.toast-app[data-tone="danger"],
.toast-app[data-tone="error"] { border-left-color: var(--app-danger); }
.toast-app[data-tone="info"] { border-left-color: var(--app-info); }
.toast-app .toast-body { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.toast-app .toast-body > i { font-size: 16px; line-height: 1.3; color: var(--app-primary); }
.toast-app[data-tone="success"] .toast-body > i { color: var(--app-success); }
.toast-app[data-tone="warning"] .toast-body > i { color: var(--app-warning); }
.toast-app[data-tone="danger"] .toast-body > i,
.toast-app[data-tone="error"] .toast-body > i { color: var(--app-danger); }
.toast-app[data-tone="info"] .toast-body > i { color: var(--app-info); }

.alert-app {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left-width: 4px;
  border-radius: var(--app-radius);
  color: var(--app-text);
  padding: 12px 16px;
}
.alert-app[data-tone="success"] { border-left-color: var(--app-success); }
.alert-app[data-tone="warning"] { border-left-color: var(--app-warning); }
.alert-app[data-tone="danger"]  { border-left-color: var(--app-danger); }
.alert-app[data-tone="info"]    { border-left-color: var(--app-info); }

/* Onay modalı gövdesi */
.confirm-box { display: flex; gap: 14px; align-items: flex-start; }
.confirm-box .confirm-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-danger-soft);
  color: var(--app-danger);
  font-size: 19px;
}
.confirm-box .confirm-text { font-size: 13.5px; color: var(--app-text-muted); margin: 4px 0 0; }

/* Silme onayı sayfası */
.confirm-page { max-width: 640px; margin: 0 auto; }
.confirm-page .confirm-object {
  font-size: 15px;
  font-weight: 600;
  color: var(--app-text);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 12px 16px;
  margin: 14px 0;
  word-break: break-word;
}
.confirm-page .confirm-blocked {
  border-left: 4px solid var(--app-danger);
  background: var(--app-danger-soft);
  color: var(--app-danger);
  border-radius: var(--app-radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
}

/* ==========================================================================
   24. Boş kabuk (login / hata sayfaları)
   ========================================================================== */
.blank-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--app-bg); }
.blank-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.blank-card {
  width: 100%;
  max-width: 460px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 32px;
  text-align: center;
}

.auth-split { display: flex; min-height: 100vh; }
.auth-visual {
  flex: 1 1 auto;
  position: relative;
  display: none;
  background: linear-gradient(140deg, #0f172a 0%, #115e59 60%, #0f766e 100%);
  color: #fff;
  padding: 48px;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(45, 212, 191, .28), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(37, 99, 235, .2), transparent 40%);
  pointer-events: none;
}
.auth-visual-content { position: relative; z-index: 1; max-width: 460px; }
.auth-visual h2 { font-size: 30px; font-weight: 700; line-height: 1.2; color: #fff; }
.auth-visual p { margin-top: 12px; font-size: 15px; color: rgba(226, 232, 240, .85); }
.auth-visual .auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-visual .auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(226, 232, 240, .92);
}
.auth-visual .auth-points i { color: #5eead4; font-size: 17px; }

.auth-panel {
  flex: 0 0 100%;
  max-width: 100%;
  background: var(--app-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 28px;
}
.auth-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--app-radius-sm);
  background: linear-gradient(135deg, #0f766e, #2dd4bf);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.auth-brand .brand-title { font-size: 16px; font-weight: 700; color: var(--app-text); line-height: 1.2; }
.auth-brand .brand-sub { font-size: 12px; color: var(--app-text-muted); }
.auth-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.auth-subtitle { font-size: 13.5px; color: var(--app-text-muted); margin: 0 0 22px; }
.auth-footer { margin-top: 26px; font-size: 12px; color: var(--app-text-muted); text-align: center; }
.auth-panel .form-control { height: 42px; }
.auth-panel .btn-primary { height: 44px; font-weight: 600; }
.cf-turnstile { margin: 4px 0 2px; }

.error-page { text-align: center; max-width: 520px; }
.error-code {
  font-size: 68px;
  font-weight: 700;
  line-height: 1;
  color: var(--app-primary);
  letter-spacing: -.03em;
}
.error-title { font-size: 20px; font-weight: 600; margin: 10px 0 6px; }
.error-text { color: var(--app-text-muted); font-size: 14px; margin-bottom: 22px; }

/* ==========================================================================
   25. Yardımcı sınıflar
   ========================================================================== */
.text-app-muted { color: var(--app-text-muted); }
.text-app-primary { color: var(--app-primary); }
.text-app-success { color: var(--app-success); }
.text-app-warning { color: var(--app-warning); }
.text-app-danger { color: var(--app-danger); }
.bg-app-surface { background: var(--app-surface); }
.bg-app-surface-2 { background: var(--app-surface-2); }
.border-app { border: 1px solid var(--app-border); }
.rounded-app { border-radius: var(--app-radius); }
.rounded-app-sm { border-radius: var(--app-radius-sm); }
.shadow-app { box-shadow: var(--app-shadow); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: var(--app-gap-sm); }

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--app-text-muted);
  margin: 0 0 10px;
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--app-border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--app-surface-2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--app-text-muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--app-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--app-radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.spinner-app {
  width: 18px;
  height: 18px;
  border: 2px solid var(--app-border);
  border-top-color: var(--app-primary);
  border-radius: 50%;
  display: inline-block;
  animation: app-spin .7s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

.is-busy { position: relative; pointer-events: none; opacity: .65; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ==========================================================================
   26. Duyarlı kurallar
   ========================================================================== */
@media (max-width: 1199.98px) {
  .topbar-search { width: 200px; }
}

@media (max-width: 991.98px) {
  .app-sidebar-fixed { display: none; }
  .sidebar-toggle { display: inline-flex; }
  .app-content { padding: var(--app-gap-sm); }
  .app-topbar { padding: 0 var(--app-gap-sm); gap: 8px; }
  .topbar-search { width: auto; flex: 1 1 140px; max-width: none; }
  .topbar-title { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list > dt { border-bottom: 0; padding-bottom: 0; }
  .detail-list > dd { padding-top: 2px; }
}

@media (max-width: 767.98px) {
  :root { --app-gap: 16px; }
  .page-header h1 { font-size: 20px; }
  .page-header-actions { margin-left: 0; width: 100%; }
  .page-header-actions .btn { flex: 1 1 auto; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }
  .stat-value { font-size: 19px; }
  .filter-bar { padding: 12px; }
  .filter-bar .filter-field { flex: 1 1 100%; min-width: 0; }
  .filter-bar .filter-actions { margin-left: 0; width: 100%; }
  .filter-bar .filter-actions .btn { flex: 1 1 auto; }
  .app-card-body { padding: 16px; }
  .app-card-header { padding: 12px 16px; }
  .app-card > .table-wrap > .table-app thead th:first-child,
  .app-card > .table-wrap > .table-app tbody td:first-child { padding-left: 16px; }
  .app-card > .table-wrap > .table-app thead th:last-child,
  .app-card > .table-wrap > .table-app tbody td:last-child { padding-right: 16px; }
  .form-footer { padding: 10px 14px; }
  .form-footer .form-footer-end { width: 100%; }
  .form-footer .form-footer-end .btn { flex: 1 1 auto; }
  .toast-stack { left: 12px; right: 12px; max-width: none; top: auto; bottom: 12px; }
  .app-pagination { justify-content: center; }
  .app-pagination .page-info { width: 100%; text-align: center; }
}

@media (min-width: 992px) {
  .auth-visual { display: flex; }
  .auth-panel { flex: 0 0 460px; max-width: 460px; padding: 40px; }
}

/* ==========================================================================
   27. Yazdırma güvenli varsayılanlar
   (Asıl çıktı şablonları base_print.html kullanır.)
   ========================================================================== */
@media print {
  :root {
    --app-bg: #fff;
    --app-surface: #fff;
    --app-surface-2: #fff;
    --app-border: #cbd5e1;
    --app-text: #000;
    --app-text-muted: #444;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .toast-stack,
  .page-header-actions,
  .filter-bar,
  .form-footer,
  .app-pagination,
  .col-actions,
  .btn,
  .offcanvas,
  .offcanvas-backdrop,
  .no-print { display: none !important; }
  .app-shell { display: block; }
  .app-content { max-width: none; padding: 0; }
  .app-card { border: 1px solid #cbd5e1; box-shadow: none; break-inside: avoid; }
  .table-app { font-size: 10pt; }
  .table-app thead th { position: static; background: #f1f5f9; color: #000; }
  .table-wrap { overflow: visible; }
  .status-badge { border: 1px solid #94a3b8; }
  a[href]::after { content: ""; }
  @page { size: A4; margin: 14mm; }
}

/* ==========================================================================
   28. Topbar açılır panelleri — lokasyon seçici & kullanıcı menüsü
   --------------------------------------------------------------------------
   Ortak iskelet (`.dd-*`) static/js/app.js içindeki `App.dropdown()`
   yardımcısıyla birlikte çalışır:

     .dd-wrap      konumlandırma çıpası (position: relative)
     .dd-panel     panel; `.is-open` ile görünür, `.dd-flip-start` ile sola
                   çevrilir, 576px altında alt sayfaya (bottom sheet) döner
     .dd-handle    alt sayfa tutamacı (yalnız 576px altında görünür)
     .dd-head      panel başlığı        .dd-search  panel içi arama
     .dd-scroll    kaydırılabilir gövde .dd-divider ayraç
     .dd-section   bölüm başlığı        .dd-group   bölüm sarmalayıcı
     .dd-item      menü satırı          .dd-option  listbox satırı
     .dd-foot      alt şerit (çıkış)

   Panel yarıçapı/kenarlığı/gölgesi `.app-card` ile aynı token'ları kullanır.
   Geçişler kısa (.16s) ve `prefers-reduced-motion` genel kuralıyla kapanır.
   ========================================================================== */

.dd-wrap { position: relative; flex: 0 0 auto; }

.dd-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  min-width: 264px;
  max-width: min(360px, calc(100vw - 24px));
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.985);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.dd-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: opacity .16s ease, transform .16s ease, visibility 0s;
}
.dd-panel.dd-flip-start { right: auto; left: 0; transform-origin: top left; }

.dd-handle { display: none; }

.dd-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-2);
}
.dd-head-title {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}
.dd-head-sub { margin: 3px 0 0; font-size: 12px; color: var(--app-text-muted); }

.dd-search { padding: 10px 12px; border-bottom: 1px solid var(--app-border); }
.dd-search .form-control { height: 34px; font-size: 13px; border-radius: var(--app-radius-sm); }

/* role="menu" sarmalayıcısı: kaydırılan gövde + sabit alt şerit birlikte. */
.dd-menu { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.dd-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.dd-divider { height: 1px; margin: 6px 4px; background: var(--app-border); }

.dd-section {
  margin: 10px 8px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}
.dd-group:first-child > .dd-section { margin-top: 2px; }

.dd-item,
.dd-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--app-text);
  border-radius: var(--app-radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--app-transition), color var(--app-transition);
}
.dd-item > i,
.dd-option > i { flex: 0 0 18px; width: 18px; font-size: 15px; text-align: center; color: var(--app-text-muted); }
.dd-item:hover,
.dd-option:hover { background: var(--app-surface-2); color: var(--app-text); text-decoration: none; }
.dd-item:focus,
.dd-option:focus { outline: none; background: var(--app-surface-2); box-shadow: var(--app-focus-ring); }

.dd-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--app-text-muted);
}

.dd-foot { border-top: 1px solid var(--app-border); padding: 6px; }
.dd-foot form { margin: 0; }
.dd-item-danger,
.dd-item-danger > i { color: var(--app-danger); }
.dd-item-danger:hover { background: var(--app-danger-soft); color: var(--app-danger); }
.dd-item-danger:hover > i { color: var(--app-danger); }

/* ---------------------------- Lokasyon seçici ---------------------------- */

.loc-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  max-width: 230px;
  padding: 0 11px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  color: var(--app-text);
  border-radius: var(--app-radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--app-transition), border-color var(--app-transition), color var(--app-transition);
}
.loc-trigger:hover { background: var(--app-surface); border-color: var(--app-primary); }
.loc-trigger:focus-visible { outline: none; box-shadow: var(--app-focus-ring); }
.loc-trigger .loc-pin { flex: 0 0 auto; font-size: 14px; color: var(--app-text-muted); }
.loc-trigger .loc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-trigger .loc-chevron {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--app-text-muted);
  transition: transform var(--app-transition);
}
.loc-trigger.is-open .loc-chevron { transform: rotate(180deg); }

.loc-code {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: var(--app-radius-pill);
  background: var(--app-muted-soft);
  color: var(--app-text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* Filtre etkinken tetikleyici vurgulanır. */
.loc-trigger.is-filtered {
  background: var(--app-primary-soft);
  border-color: var(--app-primary);
  color: var(--app-primary);
}
.loc-trigger.is-filtered .loc-pin,
.loc-trigger.is-filtered .loc-chevron { color: var(--app-primary); }
.loc-trigger.is-filtered .loc-code { background: var(--app-primary); color: var(--app-primary-contrast); }

.loc-panel .dd-option { align-items: flex-start; }
.loc-panel .dd-option > i { margin-top: 2px; }

.dd-option-main { flex: 1 1 auto; min-width: 0; }
.dd-option-name {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd-option-sub {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--app-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd-option .dd-check { flex: 0 0 18px; margin-top: 2px; font-size: 15px; color: var(--app-primary); visibility: hidden; }
.dd-option[aria-selected="true"] { background: var(--app-primary-soft); }
.dd-option[aria-selected="true"] .dd-option-name { color: var(--app-primary); font-weight: 600; }
.dd-option[aria-selected="true"] > i { color: var(--app-primary); }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }

/* ---------------------------- Kullanıcı menüsü --------------------------- */

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  border-radius: var(--app-radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--app-transition), border-color var(--app-transition);
}
.user-trigger:hover { background: var(--app-surface-2); border-color: var(--app-primary); }
.user-trigger:focus-visible { outline: none; box-shadow: var(--app-focus-ring); }
.user-trigger .user-trigger-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger .user-chevron {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--app-text-muted);
  transition: transform var(--app-transition);
}
.user-trigger.is-open .user-chevron { transform: rotate(180deg); }

.user-panel { min-width: 292px; }

.user-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
}
.user-card-info { min-width: 0; }
.user-card-name {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-handle,
.user-card-mail {
  display: block;
  font-size: 12px;
  color: var(--app-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-login { display: block; margin-top: 6px; font-size: 11.5px; color: var(--app-text-muted); }

.user-role-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.user-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--app-radius-pill);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.user-role-badge.is-muted { background: var(--app-muted-soft); color: var(--app-text-muted); }

/* Görünüm — üçlü segment denetimi (Açık / Koyu / Sistem) */
.theme-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 4px 6px 2px;
  padding: 4px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}
.theme-seg-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--app-text-muted);
  border-radius: 6px;
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--app-transition), color var(--app-transition);
}
.theme-seg-btn i { font-size: 15px; }
.theme-seg-btn:hover { background: var(--app-surface); color: var(--app-text); }
.theme-seg-btn:focus { outline: none; box-shadow: var(--app-focus-ring); }
.theme-seg-btn.is-active { background: var(--app-surface); color: var(--app-primary); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
[data-bs-theme="dark"] .theme-seg-btn.is-active { box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

/* ------------------------------ Duyarlılık ------------------------------- */

@media (max-width: 767.98px) {
  .loc-trigger { max-width: 150px; padding: 0 9px; gap: 6px; }
  .user-trigger { max-width: none; padding: 3px; border-color: transparent; background: transparent; }
  .user-trigger .user-trigger-name,
  .user-trigger .user-chevron { display: none; }
}

/* 576px altında her iki panel de alt sayfa (bottom sheet) olur. */
@media (max-width: 575.98px) {
  .topbar-search { flex: 1 1 90px; }
  .loc-trigger { max-width: none; }
  .loc-trigger .loc-name,
  .loc-trigger .loc-chevron { display: none; }

  /* Alt sayfa perdesi. `.app-topbar` z-index:1020 ile yığınlama bağlamı
     açtığı için perde de panelle AYNI bağlamda (yani `.dd-wrap` içinde)
     durmalı; body üzerine konulursa panelin üstüne biner. */
  .dd-wrap.dd-sheet-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(15, 23, 42, .45);
  }

  .dd-panel,
  .dd-panel.dd-flip-start {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 82vh;
    border-width: 1px 0 0;
    border-radius: var(--app-radius) var(--app-radius) 0 0;
    transform: translateY(14px);
    transform-origin: bottom center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .dd-panel.is-open { transform: none; }

  .dd-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 8px auto 2px;
    border-radius: var(--app-radius-pill);
    background: var(--app-border);
  }
  .dd-scroll { padding: 8px; }
  .dd-item,
  .dd-option { padding: 11px 12px; font-size: 14.5px; }
  .theme-seg-btn { padding: 11px 4px; }
}

/* JS kapalıyken özel açılır liste gizlenir; <noscript> içindeki yerel
   <select> yedeği devreye girer (<html class="js"> base.html head script). */
html:not(.js) .topbar-location-js { display: none; }
html:not(.js) .topbar-language-js { display: none; }

/* ------------------------------- Dil seçici ------------------------------ */
/* Lokasyon seçicisiyle aynı `.loc-trigger` / `.dd-*` sözleşmesini kullanır;
   yalnız genişlik ve kompakt (yalnız kod) varyantı farklıdır. */
.lang-trigger { max-width: 170px; }
.lang-panel { min-width: 240px; }
.topbar-language-fallback { display: flex; align-items: center; gap: 6px; }
.topbar-language-fallback .form-select { width: auto; min-width: 120px; height: 36px; font-size: 13px; }

/* base_blank.html: sayfa yerleşimine karışmayan yüzen köşe denetimi. */
.blank-lang {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1030;
}
.blank-lang .lang-trigger { background: var(--app-surface); }

@media (max-width: 575.98px) {
  .blank-lang { top: 10px; right: 10px; }
  /* Kompakt tetikleyicide kod her zaman görünür kalır. */
  .lang-trigger .loc-code { display: inline-block; }
}

/* ==========================================================================
   USB barkod okuyucu kutusu (static/js/barkod.js)

   Kutu görünmez yakalayıcının tamamlayıcısıdır: odak bir form alanındayken
   yakalayıcı bilerek devre dışı kalır, kutu ise her durumda çalışır ve ekran
   okuyucuya görünür. Kısayol `SistemAyari.barkod_kisayol` ile yönetilir.
   Panel `.app-card` görünümünü izler; z-index perde (1070) ile topbar (1020)
   arasına değil, ikisinin de ÜSTÜNE konur — kutu her bağlamda erişilebilmeli.
   ========================================================================== */
.barkod-kutu {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(15, 23, 42, .38);
}

.barkod-kutu[hidden] { display: none; }

.barkod-kutu-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
}

.barkod-kutu-baslik {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--app-text);
}

.barkod-kutu-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--app-text);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}

.barkod-kutu-input:focus {
  outline: none;
  border-color: var(--app-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

/* `aria-live` satırı: okutma sonucu ekran okuyucuya buradan duyurulur. */
.barkod-kutu-durum {
  min-height: 1.25rem;
  margin-top: 10px;
  font-size: .875rem;
  color: var(--app-text-muted);
}

.barkod-kutu-ipucu {
  margin: 10px 0 0;
  font-size: .8125rem;
  color: var(--app-text-muted);
}

.barkod-kutu-kapat {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--app-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--app-radius-sm);
  cursor: pointer;
}

.barkod-kutu-kapat:hover { background: var(--app-muted-soft); color: var(--app-text); }

/* Topbar tetikleyicisi — kısayolu bilmeyen kullanıcı için görünür giriş. */
.topbar-barkod-trigger { flex: 0 0 auto; }

@media (max-width: 575.98px) {
  .barkod-kutu { padding-top: 8vh; }
  .barkod-kutu-panel { padding: 16px; }
}

/* LDAP bağlantı sınaması sonucu — adım listesi (bkz. sistem_ayarlari.js). */
.ldap-test-adimlar {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: .8125rem;
}

.ldap-test-adimlar li { padding: 2px 0; }
