@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Mokita marka teması — sıcak nötrler, olive aksiyon, gold vurgu */
  --bg: #f5f2ec;
  --bg-subtle: #efe9df;
  --surface: #ffffff;
  --surface-hover: #faf8f4;
  --surface-raised: #ffffff;
  --border: #e7e0d4;
  --border-strong: #d6cdbd;
  --text: #2b2521;
  --text-secondary: #5c5348;
  --muted: #8a7f70;
  --accent: #5e6650;          /* olive — birincil aksiyon */
  --accent-hover: #4a5240;
  --accent-soft: #eef0e9;
  --accent-border: #cdd3c0;
  --brand: #b08442;           /* gold — marka vurgusu */
  --brand-soft: #f7efe1;
  --brand-border: #e6d3ad;
  --success: #4f8a5b;
  --success-soft: #eaf3ec;
  --warning: #c08a2e;
  --warning-soft: #f9f0dd;
  --danger: #c0483f;
  --danger-soft: #f8ebe9;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(43, 37, 33, 0.04);
  --shadow-sm: 0 1px 3px rgba(43, 37, 33, 0.06), 0 1px 2px rgba(43, 37, 33, 0.04);
  --shadow-md: 0 4px 16px rgba(43, 37, 33, 0.08);
  --shadow-lg: 0 12px 40px rgba(43, 37, 33, 0.14);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --chart-grid: #e7e0d4;
  --chart-text: #8a7f70;
  color-scheme: light;
}

/* ─── Koyu mod — token override (bileşenler değişkenleri kullandığı için otomatik) ─── */
:root[data-theme="dark"] {
  --bg: #17150f;
  --bg-subtle: #201d15;
  --surface: #211e16;
  --surface-hover: #29251b;
  --surface-raised: #262218;
  --border: #35301f;
  --border-strong: #46402d;
  --text: #ede7d9;
  --text-secondary: #b8ad97;
  --muted: #8f846e;
  --accent: #9aa47c;
  --accent-hover: #aab585;
  --accent-soft: #262a1d;
  --accent-border: #3d4430;
  --brand: #d3a655;
  --brand-soft: #2b2415;
  --brand-border: #4a3d20;
  --success: #6fae76;
  --success-soft: #1e2a1f;
  --warning: #d2a24a;
  --warning-soft: #2c2413;
  --danger: #d47268;
  --danger-soft: #2c1c19;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --chart-grid: #35301f;
  --chart-text: #8f846e;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.brand {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, var(--brand) 0%, #8a6528 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(176, 132, 66, 0.3);
}

.brand h1 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand p {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1px;
}

.nav {
  flex: 1;
  padding: 0.65rem 0.6rem;
  overflow-y: auto;
}

.nav-section {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0.85rem 0.75rem 0.35rem;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  transition: background var(--transition), color var(--transition);
}

.nav a .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.65;
  flex-shrink: 0;
}

.nav a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav a.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: var(--danger);
}

/* ─── Main ─── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-menu {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.global-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.global-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#global-search {
  width: 100%;
  min-width: unset;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: all var(--transition);
}

#global-search:focus {
  background: var(--surface);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  background: var(--bg-subtle);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.ok { background: var(--success); box-shadow: 0 0 0 2px var(--success-soft); }
.status-dot.err { background: var(--danger); }

.topbar-page {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.topbar-page strong {
  color: var(--text);
  font-weight: 600;
}

.page-content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-header p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* ─── KPI Cards ─── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.card .label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card .value {
  font-size: 1.65rem;
  font-weight: 700;
  margin-top: 0.35rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.card .sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.card.success .value { color: var(--success); }
.card.warning .value { color: var(--warning); }
.card.danger .value { color: var(--danger); }
.card.accent .value { color: var(--accent); }

/* ─── Panels & Tables ─── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
  overflow: hidden;
}

.panel-header {
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
}

.panel-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.panel-body { padding: 1.15rem; }

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Form Controls ─── */
input[type="search"],
input[type="text"],
input[type="number"],
input[type="url"],
input[type="password"],
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  min-width: 140px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { min-width: 100%; resize: vertical; }

select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; appearance: none; }

.info-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* ─── Buttons ─── */
button, .btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.4;
}

button:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button.brand:hover:not(:disabled) {
  background: #b45309;
  border-color: #b45309;
}

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.view-toggle {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

.view-toggle button {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.4rem 0.65rem;
  color: var(--muted);
}

.view-toggle button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr { transition: background var(--transition); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-subtle); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.badge.ok { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.badge.warn { background: var(--warning-soft); color: var(--warning); border-color: #fde68a; }
.badge.err { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge.neutral { background: var(--bg-subtle); color: var(--muted); border-color: var(--border); }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }

/* ─── Product Grid ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.product-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.product-card-img {
  aspect-ratio: 1;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-img .no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 1.75rem;
  opacity: 0.4;
}

.product-card-body { padding: 0.75rem; }

.product-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Portal ─── */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.portal-form .field { margin-bottom: 0.85rem; }

.portal-form label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
  width: 100%;
  min-width: unset;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.image-preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.preview-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.attr-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
}

.attr-chip strong { color: var(--muted); font-weight: 500; }

.bulk-paste {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.78rem;
  min-height: 130px;
  background: var(--bg-subtle);
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 1rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: -1px;
  cursor: pointer;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Sync Cards ─── */
.sync-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.sync-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition);
}

.sync-card:hover { border-color: var(--border-strong); }

.sync-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sync-card p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

/* ─── Charts ─── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chart-panel .chart-wrap { height: 200px; padding: 0.65rem 1rem 0.85rem; }
.chart-wide { grid-column: 1 / -1; }
.chart-wide .chart-wrap { height: 240px; }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  max-width: 380px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  display: none;
}

.toast.show { display: block; animation: toastIn 0.2s ease; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.8rem;
}

.clickable { cursor: pointer; }

/* ─── Modal ─── */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(800px, 100%);
  max-height: 90vh;
  overflow: auto;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h3 { font-size: 1rem; font-weight: 600; }

.modal-close {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { padding: 1.25rem; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.detail-section {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }

.detail-table { width: 100%; font-size: 0.82rem; margin-top: 0.5rem; }
.detail-table th, .detail-table td { padding: 0.45rem 0.65rem; }

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.detail-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.detail-gallery img:hover { transform: scale(1.02); }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.nav-badge.hidden { display: none; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  z-index: 90;
}

/* ─── Login Page ─── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #1c1917 100%);
  color: #f8fafc;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 30% 50%, rgba(194, 65, 12, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(37, 99, 235, 0.15), transparent 50%);
}

.login-hero-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.login-hero .brand-icon {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.login-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.login-hero .tagline {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.login-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.login-features .feat-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.login-features strong {
  display: block;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.1rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.login-card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.login-card-header { margin-bottom: 1.75rem; }

.login-card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.login-card-header p { font-size: 0.85rem; color: var(--muted); }

.login-field { margin-bottom: 1.1rem; }

.login-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.login-input-wrap { position: relative; }

.login-input-wrap .input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.login-field input {
  width: 100%;
  min-width: unset;
  padding: 0.65rem 0.75rem 0.65rem 2.25rem;
}

.login-submit {
  width: 100%;
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.login-submit.loading { color: transparent; pointer-events: none; position: relative; }

.login-submit.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.login-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--danger);
}

.login-error:empty { display: none; }

.login-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .portal-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .topbar-menu { display: flex; }
  .topbar-page { display: none; }
  .page-content { padding: 1rem; }
  .global-search-wrap { max-width: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem 1.5rem; }
  .login-hero h1 { font-size: 1.65rem; }
  .login-features { display: none; }
}

/* ─── Cari Hesaplar ─── */
.cari-sub { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }

.cari-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 0.16rem 0.6rem; border-radius: 999px; font-size: 0.8rem;
}
.cari-pill em { font-style: normal; font-size: 0.66rem; font-weight: 600; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.03em; }
.cari-pill.pos { background: var(--success-soft); color: var(--success); }
.cari-pill.neg { background: var(--danger-soft); color: var(--danger); }
.cari-pill.zero { background: var(--bg-subtle); color: var(--muted); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.cari-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--surface) 70%);
  box-shadow: var(--shadow-xs); margin-bottom: 1.1rem;
}
.cari-balance { text-align: right; display: flex; flex-direction: column; }
.cari-balance-amt { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cari-balance-lbl { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.cari-balance.pos .cari-balance-amt, .cari-balance.pos .cari-balance-lbl { color: var(--success); }
.cari-balance.neg .cari-balance-amt, .cari-balance.neg .cari-balance-lbl { color: var(--danger); }
.cari-balance.zero .cari-balance-amt { color: var(--text); }

.cari-addtx { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; margin: 1.1rem 0; }
.cari-addtx-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.cari-addtx-row select { min-width: 130px; }
.cari-addtx-row input[type="number"] { max-width: 150px; }
.cari-addtx-row input[type="text"] { flex: 1; min-width: 160px; }

.cari-statement-sum { display: flex; flex-wrap: wrap; gap: 1.35rem; font-size: 0.8rem; color: var(--muted); margin: 0.35rem 0 0.85rem; }
.cari-statement-sum strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cari-statement tbody tr:nth-child(even) td { background: rgba(37, 99, 235, 0.02); }

.cari-form .field { margin-bottom: 0.85rem; }
.cari-form label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; }
.cari-form input, .cari-form select, .cari-form textarea { width: 100%; min-width: unset; }
.cari-form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 520px) { .cari-form-2 { grid-template-columns: 1fr; } }

/* ——— Canlı (SignalR) göstergesi ——— */
.rt-live { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--text-secondary); }
.rt-live-label { letter-spacing: 0.02em; }
.rt-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; box-shadow: 0 0 0 0 rgba(0,0,0,0); }
.rt-dot[data-state="connected"] { background: #22c55e; animation: rtPulse 2s infinite; }
.rt-dot[data-state="connecting"] { background: #f59e0b; }
.rt-dot[data-state="disconnected"] { background: #ef4444; }
@keyframes rtPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.rt-flash {
  font-size: 0.72rem; color: var(--accent, #c99a4b); font-weight: 600;
  opacity: 0; transform: translateY(-3px); transition: opacity .3s, transform .3s;
  max-width: 0; overflow: hidden; white-space: nowrap;
}
.rt-flash.show { opacity: 1; transform: translateY(0); max-width: 220px; }
@media (max-width: 640px) { .rt-live-label, .rt-flash { display: none; } }

/* ═══════════════════════════════════════════════════════════
   v2 tasarım cilası — marka derinliği, koyu mod uyumu
   ═══════════════════════════════════════════════════════════ */

/* KPI kartları: sol renk şeridi + üstte ince gradient parıltı */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border-strong); opacity: 0; transition: opacity var(--transition);
}
.card:hover::before { opacity: 1; }
.card.accent::before { background: var(--accent); opacity: 1; }
.card.success::before { background: var(--success); opacity: 1; }
.card.warning::before { background: var(--warning); opacity: 1; }
.card.danger::before { background: var(--danger); opacity: 1; }
.card.brand::before { background: var(--brand); opacity: 1; }
.card .value { color: var(--text); }
.card.brand .value { color: var(--brand); }

/* KPI trend etiketi (opsiyonel — .card .trend.up/.down) */
.card .trend { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; font-weight: 600; margin-top: 0.25rem; }
.card .trend.up { color: var(--success); }
.card .trend.down { color: var(--danger); }

/* Tablolar: yapışkan başlık + satır hover + zebra */
.table-wrap table { border-collapse: separate; border-spacing: 0; width: 100%; }
.table-wrap thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-subtle); color: var(--text-secondary);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-wrap tbody td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.table-wrap tbody tr { transition: background var(--transition); }
.table-wrap tbody tr:hover { background: var(--surface-hover); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

/* Durum pill'leri (badge zaten var — yumuşak dolgu + nokta) */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; }
.badge.ok::before, .badge.warn::before, .badge.err::before, .badge.info::before, .badge.neutral::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}

/* Panel başlıkları: hafif üst gradient */
.panel-header { background: linear-gradient(180deg, var(--surface-hover), var(--surface)); }

/* Butonlar: birincil marka olive, ince yükselme */
button.primary, .btn.primary, .btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
button.primary:hover, .btn.primary:hover, .btn-primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
}
button.brand, .btn.brand { background: var(--brand); color: #fff; border-color: var(--brand); }
button.brand:hover, .btn.brand:hover { filter: brightness(0.95); }

/* Sidebar aktif öğe: sol gold vurgu */
.nav a { position: relative; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav a.active { background: var(--accent-soft); color: var(--text); }

/* Skeleton yükleme */
.skeleton {
  position: relative; overflow: hidden; background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }
.skeleton.line { height: 0.8rem; margin: 0.35rem 0; }
.skeleton.line.sm { width: 40%; } .skeleton.line.md { width: 65%; } .skeleton.line.lg { width: 90%; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Boş durum */
.empty-state {
  text-align: center; padding: 2.5rem 1.5rem; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-hover);
}
.empty-state .empty-icon { font-size: 1.6rem; opacity: 0.5; }
.empty-state p { margin-top: 0.5rem; font-size: 0.85rem; }

/* Tema geçiş butonu */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

/* Smooth tema geçişi */
body, .sidebar, .topbar, .card, .panel, .surface, button, input, select, textarea {
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

/* Kaydırma çubuğu (koyu modda da hoş) */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
