/* Verinova Signature — layout (Vercel / Stripe / Apple-inspired) */

:root {
  --sidebar-width: 256px;
  /* Sidebar üst blok (logo + marka) ile header aynı yükseklikte; alt çizgiler hizalı */
  --header-height: 77px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --text: #0d0d2b;
  --text-secondary: #4a4a66;
  --muted: #6b7280;
  --border: #e2e6ef;
  --border-subtle: #eef1f7;

  --primary: #0d0d2b;
  --primary-hover: #1b1b44;
  --accent: #0175ff;
  --accent-strong: #1100ff;
  --accent-soft: #00b1d9;
  --accent-muted: rgba(1, 117, 255, 0.12);
  --accent-gradient: linear-gradient(135deg, #00b1d9 0%, #0175ff 55%, #1100ff 100%);

  --sidebar-bg: #f7f9fc;
  --sidebar-text: #0d0d2b;
  --sidebar-muted: #6b7280;
  --sidebar-hover: rgba(13, 13, 43, 0.05);
  --sidebar-active-bg: rgba(1, 117, 255, 0.08);
  --sidebar-border: #e2e6ef;
  --sidebar-accent: var(--accent);

  --header-bg: rgba(247, 249, 252, 0.78);
  --header-blur: 16px;
}

[data-theme="dark"] {
  --bg: #07071a;
  --bg-elevated: #0f0f24;
  --text: #f3f5fb;
  --text-secondary: #b6bcd0;
  --muted: #8a90a6;
  --border: #1f2040;
  --border-subtle: #14152e;

  --primary: #f3f5fb;
  --primary-hover: #dadefb;
  --accent: #4d9bff;
  --accent-strong: #5566ff;
  --accent-soft: #4ed1f5;
  --accent-muted: rgba(77, 155, 255, 0.18);
  --accent-gradient: linear-gradient(135deg, #4ed1f5 0%, #4d9bff 55%, #5566ff 100%);

  --sidebar-bg: #07071a;
  --sidebar-text: #f3f5fb;
  --sidebar-muted: #b6bcd0;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(77, 155, 255, 0.12);
  --sidebar-border: #1f2040;

  --header-bg: rgba(7, 7, 26, 0.78);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.layout-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.sidebar-brand {
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.sidebar-brand-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sidebar-brand-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  border: none;
  border-radius: 0;
  background: transparent;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--sidebar-muted);
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0 20px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 22px;
}

.sidebar-section-title {
  padding: 6px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
}

.sidebar-menu {
  list-style: none;
  padding: 0 8px;
}

.sidebar-menu-item {
  margin: 1px 0;
  position: relative;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}

.sidebar-menu-link:hover {
  background: var(--sidebar-hover);
}

.sidebar-menu-link.active {
  background: var(--sidebar-active-bg);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 3px 0 0 var(--sidebar-accent);
}

.sidebar-menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-muted);
  transition: color 0.15s ease;
}

.sidebar-menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-menu-link:hover .sidebar-menu-icon,
.sidebar-menu-link.active .sidebar-menu-icon {
  color: var(--text);
}

.sidebar-menu-link.active .sidebar-menu-icon {
  color: var(--sidebar-accent);
}

/* Menü satırı: başlık solda, rozet(ler) sağda (Apple tarzı yumuşak pill) */
.sidebar-menu-text-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-menu-label {
  font-size: 13px;
  font-weight: inherit;
  line-height: 1.25;
  min-width: 0;
}

.sidebar-menu-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.sidebar-pill {
  min-width: 1.35rem;
  height: 21px;
  padding: 0 7px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  border: 1px solid rgba(13, 13, 43, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(232, 240, 255, 0.92) 100%);
  color: var(--accent-strong);
  box-shadow:
    0 1px 1px rgba(13, 13, 43, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .sidebar-pill {
  background: rgba(77, 155, 255, 0.14);
  color: #cbd9ff;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--sidebar-muted);
  letter-spacing: 0.02em;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

/* Header — yükseklik sidebar .sidebar-brand ile aynı (--header-height) */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur));
  -webkit-backdrop-filter: blur(var(--header-blur));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.menu-toggle:hover {
  background: var(--sidebar-hover);
}

.menu-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-toggle-icon {
  display: block;
}

.header-title-wrap {
  min-width: 0;
}

.header-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.header-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme toggle — pill control */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
}

.theme-toggle-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.theme-toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--border-subtle);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .theme-toggle-track {
  background: var(--bg-elevated);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.theme-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

.theme-icon-sun {
  opacity: 1;
}

.theme-icon-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12);
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 14px;
  }

  .main-content {
    padding: 16px;
  }

  .header-title {
    font-size: 14px;
  }

  .theme-toggle-label {
    display: none;
  }
}

/* Legacy switch (sayfalarda kalmış olabilir) */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.switch input[type="checkbox"] {
  cursor: pointer;
}

button:not(.menu-toggle):not(.theme-toggle),
.btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(1, 117, 255, 0.18);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  filter: brightness(1.02);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--sidebar-hover);
}

.btn-danger {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

@media (max-width: 1100px) {
  .container {
    grid-template-columns: 1fr;
  }
}
