@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Baloo+2:wght@500;600;700;800&display=swap');
:root {
  --accent: #1a5f4a;
  --accent-fg: #fff;
  --accent-soft: #1a5f4a14;
  --bg: #fbfaf6;
  --surface: #fff;
  --surface-2: #f5f3ed;
  --fg: #1c1b18;
  --fg-2: #4a4843;
  --fg-3: #86847e;
  --fg-4: #b8b5ae;
  --border: #1c1b1814;
  --border-strong: #1c1b1822;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --info: #1d4ed8;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font-sans: 'Nunito', system-ui, sans-serif;
  --font-serif: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #131210; --surface: #1c1b18; --surface-2: #242320;
  --fg: #f5f3ed; --fg-2: #c8c5bd; --fg-3: #86847e; --fg-4: #5a5852;
  --border: #f5f3ed14; --border-strong: #f5f3ed22; --accent-soft: var(--accent)22;
}
[dir="rtl"] { direction: rtl; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .drawer { left: 0; right: auto; border-left: none; border-right: 1px solid var(--border); transform: translateX(-100%); }
[dir="rtl"] .drawer.open { transform: translateX(0); }
[dir="rtl"] .toast-stack { right: auto; left: 20px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font-sans); background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; transition: background .2s, color .2s; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* TOPBAR */
.topbar { display: grid; grid-template-columns: 240px auto 1fr auto auto; align-items: center; height: 80px; padding: 0 20px 0 0; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; gap: 20px; }
.topbar-brand { display: flex; align-items: center; gap: 6px; height: 80px; border-right: 1px solid var(--border); padding: 8px 16px; min-width: 0; max-width: 240px; box-sizing: border-box; overflow: hidden; }
.brand-logo-box { flex: 1; height: 64px; max-height: 64px; display: flex; align-items: center; justify-content: flex-start; overflow: hidden; min-width: 0; }
.brand-logo-box img { max-height: 64px; max-width: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.brand-logo-box svg, .brand-logo-box img[src*=".svg"] { width: 100%; max-width: 200px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; overflow: hidden; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--accent-fg); font-weight: 600; font-size: 13px; font-family: var(--font-mono); letter-spacing: -0.5px; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-weight: 500; font-size: 15px; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--fg-3); margin-left: 4px; }

.topbar-clock { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 0 16px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); height: 56px; justify-content: center; min-width: 150px; }
.tc-time { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--fg); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.tc-date { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); line-height: 1; }

.search { display: flex; align-items: center; background: var(--surface-2); border-radius: var(--radius); padding: 8px 14px; max-width: 420px; gap: 10px; border: 1px solid transparent; transition: border-color .15s; }
.search:focus-within { border-color: var(--border-strong); background: var(--surface); }
.search svg { width: 14px; height: 14px; color: var(--fg-3); flex-shrink: 0; }
.search input { background: transparent; border: none; outline: none; flex: 1; font-size: 13px; color: var(--fg); }
.search input::placeholder { color: var(--fg-3); }
.search kbd { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); background: var(--bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--fg-2); transition: all .15s; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .badge-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; border: 1.5px solid var(--surface); }
.user-chip { width: 32px; height: 32px; border-radius: 50%; background: var(--fg); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 12px; cursor: pointer; margin-left: 4px; }

/* LAYOUT */
.app-body { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 80px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; height: calc(100vh - 80px); overflow-y: auto; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--fg-3); padding: 14px 10px 6px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--fg-2); text-decoration: none; font-size: 13px; font-weight: 400; cursor: pointer; transition: all .12s; background: transparent; border: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 11px; font-family: var(--font-mono); padding: 1px 6px; border-radius: 20px; background: var(--surface-2); color: var(--fg-2); }
.nav-item.active .nav-badge { background: var(--accent); color: var(--accent-fg); }
.sidebar-footer { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); display: flex; justify-content: space-between; }
.sidebar-settings-btn { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); color: var(--fg-2); font-size: 13px; cursor: pointer; background: transparent; border: none; width: 100%; text-align: left; margin-top: 8px; transition: all .12s; font-family: inherit; }
.sidebar-settings-btn:hover { background: var(--surface-2); color: var(--fg); }
.sidebar-settings-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.content { padding: 28px 32px 60px; max-width: 1400px; }

/* PAGE HEAD */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: 38px; letter-spacing: -0.5px; line-height: 1.1; color: var(--fg); }
.page-head h1 em { font-style: italic; color: var(--accent); }
.page-sub { color: var(--fg-3); font-size: 13px; margin-top: 4px; font-family: var(--font-mono); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; white-space: nowrap; font-family: inherit; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { opacity: 0.9; background: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--err); border-color: var(--err)33; }
.btn-danger:hover { background: var(--err)0d; }
.btn svg { width: 14px; height: 14px; }

/* FILTERS */
.filters-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filters-bar .search { padding: 6px 10px; min-width: 200px; flex: 1; }
.filter-chip { padding: 5px 12px; background: transparent; border: 1px solid var(--border-strong); border-radius: 20px; font-size: 12px; color: var(--fg-2); cursor: pointer; transition: all .12s; font-family: inherit; }
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 500; }
.filter-count { margin-left: auto; font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); padding: 4px 10px; }

/* WIDGET GRID */
.widgets-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; animation: fadeUp .4s cubic-bezier(.2,.8,.2,1) both; transition: border-color .15s; overflow: hidden; position: relative; }
.widget:hover { border-color: var(--border-strong); }
.widget.span-3 { grid-column: span 3; }
.widget.span-4 { grid-column: span 4; }
.widget.span-6 { grid-column: span 6; }
.widget.span-8 { grid-column: span 8; }
.widget.span-12 { grid-column: span 12; }
.widget-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.widget-title { font-size: 13px; font-weight: 500; color: var(--fg-2); letter-spacing: -0.1px; display: flex; align-items: center; gap: 8px; }
.widget-sub { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }

/* Lego mode: widget ekle/çıkar */
.widget-remove { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--err); color: white; border: none; cursor: pointer; font-size: 14px; line-height: 1; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; z-index: 2; }
.widget:hover .widget-remove { opacity: 1; display: flex; }
.add-widget-card { background: transparent; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--fg-3); font-size: 13px; font-weight: 500; transition: all .15s; font-family: inherit; }
.add-widget-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.widget-picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.widget-picker-item { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .15s; background: var(--surface); }
.widget-picker-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.widget-picker-item .wp-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.widget-picker-item .wp-desc { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }
.widget-picker-item.added { opacity: 0.5; pointer-events: none; position: relative; }
.widget-picker-item.added::after { content: '✓ eklendi'; position: absolute; top: 12px; right: 12px; font-size: 10px; color: var(--ok); font-family: var(--font-mono); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* STATS */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.stat-label { font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-family: var(--font-serif); font-size: 38px; font-weight: 400; letter-spacing: -1px; color: var(--fg); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-family: var(--font-sans); font-size: 14px; color: var(--fg-3); margin-left: 4px; }
.stat-delta { font-size: 12px; font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--ok); }
.stat-delta.down { color: var(--err); }
.stat-delta.flat { color: var(--fg-3); }
.kpi-grid { display: grid; gap: 28px; padding: 4px 0; }
.kpi-grid .stat:not(:last-child) { border-right: 1px solid var(--border); padding-right: 28px; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.data-table .code { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }
.data-table .muted { color: var(--fg-3); }
.data-table .mono { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }

/* Hizalama sınıfları — th ve td aynı sınıfı alırsa başlık ve içerik aynı hizada olur */
.data-table th.num, .data-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table th.center, .data-table td.center { text-align: center; }
.data-table th.right, .data-table td.right { text-align: right; }
/* Durum/tag sütunları - ortaya hizalı ve içindeki tag ortalanmış görünsün */
.data-table th.status, .data-table td.status { text-align: left; }
.data-table td .tag { display: inline-flex; }

/* ===== PERSONEL AVATAR ===== */
.emp-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 500; overflow: hidden; flex-shrink: 0; }
.emp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.emp-row-name { display: flex; align-items: center; gap: 10px; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px #10b98133; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 3px #10b98133; } 50% { box-shadow: 0 0 0 6px #10b98111; } }

/* ===== YETKİNLİK ÇİPLERİ ===== */
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--fg-2); }
.skill-chip.cert { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ===== DOKÜMAN LİSTESİ ===== */
.doc-list { display: flex; flex-direction: column; gap: 6px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.doc-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--fg-3); flex-shrink: 0; }
.doc-icon svg { width: 18px; height: 18px; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); margin-top: 2px; }

/* ===== MESAİ KARTI (detail side) ===== */
.attendance-card { padding: 18px; }
.clock-state { text-align: center; padding: 18px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.state-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500; margin-bottom: 12px; }
.state-badge.on { background: #10b98122; color: #059669; }
.state-badge.off { background: var(--surface-2); color: var(--fg-3); }
.state-since { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); margin-bottom: 14px; }
.btn-clock { display: block; width: 100%; padding: 14px; border-radius: var(--radius); border: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; font-family: inherit; letter-spacing: 0.3px; }
.btn-clock.btn-in { background: #10b981; color: white; }
.btn-clock.btn-in:hover { background: #059669; }
.btn-clock.btn-out { background: #ef4444; color: white; }
.btn-clock.btn-out:hover { background: #dc2626; }
.btn-clock-small { padding: 6px 12px; border-radius: var(--radius-sm); border: none; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-clock-small.btn-in { background: #10b981; color: white; }
.btn-clock-small.btn-in:hover { background: #059669; }
.btn-clock-small.btn-out { background: #ef4444; color: white; }
.btn-clock-small.btn-out:hover { background: #dc2626; }

.attendance-stats .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.attendance-stats .stat { text-align: center; padding: 10px 6px; background: var(--surface-2); border-radius: var(--radius-sm); }
.attendance-stats .stat-value { font-size: 18px; font-weight: 500; color: var(--fg); }
.attendance-stats .stat-label { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.att-mini { padding-top: 12px; border-top: 1px solid var(--border); }
.att-mini-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; }
.att-mini-row span:first-child { color: var(--fg-3); }

/* ===== AKTİVİTE LİSTESİ ===== */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; gap: 14px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.activity-list li:last-child { border-bottom: none; }
.activity-list .mono { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); min-width: 60px; flex-shrink: 0; }

/* ===== GENEL STAT ROW (detay kartı içi) ===== */
.info-card .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.info-card .stat-row .stat { text-align: center; padding: 14px 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.info-card .stat-row .stat-value { font-size: 22px; font-weight: 500; font-family: var(--font-serif); }
.info-card .stat-row .stat-label { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ===== FORM TABS ===== */
.form-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.form-tab { padding: 10px 16px; background: transparent; border: none; color: var(--fg-3); font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.form-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.form-tab-panel { display: none; }
.form-tab-panel.active { display: block; }
.form-hint { font-size: 11px; color: var(--fg-3); margin-top: 4px; }

/* ===== FILTER SELECT (role/shift filter) ===== */
.filter-select { padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-size: 12px; cursor: pointer; font-family: inherit; }
.filter-select:hover { border-color: var(--border-strong); }

/* ===== MESAİ SAYFASI ÖZET KARTLARI ===== */
.att-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.att-sum-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sum-ico { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--fg-3); background: var(--surface-2); flex-shrink: 0; }
.sum-ico svg { width: 18px; height: 18px; }
.sum-ico.on { background: #10b98122; color: #059669; }
.sum-ico.done { background: var(--accent-soft); color: var(--accent); }
.sum-ico.absent { background: #ef444422; color: #dc2626; font-weight: 500; }
.sum-val { font-size: 24px; font-weight: 500; font-family: var(--font-serif); line-height: 1; }
.sum-lbl { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.att-section-title { font-size: 13px; font-weight: 500; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 10px; padding: 0 4px; }

/* TAGS */
.tag { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--fg-2); font-family: var(--font-mono); white-space: nowrap; }
.tag.ok { background: #15803d14; color: var(--ok); }
.tag.warn { background: #b4530914; color: var(--warn); }
.tag.err { background: #b91c1c14; color: var(--err); }
.tag.info { background: var(--accent-soft); color: var(--accent); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-4); margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.dot.run { background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }

.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: border-color .12s; }
.card:hover { border-color: var(--border-strong); }
.card-row-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* CUSTOMER CARD */
.customer-card { display: flex; flex-direction: column; gap: 10px; }
.customer-card .top { display: flex; gap: 12px; align-items: center; }
.customer-card .logo { width: 42px; height: 42px; border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 500; color: var(--fg-2); flex-shrink: 0; }
.customer-card .name { font-weight: 500; font-size: 14px; }
.customer-card .sub { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }
.customer-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 12px; }
.customer-card .meta dt { color: var(--fg-3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.customer-card .meta dd { color: var(--fg); font-family: var(--font-mono); font-size: 13px; margin-top: 2px; }

/* MACHINE */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.machine-card { padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid transparent; transition: all .15s; cursor: pointer; }
.machine-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.machine-card.running { background: var(--accent-soft); border-color: var(--accent)44; }
.machine-card.down { background: #b91c1c0d; border-color: #b91c1c22; }
.machine-card .name { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--fg); margin-bottom: 4px; }
.machine-card .state { font-size: 11px; color: var(--fg-3); text-transform: lowercase; }
.machine-card .load { font-family: var(--font-serif); font-size: 26px; line-height: 1; color: var(--fg); margin-top: 10px; font-variant-numeric: tabular-nums; }
.machine-card .load .pct { font-size: 12px; color: var(--fg-3); font-family: var(--font-sans); }

/* FEED */
.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; }
.feed-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--fg-2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; flex-shrink: 0; }
.feed-body { flex: 1; font-size: 13px; line-height: 1.5; }
.feed-body b { font-weight: 500; }
.feed-body .muted { color: var(--fg-3); }
.feed-time { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); white-space: nowrap; }

/* STOCK LIST */
.stock-list { display: flex; flex-direction: column; }
.stock-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stock-row:last-child { border-bottom: none; }
.stock-row .name { font-size: 13px; }
.stock-row .code { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.stock-row .qty { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.stock-row .qty .unit { color: var(--fg-3); font-size: 11px; margin-left: 2px; }

/* CHART */
.chart-container { position: relative; height: 220px; margin-top: 8px; }
.chart-container.tall { height: 280px; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--fg-3); margin-bottom: 10px; }
.chart-legend .swatch { display: inline-block; width: 10px; height: 3px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }

/* DRAWER */
.drawer-scrim { position: fixed; inset: 0; background: #0006; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; background: var(--surface); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); z-index: 40; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: 22px; }
.drawer-head h2 em { font-style: italic; color: var(--accent); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.drawer-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fg-3); font-weight: 500; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.field input[type="text"], .field input[type="number"], .field select { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; outline: none; transition: border-color .15s; color: var(--fg); }
.field input[type="text"]:focus, .field input[type="number"]:focus, .field select:focus { border-color: var(--accent); }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type="color"] { width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: none; padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-row .hex { flex: 1; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; outline: none; }
.color-swatches { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.color-swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .1s; }
.color-swatches button:hover { transform: scale(1.1); }
.color-swatches button.active { border-color: var(--fg); }
.segment { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.segment button { flex: 1; padding: 6px 10px; background: transparent; border: none; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--fg-2); cursor: pointer; transition: all .12s; font-family: inherit; }
.segment button.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px #0001; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row .val { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); min-width: 36px; text-align: right; }

.toggle { position: relative; width: 34px; height: 20px; background: var(--border-strong); border-radius: 20px; transition: background .15s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: transform .15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(14px); }

.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.drawer-footer .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-footer .btn { justify-content: center; width: 100%; }
.drawer-footer .muted { text-align: center; font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); margin-top: 4px; }

.logo-upload-box { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; text-align: center; cursor: pointer; transition: all .15s; position: relative; }
.logo-upload-box:hover { border-color: var(--accent); background: var(--accent-soft); }
.logo-upload-box .preview { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--fg-3); }
.logo-upload-box .preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-upload-box .hint { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }
.logo-upload-box .remove { position: absolute; top: 6px; right: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 11px; padding: 3px 7px; color: var(--fg-2); cursor: pointer; }

/* MODAL — v64.1: tüm modal'lar viewport'a sığar, yatay scroll yok */
.modal-scrim { position: fixed; inset: 0; background: #0008; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px 20px; overflow-y: auto; overflow-x: hidden; }
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 20px 60px #0003; width: 100%; max-width: min(720px, 95vw); transform: translateY(-20px); transition: transform .25s cubic-bezier(.2,.8,.2,1); overflow: hidden; display: flex; flex-direction: column; }
.modal-scrim.open .modal { transform: translateY(0); }
.modal.wide  { max-width: min(1200px, 96vw); }
.modal.xwide { max-width: min(1400px, 97vw); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: 22px; letter-spacing: -0.3px; }
.modal-head h2 em { font-style: italic; color: var(--accent); }
.modal-body { padding: 22px; overflow-y: auto; overflow-x: hidden; max-height: calc(100vh - 200px); }
/* Geniş tablo/grid varsa kendi içinde yatay scroll — modal'ı taşırmasın */
.modal-body .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .modal-scrim { padding: 20px 8px; }
  .modal-body { padding: 16px; }
}

/* FORM */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.form-field label .req { color: var(--err); margin-left: 2px; }
.form-field input, .form-field select, .form-field textarea { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; outline: none; transition: border-color .12s; font-family: inherit; color: var(--fg); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 64px; }

/* DETAIL VIEW */
.detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.back-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--fg-2); transition: all .12s; margin-top: 4px; }
.back-btn:hover { background: var(--surface-2); color: var(--fg); }
.back-btn svg { width: 16px; height: 16px; }
.detail-head .meta { flex: 1; min-width: 0; }
.detail-head .eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin-bottom: 4px; }
.detail-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: 32px; letter-spacing: -0.3px; line-height: 1.1; color: var(--fg); margin-bottom: 6px; }
.detail-head h1 em { font-style: italic; color: var(--accent); }
.detail-head .sub { color: var(--fg-3); font-size: 13px; }
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-bottom: 40px; }
.detail-main { display: flex; flex-direction: column; gap: 16px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.info-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fg-3); font-weight: 500; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.kv-grid .full { grid-column: 1 / -1; }
.kv dt { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.kv dd { font-size: 14px; color: var(--fg); }
.kv dd.mono { font-family: var(--font-mono); font-size: 13px; }
.kv dd.big { font-family: var(--font-serif); font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.kv dd.big .unit { font-family: var(--font-sans); font-size: 12px; color: var(--fg-3); margin-left: 4px; }

/* TIMELINE */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1.5px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 18px 16px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tl-item .tl-title { font-size: 13px; font-weight: 500; }
.tl-item .tl-title .arrow { color: var(--fg-3); margin: 0 4px; font-family: var(--font-mono); }
.tl-item .tl-time { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); white-space: nowrap; }
.tl-item .tl-by { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.tl-item .tl-note { font-size: 12px; color: var(--fg-2); margin-top: 4px; font-style: italic; }

/* TRANSITIONS */
.transitions-panel { display: flex; flex-direction: column; gap: 8px; }
.transition-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 14px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: all .12s; text-align: left; font-family: inherit; }
.transition-btn:hover { background: var(--accent-soft); border-color: var(--accent)44; }
.transition-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.transition-btn:disabled:hover { background: var(--surface-2); border-color: transparent; }
.transition-btn .from { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); display: block; margin-bottom: 2px; }
.transition-btn .to { font-size: 14px; font-weight: 500; color: var(--fg); }
.transition-btn .req { font-size: 10px; color: var(--warn); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 6px; background: var(--warn)14; border-radius: 3px; }

/* TOAST */
.toast-stack { position: fixed; top: 72px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; max-width: 380px; }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 8px 24px #0001; font-size: 13px; line-height: 1.4; display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: toastIn .25s cubic-bezier(.2,.8,.2,1); border-left: 3px solid var(--fg-3); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--err); }
.toast.info { border-left-color: var(--accent); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 500; margin-bottom: 2px; }
.toast .t-detail { color: var(--fg-3); font-size: 11px; font-family: var(--font-mono); }
.toast .t-close { background: none; border: none; color: var(--fg-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* MOBILE */
.hamburger-btn { display: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; cursor: pointer; align-items: center; justify-content: center; color: var(--fg-2); }
.hamburger-btn:hover { background: var(--surface-2); }
.hamburger-btn svg { width: 18px; height: 18px; }
.sidebar-scrim { display: none; position: fixed; inset: 60px 0 0 0; background: #0005; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 25; }
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

/* LOADER */
.inline-loader { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--fg-3); font-family: var(--font-mono); font-size: 12px; grid-column: 1 / -1; }
.inline-loader::before { content: ''; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 20px; color: var(--fg-3); font-family: var(--font-mono); font-size: 13px; }
.empty em { font-family: var(--font-serif); font-style: italic; color: var(--fg); font-size: 18px; display: block; margin-bottom: 8px; }

/* WAREHOUSE — DEPO RAF SISTEMI */
.wh-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.wh-tab { padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-2); cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: all .12s; font-family: inherit; }
.wh-tab:hover { background: var(--surface-2); }
.wh-tab.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.wh-tab .count { background: #ffffff33; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-family: var(--font-mono); }
.wh-subtabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.wh-subtab { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); cursor: pointer; font-size: 12px; font-weight: 500; transition: all .12s; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.wh-subtab:hover { background: var(--surface-2); }
.wh-subtab.active { background: var(--ok)14; color: var(--ok); border-color: var(--ok)44; }

.wh-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.wh-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.wh-kpi .ico { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--fg-3); display: flex; align-items: center; justify-content: center; }
.wh-kpi .ico svg { width: 16px; height: 16px; }
.wh-kpi .val { font-family: var(--font-serif); font-size: 34px; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.wh-kpi .lbl { font-size: 11px; color: var(--fg-3); margin-top: 4px; }

.wh-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.wh-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.wh-panel-title { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.wh-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--fg-3); }
.wh-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

.wh-rack-layout { display: grid; grid-template-columns: 60px repeat(6, 1fr); gap: 6px 10px; align-items: center; }
.wh-zone-header { font-size: 11px; font-weight: 500; color: var(--fg-2); text-align: center; padding-bottom: 8px; }
.wh-floor-label { font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }
.wh-rack-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.wh-rack { aspect-ratio: 1; border-radius: 4px; border: 1.5px solid transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; position: relative; background: var(--surface-2); min-height: 34px; }
.wh-rack svg { width: 14px; height: 14px; opacity: 0.7; }
.wh-rack.full { background: #d1fae5; border-color: #10b981; color: #065f46; }
.wh-rack.reserved { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.wh-rack.empty { background: transparent; border-color: var(--border-strong); color: var(--fg-4); }
.wh-rack.empty svg { display: none; }
.wh-rack.empty::after { content: attr(data-pos); font-size: 10px; color: var(--fg-4); }
.wh-rack.surface { background: #dbeafe; border-color: #60a5fa; color: #1e40af; }
.wh-rack.ready { background: #c7d2fe; border-color: #6366f1; color: #3730a3; }
.wh-rack:hover { transform: scale(1.08); z-index: 2; box-shadow: 0 4px 12px #0002; }
.wh-rack.selected { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); z-index: 2; }

/* Palet detay popup */
.wh-popup { position: absolute; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 30px #0002; font-size: 12px; min-width: 220px; z-index: 10; }
.wh-popup-title { font-weight: 500; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.wh-popup-title svg { width: 14px; height: 14px; color: var(--fg-3); }
.wh-popup-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 4px 0; }
.wh-popup-row .k { color: var(--fg-3); font-size: 11px; }
.wh-popup-row .v { color: var(--fg); font-size: 12px; font-weight: 500; }
.wh-popup-row .v.mono { font-family: var(--font-mono); }
.wh-popup-footer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }

/* Yüzey alanları */
.wh-surfaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 8px; }
.wh-surface-card { background: #dbeafe; border-radius: var(--radius); padding: 16px; }
.wh-surface-head { display: flex; justify-content: space-between; align-items: center; color: #1e40af; font-weight: 500; font-size: 13px; margin-bottom: 12px; }
.wh-surface-zone { font-size: 11px; color: #1e40af99; font-family: var(--font-mono); }
.wh-surface-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; }
.wh-surface-slot { aspect-ratio: 1; background: #bfdbfe; border: 1px solid #60a5fa; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #1e40af; font-family: var(--font-mono); }
.wh-surface-card.purple { background: #ede9fe; }
.wh-surface-card.purple .wh-surface-head, .wh-surface-card.purple .wh-surface-zone { color: #5b21b6; }
.wh-surface-card.purple .wh-surface-slot { background: #ddd6fe; border-color: #a78bfa; color: #5b21b6; }
.wh-surface-footer { text-align: right; font-size: 11px; color: #1e40af99; margin-top: 10px; padding-top: 10px; border-top: 1px solid #60a5fa44; }

.wh-corridor { margin-top: 18px; padding: 14px; background: #fef9c3; border: 1px dashed #eab308; border-radius: var(--radius); text-align: center; color: #854d0e; font-weight: 500; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.wh-corridor svg { width: 18px; height: 18px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .topbar-clock { min-width: 90px; padding: 0 10px; }
  .tc-time { font-size: 13px; }
  .tc-date { font-size: 10px; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: auto auto 1fr auto; padding: 0 14px 0 0; }
  .topbar-brand { padding: 0 10px; border-right: none; }
  .brand-logo-box { max-width: 100px; }
  .topbar-clock { display: none; }
  .app-body { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 40px; }
  .widget.span-3, .widget.span-4, .widget.span-6, .widget.span-8, .widget.span-12 { grid-column: span 12; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px; }
  .kpi-grid .stat:not(:last-child) { border-right: none; padding-right: 0; }
  .page-head h1 { font-size: 28px; }
  .drawer { width: 100%; }
  .hamburger-btn { display: inline-flex; }
  .sidebar { display: flex !important; position: fixed; top: 80px; bottom: 0; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 30; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-head h1 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; margin: 0 10px; }
  .wh-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .wh-rack-layout { grid-template-columns: 40px repeat(6, 1fr); gap: 4px; }
  .wh-rack { min-height: 28px; }
}
.load-error {
  max-width: 400px; margin: 60px auto;
  text-align: center; padding: 30px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 12px; color: #991b1b;
}
.load-error h2 { margin: 0 0 8px; font-size: 18px; }
.load-error p { margin: 0 0 16px; font-size: 13px; }

.inline-loader {
  text-align: center; padding: 60px 20px;
  color: var(--fg-3); font-size: 14px;
}
.inline-loader::before {
  content: ''; display: inline-block;
  width: 20px; height: 20px; margin-right: 10px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN SCREEN — Split Layout
   ============================================================ */

/* Login görünürken panel içerikleri saklı */
body.logged-out .topbar,
body.logged-out .app-body,
body.logged-out #drawer,
body.logged-out #admin-drawer,
body.logged-out .drawer-scrim { display: none !important; }

.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex;
  background: #fff;
  overflow: hidden;
}

/* ---------- SOL: HERO ---------- */

.login-hero {
  flex: 1.2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100vh;
  color: #fff;
}

.login-hero-pattern {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.12;
}

.pattern-dots {
  background-image: radial-gradient(circle, #fff 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.pattern-grid {
  background-image:
    linear-gradient(#fff 1px, transparent 1px),
    linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.08;
}
.pattern-waves {
  background-image:
    radial-gradient(ellipse at top left, transparent 0%, transparent 40%, rgba(255,255,255,0.15) 41%, transparent 42%),
    radial-gradient(ellipse at bottom right, transparent 0%, transparent 40%, rgba(255,255,255,0.15) 41%, transparent 42%);
  background-size: 200px 200px;
}
.pattern-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.08) 20px,
    rgba(255,255,255,0.08) 21px
  );
}
.pattern-none { display: none; }

.login-hero-content {
  /* artık kullanılmıyor - hero sadece arka plan */
  display: none;
}

.login-hero-logo-box,
.login-hero-title,
.login-hero-tag,
.login-hero-footer {
  display: none;
}

/* ---------- SAĞ: FORM ---------- */

.login-panel {
  flex: 1;
  max-width: 520px;
  min-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  background: #fff;
}

.login-customize-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.login-customize-btn:hover {
  background: #e5e5e5;
  color: #1a1a1a;
  transform: rotate(30deg);
}

.login-form-wrap {
  width: 100%;
  max-width: 360px;
  animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-form-wrap.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Logo + firma adı bloğu — formun üstünde */
.login-form-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-form-logo-box {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.login-form-logo-box img {
  max-width: 220px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.login-form-company {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 4px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.login-form-tagline {
  font-size: 13px;
  color: #888;
  margin: 0;
  line-height: 1.4;
}

.login-form-head {
  margin-bottom: 24px;
  text-align: center;
}
.login-form-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 4px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.login-form-head p {
  margin: 0;
  color: #777;
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
}
.login-field label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8f8f8;
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: all 0.15s;
}
.login-input-wrap:focus-within {
  border-color: #0f766e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15,118,110,0.08);
}
.login-input-wrap svg {
  position: absolute;
  left: 14px;
  color: #999;
  pointer-events: none;
}
.login-input-wrap:focus-within svg { color: #0f766e; }

.login-input-wrap input {
  flex: 1;
  padding: 14px 14px 14px 44px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  width: 100%;
}
.login-input-wrap input::placeholder { color: #bbb; }

.login-pw-toggle {
  background: none;
  border: none;
  padding: 10px;
  margin-right: 4px;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-pw-toggle:hover { color: #1a1a1a; }

.login-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-error::before {
  content: '⚠';
  font-size: 14px;
}

.login-btn {
  padding: 14px 16px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.login-btn:hover:not(:disabled) {
  background: #115e59;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,118,110,0.3);
}
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { cursor: wait; }

.login-btn.loading { background: #0f766e; opacity: 0.7; }
.login-btn.loading .login-btn-arrow { display: none; }
.login-btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.login-btn.success {
  background: #059669 !important;
}
.login-btn.success .login-btn-arrow { display: none; }

.login-btn-arrow { opacity: 0.7; transition: transform 0.15s; }
.login-btn:hover:not(:disabled) .login-btn-arrow { transform: translateX(3px); }

.login-footer {
  text-align: center;
  color: #999;
  font-size: 11px;
  margin: 32px 0 0;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- CUSTOMIZATION PANEL ---------- */

.lc-tabs {
  display: flex;
  gap: 2px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}
.lc-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  font-family: inherit;
}
.lc-tab.active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.lc-panel { display: none; }
.lc-panel.active { display: block; }

.lc-field {
  margin-bottom: 18px;
}
.lc-field > label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.lc-field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.lc-field input[type="text"]:focus {
  outline: none;
  border-color: #0f766e;
}

.lc-hint {
  font-size: 11px;
  color: #999;
  margin: 6px 0 0;
}

.lc-logo-preview {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, #0f766e, #1e3a8a);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.lc-logo-preview img {
  max-width: 70%;
  max-height: 60px;
  background: rgba(255,255,255,0.9);
  padding: 10px 18px;
  border-radius: 8px;
}

.lc-file-row {
  display: flex;
  gap: 8px;
}

.lc-seg {
  display: flex;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.lc-seg button {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  font-family: inherit;
}
.lc-seg button.active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.lc-color-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lc-color-row input[type="color"] {
  width: 48px;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  padding: 4px;
}
.lc-hex {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.lc-pattern-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.lc-pattern-btn {
  background: #f8f8f8;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 11px;
  color: #666;
}
.lc-pattern-btn.active {
  border-color: #0f766e;
  background: #fff;
}
.lc-pattern-preview {
  width: 100%;
  height: 40px;
  background: linear-gradient(135deg, #0f766e, #1e3a8a);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.lc-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.lc-preset-btn {
  height: 70px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}
.lc-preset-btn:hover { transform: translateY(-2px); }
.lc-preset-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  font-family: inherit;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .login-screen {
    flex-direction: column;
  }
  .login-hero {
    flex: 0 0 120px;
    min-height: 120px;
  }
  .login-panel {
    flex: 1;
    min-width: 100%;
    max-width: 100%;
  }
  .login-form-logo-box img { max-height: 60px; max-width: 180px; }
  .login-form-company { font-size: 22px; }
}

@media (max-width: 500px) {
  .login-panel { padding: 30px 20px; }
  .login-form-head h2 { font-size: 20px; }
  .login-form-logo-box img { max-height: 50px; max-width: 150px; }
}

/* Pattern preview minik önizlemeler için */
.lc-pattern-preview.pattern-dots::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.35;
}
.lc-pattern-preview.pattern-grid::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(#fff 0.5px, transparent 0.5px),
    linear-gradient(90deg, #fff 0.5px, transparent 0.5px);
  background-size: 10px 10px;
  opacity: 0.3;
}
.lc-pattern-preview.pattern-waves::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 30%, transparent 50%, rgba(255,255,255,0.3) 51%, transparent 52%);
  background-size: 40px 40px;
}
.lc-pattern-preview.pattern-diagonal::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,0.25) 6px, rgba(255,255,255,0.25) 7px);
}

/* ============================================================
   USER MENU (topbar chip dropdown)
   ============================================================ */

.user-chip {
  position: relative;
  cursor: pointer;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 6px 0;
  z-index: 500;
  display: none;
  overflow: hidden;
}

.user-menu.open {
  display: block;
  animation: userMenuFade 0.15s ease;
}

@keyframes userMenuFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.user-menu-header strong {
  display: block;
  margin-bottom: 2px;
  color: var(--fg);
  font-weight: 500;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}
.user-menu-item:hover {
  background: var(--bg-alt);
}
.user-menu-item.danger {
  color: #dc2626;
}
.user-menu-item.danger:hover {
  background: #fef2f2;
}
.user-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   BANNER / DUYURU
   ============================================================ */

#banner-host { background: transparent; }

.banner {
  position: relative;
  margin: 12px 16px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  min-height: 70px;
  display: flex;
  align-items: stretch;
}

.banner-horizontal {
  display: flex;
  width: 100%;
  align-items: stretch;
  min-height: 90px;
}
.banner-image {
  flex: 0 0 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.banner-content {
  flex: 1;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.banner-text-only {
  flex: 1;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.banner-img-only {
  flex: 1;
  min-height: 120px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.banner-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.banner-message {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.92;
}

.banner-close, .banner-edit {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 5;
}
.banner-close { right: 8px; }
.banner-edit  { right: 42px; opacity: 0; }
.banner:hover .banner-edit { opacity: 1; }

.banner-close:hover, .banner-edit:hover {
  background: rgba(0,0,0,0.4);
}

/* ---------- BANNER EDITOR ---------- */

.be-grid { display: flex; flex-direction: column; gap: 16px; }

.be-row { display: flex; flex-direction: column; gap: 6px; }
.be-row > label:not(.be-toggle) {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.be-row input[type="text"],
.be-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
}
.be-row input[type="text"]:focus,
.be-row textarea:focus {
  outline: none;
  border-color: #0f766e;
}

.be-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
}
.be-toggle input { width: 18px; height: 18px; cursor: pointer; }

.be-seg {
  display: flex;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.be-seg button {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
  font-family: inherit;
}
.be-seg button.active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.be-image-preview {
  width: 100%;
  height: 100px;
  background: #f5f5f5;
  border: 1px dashed #ddd;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
  margin-bottom: 8px;
}

.be-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.be-colors > div { display: flex; flex-direction: column; gap: 6px; }
.be-colors label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.be-presets { padding-top: 14px; border-top: 1px solid #eee; }
.be-presets-title {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.be-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.be-preset {
  padding: 10px 6px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: transform 0.15s;
}
.be-preset:hover { transform: translateY(-2px); }

@media (max-width: 700px) {
  .banner-horizontal { flex-direction: column; }
  .banner-image { flex: 0 0 120px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
  .be-colors { grid-template-columns: 1fr; }
  .be-presets-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   KULLANICI YÖNETİMİ
   ============================================================ */

.user-row-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.badge-self {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-alt);
  color: var(--fg-3);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 6px;
  vertical-align: middle;
}

.row-inactive { opacity: 0.55; }
.row-inactive td { color: var(--fg-3); }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions .icon-btn {
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border-radius: 6px;
}
.row-actions .icon-btn.danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

.role-help {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--bg-alt);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.role-help h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-2);
  font-weight: 500;
}
.role-help ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.role-help li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.5;
}
.role-help li .tag {
  margin-right: 8px;
}

/* ============================================================
   GROUPS / ROLLER & YETKİLER
   ============================================================ */

.grp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.grp-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s, transform 0.15s;
}
.grp-card:hover {
  border-color: var(--accent);
}

.grp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.grp-card-name {
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
  margin-bottom: 2px;
}
.grp-card-desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.4;
}
.grp-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.grp-card-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.grp-card-actions .icon-btn.danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

.badge-sys {
  display: inline-block;
  padding: 1px 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.grp-card-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-3);
  margin-bottom: 12px;
  font-family: var(--font-mono, monospace);
}

.grp-card-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.grp-mod-pill {
  display: inline-block;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fg-2);
}
.grp-mod-pill.more {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 500;
}

.grp-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: transparent;
  border: 2px dashed var(--border-strong);
  color: var(--fg-3);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  min-height: 140px;
  transition: all 0.15s;
}
.grp-card-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-alt);
}

/* ---------- GRUP FORMU (modules grid) ---------- */

.grp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grp-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  background: var(--bg-alt);
  padding: 14px;
  border-radius: 10px;
  margin-top: 6px;
}

.grp-mod-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.grp-mod-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.grp-mod-cat-toggle {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  padding: 0;
}
.grp-mod-cat-toggle:hover { text-decoration: underline; }

.grp-mod-cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grp-mod-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}
.grp-mod-check:hover { background: var(--bg-alt); }
.grp-mod-check input { cursor: pointer; }

/* ---------- KULLANICI FORMU - GRUP CHECKBOX ---------- */

.user-groups-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.user-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.user-group-row:hover { border-color: var(--accent); }

.user-group-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.user-group-info-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.user-group-info-desc {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 1px;
}
.user-group-info-modcount {
  font-size: 10px;
  color: var(--fg-3);
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}

.user-groups-empty {
  text-align: center;
  padding: 20px;
  color: var(--fg-3);
  font-size: 13px;
}
.user-groups-empty button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  font-size: 13px;
}

/* Kullanıcı listesinde grup rozetleri */
.user-groups-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.user-group-badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fg-2);
  white-space: nowrap;
}
.user-group-badge.more {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   AKORDİYON LİSTE (müşteriler, tedarikçiler vb.)
   ============================================================ */

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acc-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.acc-row:hover { border-color: var(--border-strong); }
.acc-row.open {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(15,118,110,0.08);
}

.acc-head {
  display: grid;
  grid-template-columns: 20px 40px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.acc-head:hover { background: var(--bg-alt); }

.acc-chev {
  color: var(--fg-3);
  transition: transform 0.2s;
  display: flex;
}
.acc-row.open .acc-chev {
  transform: rotate(90deg);
  color: var(--accent);
}

.acc-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}

.acc-main {
  min-width: 0;
  overflow: hidden;
}
.acc-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-sub {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.acc-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 200px;
  justify-content: flex-end;
}

.acc-balance {
  text-align: right;
  min-width: 90px;
}
.acc-balance {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.acc-balance.pos { color: #dc2626; }
.acc-balance.neg { color: #059669; }
.acc-balance-label {
  font-size: 10px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
  font-weight: 400;
  margin-top: 1px;
}

/* v75d2 — Müşteri kartı: logo + cari (ters renk) + bayrak (en sağda) + filtre */
.acc-head.cust-head {
  grid-template-columns: 20px 40px 1fr auto auto auto;
}
.acc-flag {
  font-size: 26px;
  line-height: 1;
  text-align: center;
  min-width: 34px;
  user-select: none;
}
.acc-flag-none { font-size: 20px; opacity: 0.35; }
.sup-flag { font-size: 22px; line-height: 1; text-align: center; min-width: 28px; user-select: none; flex-shrink: 0; }
.sup-flag-none { font-size: 18px; opacity: 0.35; }
.cf-logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 22px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  overflow: hidden;
}
.cust-country-filter {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  cursor: pointer;
  max-width: 220px;
}
@media (max-width: 680px) {
  .acc-head.cust-head {
    grid-template-columns: 18px 34px 1fr auto auto;
    gap: 10px;
  }
  .acc-head.cust-head .acc-tags { display: none; }
  .acc-flag { min-width: 26px; font-size: 22px; }
}

/* Açılan gövde */
.acc-body {
  padding: 18px 20px 16px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.acc-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 14px;
}

.acc-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acc-section.full { grid-column: 1 / -1; }

.acc-section h4 {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-3);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.acc-section dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-section dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.acc-section dl > div.full {
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.acc-section dt {
  font-size: 12px;
  color: var(--fg-3);
  flex-shrink: 0;
}
.acc-section dd {
  margin: 0;
  font-size: 13px;
  color: var(--fg);
  text-align: right;
  font-weight: 500;
}
.acc-section dd.pos { color: #dc2626; }
.acc-section dd.neg { color: #059669; }
.acc-section dd.mono { font-family: var(--font-mono, monospace); }

.acc-notes {
  background: var(--surface);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg);
  white-space: pre-line;
  line-height: 1.5;
}

.acc-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.acc-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

/* Risk bar */
.risk-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.risk-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}
.risk-fill.warn { background: #f59e0b; }
.risk-fill.danger { background: #dc2626; }

/* Etiket pill */
.cust-tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fg-2);
  white-space: nowrap;
}

/* Etiket filtresi bar */
.tag-filter-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tag-filter-btn {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 11px;
  color: var(--fg-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.1s;
}
.tag-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Form section title */
.form-section-title {
  grid-column: 1 / -1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-3);
  font-weight: 500;
  padding: 6px 0 2px;
  border-bottom: 1px solid var(--border);
  margin-top: 6px;
}

/* Empty state */
.cust-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-3);
}
.cust-empty em {
  display: block;
  font-size: 15px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .acc-head {
    grid-template-columns: 20px 40px 1fr auto;
    gap: 10px;
  }
  .acc-tags { display: none; }
  .acc-detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   GERİ BUTONU (topbar)
   ============================================================ */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
  white-space: nowrap;
}
.back-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateX(-2px);
}
.back-btn svg { flex-shrink: 0; }

@media (max-width: 900px) {
  .back-btn span { display: none; }
  .back-btn { padding: 8px 10px; }
}


/* ===== v71at — Rounded/minimal font + İşlerim-mavi kart canlandırma ===== */
.page-head h1 { font-family: var(--font-serif); font-weight: 700; letter-spacing: -.5px; }

/* Sidebar aktif sekme — accent gradient (mavi seçilince İşlerim havası) */
.nav-item { font-weight: 600; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 68%, #06b6d4) 100%);
  color: var(--accent-fg); font-weight: 700;
  box-shadow: 0 5px 14px -3px color-mix(in srgb, var(--accent) 48%, transparent);
}
.nav-item.active svg { color: var(--accent-fg); }

/* Birincil buton — gradient + yükselme */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 72%, #06b6d4) 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--accent) 50%, transparent);
}
.btn-primary:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 8px 20px -5px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn:active { transform: translateY(0); }

/* Dashboard widget'ları — üst accent şerit + hover yükselme */
.widget { box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .15s; }
.widget::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, #06b6d4) 60%, #22d3ee 100%);
  opacity: .92;
}
.widget:hover { transform: translateY(-4px); box-shadow: 0 16px 36px -14px color-mix(in srgb, var(--accent) 32%, rgba(0,0,0,.18)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

/* Büyük rakamlar rounded display */
.widget .big, .kpi-value, .widget-value, .stat-value { font-family: var(--font-serif); }

/* Modül içi kutucuk/kart hover */
.card, .pv-variant, .pr-card { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover, .pv-variant:hover, .pr-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 28%, rgba(0,0,0,.16)); }

@media (prefers-reduced-motion: reduce) {
  .nav-item, .btn, .btn-primary, .widget, .card, .pv-variant, .pr-card { transition: none !important; transform: none !important; }
}
