/* COLOR.as AI-CRM (Talent OS) Design System
   Refined Hospitality x Executive SaaS
   Palette: Midnight Navy #1B2A4A / Champagne Gold #C59B5F / Coral Rose #D66D75 / Warm Ivory #FAF8F5 */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Noto+Sans+JP:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface-subtle: #F4F1EC;
  --navy: #1B2A4A;
  --navy-light: #2B3F6B;
  --navy-soft: rgba(27, 42, 74, 0.06);
  --gold: #C59B5F;
  --gold-dark: #A67E44;
  --gold-soft: rgba(197, 155, 95, 0.14);
  --rose: #D66D75;
  --rose-soft: rgba(214, 109, 117, 0.13);
  --teal: #2E7D6F;
  --teal-soft: rgba(46, 125, 111, 0.12);
  --amber: #C9822B;
  --amber-soft: rgba(201, 130, 43, 0.14);
  --purple: #6E56A3;
  --purple-soft: rgba(110, 86, 163, 0.12);
  --text: #1E2430;
  --text-sub: #5A6475;
  --text-muted: #8A94A6;
  --border: #E6E1D8;
  --border-strong: #D4CEC2;
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.05);
  --shadow-md: 0 6px 20px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 16px 40px rgba(27, 42, 74, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--navy);
  color: #EEF1F6;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--rose) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(197, 155, 95, 0.35);
}

.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.4px;
  color: #fff;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(238, 241, 246, 0.45);
  padding: 10px 12px 6px;
  font-weight: 600;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(238, 241, 246, 0.78);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.16s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(197, 155, 95, 0.22) 0%, rgba(197, 155, 95, 0.08) 100%);
  color: #fff;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--rose);
  color: #fff;
}

.nav-badge.gold {
  background: rgba(197, 155, 95, 0.28);
  color: #F4D8A8;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-status-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(197, 155, 95, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.82);
}

.ai-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4CD9A4;
  margin-right: 6px;
  box-shadow: 0 0 8px #4CD9A4;
}

.slides-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(197, 155, 95, 0.16);
  color: #F5DEC0;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(197, 155, 95, 0.35);
  transition: all 0.16s ease;
}

.slides-link:hover {
  background: var(--gold);
  color: var(--navy);
}

/* Main Area */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header */
.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-heading {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 2px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Role Switcher */
.role-switcher {
  display: flex;
  align-items: center;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 3px;
}

.role-btn {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.role-btn.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.role-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* Role Banner */
.role-banner {
  background: linear-gradient(90deg, rgba(27, 42, 74, 0.04) 0%, rgba(197, 155, 95, 0.1) 100%);
  border-bottom: 1px solid var(--border);
  padding: 9px 28px;
  font-size: 12.5px;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.role-banner strong {
  color: var(--navy);
}

/* Content Container */
.content {
  padding: 24px 28px 40px;
  max-width: 1440px;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }

.btn-ai {
  background: linear-gradient(135deg, #2A3F6E 0%, #6E56A3 60%, #C76274 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(110, 86, 163, 0.28);
}
.btn-ai:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: var(--gold-dark); }

.btn-teal {
  background: var(--teal);
  color: #fff;
}
.btn-teal:hover { filter: brightness(1.06); }

.btn-outline {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--surface-subtle); }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }

/* Cards & Grids */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card.highlight {
  background: linear-gradient(145deg, var(--navy) 0%, #243862 100%);
  color: #fff;
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
}

.kpi-card.highlight .kpi-label,
.kpi-card.highlight .kpi-meta { color: rgba(255,255,255,0.78); }
.kpi-card.highlight .kpi-value { color: #fff; }

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin: 8px 0 4px;
  line-height: 1.15;
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.delta-up { color: var(--teal); font-weight: 700; }
.delta-warn { color: var(--rose); font-weight: 700; }
.kpi-card.highlight .delta-up { color: #6BE0B8; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.panel-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-2-asym {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.grid-2-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-rose { background: var(--rose-soft); color: #B4454E; }
.badge-amber { background: var(--amber-soft); color: #9A5F15; }
.badge-navy { background: var(--navy-soft); color: var(--navy); }
.badge-gold { background: var(--gold-soft); color: #8A642B; }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-subtle);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

.tag-ai {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: rgba(110, 86, 163, 0.22);
}

/* Queue & List Items */
.queue-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.15s ease;
  background: #fff;
}

.queue-item:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.queue-item:last-child { margin-bottom: 0; }

/* Progress Bars */
.progress-row {
  margin-bottom: 13px;
}
.progress-row:last-child { margin-bottom: 0; }
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.progress-track {
  height: 8px;
  background: var(--surface-subtle);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 100%);
  transition: width 0.35s ease;
}
.progress-fill.teal { background: var(--teal); }
.progress-fill.purple { background: var(--purple); }
.progress-fill.rose { background: var(--rose); }

/* Toolbar & Filters */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.input, .select, .textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.08);
}

.textarea { width: 100%; resize: vertical; line-height: 1.65; }

/* Talent Cards Grid */
.talent-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

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

.talent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.talent-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.talent-card.selected {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(27, 42, 74, 0.16);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.talent-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.talent-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
}

.talent-airline {
  font-size: 12px;
  color: var(--text-sub);
}

.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

/* Detail Sticky Pane */
.detail-pane {
  position: sticky;
  top: 76px;
}

.skill-bar-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 12px 0;
}

/* AI Box */
.ai-box {
  background: linear-gradient(135deg, rgba(110, 86, 163, 0.07) 0%, rgba(197, 155, 95, 0.09) 100%);
  border: 1px solid rgba(110, 86, 163, 0.25);
  border-radius: 11px;
  padding: 14px 15px;
  margin: 12px 0;
}

.ai-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.alert-box {
  background: rgba(214, 109, 117, 0.08);
  border: 1px solid rgba(214, 109, 117, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 12.5px;
}

.alert-box-title {
  font-weight: 700;
  color: #B4454E;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Matching Workbench */
.match-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

.slider-group {
  margin-bottom: 12px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--navy);
  cursor: pointer;
}

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.16s ease;
}

.match-card.rank-1 {
  border: 1.5px solid var(--gold);
  box-shadow: 0 8px 24px rgba(197, 155, 95, 0.16);
}

.score-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  border: 3px solid var(--gold);
  background: var(--bg);
}

.score-ring.high { border-color: var(--teal); color: var(--teal); }
.score-ring.mid { border-color: var(--gold); color: var(--gold-dark); }
.score-ring-num { font-size: 21px; line-height: 1; font-family: 'Plus Jakarta Sans', sans-serif; }
.score-ring-label { font-size: 9.5px; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }

.sub-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
  background: var(--surface-subtle);
  padding: 10px 12px;
  border-radius: 10px;
}

.sub-score-item {
  font-size: 11.5px;
  color: var(--text-sub);
}
.sub-score-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 25, 42, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}

.modal-body { padding: 20px 22px; }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg);
}

/* Flow Comparison */
.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.flow-box {
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.flow-box.asis { border-top: 4px solid var(--rose); }
.flow-box.tobe { border-top: 4px solid var(--teal); }

.flow-step {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  margin: 8px 0;
  font-size: 13px;
}

.flow-arrow {
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

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

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--text-sub);
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  font-weight: 700;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: #fff;
  padding: 13px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s ease;
  border-left: 4px solid var(--gold);
}

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

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(110, 86, 163, 0.25);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--text-sub); font-size: 12.5px; }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-asym, .talent-layout, .match-layout, .flow-grid, .grid-2-even { grid-template-columns: 1fr; }
  .talent-grid { grid-template-columns: 1fr; }
}
