:root {
  --navy: #13213A;
  --navy-soft: #243554;
  --gold: #BFA27A;
  --gold-dark: #9B7F58;
  --gold-tint: #F4EFE6;
  --ivory: #F5F1EA;
  --surface: #FFFFFF;
  --surface-subtle: #FAF8F4;
  --border: #E8E2D8;
  --border-strong: #D9D1C4;

  --text-primary: #13213A;
  --text-secondary: #5B6473;
  --text-tertiary: #8B92A0;

  --danger: #A64444;
  --danger-bg: #F9EFEF;
  --success: #3A7256;
  --success-bg: #EEF5F1;
  --warning: #9B6F36;
  --warning-bg: #F8F2E7;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-card: 0 1px 3px rgba(19, 33, 58, 0.04), 0 1px 2px rgba(19, 33, 58, 0.02);
  --shadow-fab: 0 8px 20px rgba(19, 33, 58, 0.22);
  --shadow-sheet: 0 -8px 32px rgba(19, 33, 58, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-primary);
  background: #E7E1D7;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

svg {
  display: block;
  flex-shrink: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Desktop centering shell */
.viewport-host {
  width: 100%;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 480px) {
  .app-shell {
    box-shadow: 0 0 0 1px rgba(19, 33, 58, 0.08), 0 24px 60px rgba(19, 33, 58, 0.14);
  }
}

/* =========================================================
   LOGIN SCREEN
   ========================================================= */
.login-screen {
  position: absolute;
  inset: 0;
  background: var(--ivory);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(32px + env(safe-area-inset-top)) 24px calc(48px + env(safe-area-inset-bottom));
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.login-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 44px;
}

.login-logo-mark {
  width: 34px;
  height: 34px;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-mark svg {
  width: 34px;
  height: 34px;
}

.login-wordmark {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--navy);
  text-transform: uppercase;
  line-height: 1;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  outline: none;
  transition: border-color 150ms var(--ease);
}

.login-input:focus {
  border-color: var(--navy);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .login-input {
  padding-right: 48px;
}

.eye-btn {
  position: absolute;
  right: 2px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.eye-btn svg {
  width: 20px;
  height: 20px;
}

.login-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin-top: -4px;
}

.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* =========================================================
   HEADER & SHELL
   ========================================================= */
.app-header {
  flex-shrink: 0;
  background: var(--surface);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--navy);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.screen-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  transition: background 150ms var(--ease);
}

.select-pill:active {
  background: var(--ivory);
}

.select-pill svg {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.header-action-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gold-dark);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  white-space: nowrap;
}

/* Main Scroll Area */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: var(--ivory);
}

.app-main::-webkit-scrollbar {
  display: none;
}

/* Bottom Navigation (flex child, NOT fixed) */
.bottom-nav {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.nav-item {
  position: relative;
  height: var(--nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  transition: color 180ms var(--ease);
}

.nav-item.active {
  color: var(--navy);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  border-radius: 0 0 2px 2px;
  background: var(--gold);
}

.nav-icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.nav-item.active .nav-label {
  font-weight: 600;
}

.nav-badge {
  position: absolute;
  top: -5px;
  right: -11px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--navy);
  color: var(--surface);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

.nav-badge.gold {
  background: var(--gold-dark);
}

/* FAB */
.fab {
  position: absolute;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  width: 54px;
  height: 54px;
  border-radius: var(--r-pill);
  background: var(--navy);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 18;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

.fab::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(191, 162, 122, 0.35);
  pointer-events: none;
}

.fab:active {
  transform: scale(0.94);
}

.fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.fab svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

/* =========================================================
   PIPELINE SCREEN
   ========================================================= */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.summary-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  border-right: 1px solid var(--border);
}

.summary-cell:first-child {
  padding-left: 0;
}

.summary-cell:last-child {
  border-right: none;
  padding-right: 0;
}

.summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.summary-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.summary-value.gold {
  color: var(--gold-dark);
}

.summary-value.danger {
  color: var(--danger);
}

/* Sticky Stage Selector */
.stage-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 9;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stage-scroller {
  display: flex;
  overflow-x: auto;
  padding: 0 12px;
  gap: 4px;
  scrollbar-width: none;
}

.stage-scroller::-webkit-scrollbar {
  display: none;
}

.stage-tab {
  position: relative;
  flex-shrink: 0;
  min-height: 48px;
  padding: 10px 12px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: color 180ms var(--ease);
}

.stage-tab.active {
  color: var(--navy);
}

.stage-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

.stage-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.stage-tab.active .stage-num {
  color: var(--gold-dark);
}

.stage-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.stage-tab.active .stage-name {
  font-weight: 600;
}

.stage-count {
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--ivory);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stage-tab.active .stage-count {
  background: var(--navy);
  color: var(--surface);
}

/* Quick Filters */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 160ms var(--ease);
}

.filter-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

.filter-chip.side-state {
  border-color: var(--border-strong);
  color: var(--navy);
  background: var(--surface-subtle);
}

.filter-chip.side-state.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

.dot-danger {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  flex-shrink: 0;
}

.dot-gold {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-dark);
  display: inline-block;
  flex-shrink: 0;
}

/* Pipeline Cards (4 clean non-cramped rows) */
.cards-list {
  padding: 4px 16px 88px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
}

.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}

.lead-card:active {
  transform: scale(0.99);
  border-color: var(--gold);
}

.card-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--ivory);
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
}

.lead-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.need-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.need-tag.mua {
  background: var(--gold-tint);
  color: var(--gold-dark);
}

.need-tag.thue {
  background: #EDF1F6;
  color: var(--navy-soft);
}

.card-row-2 {
  font-size: 13.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.card-row-2 strong {
  color: var(--navy);
  font-weight: 600;
}

.card-row-3 {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.35;
}

.card-row-4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--ivory);
}

.next-action-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  min-width: 0;
  flex: 1;
}

.next-action-line span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-action-line svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.next-action-line.overdue {
  color: var(--danger);
}

.next-action-line.overdue svg {
  color: var(--danger);
}

.next-action-line.done {
  color: var(--success);
}

.next-action-line.done svg {
  color: var(--success);
}

.next-action-line.muted {
  color: var(--text-secondary);
  font-weight: 400;
}

.reopen-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  padding: 6px 4px;
  min-height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
}

.reopen-link:active {
  opacity: 0.65;
}

/* Empty State */
.empty-state {
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

/* =========================================================
   SCHEDULE SCREEN (Lịch hẹn)
   ========================================================= */
.week-strip {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px 12px;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  border-radius: var(--r-md);
  min-height: 54px;
  transition: background 160ms var(--ease);
}

.day-btn.active {
  background: var(--navy);
  color: var(--surface);
}

.day-dow {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.day-btn.active .day-dow {
  color: rgba(255, 255, 255, 0.72);
}

.day-num {
  font-size: 14px;
  font-weight: 600;
}

.day-btn.today:not(.active) .day-num {
  color: var(--gold-dark);
}

.day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.day-dot.has-task {
  background: var(--gold);
}

.day-dot.has-overdue {
  background: var(--danger);
}

.agenda-wrap {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agenda-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agenda-group-title.overdue {
  color: var(--danger);
}

.agenda-card-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-bottom: 1px solid var(--ivory);
  min-height: 62px;
}

.agenda-item:last-child {
  border-bottom: none;
}

.check-hit {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms var(--ease);
}

.check-hit:active .check-circle {
  border-color: var(--navy);
  background: var(--ivory);
}

.agenda-body {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  text-align: left;
}

.agenda-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.agenda-action {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.agenda-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

.agenda-time.overdue {
  color: var(--danger);
}

.agenda-sub {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* =========================================================
   REPORTS SCREEN (Báo cáo)
   ========================================================= */
.report-wrap {
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #ECE6DC;
  padding: 3px;
  border-radius: 10px;
}

.segmented.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.seg-btn {
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 180ms var(--ease);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(19, 33, 58, 0.08);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-tile.featured {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.kpi-tile.featured .kpi-label {
  color: rgba(255, 255, 255, 0.72);
}

.kpi-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.kpi-tile.featured .kpi-num {
  color: var(--gold);
}

.kpi-delta {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.kpi-tile.featured .kpi-delta {
  color: rgba(255, 255, 255, 0.8);
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.section-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
}

.bar-name {
  color: var(--navy);
  font-weight: 500;
}

.bar-val {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.bar-val strong {
  color: var(--navy);
  font-weight: 600;
}

.bar-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ivory);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--navy);
  transition: width 300ms var(--ease);
}

.bar-fill.gold {
  background: var(--gold);
}

.bar-fill.muted-danger {
  background: var(--danger);
  opacity: 0.72;
}

.funnel-conv {
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 600;
  margin-left: 6px;
}

/* Sales Team Table */
.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.team-table th {
  text-align: right;
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.team-table th:first-child {
  text-align: left;
  padding-left: 0;
}

.team-table td {
  text-align: right;
  padding: 11px 4px;
  border-bottom: 1px solid var(--ivory);
  color: var(--navy);
  font-weight: 500;
}

.team-table td:first-child {
  text-align: left;
  padding-left: 0;
  font-weight: 600;
}

.team-table tr:last-child td {
  border-bottom: none;
  padding-bottom: 2px;
}

.td-overdue {
  color: var(--danger) !important;
}

.td-done {
  color: var(--gold-dark) !important;
  font-weight: 600 !important;
}

/* =========================================================
   NOTIFICATIONS SCREEN
   ========================================================= */
.notif-list {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-card);
  transition: background 150ms var(--ease);
}

.notif-item.unread {
  background: #FFFEFC;
  border-color: #DFD5C5;
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--ivory);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.notif-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.notif-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.notif-icon svg {
  width: 18px;
  height: 18px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.notif-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.notif-time {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* =========================================================
   MORE SCREEN (Thêm)
   ========================================================= */
.more-wrap {
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
}

.profile-role {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 500;
  margin-top: 2px;
}

.profile-org {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.settings-row {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ivory);
  text-align: left;
  transition: background 150ms var(--ease);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:active {
  background: var(--surface-subtle);
}

.settings-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.settings-icon {
  width: 20px;
  height: 20px;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-icon svg {
  width: 20px;
  height: 20px;
}

.settings-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-label.danger {
  color: var(--danger);
}

.settings-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-right svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
}

.version-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  padding-top: 8px;
}

/* =========================================================
   FULL-SCREEN PUSHED DETAIL PAGE
   ========================================================= */
.detail-page {
  position: absolute;
  inset: 0;
  background: var(--ivory);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 200ms var(--ease);
  pointer-events: none;
}

.detail-page.open {
  transform: translateX(0);
  pointer-events: auto;
}

.detail-header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.icon-btn:active {
  background: var(--ivory);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.detail-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-card);
}

.detail-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-name {
  font-size: 19px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.detail-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.qa-btn {
  min-height: 48px;
  border-radius: var(--r-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  transition: background 150ms var(--ease);
}

.qa-btn:active {
  background: var(--ivory);
}

.qa-btn svg {
  width: 19px;
  height: 19px;
  color: var(--navy);
}

.qa-btn.primary-tint {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

.qa-btn.primary-tint svg {
  color: var(--gold);
}

/* 5-Step Progress Indicator */
.stepper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.stepper-stage-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.stepper-sub {
  font-size: 12px;
  color: var(--gold-dark);
  font-weight: 500;
  text-align: right;
}

.stepper-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.step-seg {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.step-line {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--ivory);
}

.step-seg.done .step-line {
  background: var(--navy);
}

.step-seg.current .step-line {
  background: var(--gold);
}

.step-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-seg.current .step-label {
  color: var(--navy);
  font-weight: 600;
}

.status-alert-banner {
  padding: 12px 14px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.status-alert-banner.paused {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(155, 111, 54, 0.22);
}

.status-alert-banner.lost {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(166, 68, 68, 0.22);
}

/* Next Action Card */
.next-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.next-card.overdue {
  border-color: rgba(166, 68, 68, 0.35);
  background: #FFFCFC;
}

.next-card-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.next-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 2px;
}

.next-card-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-card-date.overdue {
  color: var(--danger);
  font-weight: 500;
}

.btn-outline-sm {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Stage CTA Buttons */
.stage-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: var(--surface);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  transition: opacity 160ms var(--ease), transform 140ms var(--ease);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-secondary {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 150ms var(--ease);
}

.btn-secondary:active {
  background: var(--surface-subtle);
}

.btn-secondary svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-secondary.danger-text {
  color: var(--danger);
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.info-item.full {
  grid-column: 1 / -1;
}

.info-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  margin-top: 2px;
}

/* Timeline & Composer */
.composer {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.composer input {
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  outline: none;
}

.composer input:focus {
  border-color: var(--navy);
  background: var(--surface);
}

.composer-send {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--navy);
  color: var(--surface);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tl-item {
  display: flex;
  gap: 12px;
  position: relative;
}

.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: -14px;
  width: 1px;
  background: var(--border);
}

.tl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ivory);
  border: 1px solid var(--border);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.tl-dot svg {
  width: 12px;
  height: 12px;
}

.tl-body {
  flex: 1;
  min-width: 0;
}

.tl-text {
  font-size: 14px;
  color: var(--navy);
  line-height: 1.45;
}

.tl-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* =========================================================
   BOTTOM SHEETS
   ========================================================= */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 33, 58, 0.42);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 200ms var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet-backdrop.open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}

.field-label .req {
  color: var(--danger);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--navy);
  outline: none;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--navy);
  background: var(--surface);
}

.dup-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(155, 111, 54, 0.35);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--warning);
}

.dup-warning svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--ivory);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}

.collapse-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 200ms var(--ease);
}

.collapse-toggle.open svg {
  transform: rotate(180deg);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pick-chip {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  transition: all 150ms var(--ease);
}

.pick-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}

.stage-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
}

.stage-option.active {
  border-color: var(--navy);
  background: #F7F5F0;
}

.stage-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-opt-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-dark);
  width: 24px;
}

.stage-opt-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.stage-opt-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-option.active .radio-dot {
  border-color: var(--navy);
}

.stage-option.active .radio-dot::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--navy);
}

.menu-option {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  color: var(--navy);
}

.menu-option.active {
  background: var(--ivory);
  font-weight: 600;
}

.menu-option svg {
  width: 18px;
  height: 18px;
}

.pill-subtle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
  background: var(--navy);
  color: var(--surface);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(19, 33, 58, 0.24);
  z-index: 60;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

.helper-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* =========================================================
   BỔ SUNG KHI GHÉP API THẬT (ngoài bản Gemini)
   ========================================================= */
[hidden] { display: none !important; }
a.qa-btn { text-decoration: none; }
.login-screen.boot .login-form,
.login-screen.boot .login-footer { visibility: hidden; }
.stage-scroller { position: relative; }

.header-note { font-size: 13px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }
.select-pill .pill-text { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.header-action-link.compact { min-height: 32px; }

/* Nút đang gửi */
button[disabled], .btn-primary[disabled] { opacity: 0.55; cursor: default; }
.is-busy { position: relative; }
.btn-primary.is-busy::after, .composer-send.is-busy::after, .btn-secondary.is-busy::after {
  content: ''; width: 14px; height: 14px; margin-left: 8px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary.danger { background: var(--danger); }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn {
  font-size: 13px; font-weight: 600; color: var(--gold-dark); padding: 4px 2px; min-height: 28px;
  white-space: nowrap; flex-shrink: 0;
}

/* Toast lỗi */
.toast.error { background: var(--danger); }
.toast.error svg { color: #fff; }

/* Thẻ khách */
.card-row-3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-row-3 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-owner {
  flex-shrink: 0; font-size: 11px; font-weight: 500; color: var(--text-tertiary);
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 1px 8px;
}
.lead-card.is-overdue { border-left: 3px solid rgba(166, 68, 68, 0.55); }
.cards-list.slide-from-right { animation: slideR 200ms var(--ease); }
.cards-list.slide-from-left { animation: slideL 200ms var(--ease); }
@keyframes slideR { from { opacity: 0.3; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0.3; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* Khung xương khi đang tải */
.skel-card { cursor: default; gap: 10px; }
.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ivory) 25%, #EFE9DF 50%, var(--ivory) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty-state .btn-outline-sm { margin-top: 4px; }

/* Chi tiết */
.detail-owner { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.sub-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 2px; }
.sub-btn svg { color: var(--gold-dark); }
.banner-held { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.next-card-btns { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.next-card-btns .btn-outline-sm { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.section-heading .header-action-link { min-height: 28px; font-size: 13px; }
.pre { white-space: pre-wrap; font-weight: 400; line-height: 1.5; }
.note-types { margin-bottom: 10px; }
.pick-chip.sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.tl-text { white-space: pre-wrap; word-break: break-word; }

/* Sheet: form bọc cả thân + chân để chân luôn dính đáy */
.sheet { overflow: hidden; }
.sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.sheet-body { min-height: 0; flex: 1 1 auto; }
.sheet-header { gap: 8px; }
.sheet-header .sheet-title { flex: 1; min-width: 0; }
.sheet-back { margin-left: -10px; }
.menu-body { gap: 4px; }
.menu-left { display: inline-flex; align-items: center; gap: 10px; }
.gold-ic { color: var(--gold-dark); display: inline-flex; }
.muted-sm { font-size: 12px; color: var(--text-tertiary); font-weight: 400; }
.form-error { font-size: 13px; color: var(--danger); min-height: 0; margin-bottom: 8px; }
.form-error:empty { display: none; }
.dup-warning { flex-wrap: wrap; }
.dup-warning span { flex: 1; min-width: 0; }
.collapse-toggle svg { transition: transform 200ms var(--ease); }
.extra-fields { display: flex; flex-direction: column; gap: 12px; }
.segmented + .input { margin-top: 4px; }
.field-row > .input { min-width: 0; }
input[type=date].input, input[type=time].input { min-width: 0; }

.req-box { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 12px; background: var(--ivory); border: 1px solid var(--border); }
.req-box.gold { background: var(--gold-tint); border-color: rgba(191, 162, 122, 0.5); }
.req-box-title { font-size: 13px; font-weight: 600; color: var(--navy); }
.money-wrap { position: relative; display: flex; align-items: center; }
.money-wrap .input { padding-right: 52px; }
.money-unit { position: absolute; right: 10px; font-size: 12px; color: var(--text-tertiary); pointer-events: none; }
.money-preview { font-size: 12.5px; font-weight: 600; color: var(--gold-dark); min-height: 16px; }
.money-preview.bad { color: var(--danger); }
.cur-tag { font-size: 11px; font-weight: 500; color: var(--gold-dark); background: var(--gold-tint); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

/* Danh sách trong sheet (NV, dự án) */
.list-rows { display: flex; flex-direction: column; }
.list-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--ivory); text-align: left; color: var(--text-tertiary); min-height: 54px;
}
.list-row:last-child { border-bottom: none; }
.list-row.inactive .list-title { color: var(--text-tertiary); text-decoration: line-through; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-title { font-size: 15px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { font-size: 12px; color: var(--text-tertiary); }
.list-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--ivory); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-row .btn-outline-sm { height: 32px; padding: 0 10px; }
.inline-add { display: flex; gap: 8px; }
.inline-add .input { flex: 1; }

/* Lịch hẹn: điều hướng tuần */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 6px; }
.week-label { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--navy); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm svg { width: 20px; height: 20px; }
.check-hit.checked .check-circle { background: var(--navy); border-color: var(--navy); }

/* Báo cáo */
.report-range { font-size: 12px; color: var(--text-tertiary); text-align: center; margin-top: -6px; }
.kpi-num.danger { color: var(--danger); }
.kpi-delta.muted { color: var(--text-secondary); }
.team-table th:nth-child(3) { white-space: normal; }
.settings-right span { white-space: nowrap; }
