/* ============================================================
   rail.css — 左側資訊欄統一樣式（前後台共用）
   位置：~/seo-platform/shared-assets/rail.css
   ============================================================ */

/* ── Left Rail container ── */
.left-rail {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 220px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

/* ── Title row ── */
.rail-title-row {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.rail-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px; font-weight: 600; color: var(--text);
  line-height: 1.3;
}

/* ── Section (groups) ── */
.rail-section {
  padding: 14px 14px 0;
  position: relative;
}
.rail-section-label {
  font-size: 10px; font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0 12px;
  margin-bottom: 6px;
}

/* ── Nav ── */
.rail-nav { padding: 14px 14px; flex: 1; overflow-y: auto; }
.rail-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: var(--tr);
  margin-bottom: 2px;
}
.rail-nav-item:hover { background: var(--bg); }
.rail-nav-item.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
}
.rail-nav-item.parent-active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 500;
}
.rail-nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }

/* ── Step numbers (used by workflow nav) ── */
.rail-step-num {
  width: 20px; height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg); color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Noto Sans TC', sans-serif;
  border: 1px solid var(--border);
}
.rail-nav-item.active .rail-step-num {
  background: rgba(255,255,255,.22);
  color: var(--white);
  border-color: rgba(255,255,255,.3);
}
.rail-nav-item.parent-active .rail-step-num {
  background: rgba(27,94,66,.12);
  color: var(--primary-dark);
  border-color: transparent;
}

.rail-sub-nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 4px;
  padding: 9px 12px 9px 44px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--tr);
}
.rail-sub-nav-item:hover { background: var(--bg); color: var(--text); }
.rail-sub-nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.rail-sub-dot {
  display: none;
}

/* ── Footer ── */
.rail-footer {
  padding: 12px 14px 18px;
  border-top: 1px solid var(--border);
}
.rail-footer-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--tr);
  cursor: pointer;
  background: transparent; border: none;
  width: 100%; text-align: left;
  font-family: 'Noto Sans TC', sans-serif;
}
.rail-footer-link:hover { background: var(--bg); color: var(--text); }
.rail-footer-link.primary {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 500;
}
.rail-footer-link.primary:hover { background: var(--primary); color: var(--white); }

/* ── Client Pill ── */
.client-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  width: 100%;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: default;
  transition: var(--tr);
}
.client-pill.clickable, button.client-pill { cursor: pointer; }
.client-pill.clickable:hover, button.client-pill:hover {
  background: var(--primary-light); border-color: var(--primary-light);
}
.client-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}
.client-pill .chevron {
  font-size: 10px; color: var(--text-muted);
  margin-left: auto;
  transition: transform var(--tr);
}
.client-pill.open .chevron { transform: rotate(180deg); }

/* ── Client Dropdown ── */
.client-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 240px; padding: 6px;
  z-index: 200;
}
.client-dropdown-title {
  font-size: 10px; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 10px 6px;
}
.client-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px; color: var(--text);
  transition: var(--tr);
}
.client-dropdown-item:hover { background: var(--bg); }
.client-dropdown-item.active { background: var(--primary); color: var(--white); }
.client-dropdown-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-planned, #CBCBC8); flex-shrink: 0;
}
.client-dropdown-item.active .dot { background: rgba(255,255,255,.55); }
.client-dropdown-item .sub {
  font-size: 11px; color: var(--text-muted);
  margin-left: auto; white-space: nowrap;
}
.client-dropdown-item.active .sub { color: rgba(255,255,255,.75); }
.client-dropdown-add {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px; color: var(--primary); font-weight: 500;
  border: none; background: transparent;
  width: 100%; text-align: left;
  font-family: 'Noto Sans TC', sans-serif;
  transition: var(--tr);
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.client-dropdown-add:hover { background: var(--bg); }

/* ── Container padding for rail offset ── */
.has-rail { padding-left: 220px; min-height: 100vh; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .left-rail {
    position: static;
    width: 100%; height: auto; bottom: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .rail-nav { padding: 10px 12px; }
  .rail-footer { padding: 10px 12px; }
  .has-rail { padding-left: 0; }
  .client-dropdown { min-width: 200px; }
}
