/* 10X Water – Icon Rail & Layout Overrides */

/* ── Hide the old nexus sidebar ────────────────────────────────── */
#layout-sidebar,
#layout-sidebar-toggle-trigger,
#layout-sidebar-hover-trigger,
#layout-sidebar-hover,
#layout-sidebar-backdrop {
  display: none !important;
}

/* ── Icon Rail ─────────────────────────────────────────────────── */
.icon-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  min-width: 72px;
  height: 100vh;
  height: 100dvh;
  background: #2d2f36;
  background: oklch(0.21 0.02 260);
  padding: 12px 10px;
  gap: 8px;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.icon-rail:hover {
  scrollbar-color: oklch(0.4 0 0 / 0.4) transparent;
}

[data-theme="light"] .icon-rail {
  background: #d8dae4;
  background: oklch(0.88 0.02 260);
}
[data-theme="light"] .icon-rail-logo {
  color: #1e4070;
  color: oklch(0.3 0.12 250);
}
[data-theme="light"] .icon-rail-logo:focus-visible {
  outline-color: #1e4070;
  outline-color: oklch(0.3 0.12 250);
}
[data-theme="light"] .icon-rail-item {
  color: #4a4e5a;
  color: oklch(0.4 0.02 260);
}
[data-theme="light"] .icon-rail-item:hover,
[data-theme="light"] .icon-rail-item:focus-visible {
  background: #b8bcc8;
  background: oklch(0.75 0.02 260);
  color: #1a1c22;
  color: oklch(0.25 0.02 260);
}
[data-theme="light"] .icon-rail-item.active {
  background: rgba(168, 196, 224, 0.35);
  background: oklch(0.7 0.12 210 / 0.35);
  color: #1e4976;
  color: oklch(0.35 0.12 250);
}

.icon-rail-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  color: #5b9bd5;
  color: oklch(0.75 0.15 210);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.icon-rail-logo:focus-visible {
  outline: 2px solid #5b9bd5;
  outline: 2px solid oklch(0.75 0.15 210);
  outline-offset: 2px;
}

.icon-rail-divider {
  width: 36px;
  height: 1px;
  background: rgba(128, 128, 128, 0.3);
  background: oklch(0.4 0 0 / 0.3);
  margin: 8px 0;
}

.icon-rail-spacer {
  flex: 1;
}

/* Rail nav items */
.icon-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  padding: 6px 0;
  border-radius: 12px;
  color: #b8bcc8;
  color: oklch(0.75 0 0);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.icon-rail-item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: #5b9bd5;
  background: oklch(0.75 0.15 210);
  opacity: 0;
  transition: opacity 0.15s;
}
.icon-rail-item:hover,
.icon-rail-item:focus-visible {
  background: #3d4048;
  background: oklch(0.35 0.02 260);
  color: #e8e8ec;
  color: oklch(0.95 0 0);
}
.icon-rail-item:focus-visible {
  outline: 2px solid #5b9bd5;
  outline: 2px solid oklch(0.75 0.15 210);
  outline-offset: 2px;
}
.icon-rail-item:focus-visible::before {
  opacity: 1;
}
.icon-rail-item.active {
  background: rgba(91, 155, 213, 0.2);
  background: oklch(0.55 0.15 210 / 0.2);
  color: #a8c8e8;
  color: oklch(0.85 0.15 210);
}

@media (prefers-reduced-motion: reduce) {
  .icon-rail-item,
  .icon-rail-item::before {
    transition: none;
  }
}

.icon-rail-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}

/* Icon sizes */
.icon-rail-icon {
  width: 20px;
  height: 20px;
}
.icon-rail-icon-lg {
  width: 24px;
  height: 24px;
}


/* ── App Main (content area alongside icon rail) ───────────────── */
.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
}

[data-theme="light"] .app-main {
  background: #e8e9ec;
  background: oklch(0.94 0.008 260);
}

.icon-rail-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* ── App Shell (flex wrapper for icon rail + main) ───────────── */
.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

/* ── Bottom Nav (mobile) ─────────────────────────────────────── */
.bottom-nav {
  display: none;
}

.bottom-nav-item-wrapper {
  flex: 1;
  display: flex;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2px;
  padding: 6px 0;
  color: #b8bcc8;
  color: oklch(0.75 0 0);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
  color: #a8c8e8;
  color: oklch(0.85 0.15 210);
}
[data-theme="light"] .bottom-nav-item {
  color: #5a5e6a;
  color: oklch(0.5 0.02 260);
}
[data-theme="light"] .bottom-nav-item.active {
  color: #1e4976;
  color: oklch(0.35 0.12 250);
}
.bottom-nav-item:focus-visible {
  outline: 2px solid #5b9bd5;
  outline: 2px solid oklch(0.75 0.15 210);
  outline-offset: -2px;
  border-radius: 8px;
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
}

.bottom-nav-logo {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
  line-height: 22px;
  color: #5b9bd5;
  color: oklch(0.75 0.15 210);
}
[data-theme="light"] .bottom-nav-logo {
  color: #1e4070;
  color: oklch(0.3 0.12 250);
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* ── Mobile: hide sidebar, show bottom nav ───────────────────── */
@media (max-width: 639px) {
  .icon-rail {
    display: none;
  }

  .app-shell {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }

  .app-main {
    height: auto;
    flex: 1;
    min-height: 0;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav {
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #2d2f36;
    background: oklch(0.21 0.02 260);
    border-top: 1px solid oklch(0.4 0 0 / 0.3);
    z-index: 50;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  [data-theme="light"] .bottom-nav {
    background: #d8dae4;
    background: oklch(0.88 0.02 260);
    border-top-color: oklch(0.7 0 0 / 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav-item {
    transition: none;
  }
}

/* ── Section Tabs ──────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.section-tabs:hover {
  scrollbar-color: oklch(0.75 0 0 / 0.3) transparent;
}
[data-theme="light"] .section-tabs:hover {
  scrollbar-color: oklch(0.4 0 0 / 0.4) transparent;
}
