/* Finexy-inspired navigation: narrow icon rail, rounded top pills, compact
   profile capsule. Layered after app.css/workspace.css; owns only the
   rail/header/profile selectors below. */

.app-shell { align-items: stretch; }

/* --- Icon rail -------------------------------------------------------- */
.app-rail {
  width: 86px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px;
  background: transparent;
  border-right: 1px solid var(--color-border);
}
.app-rail summary { list-style: none; cursor: default; }
.app-rail summary::-webkit-details-marker,
.app-rail summary::marker { display: none; content: ""; }
.rail-brand, .rail-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-accent);
  color: #20231d;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.rail-brand { text-decoration: none; font-size: 24px; }
.rail-disclosure { width: 100%; }
.rail-summary .rail-toggle-icon { display: flex; }
.rail-content { width: 100%; display: block; }
.rail-groups { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 22px; box-shadow: 0 2px 14px rgba(32, 35, 29, 0.06); }
.rail-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 4px 9px;
  border-radius: 16px;
  color: #80857a;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.rail-link:hover { background: #f1f3ed; color: var(--color-ink); }
.rail-link.active { background: #25281f; color: #fff; }

.rail-icon { display: flex; position: relative; }
.rail-label { font-size: 10.5px; font-weight: 500; letter-spacing: .01em; text-align: center; line-height: 1.15; }

/* --- Header: pills + profile ------------------------------------------ */
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 30px 0; }
.pills-scroll { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.pills { list-style: none; display: flex; gap: 2px; margin: 0; padding: 5px; background: #fff; border-radius: 999px; box-shadow: 0 2px 14px rgba(32, 35, 29, 0.05); width: max-content; }
.pill { display: inline-block; padding: 9px 18px; border-radius: 999px; color: #62665d; text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.pill:hover { color: var(--color-ink); background: #f1f3ed; }
.pill.active { background: #25281f; color: #fff; }

/* --- Profile dropdown --------------------------------------------------- */
.profile-menu { position: relative; flex-shrink: 0; }
.profile-menu summary { list-style: none; }
.profile-menu summary::-webkit-details-marker,
.profile-menu summary::marker { display: none; content: ""; }
.profile-pill { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: #fff; border-radius: 999px; box-shadow: 0 2px 14px rgba(32, 35, 29, 0.05); cursor: pointer; }
.profile-pill:hover { background: #f8f9f6; }
.profile-initials { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-accent); color: #20231d; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.profile-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.profile-name { font-size: 13px; font-weight: 600; color: var(--color-ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-role { font-size: 11.5px; color: var(--color-ink-muted); }
.profile-chevron { display: flex; color: var(--color-ink-muted); flex-shrink: 0; }
.profile-menu[open] .profile-chevron svg { transform: rotate(180deg); }
.profile-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: #fff; border: 1px solid var(--color-border); border-radius: 16px; box-shadow: 0 12px 30px rgba(32, 35, 29, 0.14); padding: 8px; display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.profile-menu-panel a,
.profile-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--color-ink);
  font-size: 13.5px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.profile-menu-panel a:hover,
.profile-menu-panel button:hover { background: #f1f3ed; }
.profile-menu-panel button { color: var(--color-danger); font-weight: 600; }

@media (min-width: 761px) {
  .rail-disclosure[open] > .rail-summary { display: none; }
  .rail-link:hover::after, .rail-link:focus-visible::after { content: attr(aria-label); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); padding: 7px 12px; background: #25281f; color: #fff; border-radius: 10px; font-size: 12px; white-space: nowrap; z-index: 40; box-shadow: 0 4px 16px #20231d18; }
}

@media (max-width: 1240px) and (min-width: 761px) {
  .app-rail { width: 76px; }
}

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .app-rail { display: block; width: 100%; min-height: auto; border-right: 0; border-bottom: 1px solid var(--color-border); padding: 12px 14px; }
  .app-rail .rail-summary { margin: 0; cursor: pointer; width: auto; justify-content: flex-start; gap: 10px; padding: 0 14px; background: #fff; border: 1px solid var(--color-border); border-radius: 999px; }
  .app-rail .rail-brand { display: none; }
  .rail-summary::after { content: "Menü"; font-size: 13px; font-weight: 600; }
  .app-rail .rail-toggle-icon { display: block; }
  .app-rail .rail-content { margin-top: 12px; }
  .rail-disclosure:not([open]) .rail-content { display: none; }
  .rail-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; border-radius: 18px; padding: 8px; }
  .rail-link { flex-direction: row; gap: 8px; padding: 9px 12px; white-space: nowrap; }
  .rail-label { font-size: 12.5px; }
  .app-header { padding: 14px 16px 0; gap: 10px; }
  .pills-scroll { flex: 1; }
  .profile-menu-panel { min-width: 200px; max-width: calc(100vw - 32px); }
  .profile-text { display: none; }
  .profile-chevron { display: none; }
  .profile-pill { padding: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .rail-link, .pill, .profile-chevron svg { transition: none !important; }
}
