/* —— Kurumsal tasarım sistemi —— */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #eef1f6;
  --bg-subtle: #e4e9f0;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-muted: #f1f5f9;

  --sidebar-bg: #0c1222;
  --sidebar-bg-hover: #151d32;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-accent: #3b82f6;
  --sidebar-width: 260px;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;

  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --success: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #d97706;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --transition: 0.15s ease;
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.hidden { display: none !important; }

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

code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85em;
  background: var(--surface-muted);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* —— Marka —— */
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-mark.sm {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.brand { text-align: center; margin-bottom: 1.75rem; }
.brand h1 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1rem 0 0.35rem;
  color: var(--text);
}
.brand p { color: var(--muted); font-size: 0.875rem; }

/* —— Giriş ekranı —— */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    linear-gradient(160deg, #0c1222 0%, #1e293b 45%, #eef1f6 45%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
}
.auth-form .field { margin-bottom: 1rem; }
.auth-form .field:last-of-type { margin-bottom: 1.25rem; }

/* —— Uygulama kabuğu (yan menü) —— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.35rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-brand-text strong {
  color: var(--sidebar-text-active);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-domain {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
}
.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--sidebar-accent);
}
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .nav-icon { opacity: 1; color: var(--sidebar-accent); }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}
.nav-item-logout:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
}

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}
.page-subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.main-content {
  flex: 1;
  padding: 1.5rem 2rem 2.5rem;
  max-width: 1400px;
  width: 100%;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.tab-panel.hidden { display: none !important; }

/* —— Paneller —— */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.panel-accent {
  border-color: var(--primary-border);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 120px);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.panel-head h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.panel-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: -0.5rem 0 1.25rem;
  line-height: 1.5;
}

h2 { font-size: 1rem; font-weight: 600; }

/* —— Metrik kartları —— */
.traffic-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .traffic-metrics { grid-template-columns: 1fr; }
}

.metric-card {
  padding: 1.1rem 1.25rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.traffic-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.range-sep { color: var(--muted); font-size: 0.875rem; }
.traffic-chart-wrap,
.stats-chart-box {
  position: relative;
  width: 100%;
  min-height: 240px;
  padding-top: 0.5rem;
}
.stats-pie-panel.chart-wrap {
  position: relative;
}

.dashboard-feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 1024px) {
  .dashboard-feed-grid { grid-template-columns: 1fr; }
}

/* —— Formlar —— */
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:hover, select:hover {
  border-color: var(--muted);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.input-sm {
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  width: auto;
  min-width: 130px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.field.full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  font-weight: 500;
}
.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
}

/* —— Butonlar —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: var(--muted);
  color: var(--text);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}
.btn-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* Geriye uyumluluk (link.html, super) */
.btn.primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
}
.btn.danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}
.btn.danger:hover { background: var(--danger-light); }
.btn.sm { padding: 0.45rem 0.85rem; font-size: 0.8125rem; }

/* —— Tablolar —— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.25rem;
}
.data-table, table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th, table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td, table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}
.data-table tbody tr:last-child td,
table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover,
table tbody tr:hover { background: var(--surface-hover); }

.col-actions { width: 1%; white-space: nowrap; }

.target-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}

.status-on {
  color: var(--success);
  font-weight: 600;
  font-size: 0.8125rem;
}
.status-off {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.8125rem;
}

.link-row { cursor: pointer; }
.slug-link, .clicks-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.slug-link:hover, .clicks-link:hover { text-decoration: underline; }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 0.35rem; margin-bottom: 0.2rem; }

.short-url-list { display: flex; flex-direction: column; gap: 0.35rem; }
.short-url-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.link-created-at {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}
.clicks-cell {
  white-space: nowrap;
  line-height: 1.35;
}
.clicks-cell .clicks-link {
  display: block;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.clicks-cell .clicks-link strong { color: var(--text); font-weight: 700; }
.clicks-cell .clicks-unique { color: var(--primary); font-weight: 600; }
.clicks-cell .clicks-sep { color: var(--muted); font-weight: 400; margin: 0 0.1rem; }
.clicks-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}
.copy-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.35rem;
  padding: 0.2rem;
}
.copy-btn:hover { color: var(--primary); }

/* —— Oluşturma sonucu —— */
.create-result {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--success-light);
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
}
.create-result strong { color: var(--success); font-size: 0.875rem; }
.create-result-url {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.create-result a {
  color: var(--primary);
  font-weight: 500;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.create-copy-btn, .feed-copy {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.create-copy-btn:hover, .feed-copy:hover {
  background: var(--primary-light);
}

/* —— Feed kartları —— */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 480px;
  overflow-y: auto;
}
.feed-card {
  padding: 1rem 1.1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feed-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-xs);
}
.feed-target {
  display: block;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-all;
  text-decoration: none;
  margin-bottom: 0.35rem;
}
.feed-target:hover { text-decoration: underline; }
.feed-short-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.feed-short {
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: none;
  word-break: break-all;
}
.feed-short:hover { color: var(--primary); }
.feed-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.feed-time { white-space: nowrap; font-size: 0.75rem; }

.activity-top {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.activity-globe { font-size: 1rem; flex-shrink: 0; }
.activity-urls { flex: 1; min-width: 0; }
.activity-top .feed-time { margin-left: auto; }
.activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.activity-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* —— İstatistik / analitik sayfası —— */
.page-analytics .main-wrapper { margin-left: 0; }
.page-analytics .main-wrapper { margin-left: 0; }
.page-analytics .page-header-inner,
.page-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0 2rem;
}
.page-analytics .page-header { padding-left: 0; padding-right: 0; }
.page-analytics .main-content { max-width: 1400px; }

.link-hero { padding: 1.35rem 1.5rem; }
.link-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .link-hero-grid { grid-template-columns: 1fr; }
}
.link-hero-code code {
  font-size: 1.125rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.link-hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.5rem 0 0.35rem;
  letter-spacing: -0.02em;
}
.link-hero-meta { font-size: 0.875rem; color: var(--muted); margin: 0; }
.link-hero-url-block { margin-bottom: 0.75rem; }
.link-hero-url-block:last-child { margin-bottom: 0; }
.link-hero-url-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.link-hero-url {
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-all;
  text-decoration: none;
}
.link-hero-url.target { color: var(--text-secondary); font-weight: 400; }
.link-hero-url:hover { text-decoration: underline; }

.link-traffic-panel .traffic-metrics { margin-bottom: 1.25rem; }
.link-summary-metrics { border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; }
.filter-form-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.range-info-inline { color: var(--muted); }
.link-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.5rem 0 0.75rem;
}
.link-section-foot { margin-top: 1rem; margin-bottom: 0; }
.link-details-grid { margin-top: 0; }

.daily-date-full {
  display: block;
  font-weight: 500;
  color: var(--text);
}
.daily-date-short {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.data-table tr.row-zero td {
  color: var(--muted);
  background: var(--surface-hover);
}
.data-table tr.row-zero strong { font-weight: 500; color: var(--muted); }
.daily-total-row td {
  background: var(--surface-muted);
  border-top: 2px solid var(--border);
  font-size: 0.9rem;
}
.data-table tfoot td { padding: 0.85rem 1rem; }

.access-loc { white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }
.activity-loc { font-weight: 500; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin-right: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.back-link:hover {
  color: var(--primary);
  border-color: var(--primary-border);
  background: var(--primary-light);
  text-decoration: none;
}

.link-header .link-meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.35rem; }

.filter-hint, .section-sub, .range-info {
  font-size: 0.875rem;
  color: var(--muted);
}
.filter-hint { margin-bottom: 1rem; }
.range-info { margin-top: 0.75rem; }
.muted-sm { font-size: 0.8125rem; color: var(--muted); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.filter-bar .field { flex: 1; min-width: 140px; }
.filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.35rem;
  letter-spacing: -0.02em;
}

.bar-track {
  height: 6px;
  background: var(--surface-muted);
  border-radius: 3px;
  min-width: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #3b82f6 100%);
  border-radius: 2px;
  transition: width 0.25s ease;
}

/* —— Grafik (analitik) —— */
.timeline-panel .panel-head { margin-bottom: 1rem; }
.timeline-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.legend-item { display: flex; align-items: center; gap: 0.45rem; }
.legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}
.legend-line.today { background: var(--primary); }
.legend-line.yesterday { background: var(--border-strong); }

.chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0f172a;
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.45;
  z-index: 30;
  display: none;
  max-width: 220px;
  box-shadow: var(--shadow-md);
}
.chart-tooltip.visible { display: block; }
.chart-tooltip strong { font-weight: 600; }

/* —— Modal —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.modal-dialog, .modal-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-dialog .field { margin-bottom: 1rem; }

/* —— Toplu güncelleme —— */
.bulk-preview {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  max-height: 300px;
  overflow-y: auto;
}
.bulk-preview .preview-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.bulk-preview .preview-row:last-child { border-bottom: none; }
.bulk-preview code { word-break: break-all; }

/* —— Süper panel / eski sınıflar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.brand-inline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-panel {
  max-width: 420px;
  margin: 10vh auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.panel-header h2 { margin: 0; }

.muted { color: var(--muted); text-align: center; padding: 1.5rem; }
.error { color: var(--danger); font-size: 0.8125rem; margin-top: 0.5rem; }

/* —— Mobil: yan menü üstte —— */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar-brand {
    flex: 1;
    min-width: 200px;
    border-bottom: none;
    border-right: 1px solid var(--sidebar-border);
  }
  .sidebar-nav {
    flex: 1;
    flex-direction: row;
    padding: 0.5rem;
    overflow-x: auto;
  }
  .nav-item {
    flex-shrink: 0;
    padding: 0.55rem 0.75rem;
  }
  .nav-item span { display: none; }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--sidebar-accent); }
  .sidebar-footer {
    width: 100%;
    border-top: 1px solid var(--sidebar-border);
  }
  .app-shell { flex-direction: column; }
  .main-wrapper {
    margin-left: 0;
  }
  .main-content { padding: 1rem; }
  .page-header { padding: 1rem; }
}

@media (max-width: 600px) {
  .page-header h1 { font-size: 1.125rem; }
}

/* —— İstatistik sekmesi —— */
.stats-section .panel-head { margin-bottom: 0; }
.stats-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.stats-total-badge {
  font-size: 0.875rem;
  color: var(--muted);
}
.stats-total-badge strong {
  color: var(--text);
  font-size: 1.125rem;
}
.stats-chart-box {
  min-height: 260px;
  width: 100%;
}
.stats-block { margin-top: 0.5rem; }
.stats-block-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}
.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .stats-split { grid-template-columns: 1fr; }
}
.stats-map-panel { padding: 0.75rem; overflow: hidden; }
.stats-map {
  width: 100%;
  height: 360px;
  min-height: 280px;
}
.stats-pie-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  min-height: 280px;
}
.stats-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.geo-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.geo-tab {
  padding: 0.4rem 0.85rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
}
.geo-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
}
.rank-flag { font-size: 1.15rem; line-height: 1; text-align: center; }
.rank-flag-empty { visibility: hidden; }
.rank-body { min-width: 0; }
.rank-name {
  display: block;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.35rem;
}
.rank-bar-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 4px;
  overflow: hidden;
}
.rank-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: 4px;
  min-width: 2px;
}
.rank-value {
  text-align: right;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rank-value em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8125rem;
}
.pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.pie-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
