/* ═══════════════════════════════════════════════════════════════════
   SOLVEON PULSE · THEME
   "Fabrika hissi — SaaS parıltısı değil."
   Extracted from claude-design-rework/dashboard-overview.html
   Two synced sets: :root (light) and .dark (dark)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ─── Neutrals (warm-cool slate, 0.01 chroma) ─── */
  --ink-0:   #ffffff;
  --ink-50:  #f6f7f8;
  --ink-100: #eceef2;
  --ink-150: #dee2e8;
  --ink-200: #c8cdd6;
  --ink-300: #a7aeba;
  --ink-400: #7b8493;
  --ink-500: #596273;
  --ink-600: #3f4858;
  --ink-700: #2a3140;
  --ink-800: #1a1f2b;
  --ink-900: #0f141d;

  --surface:        #ffffff;
  --surface-2:      #fafbfc;
  --surface-sunk:   #f1f3f6;
  --bg:             #f3f5f8;
  --hairline:       #e3e6ec;
  --hairline-strong:#cfd4dc;

  --text:           var(--ink-900);
  --text-muted:     var(--ink-500);
  --text-faint:     var(--ink-400);
  --text-invert:    var(--ink-0);

  /* ─── Accents (factory palette) ─── */
  --emerald-50:  #e7f6ee;
  --emerald-100: #c8ebd6;
  --emerald-500: #15a45a;
  --emerald-600: #0c8a48;
  --emerald-700: #0a6b39;

  --sky-50:   #e4f0fb;
  --sky-100:  #c4dcf3;
  --sky-500:  #1d7bd9;
  --sky-600:  #1566b5;
  --sky-700:  #0f4e8a;

  --amber-50:  #fdf0dc;
  --amber-100: #fadfb2;
  --amber-500: #d98205;
  --amber-600: #b16904;
  --amber-700: #8a5203;

  --violet-50:  #ede8fa;
  --violet-100: #d6cdf4;
  --violet-500: #6b46c1;
  --violet-600: #563596;
  --violet-700: #40286f;

  --red-50:   #fbe5e5;
  --red-100:  #f4c3c3;
  --red-500:  #c42b2b;
  --red-600:  #9f2020;
  --red-700:  #7d1717;

  /* TOU palette — saturated, readable */
  --tou-puant:  #c42b2b;
  --tou-gunduz: #e0a93a;
  --tou-gece:   #2fa36a;

  /* ─── Spacing scale ─── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10:40px;
  --s-12:48px; --s-16:64px;

  /* ─── Radii ─── */
  --r-sm:  4px;
  --r-md:  6px;
  --r-lg:  10px;
  --r-xl:  14px;
  --r-pill:999px;

  /* ─── Shadows — single elevation, factory-flat ─── */
  --shadow-1: 0 1px 0 rgba(15,20,29,.04), 0 1px 2px rgba(15,20,29,.05);
  --shadow-2: 0 1px 0 rgba(15,20,29,.05), 0 6px 16px -6px rgba(15,20,29,.10);
  --shadow-inset: inset 0 0 0 1px var(--hairline);

  /* ─── Type scale ─── */
  --fz-xs:   11px;
  --fz-sm:   12px;
  --fz-base: 14px;
  --fz-md:   15px;
  --fz-lg:   17px;
  --fz-xl:   20px;
  --fz-2xl:  26px;
  --fz-hero: 38px;
  --fz-mega: 48px;

  /* ─── Motion ─── */
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --t-fast:   120ms;
  --t-med:    200ms;
}

.dark {
  --ink-0:   #0a0e16;
  --ink-50:  #0f141d;
  --ink-100: #141a25;
  --ink-150: #1a2130;
  --ink-200: #232c3d;
  --ink-300: #344156;
  --ink-400: #556278;
  --ink-500: #7a8699;
  --ink-600: #9aa4b5;
  --ink-700: #b9c1ce;
  --ink-800: #d6dbe3;
  --ink-900: #ecf0f5;

  --surface:        #131927;
  --surface-2:      #0f141f;
  --surface-sunk:   #0a0f18;
  --bg:             #080c14;
  --hairline:       #212938;
  --hairline-strong:#2d3646;

  --text:           var(--ink-900);
  --text-muted:     var(--ink-500);
  --text-faint:     var(--ink-400);

  --emerald-50:  #0f2a1c;
  --emerald-100: #133a27;
  --emerald-500: #27c06d;
  --emerald-600: #1aa15a;
  --emerald-700: #158049;

  --sky-50:   #0e2235;
  --sky-100:  #13304b;
  --sky-500:  #3ba3ff;
  --sky-600:  #2a89de;
  --sky-700:  #1f6bb0;

  --amber-50:  #2b1c06;
  --amber-100: #3d2808;
  --amber-500: #f2a530;
  --amber-600: #c88621;
  --amber-700: #9b6918;

  --violet-50:  #1d1538;
  --violet-100: #27204d;
  --violet-500: #9c84e8;
  --violet-600: #7a63c9;
  --violet-700: #5e48a6;

  --red-50:   #30110f;
  --red-100:  #451715;
  --red-500:  #ef4545;
  --red-600:  #c42b2b;
  --red-700:  #9f2020;

  --tou-puant:  #ef4545;
  --tou-gunduz: #f2a530;
  --tou-gece:   #27c06d;

  --shadow-1: 0 1px 0 rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.25);
  --shadow-2: 0 1px 0 rgba(0,0,0,.35), 0 8px 20px -8px rgba(0,0,0,.5);
}

/* ═══════════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════════ */
html, body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
.mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.caps { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--fz-xs); font-weight: 600; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════
   COMPONENT LAYER
   ═══════════════════════════════════════════════════════════════════ */

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-sunk {
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fz-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-muted);
  line-height: 1;
}
.badge-solid-emerald { background: var(--emerald-50); border-color: transparent; color: var(--emerald-700); }
.badge-solid-sky     { background: var(--sky-50); border-color: transparent; color: var(--sky-700); }
.badge-solid-amber   { background: var(--amber-50); border-color: transparent; color: var(--amber-700); }
.badge-solid-violet  { background: var(--violet-50); border-color: transparent; color: var(--violet-700); }
.badge-solid-red     { background: var(--red-50); border-color: transparent; color: var(--red-700); }
.dark .badge-solid-emerald { color: #7de0ad; }
.dark .badge-solid-sky     { color: #8cc6ff; }
.dark .badge-solid-amber   { color: #f4c06b; }
.dark .badge-solid-violet  { color: #bfadef; }
.dark .badge-solid-red     { color: #ff8585; }

/* Hero card (₺ kartları) */
.hero {
  position: relative;
  padding: 20px 22px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.hero .hero-accent {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: currentColor;
}
.hero-emerald { color: var(--emerald-500); }
.hero-sky     { color: var(--sky-500); }
.hero-amber   { color: var(--amber-500); }
.hero-violet  { color: var(--violet-500); }

.hero .hero-label { color: var(--text-muted); font-size: var(--fz-sm); font-weight: 500; }
.hero .hero-num {
  font-size: var(--fz-hero);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero .hero-sub { color: var(--text-faint); font-size: var(--fz-xs); }

/* Nav items */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: var(--fz-base);
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
  cursor: pointer;
}
.nav-item:hover {
  background: var(--surface-sunk);
  color: var(--text);
}
.nav-item.active {
  background: var(--surface-sunk);
  color: var(--text);
  border-color: var(--hairline);
  box-shadow: inset 2px 0 0 var(--emerald-500);
}
.dark .nav-item.active { box-shadow: inset 2px 0 0 var(--emerald-500); }

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

/* Offline ribbon */
.offline-ribbon {
  background: linear-gradient(90deg, var(--ink-900), var(--ink-700));
  color: #e2e8f0;
  font-size: var(--fz-sm);
  padding: 6px 20px;
}
.dark .offline-ribbon {
  background: linear-gradient(90deg, #000, var(--ink-200));
}

/* Pulse dot */
.pulse-dot {
  position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald-500);
}
.pulse-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--emerald-500); opacity: 0.6;
  animation: pulseRing 2s var(--ease-out) infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: var(--fz-base);
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  min-height: 36px;
}
.btn:hover { background: var(--surface-sunk); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--emerald-600);
  color: #fff;
  border-color: var(--emerald-700);
}
.btn-primary:hover { background: var(--emerald-700); }
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover { background: var(--surface-sunk); }
.btn-icon {
  width: 36px; padding: 0; justify-content: center;
}

/* Sparkline bar */
.sparkbar {
  display: flex; align-items: flex-end; gap: 3px; height: 36px;
}
.sparkbar > div {
  flex: 1; border-radius: 2px; background: currentColor; opacity: .35;
  transition: height var(--t-med) var(--ease-out);
  min-height: 3px;
}
.sparkbar > div:last-child { opacity: 1; }

/* Alarm row */
.alarm-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-top: 1px solid var(--hairline);
}
.alarm-row:first-child { border-top: none; }
.alarm-icon {
  width: 28px; height: 28px; border-radius: var(--r-md);
  display: grid; place-items: center; flex-shrink: 0;
}

/* Opportunity card */
.opp {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.opp:hover { border-color: var(--violet-500); background: var(--violet-50); }
.dark .opp:hover { background: var(--violet-50); }

/* Chart wrapper */
.chart-wrap { position: relative; height: 260px; }
.chart-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: var(--fz-sm); color: var(--text-muted);
}
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Section header */
.section-h {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.section-h h3 {
  font-size: var(--fz-lg); font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}
.section-h .sub { font-size: var(--fz-sm); color: var(--text-muted); }

/* Logo mark */
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--ink-900); color: var(--ink-0);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.logo-mark svg { width: 16px; height: 16px; }
.dark .logo-mark { background: var(--emerald-500); color: var(--ink-0); }

/* Avatar */
.avatar {
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald-600), var(--sky-600));
  color: #fff; font-weight: 700; font-size: 13px;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-1);
}

/* Mobile bottom nav */
.mob-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  display: none;
  padding: 8px 6px calc(env(safe-area-inset-bottom,0px) + 8px);
  box-shadow: 0 -6px 20px -12px rgba(0,0,0,.15);
}
.mob-nav .m-item {
  flex: 1; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-muted); font-size: 10px; font-weight: 600;
  border-radius: var(--r-md);
}
.mob-nav .m-item.active { color: var(--emerald-600); background: var(--emerald-50); }
.dark .mob-nav .m-item.active { color: var(--emerald-500); background: var(--emerald-100); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .sidebar-desktop { display: none; }
  .mob-nav { display: flex; }
  main.main-pad { padding-bottom: 88px !important; }
}
@media (max-width: 640px) {
  :root { --fz-hero: 32px; }
}

/* Focus */
*:focus-visible {
  outline: 2px solid var(--emerald-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Divider */
.hr { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* Fade-in */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .35s var(--ease-out) both; }

/* ═══════════════════════════════════════════════════════════════════
   FORM CONTROLS
   ═══════════════════════════════════════════════════════════════════ */
.form-label {
  display: block;
  font-size: var(--fz-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.4;
}
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--text);
  font: inherit;
  font-size: var(--fz-sm);
  padding: 9px 11px;
  transition: border-color var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}
.input:hover { border-color: var(--hairline-strong); }
.input:focus {
  border-color: var(--emerald-500);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(21, 164, 90, 0.15);
}
.input[readonly] {
  background: var(--surface-sunk);
  color: var(--text-muted);
  cursor: default;
}
.input[readonly]:focus { box-shadow: none; border-color: var(--hairline); }
textarea.input { min-height: 80px; resize: vertical; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8493' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Checkbox / Radio chip */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--fz-sm);
  user-select: none;
}
.check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--emerald-500);
  cursor: pointer;
}
.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fz-sm);
  background: var(--surface);
  transition: border-color var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
}
.radio-chip input[type="radio"] {
  width: 14px; height: 14px;
  accent-color: var(--emerald-500);
  cursor: pointer;
}
.radio-chip:has(input:checked) {
  border-color: var(--emerald-500);
  background: var(--emerald-50);
  color: var(--emerald-700);
}
.dark .radio-chip:has(input:checked) {
  background: rgba(21, 164, 90, 0.12);
  color: #7de0ad;
}

/* ═══════════════════════════════════════════════════════════════════
   SETTINGS TABS
   ═══════════════════════════════════════════════════════════════════ */
.set-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: var(--fz-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.set-tab:hover { background: var(--surface-sunk); color: var(--text); }
.set-tab.active {
  background: var(--emerald-50);
  color: var(--emerald-700);
  font-weight: 600;
}
.dark .set-tab.active {
  background: rgba(21, 164, 90, 0.15);
  color: #7de0ad;
}
.set-panel { animation: fadeUp .25s var(--ease-out) both; }

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 20, 29, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 20px;
  animation: fadeIn .2s var(--ease-out);
}
/* Tailwind .hidden (display:none) modal-overlay'in display:flex'ini ezemiyor —
   daha spesifik seçici ile override. Ayrıca hidden varken animasyon yapmasın. */
.modal-overlay.hidden { display: none !important; animation: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeUp .25s var(--ease-out);
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   ALERT ROW (Alerts page)
   ═══════════════════════════════════════════════════════════════════ */
.alert-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink-300);
  transition: background var(--motion-fast) var(--ease-out);
}
.alert-card.sev-warning { border-left-color: var(--amber-500); }
.alert-card.sev-critical { border-left-color: var(--red-500); }
.alert-card:hover { background: var(--surface-2); }
.alert-card .title { font-weight: 700; font-size: var(--fz-md); }
.alert-card .meta { font-size: var(--fz-xs); color: var(--text-muted); }
