/* Chemoris uygulama kabuğu (shell.js) — /app, /sds, /profile.
   Sol ray 248px (design-system/chemoris/pages/dashboard.md); <900px çekmece + hamburger.
   Buradaki ortak bileşenler "sh-" önekli: /app'teki style.css sınıflarıyla çakışmaz.
   Renkler yalnız tokens.css jetonlarından. */
:root { --dash-w: 248px; }

/* ---------- Kabuk: ray ---------- */
body.has-dash { padding-left: var(--dash-w); }
body.has-dash .wizard-nav { left: var(--dash-w); }

.sh-rail {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--dash-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  font-family: var(--font);
}
.sh-brand {
  height: 64px; flex: none; display: flex; align-items: center; padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.sh-brand a { display: inline-flex; align-items: center; min-height: var(--tap); border-radius: var(--radius-sm); }
.sh-brand a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sh-brand img { display: block; height: 30px; width: auto; }

.sh-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sh-nav-label {
  margin: 8px 12px 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.sh-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sh-link {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.sh-link:hover { background: var(--surface-2); color: var(--text); }
.sh-link:focus-visible { outline: none; box-shadow: var(--focus-ring); color: var(--text); }
.sh-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sh-link .sh-ic { width: 20px; height: 20px; }

.sh-user {
  flex: none; display: flex; align-items: center; gap: 10px; margin: 12px;
  padding: 10px 8px 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg);
}
.sh-avatar {
  flex: none; width: 36px; height: 36px; border-radius: var(--radius-pill);
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase;
}
.sh-avatar--lg { width: 56px; height: 56px; font-size: var(--fs-lg); }
.sh-user-meta { min-width: 0; flex: 1; line-height: 1.3; }
.sh-user-name { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-user-mail { display: block; font-size: var(--fs-xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sh-icon-btn {
  flex: none; width: var(--tap); height: var(--tap); display: inline-grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
  cursor: pointer; transition: background-color .15s, color .15s;
}
.sh-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sh-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sh-icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.sh-icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.sh-icon-btn .sh-ic { width: 20px; height: 20px; }

.sh-ic { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Koyu ray (K-35, K-37): düz lacivert tek renk — yönetim paneli dili (ikas/Shopify gibi);
   bulanık gradyan ışık "yapay zekâ ürünü" görünümü verdiği için kaldırıldı ---------- */
.sh-rail { background: var(--navy); color: var(--on-navy); border-right: 0; }
.sh-rail .sh-brand { border-bottom-color: rgba(255, 255, 255, .08); }
.sh-rail .sh-nav-label { color: rgba(205, 213, 223, .6); }
.sh-rail .sh-link { color: var(--on-navy); }
.sh-rail .sh-link:hover { background: rgba(255, 255, 255, .08); color: var(--on-navy-strong); }
.sh-rail .sh-link[aria-current="page"] {
  background: rgba(255, 255, 255, .12); color: var(--on-navy-strong);
  box-shadow: inset 3px 0 0 #00acff;
}
.sh-rail .sh-user { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .10); }
.sh-rail .sh-avatar { background: var(--primary); color: var(--on-navy-strong); }
.sh-rail .sh-user-name { color: var(--on-navy-strong); }
.sh-rail .sh-user-mail { color: rgba(205, 213, 223, .7); }
.sh-rail .sh-icon-btn { color: rgba(205, 213, 223, .75); }
.sh-rail .sh-icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--on-navy-strong); }
.sh-rail .sh-icon-btn--danger:hover { background: rgba(240, 68, 56, .18); color: #ffb4ab; }
.sh-rail a:focus-visible, .sh-rail button:focus-visible, .sh-rail .sh-link:focus-visible {
  outline: 2px solid var(--on-navy-strong); outline-offset: 2px; box-shadow: none;
}

/* ---------- Kabuk: mobil üst çubuk + çekmece ---------- */
.sh-topbar { display: none; }
.sh-burger { display: none; }
.sh-scrim { display: none; }

@media (max-width: 899.98px) {
  body.has-dash { padding-left: 0; }
  body.has-dash .wizard-nav { left: 0; }

  .sh-topbar {
    position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px;
    height: var(--bar-h); padding: 0 8px; background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .sh-topbar img { display: block; height: 26px; width: auto; }
  .sh-topbar a { display: inline-flex; align-items: center; min-height: var(--tap); border-radius: var(--radius-sm); }
  .sh-topbar a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .sh-burger { display: inline-grid; color: var(--text); }

  .sh-rail {
    width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  body.sh-open .sh-rail { transform: none; visibility: visible; transition: transform .22s ease; }
  .sh-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(18, 25, 38, .45);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.sh-open .sh-scrim { opacity: 1; pointer-events: auto; }
  body.sh-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-rail, .sh-scrim, .sh-link, .sh-btn, .sh-input { transition: none !important; }
}

/* ---------- Kabuklu sayfalar (/sds, /profile) — style.css'e bağımlı değil ---------- */
body.sh-page {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: var(--fs-base); line-height: var(--lh); -webkit-font-smoothing: antialiased;
}
body.sh-page *, body.sh-page *::before, body.sh-page *::after { box-sizing: border-box; }
.sh-page .hidden { display: none !important; }
.sh-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sh-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sh-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 14px;
  background: var(--surface); color: var(--primary); border-radius: var(--radius-sm); }
.sh-skip:focus { left: 8px; outline: none; box-shadow: var(--focus-ring); }

.page-shell { max-width: var(--maxw); margin: 0 auto; padding: 32px 32px 64px; }
@media (max-width: 899.98px) { .page-shell { padding: 20px 16px 48px; } }

.sh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px; }
.sh-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: var(--lh-tight);
  letter-spacing: -0.02em; color: var(--text); }
.sh-head p { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); max-width: 60ch; }

.sh-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); }

/* Butonlar */
.sh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1; text-decoration: none;
  white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.sh-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sh-btn:disabled { opacity: .55; cursor: not-allowed; }
.sh-btn--primary { background: var(--primary); color: var(--surface); }
.sh-btn--primary:hover { background: var(--primary-hover); }
.sh-btn--primary:active { background: var(--primary-press); }
.sh-btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.sh-btn--secondary:hover { background: var(--surface-2); }
.sh-btn--danger { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.sh-btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.sh-btn .sh-ic { width: 18px; height: 18px; }

/* Girdiler */
.sh-field { display: grid; gap: 6px; }
.sh-label { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.sh-hint { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.sh-input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.sh-input:hover { border-color: var(--subtle); }
.sh-input:focus { border-color: var(--primary); outline: none; box-shadow: var(--focus-ring); }
.sh-input[readonly] { background: var(--bg); color: var(--text-2); }
.sh-input[readonly]:hover { border-color: var(--border-strong); }

/* Uyarı kartı / durum mesajı */
.sh-alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); color: var(--text);
}
.sh-alert .sh-ic { width: 20px; height: 20px; margin-top: 1px; }
.sh-alert--error { background: var(--danger-soft); border-color: var(--danger-soft); }
.sh-alert--error > .sh-ic { color: var(--danger); }
.sh-alert--success { background: var(--ok-soft); border-color: var(--ok-soft); }
.sh-alert--success > .sh-ic { color: var(--ok); }
.sh-alert strong { display: block; font-weight: 600; }
.sh-alert p { margin: 2px 0 0; color: var(--text-2); }
.sh-alert .sh-btn { margin-left: auto; align-self: center; }

/* İskelet */
.sh-skel { display: block; border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; }
.sh-skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
  animation: sh-shimmer 1.3s infinite;
}
@keyframes sh-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sh-skel::after { animation: none; display: none; } }
