/* ==============================================================================
   StarTON - White Light Theme SaaS Sidebar Member Dashboard Design System
   Clean Pure White Sidebar, Soft Alabaster Workspace, High-Contrast KPIs & Form Boxes
   ============================================================================== */

.member-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #f1f5f9;
}

/* ---------------- Crisp White Left Sidebar Navigation ---------------- */
.member-sidebar {
  width: 278px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand-bar {
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 20px;
}

.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

.sidebar-group-title {
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 12px 12px 6px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.89rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-align: left;
}

.sidebar-nav-item .nav-left { display: flex; align-items: center; gap: 11px; }
.sidebar-nav-item .nav-ico { width: 22px; text-align: center; font-size: 1rem; }

.sidebar-nav-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.sidebar-nav-item.active {
  background: linear-gradient(90deg, #e0f2fe 0%, #f0fdf4 100%);
  border-color: #bae6fd;
  color: #0369a1;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.1);
}

.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gradient-brand);
}

.sidebar-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.sidebar-pill.emerald {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.sidebar-footer-card {
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.sidebar-mini-status {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 110;
}
.sidebar-backdrop.open { display: block; }

/* ---------------- Main Workspace Area ---------------- */
.member-workspace {
  margin-left: 278px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.member-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid #e2e8f0;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.sidebar-mobile-btn {
  display: none;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.15rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.topbar-breadcrumb { font-size: 0.74rem; color: #64748b; font-weight: 600; }
.topbar-title { font-size: 1.16rem; font-weight: 800; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.workspace-content {
  padding: 26px 30px 64px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------- Panels, Banner, KPIs & Form Boxes ---------------- */
.dash-view { display: none; animation: fadeViewIn 0.2s ease; }
.dash-view.active { display: block; }
@keyframes fadeViewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 26px 30px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 65%, #ecfdf5 100%);
  border: 1px solid #bae6fd;
  margin-bottom: 24px;
  box-shadow: 0 10px 28px rgba(2, 132, 199, 0.08);
  position: relative;
  overflow: hidden;
}
.dashboard-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}
.status-active { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-inactive, .status-expired { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status-pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}
.stat-card:hover { border-color: #7dd3fc; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(2, 132, 199, 0.1); }
.stat-card .stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stat-card .label { font-size: 0.76rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-ico { width: 34px; height: 34px; border-radius: 10px; background: #e0f2fe; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 900; color: #0f172a; letter-spacing: -0.02em; }

.countdown-box { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.countdown-segment {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: #0369a1;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.quick-action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.quick-action-tile:hover { border-color: #38bdf8; background: #f0f9ff; transform: translateY(-2px); }
.quick-action-tile .tile-ico { width: 40px; height: 40px; border-radius: 11px; background: #e0f2fe; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

.progress-track { width: 100%; height: 10px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--gradient-brand); transition: width 0.5s ease; }

.dash-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.dash-card-header h3 { font-size: 1.15rem; font-weight: 800; color: #0f172a; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; cursor: pointer; background: #cbd5e1; border-radius: 99px; transition: 0.22s; }
.toggle-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #ffffff; border-radius: 50%; transition: 0.22s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: #0284c7; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.services-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.service-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}
.service-card:hover { background: #ffffff; border-color: #7dd3fc; transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.service-card .category { font-size: 0.72rem; color: #0284c7; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; margin-bottom: 8px; display: inline-block; }
.service-card h4 { font-size: 1.08rem; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.service-card p { color: #475569; font-size: 0.88rem; margin-bottom: 16px; flex-grow: 1; }

.table-responsive { width: 100%; overflow-x: auto; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.88rem; }
.data-table th { padding: 13px 16px; background: #f8fafc; color: #475569; font-weight: 700; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.data-table tr:hover td { background: #f8fafc; }

.tabs-nav { display: flex; gap: 10px; border-bottom: 1px solid #e2e8f0; margin-bottom: 22px; overflow-x: auto; }
.tab-btn { padding: 11px 16px; background: none; border: none; border-bottom: 2px solid transparent; color: #64748b; font-size: 0.9rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab-btn.active { color: #0284c7; border-bottom-color: #0284c7; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

@media (max-width: 992px) {
  .member-sidebar { transform: translateX(-100%); }
  .member-sidebar.open { transform: translateX(0); }
  .member-workspace { margin-left: 0; }
  .sidebar-mobile-btn { display: inline-flex; }
  .workspace-content { padding: 18px 14px 48px; }
  .member-topbar { padding: 12px 16px; }
}

@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .topbar-user-chip .chip-text { display: none; }
}
