/* ============================================================
   LIFE DESIGN PARTNER — Premium Financial Advisory Platform
   CSS Stylesheet v3.0
   Aesthetic: Private Banking — Mizuho Private Banking /
              CBRE Private Client / Bloomberg Terminal
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* ── Luxury Color Palette ── */
  --primary:              #0a1628;
  --primary-mid:          #162040;
  --primary-light:        #1e3a5f;
  --accent:               #b8922e;
  --accent-light:         #d4aa4e;
  --accent-pale:          #f5eed8;
  --surface:              #ffffff;
  --surface-2:            #f8f7f4;
  --surface-3:            #f0ede6;

  /* ── Text ── */
  --text-primary:         #0a1628;
  --text-secondary:       #3d4f6b;
  --text-muted:           #6b7b93;
  --text-white:           #ffffff;

  /* ── Semantic Colors ── */
  --success:              #1a5c35;
  --success-bg:           #eef7f2;
  --success-light:        #eef7f2;
  --warning:              #8b4f0a;
  --warning-bg:           #fef6ec;
  --warning-light:        #fef6ec;
  --danger:               #7c1a1a;
  --danger-bg:            #fdf0f0;
  --danger-light:         #fdf0f0;

  /* ── Legacy semantic aliases ── */
  --color-primary:        #0a1628;
  --color-primary-light:  #1e3a5f;
  --color-primary-dark:   #06101c;
  --color-accent:         #b8922e;
  --color-accent-light:   #d4aa4e;
  --color-accent-dark:    #8f6f1f;
  --color-success:        #1a5c35;
  --color-success-light:  #eef7f2;
  --color-warning:        #8b4f0a;
  --color-warning-light:  #fef6ec;
  --color-danger:         #7c1a1a;
  --color-danger-light:   #fdf0f0;
  --color-bg:             #f8f7f4;
  --color-card-bg:        #ffffff;
  --color-text-primary:   #0a1628;
  --color-text-secondary: #3d4f6b;
  --color-text-muted:     #6b7b93;
  --color-text-white:     #ffffff;
  --color-border:         #ddd8ce;
  --color-border-light:   #ede9e1;
  --color-divider:        #ede9e1;

  /* ── Borders ── */
  --border:               #ddd8ce;
  --border-light:         #ede9e1;
  --divider:              #ede9e1;

  /* ── Shadows (warm-toned, navy base) ── */
  --shadow-xs:            0 1px 2px rgba(10,22,40,0.06);
  --shadow-sm:            0 2px 6px rgba(10,22,40,0.08);
  --shadow-md:            0 4px 16px rgba(10,22,40,0.10);
  --shadow-lg:            0 8px 32px rgba(10,22,40,0.13);
  --shadow-xl:            0 20px 60px rgba(10,22,40,0.16);
  --shadow-card:          0 2px 6px rgba(10,22,40,0.08);
  --shadow-card-hover:    0 4px 16px rgba(10,22,40,0.12);
  --shadow-header:        0 1px 0 var(--border), 0 2px 8px rgba(10,22,40,0.06);

  /* ── Border Radius (formal: restrained) ── */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-xl:   14px;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --transition:        all 0.2s ease;
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.22s ease;
  --transition-slow:   all 0.35s ease;
  --transition-spring: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Layout ── */
  --sidebar-width:      272px;
  --sidebar-width-sm:   240px;
  --header-height:      60px;
  --content-padding:    32px;
  --content-padding-sm: 20px;

  /* ── Typography ── */
  --font-sans:  'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', system-ui, sans-serif;
  --font-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', 'MS PMincho', Georgia, serif;
  --font-mono:  'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* ── Font Sizes ── */
  --font-size-xs:   12px;
  --font-size-sm:   14px;
  --font-size-base: 14px;
  --font-size-md:   16px;
  --font-size-lg:   18px;
  --font-size-xl:   22px;
  --font-size-2xl:  26px;
  --font-size-3xl:  32px;

  --line-height-tight: 1.3;
  --line-height-base:  1.7;
  --line-height-loose: 1.85;

  /* ── Z-Index Scale ── */
  --z-base:     0;
  --z-card:     10;
  --z-dropdown: 100;
  --z-sidebar:  200;
  --z-header:   300;
  --z-modal:    9990;
  --z-toast:    9999;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--accent-light); }

img, svg { display: block; max-width: 100%; }
ul, ol   { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

.main-content {
  flex: 1;
  padding: 28px 32px;
  padding-top: calc(var(--header-height) + 28px);
  max-width: 1440px;
  width: 100%;
  animation: fadeIn 0.2s ease both;
}

/* ============================================================
   SIDEBAR — Deep navy gradient, gold accents
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0a1628 0%, #0d1e36 55%, #0a1a30 100%);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(184,146,46,0.15);
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  scrollbar-width: thin;
  scrollbar-color: rgba(184,146,46,0.20) transparent;
  transition: width var(--transition-base), transform var(--transition-base);
}

/* Gold vertical accent stripe on left edge */
.sidebar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent 0%, var(--accent) 20%, var(--accent-light) 50%, var(--accent) 80%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(184,146,46,0.25);
  border-radius: var(--radius-full);
}

/* ── Sidebar Header / Logo ── */
.sidebar-header {
  padding: 28px 24px 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  position: relative;
}

/* Retained for JS compatibility */
.sidebar-logo {
  padding: 28px 24px 20px 28px;
  border-bottom: 1px solid rgba(184,146,46,0.22);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-main {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.2;
}

.logo-sub {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 8px;
  color: var(--accent-light);
  text-transform: uppercase;
}

/* Gold rule below logo */
.logo-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 10px 0 6px;
}

/* Legacy class — same as logo-rule */
.logo-accent-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(184,146,46,0.70) 0%, transparent 100%);
  margin-top: 12px;
}

.logo-tagline {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.38);
  margin-top: 6px;
  font-weight: 400;
}

/* Client indicator strip */
.sidebar-client {
  margin: 12px 16px 4px;
  padding: 10px 14px;
  background: rgba(184,146,46,0.10);
  border: 1px solid rgba(184,146,46,0.22);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.sidebar-client-label {
  font-size: 10px;
  color: rgba(212,170,78,0.70);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.sidebar-client-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Navigation ── */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-nav-section {
  padding: 16px 20px 6px;
}

.sidebar-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px 13px 24px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
  margin: 1px 0;
  position: relative;
  user-select: none;
}

.nav-item .material-icons {
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.nav-item .nav-label {
  flex: 1;
  letter-spacing: 0.01em;
}

.nav-item:hover {
  background: rgba(184,146,46,0.08);
  color: rgba(255,255,255,0.85);
  border-left-color: rgba(184,146,46,0.4);
}

.nav-item:hover .material-icons { opacity: 0.90; }

.nav-item.active {
  background: rgba(184,146,46,0.12);
  color: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-item.active .material-icons {
  opacity: 1;
  color: var(--accent-light);
}

/* Nav badge */
.nav-badge {
  font-size: 9px;
  background: rgba(184,146,46,0.25);
  color: var(--accent-light);
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(184,146,46,0.3);
  line-height: 1.5;
  margin-left: auto;
}

/* Progress icon (check_circle appended by JS) */
.nav-progress-icon {
  font-size: 15px !important;
  color: var(--accent) !important;
  margin-left: auto;
}

/* Nav group divider */
.nav-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 6px 20px;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.30);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.sidebar-footer .material-icons {
  font-size: 14px;
  opacity: 0.5;
}

.sidebar-version {
  font-size: 10px;
  color: rgba(255,255,255,0.22);
  text-align: center;
  letter-spacing: 0.06em;
}

/* Collapse button */
.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,16,28,0.55);
  z-index: calc(var(--z-sidebar) - 1);
  display: none;
}

/* ============================================================
   HEADER — Clean white with warm shadow
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: var(--z-header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: left var(--transition-base);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  flex: 1;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Client badge in header */
.client-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--accent-light);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(10,22,40,0.18);
}

.client-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
  opacity: 0.70;
  flex-shrink: 0;
}

/* Legacy header client tag variant */
.header-client-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
}

.header-client-tag .client-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Icon buttons */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--primary);
  border-color: var(--accent);
}

.btn-icon .material-icons { font-size: 18px; }

/* Alias */
.header-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.header-icon-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ============================================================
   SECTION WRAPPER
   ============================================================ */
.section { animation: fadeIn 0.2s ease; }
.section.hidden { display: none !important; }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 12px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Gold bar accent before title */
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title.center {
  text-align: center;
  justify-content: center;
}
.section-title.center::before { display: none; }

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: 20px;
}

/* ============================================================
   CARDS — Premium white with warm borders
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}

.card-flat:hover { box-shadow: var(--shadow-xs); }

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2,
.card-header h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.card-header h2 .material-icons,
.card-header h3 .material-icons {
  font-size: 18px;
  color: var(--accent);
  opacity: 0.85;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-body { padding: 24px; }

.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Stat Cards — Dashboard KPIs ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Left accent bar */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
}

.stat-card-primary::before  { background: var(--primary); }
.stat-card-success::before  { background: var(--success); }
.stat-card-warning::before  { background: var(--warning); }
.stat-card-danger::before   { background: var(--danger); }
.stat-card.primary::before  { background: var(--primary); }
.stat-card.success::before  { background: var(--success); }
.stat-card.warning::before  { background: var(--warning); }
.stat-card.danger::before   { background: var(--danger); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-primary .stat-icon { background: rgba(10,22,40,0.08); color: var(--primary); }
.stat-card-success .stat-icon { background: var(--success-bg);   color: var(--success); }
.stat-card-warning .stat-icon { background: var(--warning-bg);   color: var(--warning); }
.stat-card-danger  .stat-icon { background: var(--danger-bg);    color: var(--danger); }
.stat-icon .material-icons { font-size: 22px; }

/* Legacy stat icon variant */
.stat-icon-default {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.stat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  padding-bottom: 6px;
}

/* Gold underline accent on stat values */
.stat-info::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

/* Large serif number */
.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Alternative stat card layout (JS-generated) */
.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-card-value .unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.stat-card-delta       { font-size: 12px; color: var(--text-secondary); }
.stat-card-delta.up    { color: var(--success); }
.stat-card-delta.down  { color: var(--danger); }

/* Stats grid (JS-generated) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* Stat sub-variants used by JS */
.stat-primary  { border-left: 3px solid var(--primary); }
.stat-secondary { border-left: 3px solid var(--text-secondary); }
.stat-accent   { border-left: 3px solid var(--accent); }

/* ============================================================
   BUTTONS — Gold primary, refined secondary
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  letter-spacing: 0.5px;
  font-family: var(--font-sans);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
}

/* Primary — gold gradient, navy text */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: var(--transition);
  font-family: var(--font-sans);
  box-shadow: 0 2px 8px rgba(184,146,46,0.30);
  white-space: nowrap;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(184,146,46,0.40);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn-primary .material-icons { font-size: 16px; }

/* Secondary — outlined */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

.btn-secondary:active {
  background: var(--accent-pale);
  transform: translateY(0);
}

.btn-secondary .material-icons { font-size: 16px; }

/* Danger */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-danger:hover {
  background: #9b1212;
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-ghost:hover {
  color: var(--primary);
  background: var(--surface-2);
}

/* Success */
.btn-success {
  background: var(--success);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-success:hover {
  background: #145530;
  transform: translateY(-1px);
}

/* Sizes */
.btn-large { padding: 12px 28px; font-size: 14px; }
.btn-small { padding: 5px 12px;  font-size: 12px; letter-spacing: 0.3px; }

/* Legacy small button used in tables */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
}

.btn-sm.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary);
  box-shadow: none;
  padding: 5px 12px;
}

.btn-sm.btn-danger  { background: var(--danger); color: #fff; }
.btn-sm.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Quick actions layout */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   FORMS — Minimal, sophisticated
   ============================================================ */
.form-group {
  margin-bottom: 22px;
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.form-section {
  margin-bottom: 28px;
}

.form-section h3 {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding-top: 9px;
  margin-bottom: 4px;
  transition: var(--transition-fast);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input {
  display: flex;
  flex-direction: column;
}

/* Standard field with label above */
.form-field {
  position: relative;
  margin-bottom: 22px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-field .form-label {
  position: static;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  transition: none;
  transform: none;
  margin: 0 0 6px;
}

/* Bottom-border style for form controls inside .form-field */
.form-field .form-control {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--border);
  background: transparent;
  padding: 8px 2px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
  border-radius: 0;
  font-family: var(--font-sans);
}

.form-field .form-control:focus {
  border-bottom-color: var(--accent);
  border-bottom-width: 2px;
}

.form-field .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
}

/* Standard boxed input */
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  font-family: var(--font-sans);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,146,46,0.30); /* WCAG 3:1 コントラスト確保のため opacity 0.12→0.30 */
}

/* バリデーションエラー状態 */
.form-control.field-error {
  border-color: var(--danger, #c0392b);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.25);
}

.form-control:disabled {
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-control.error   { border-color: var(--danger); }
.form-control.success { border-color: var(--success); }
.form-control.form-control-sm { padding: 6px 2px; font-size: 13px; }

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.70;
}

/* Select */
select.form-control {
  background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7b93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 36px 7px 10px;
  cursor: pointer;
}

select.form-control:focus {
  border-color: var(--accent);
  outline: none;
}

/* Textarea */
textarea.form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  resize: vertical;
  min-height: 80px;
  line-height: var(--line-height-base);
}

textarea.form-control:focus {
  border-color: var(--accent);
  outline: none;
}

/* Radio and checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 6px;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  cursor: pointer;
  font-size: 13px;
}

.radio-inline input[type="radio"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.radio-option,
.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.radio-option input[type="radio"],
.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  background: var(--surface);
}

.checkbox-item input[type="checkbox"] {
  border-radius: var(--radius-xs);
}

.radio-option input[type="radio"]:checked,
.radio-item input[type="radio"]:checked,
.checkbox-item input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--primary);
}

.radio-option input[type="radio"]:checked::after,
.radio-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%) rotate(45deg);
  width: 4px;
  height: 8px;
  border: 1.5px solid var(--accent-light);
  border-top: none;
  border-left: none;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-track {
  width: 42px;
  height: 22px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
}

.toggle-switch.active .toggle-track { background: var(--primary); }
.toggle-switch.active .toggle-thumb { transform: translateX(20px); }

/* Form hint / error */
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Currency field wrapper */
.currency-field {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-field .form-control {
  flex: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.currency-suffix {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-left: 8px;
  flex-shrink: 0;
}

.currency-field .currency-symbol {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 600;
  pointer-events: none;
}

/* Form grid for financial tabs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

/* ============================================================
   TABLES — Crisp, professional
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead {
  background: var(--primary);
  color: #ffffff;
}

.table thead th {
  background: var(--primary);
  color: rgba(255,255,255,0.92);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}

.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.table tbody tr:last-child   { border-bottom: none; }

.table tbody tr:nth-child(even) td { background: var(--surface-2); }

.table tbody tr:hover td { background: var(--accent-pale); }

.table tbody td {
  padding: 10px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.table td.numeric,
.table .text-right,
.table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.table tfoot tr { background: var(--surface-3); font-weight: 700; }

.table tfoot td {
  padding: 10px 14px;
  border-top: 2px solid var(--border);
  background: var(--surface-3);
  font-weight: 600;
}

/* Compact table */
.table-compact thead th,
.table-compact td { padding: 7px 12px; }

/* Data table (JS-generated dashboard) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: var(--primary);
  color: rgba(255,255,255,0.92);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}

.data-table tbody tr { border-bottom: 1px solid var(--border-light); transition: background 0.15s; }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--accent-pale); }
.data-table tbody td { padding: 10px 14px; color: var(--text-primary); vertical-align: middle; }

.data-table .action-cell { text-align: right; white-space: nowrap; }

/* Active row in table */
.row-active { background: rgba(184,146,46,0.06) !important; }

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  font-size: 13px;
}

.comparison-table thead th {
  background: var(--primary);
  color: white;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  text-transform: uppercase;
}

.comparison-table thead th:first-child { text-align: left; }
.comparison-table thead th:last-child  { border-right: none; }

.comparison-table thead th.highlight {
  background: var(--accent);
  color: var(--primary);
}

.comparison-table tbody tr { border-bottom: 1px solid var(--border-light); }
.comparison-table tbody tr:last-child { border-bottom: none; }
.comparison-table tbody tr:nth-child(even) td { background: var(--surface-2); }

.comparison-table td {
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  text-align: center;
  vertical-align: middle;
}

.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
  background: var(--surface-2);
}

.comparison-table td:last-child { border-right: none; }

.comparison-table td.highlight,
.comparison-table .highlight-col {
  background: var(--accent-pale) !important;
  font-weight: 600;
  color: var(--primary);
}

/* ============================================================
   TABS — Underline style, gold active
   ============================================================ */
.tabs-container { width: 100%; }

.tab-bar {
  display: flex;
  flex-wrap: nowrap;
  border-bottom: 2px solid var(--border-light);
  padding: 0 4px;
  overflow-x: auto;
  gap: 2px;
  background: var(--surface-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-bar::-webkit-scrollbar { height: 3px; }
.tab-bar::-webkit-scrollbar-thumb { background: var(--accent); }

/* The HTML uses .tabs directly inside .card-header */
.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs-header {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-header::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
  position: relative;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(10,22,40,0.03);
  border-bottom-color: var(--border);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-done {
  color: var(--success);
  font-size: 11px;
  margin-left: 4px;
}

.tab-panel {
  display: none;
  padding: 22px 0;
  animation: fadeIn 0.18s ease;
}

.tab-panel.active { display: block; }

/* Pill tabs variant */
.tabs-pills .tabs-header {
  border-bottom: none;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
  display: inline-flex;
}

.tabs-pills .tab-btn {
  border-bottom: none;
  margin-bottom: 0;
  border-radius: var(--radius-xs);
  padding: 7px 16px;
}

.tabs-pills .tab-btn.active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-gold    { background: var(--accent-pale); color: var(--accent); border: 1px solid rgba(184,146,46,0.3); }
.badge-navy    { background: rgba(10,22,40,0.08); color: var(--primary); }
.badge-primary { background: rgba(10,22,40,0.07); color: var(--primary); border-color: rgba(10,22,40,0.12); }
.badge-accent  { background: var(--accent-pale); color: #7a6120; border-color: rgba(184,146,46,0.25); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(26,92,53,0.20); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(139,79,10,0.20); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(124,26,26,0.20); }
.badge-neutral { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container { margin-bottom: 14px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-full);
  transition: width 0.55s ease;
}

.progress-fill.accent  { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%); }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

.progress-bar.large { height: 10px; }
.progress-bar.slim  { height: 3px; }

/* ============================================================
   TRAFFIC LIGHT / FINANCIAL INDICATORS
   ============================================================ */
.traffic-light {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.traffic-light-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.traffic-light.green  .traffic-light-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(26,92,53,0.15); }
.traffic-light.yellow .traffic-light-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(139,79,10,0.15); }
.traffic-light.red    .traffic-light-dot { background: var(--danger);  box-shadow: 0 0 0 3px rgba(124,26,26,0.15); }

.traffic-light.green  { color: var(--success); }
.traffic-light.yellow { color: var(--warning); }
.traffic-light.red    { color: var(--danger); }

.financial-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.financial-indicator.safe    { background: var(--success-bg); color: var(--success); border-color: rgba(26,92,53,0.20); }
.financial-indicator.caution { background: var(--warning-bg); color: var(--warning); border-color: rgba(139,79,10,0.20); }
.financial-indicator.risk    { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(124,26,26,0.20); }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-wrapper {
  position: relative;
  width: 100%;
}

.chart-wrapper canvas { max-width: 100%; height: auto; }

.chart-container {
  position: relative;
  padding: 16px 0;
  min-height: 280px;
}

canvas { max-width: 100%; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  justify-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   WELCOME BANNER (first launch)
   ============================================================ */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(184,146,46,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 60px;
  width: 150px;
  height: 150px;
  background: rgba(184,146,46,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.welcome-banner p {
  color: rgba(255,255,255,0.70);
  font-size: 13px;
  margin-bottom: 24px;
}

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.10);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.step-num {
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-label {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  white-space: nowrap;
}

.step-arrow {
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

/* Step indicator widget (progress tracker) */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  transition: var(--transition-fast);
  margin-bottom: 5px;
}

.step-item.active    .step-circle    { border-color: var(--accent); color: var(--primary); background: var(--accent-pale); }
.step-item.completed .step-circle    { border-color: var(--primary); background: var(--primary); color: white; }
.step-item.active    .step-label     { color: var(--primary); font-weight: 700; }
.step-item.completed .step-label     { color: var(--text-secondary); }

/* ============================================================
   CLIENT LIST IN DASHBOARD
   ============================================================ */
.client-table-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px 90px auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.client-table-row:hover { background: var(--surface-2); }
.client-table-row:last-child { border-bottom: none; }

.client-table-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: var(--surface-3);
  border-bottom: 2px solid var(--accent);
}

.client-name-cell {
  font-weight: 500;
  color: var(--primary);
}

.client-status { display: flex; gap: 4px; }

/* ============================================================
   FINANCIAL RESULTS DISPLAY
   ============================================================ */
.result-block {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 16px;
}

.result-block h4 {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.result-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.diagnosis {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Risk badges */
.risk-badge       { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.risk-safe        { background: var(--success-bg); color: var(--success); border: 1px solid rgba(26,92,53,0.2); }
.risk-moderate    { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(139,79,10,0.2); }
.risk-risky       { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(124,26,26,0.2); }
.risk-dangerous   { background: #3d0000; color: #ff8080; }

/* ============================================================
   PSYCHOLOGY / ANALYSIS RESULTS
   ============================================================ */
.analysis-result {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 14px;
  border-left: 4px solid var(--accent);
  background: var(--accent-pale);
  position: relative;
}

.analysis-result h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 8px;
  font-weight: 600;
}

.analysis-result-primary {
  border-left-color: var(--primary);
  background: rgba(10,22,40,0.04);
}

.analysis-result.success {
  border-left-color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(26,92,53,0.18);
  border-left: 4px solid var(--success);
}

.analysis-result.warning {
  border-left-color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid rgba(139,79,10,0.18);
  border-left: 4px solid var(--warning);
}

.analysis-result.danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(124,26,26,0.18);
  border-left: 4px solid var(--danger);
}

.analysis-result.primary {
  border-left-color: var(--primary);
  background: rgba(10,22,40,0.03);
  border: 1px solid rgba(10,22,40,0.10);
  border-left: 4px solid var(--primary);
}

.analysis-result-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}

.analysis-result.success  .analysis-result-title { color: var(--success); }
.analysis-result.warning  .analysis-result-title { color: var(--warning); }
.analysis-result.danger   .analysis-result-title { color: var(--danger); }
.analysis-result.primary  .analysis-result-title { color: var(--primary); }

.analysis-result-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: var(--line-height-loose);
}

.question-group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.question-text {
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight 0.3s ease;
  font-size: 13px;
  font-weight: 500;
  border-left: 4px solid transparent;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.toast.toast-success,
.toast.success { border-left-color: var(--success); color: var(--success); }
.toast.toast-error,
.toast.danger  { border-left-color: var(--danger);  color: var(--danger); }
.toast.toast-warning,
.toast.warning { border-left-color: var(--warning); color: var(--warning); }
.toast.toast-info  { border-left-color: var(--primary-light); color: var(--primary); }

.toast .material-icons { font-size: 18px; flex-shrink: 0; }
.toast-icon    { flex-shrink: 0; margin-top: 1px; }
.toast-title   { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.toast-message { color: var(--text-secondary); line-height: 1.4; }

/* Inline app alert */
#app-alert {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#app-alert.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(26,92,53,0.2); }
#app-alert.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(139,79,10,0.2); }
#app-alert.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(124,26,26,0.2); }
#app-alert.alert-info    { background: rgba(10,22,40,0.04); color: var(--primary); border: 1px solid var(--border); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.60);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}

.modal-backdrop.hidden,
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 420px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.2s ease;
  border: 1px solid var(--border);
}

.modal.modal-lg  { max-width: 800px;  width: 800px; }
.modal.modal-xl  { max-width: 1100px; width: 1100px; }
.modal.modal-sm  { max-width: 400px;  width: 400px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3,
.modal-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(124,26,26,0.20);
}

.modal-body {
  padding: 20px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-y: auto;
  flex: 1;
}

.modal-body .text-danger { color: var(--danger); }

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  flex-shrink: 0;
}

/* ============================================================
   PDF OVERLAY SPINNER
   ============================================================ */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.75);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pdf-overlay.hidden { display: none; }

.pdf-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(184,146,46,0.30);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.pdf-overlay-text {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
}

/* ============================================================
   REPORT CHECKLIST
   ============================================================ */
.report-checklist {
  list-style: none;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.report-checklist .checked::before   { content: '✓'; color: var(--success); font-weight: 700; width: 18px; }
.report-checklist .unchecked::before { content: '○'; color: var(--text-muted); width: 18px; }

/* Checklist in HTML (id="report-checklist") */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
}

.checklist-item .material-icons { font-size: 18px; flex-shrink: 0; }

/* ============================================================
   LIFE PLAN TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--border) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 26px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

.timeline-item.completed .timeline-dot { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.timeline-item.milestone .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  width: 14px;
  height: 14px;
  left: -29px;
  top: 1px;
}

.timeline-content { padding-left: 4px; }

.timeline-year,
.timeline-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.timeline-event,
.timeline-title {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-serif);
  margin-bottom: 5px;
}

.timeline-detail,
.timeline-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: var(--line-height-loose);
}

.timeline-tag {
  display: inline-flex;
  padding: 2px 9px;
  background: rgba(10,22,40,0.06);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 5px;
}

/* ============================================================
   LIFE EVENT / ANALYSIS CARDS
   ============================================================ */
.life-event-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.life-event-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.life-event-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-pale);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.life-event-info { flex: 1; }

.life-event-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.life-event-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.life-event-amount {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.life-stage-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--accent-light);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ============================================================
   CASHFLOW LEGEND
   ============================================================ */
.cashflow-legend {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cashflow-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.cashflow-legend-bar {
  width: 22px;
  height: 9px;
  border-radius: 2px;
}

/* ============================================================
   DATA PANEL (AFP Specific)
   ============================================================ */
.data-panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.data-panel-header {
  background: var(--primary);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-panel-header-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.data-panel-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.data-panel-body { padding: 22px; }

/* Readonly display value */
.display-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.display-value .unit {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.display-value.accent  { color: var(--accent); }
.display-value.success { color: var(--success); }
.display-value.danger  { color: var(--danger); }

/* Calculation breakdown */
.calc-breakdown {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed var(--divider);
}

.calc-row:last-child { border-bottom: none; }

.calc-row.total {
  border-top: 1px solid var(--primary);
  border-bottom: none;
  padding-top: 9px;
  margin-top: 3px;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}

.calc-label { color: var(--text-secondary); }
.calc-value { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================================================
   PROPERTY CARD (Real Estate Specific)
   ============================================================ */
.property-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.property-card-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.property-card-body { padding: 16px 18px; }

.property-card-price {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.property-card-address {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.property-specs {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.property-spec {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* ============================================================
   DROPDOWN / CONTEXT MENU
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  padding: 5px;
  animation: fadeIn 0.13s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 4px 0;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
  cursor: default;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-dropdown);
  letter-spacing: 0.03em;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.30;
}

.empty-state-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-body {
  font-size: 13px;
  max-width: 300px;
  line-height: var(--line-height-loose);
  margin-bottom: 18px;
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--divider) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 14px; }
.skeleton-card  { height: 150px; border-radius: var(--radius-md); }

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-spinner.sm { width: 18px; height: 18px; border-width: 2px; }
.loading-spinner.lg { width: 48px; height: 48px; border-width: 3.5px; }

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.accordion-item.open { box-shadow: var(--shadow-sm); }

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.accordion-header:hover { background: var(--surface-2); }

.accordion-item.open .accordion-header {
  background: rgba(10,22,40,0.03);
  border-bottom: 1px solid var(--border);
}

.accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion-body {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: var(--line-height-loose);
}

/* ============================================================
   REPORT / PDF STYLES
   ============================================================ */
.report-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  margin: 0 auto;
  padding: 20mm 18mm;
  box-shadow: var(--shadow-lg);
  position: relative;
  font-family: var(--font-sans);
  font-size: 10pt;
  line-height: 1.6;
  color: #1a1a1a;
}

.report-page + .report-page { margin-top: 24px; }

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12pt;
  border-bottom: 1.5pt solid var(--primary);
  margin-bottom: 20pt;
}

.report-logo {
  display: flex;
  flex-direction: column;
  gap: 2pt;
}

.report-logo .report-brand {
  font-family: var(--font-serif);
  font-size: 15pt;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.report-logo .report-tagline {
  font-size: 7pt;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}

.report-meta {
  text-align: right;
  font-size: 8pt;
  color: #616161;
  line-height: 1.8;
}

.report-meta strong { color: var(--primary); }

.report-title {
  text-align: center;
  margin-bottom: 20pt;
  padding: 14pt 20pt;
  background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 100%);
  border-radius: 4pt;
}

.report-title h1 {
  font-family: var(--font-serif);
  font-size: 19pt;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
  margin-bottom: 4pt;
}

.report-title h2 {
  font-size: 10pt;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

.report-accent-bar {
  width: 48pt;
  height: 1.5pt;
  background: var(--accent);
  margin: 8pt auto 0;
  border-radius: 9999pt;
}

.report-section-title {
  font-family: var(--font-serif);
  font-size: 11pt;
  font-weight: 700;
  color: var(--primary);
  border-left: 3pt solid var(--accent);
  padding-left: 9pt;
  margin-bottom: 10pt;
  margin-top: 18pt;
  line-height: 1.3;
}

.report-section-title:first-child { margin-top: 0; }

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  margin-bottom: 14pt;
}

.report-table thead tr { background: var(--primary); color: #ffffff; }

.report-table thead th {
  padding: 6pt 9pt;
  text-align: left;
  font-weight: 600;
  font-size: 7.5pt;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-table tbody tr:nth-child(even) { background: #f8f7f4; }
.report-table tbody tr { border-bottom: 0.5pt solid #ddd8ce; }

.report-table td {
  padding: 6pt 9pt;
  color: #1a1a1a;
}

.report-table td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table tfoot tr {
  background: #f0ede6;
  font-weight: 700;
  border-top: 1pt solid var(--primary);
}

.report-table tfoot td { padding: 6pt 9pt; }

.report-highlight {
  padding: 11pt 14pt;
  border-radius: 3pt;
  margin-bottom: 12pt;
}

.report-highlight.primary {
  background: rgba(10,22,40,0.04);
  border: 0.75pt solid rgba(10,22,40,0.18);
}

.report-highlight.accent {
  background: rgba(184,146,46,0.06);
  border: 0.75pt solid rgba(184,146,46,0.28);
}

.report-highlight.warning {
  background: #fef6ec;
  border: 0.75pt solid #8b4f0a;
}

.report-highlight.danger {
  background: #fdf0f0;
  border: 0.75pt solid #7c1a1a;
}

.report-highlight-title {
  font-family: var(--font-serif);
  font-size: 10pt;
  font-weight: 700;
  margin-bottom: 5pt;
  color: var(--primary);
}

.report-highlight.warning .report-highlight-title { color: var(--warning); }
.report-highlight.danger  .report-highlight-title { color: var(--danger); }

.report-footer {
  position: absolute;
  bottom: 15mm;
  left: 18mm;
  right: 18mm;
  border-top: 0.5pt solid #c8c2b6;
  padding-top: 7pt;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7pt;
  color: #9e9e9e;
}

.report-page-number {
  font-size: 8pt;
  color: var(--primary);
  font-weight: 600;
}

.page-break  { page-break-before: always; break-before: page; }
.no-break    { page-break-inside: avoid; break-inside: avoid; }

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ============================================================
   FLEXBOX UTILITIES
   ============================================================ */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start   { display: flex; align-items: center; justify-content: flex-start; }
.flex-end     { display: flex; align-items: center; justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.flex-gap-sm  { gap: 8px; }
.flex-gap     { gap: 16px; }
.flex-gap-lg  { gap: 24px; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ============================================================
   SPACING UTILITIES
   ============================================================ */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 28px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 28px; }

.ml-1    { margin-left: 4px; }
.ml-2    { margin-left: 8px; }
.ml-auto { margin-left: auto; }

.mr-1    { margin-right: 4px; }
.mr-2    { margin-right: 8px; }
.mr-auto { margin-right: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 14px; }
.p-4 { padding: 20px; }
.p-5 { padding: 28px; }

.px-3 { padding-left: 14px; padding-right: 14px; }
.py-3 { padding-top: 14px; padding-bottom: 14px; }

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-xs   { font-size: 12px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 22px; }
.text-2xl  { font-size: 26px; }

.text-primary   { color: var(--primary); }
.text-accent    { color: var(--accent); }
.text-gold      { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-white     { color: #ffffff; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.font-serif { font-family: var(--font-serif); }

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================================
   VISIBILITY UTILITIES
   ============================================================ */
.hidden    { display: none !important; }
.visible   { visibility: visible; }
.invisible { visibility: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
  height: 1px;
  background: var(--border-light);
}

.divider-vertical {
  border: none;
  border-left: 1px solid var(--divider);
  height: 100%;
  margin: 0 14px;
}

/* ============================================================
   ANIMATIONS & KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.50; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Animation utilities */
.animate-fade-in  { animation: fadeIn  0.22s ease both; }
.animate-slide-in { animation: slideIn 0.22s ease both; }
.animate-scale-in { animation: scaleIn 0.20s ease both; }
.animate-delay-1  { animation-delay: 0.05s; }
.animate-delay-2  { animation-delay: 0.10s; }
.animate-delay-3  { animation-delay: 0.15s; }
.animate-delay-4  { animation-delay: 0.20s; }

/* ============================================================
   GLOBAL SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: #c8c2b6; }

/* ============================================================
   RESPONSIVE — 1200px (Large tablet / small desktop)
   ============================================================ */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: var(--sidebar-width-sm);
  }

  .main-content {
    padding: 20px;
    padding-top: calc(var(--header-height) + 20px);
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .stat-card-value { font-size: 22px; }
  .stat-value      { font-size: 22px; }
}

/* ============================================================
   RESPONSIVE — 768px (Tablet)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --content-padding: 16px;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); width: 260px; }

  .sidebar.open ~ .sidebar-overlay { display: block; }

  .main-wrapper { margin-left: 0; }

  .header {
    left: 0;
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
  }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .card { padding: 16px; }
  .card-body { padding: 16px; }

  .form-row { grid-template-columns: 1fr; }

  .welcome-banner { padding: 20px; }

  .workflow-steps { flex-direction: column; align-items: flex-start; }
  .step-arrow { transform: rotate(90deg); }

  .report-page { width: 100%; padding: 20px; }

  .steps { overflow-x: auto; }

  .comparison-table { font-size: 11px; }
  .comparison-table thead th,
  .comparison-table td { padding: 8px 10px; }

  .tabs-header { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
}

/* ============================================================
   RESPONSIVE — 480px (Mobile)
   ============================================================ */
@media (max-width: 480px) {
  html { font-size: 13px; }

  .btn-large { padding: 10px 22px; }

  .modal { border-radius: var(--radius-md); }

  .toast-container,
  #toast-container {
    top: auto;
    bottom: 14px;
    right: 14px;
    left: 14px;
    max-width: none;
  }

  .form-row { grid-template-columns: 1fr; }

  .tab-bar { gap: 0; overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { padding: 10px 10px; font-size: 11px; flex-shrink: 0; white-space: nowrap; }

  .tabs-header { gap: 0; }

  .stat-card { padding: 14px 16px; }
  .stat-card-value { font-size: 20px; }
  .stat-value      { font-size: 20px; }

  .timeline { padding-left: 24px; }
  .timeline::before { left: 7px; }
  .timeline-dot { left: -21px; width: 8px; height: 8px; }

  .life-event-card { flex-wrap: wrap; }
  .life-event-amount {
    width: 100%;
    text-align: left;
    padding-top: 4px;
    border-top: 1px solid var(--divider);
  }

  .cashflow-legend { gap: 10px; }
  .grid-auto { grid-template-columns: 1fr; }
  .header-client-tag span { display: none; }
  .property-card-price { font-size: 22px; }

  .welcome-banner { padding: 16px; }
  .workflow-steps { gap: 4px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body {
    background: #ffffff;
    margin: 0;
    padding: 0;
    font-size: 10pt;
  }

  .sidebar,
  .header,
  #toast-container,
  .pdf-overlay,
  .no-print { display: none !important; }

  .main-wrapper { margin-left: 0; }
  .main-content { padding: 0; }

  .report-page {
    box-shadow: none;
    margin: 0;
    border: none;
    page-break-after: always;
  }

  .report-page:last-child { page-break-after: auto; }

  .card {
    box-shadow: none;
    border: 0.75pt solid #ddd8ce;
    break-inside: avoid;
  }

  .report-table { font-size: 8pt; }

  a { text-decoration: none; color: inherit; }

  h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; }

  table, figure { page-break-inside: avoid; break-inside: avoid; }

  .stat-card { box-shadow: none; border: 0.75pt solid #ddd8ce; }
  .badge { border: 0.75pt solid currentColor; }

  @page {
    margin: 15mm 18mm;
    size: A4 portrait;
  }
}

/* ============================================================
   DASHBOARD — AI GENERATIVE DESIGN
   ============================================================ */

/* ── Hero Banner ─────────────────────────────────────────── */
.db-hero {
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 40%, #1a2e4a 70%, #0f2540 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 160px;
  border: 1px solid rgba(184,146,46,0.25);
}

.db-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: orbPulse 6s ease-in-out infinite;
}
.db-orb-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(184,146,46,0.35) 0%, transparent 70%);
  top: -80px; right: 80px;
  animation-delay: 0s;
}
.db-orb-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(26,80,130,0.5) 0%, transparent 70%);
  bottom: -60px; right: 200px;
  animation-delay: 2s;
}
.db-orb-3 {
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(184,146,46,0.2) 0%, transparent 70%);
  top: 20px; left: 40%;
  animation-delay: 4s;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.7; }
  50%       { transform: scale(1.15) translateY(-12px); opacity: 1; }
}

.db-hero-content { position: relative; z-index: 1; }

.db-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.db-hero-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: dotBlink 2s ease-in-out infinite;
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent); }
  50%       { opacity: 0.4; box-shadow: none; }
}

.db-hero-greeting {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.db-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
}
.db-hero-date {
  font-size: 12px;
  color: rgba(184,146,46,0.8);
  letter-spacing: 0.05em;
}

.db-hero-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(184,146,46,0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.db-hero-badge-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent) 0%, #d4aa4e 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.db-hero-badge-icon .material-icons { font-size: 22px; }
.db-hero-badge-text {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  line-height: 1.4;
}
.db-hero-badge-text span {
  color: var(--accent);
  font-weight: 700;
}

/* ── KPI Cards ────────────────────────────────────────────── */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.db-kpi-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}
.db-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.db-kpi-blue {
  background: linear-gradient(135deg, #0d1f3c 0%, #1a3a5c 100%);
  border-color: rgba(74,144,217,0.3);
}
.db-kpi-gold {
  background: linear-gradient(135deg, #1a150a 0%, #2e2210 100%);
  border-color: rgba(184,146,46,0.35);
}
.db-kpi-teal {
  background: linear-gradient(135deg, #071c1c 0%, #0e2e2e 100%);
  border-color: rgba(77,182,172,0.3);
}
.db-kpi-action {
  background: linear-gradient(135deg, #0a1628 0%, #122040 100%);
  border-color: rgba(184,146,46,0.2);
  border-style: dashed;
}
.db-kpi-action:hover { border-style: solid; border-color: var(--accent); }

.db-kpi-icon-wrap {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.db-kpi-blue   .db-kpi-icon-wrap { background: rgba(74,144,217,0.2);   color: #4a90d9; }
.db-kpi-gold   .db-kpi-icon-wrap { background: rgba(184,146,46,0.2);   color: var(--accent); }
.db-kpi-teal   .db-kpi-icon-wrap { background: rgba(77,182,172,0.2);   color: #4db6ac; }
.db-kpi-action .db-kpi-icon-wrap { background: rgba(184,146,46,0.15);  color: var(--accent); }
.db-kpi-icon-wrap .material-icons { font-size: 24px; }

.db-kpi-body { flex: 1; min-width: 0; }

.db-kpi-value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.db-kpi-name { font-size: 16px; word-break: break-all; }
.db-kpi-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
  font-weight: 500;
}
.db-kpi-gold .db-kpi-value { color: var(--accent); }

.db-kpi-glow {
  position: absolute;
  right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}
.db-kpi-blue   .db-kpi-glow { background: #4a90d9; }
.db-kpi-gold   .db-kpi-glow { background: var(--accent); }
.db-kpi-teal   .db-kpi-glow { background: #4db6ac; }
.db-kpi-action .db-kpi-glow { background: var(--accent); }

/* ── Pipeline ─────────────────────────────────────────────── */
.db-pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.db-pipeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.db-pipeline-header .material-icons { font-size: 18px; color: var(--accent); }

.db-pipeline-stages {
  display: flex;
  align-items: center;
  gap: 0;
}
.db-pipeline-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.db-pipeline-arrow {
  color: var(--text-muted);
  margin: 0 4px;
  margin-bottom: 28px;
  flex-shrink: 0;
}
.db-pipeline-arrow .material-icons { font-size: 14px; }

.db-pipeline-stage-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.db-pipeline-stage-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.db-pipeline-stage-icon.active {
  background: var(--primary);
  border-color: var(--accent);
  color: var(--accent);
}
.db-pipeline-stage-icon .material-icons { font-size: 18px; }
.db-pipeline-stage-count {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.db-pipeline-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}
.db-pipeline-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.8s ease;
}
.db-pipeline-stage-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* ── Section Header ───────────────────────────────────────── */
.db-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.db-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.db-section-title .material-icons { font-size: 20px; color: var(--accent); }

/* ── Client Cards Grid ────────────────────────────────────── */
.db-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.db-client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.db-client-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(184,146,46,0.4);
}
.db-client-card-active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
}

.db-client-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  position: relative;
}
.db-client-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 2px solid rgba(184,146,46,0.3);
}
.db-client-meta { flex: 1; min-width: 0; }
.db-client-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-client-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.db-client-active-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(184,146,46,0.12);
  border-radius: 99px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.db-client-active-badge .material-icons { font-size: 12px; }

.db-client-card-body {
  display: flex;
  gap: 0;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--divider);
}
.db-client-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-client-stat span { font-size: 11px; color: var(--text-muted); }
.db-client-stat strong { font-size: 13px; color: var(--text-primary); font-weight: 700; }

.db-client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
}
.db-client-actions { display: flex; gap: 6px; }

/* ── Badges ───────────────────────────────────────────────── */
.db-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.db-badge-blue  { background: rgba(74,144,217,0.15); color: #4a90d9;   border: 1px solid rgba(74,144,217,0.3); }
.db-badge-gold  { background: rgba(184,146,46,0.15); color: var(--accent); border: 1px solid rgba(184,146,46,0.3); }
.db-badge-teal  { background: rgba(77,182,172,0.15); color: #4db6ac;   border: 1px solid rgba(77,182,172,0.3); }
.db-badge-gray  { background: var(--surface-2);      color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Empty State ──────────────────────────────────────────── */
.db-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  text-align: center;
}
.db-empty-icon {
  width: 72px; height: 72px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 18px;
}
.db-empty-icon .material-icons { font-size: 36px; }
.db-empty-title { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.db-empty-sub { font-size: 13px; color: var(--text-muted); max-width: 320px; line-height: 1.6; margin-bottom: 24px; }

/* レスポンシブ */
@media (max-width: 1024px) {
  .db-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .db-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .db-hero-badge { align-self: flex-start; }
}
@media (max-width: 600px) {
  .db-kpi-row { grid-template-columns: 1fr 1fr; }
  .db-hero-greeting { font-size: 22px; }
  .db-client-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   INCOME STEPPER INPUT
   ============================================================ */
.income-stepper { display:flex; align-items:center; gap:6px; }
.income-step-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.income-step-btn:hover { background: var(--primary); color: var(--accent); border-color: var(--accent); }
.income-step-input { width: 100px !important; text-align: center; font-weight: 700; font-size: 16px !important; }
.income-step-label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ============================================================
   MODEL CASE PANEL
   ============================================================ */
.model-case-panel {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(184,146,46,0.25);
}
.model-case-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 14px;
}
.model-case-header .material-icons { color: var(--accent); font-size: 18px; }
.model-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.model-case-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(184,146,46,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; flex-direction: column; gap: 3px;
}
.model-case-btn:hover { background: rgba(184,146,46,0.15); border-color: var(--accent); }
.model-case-emoji { font-size: 18px; margin-bottom: 2px; }
.model-case-label { font-size: 12px; font-weight: 700; color: #fff; }
.model-case-sub { font-size: 11px; color: rgba(255,255,255,0.5); }

/* ============================================================
   HOUSING RATIO WIDGET
   ============================================================ */
.housing-ratio-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
}
.housing-ratio-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px;
}
.housing-ratio-title .material-icons { color: var(--accent); font-size: 20px; }
.housing-ratio-bar-area { margin-bottom: 16px; }
.housing-ratio-bar-track {
  position: relative;
  height: 20px;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  margin-bottom: 6px;
}
.housing-ratio-zone-safe     { background: linear-gradient(90deg, #1b5e20, #43a047); }
.housing-ratio-zone-moderate { background: linear-gradient(90deg, #e65100, #ffa726); }
.housing-ratio-zone-risky    { background: linear-gradient(90deg, #b71c1c, #ef5350); }
.housing-ratio-pointer {
  position: absolute;
  top: -4px; bottom: -4px;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%);
}
.housing-ratio-pointer-line {
  width: 2px; height: 28px;
  background: #000;
  border-radius: 1px;
}
.housing-ratio-pointer-label {
  font-size: 11px; font-weight: 700;
  background: #000; color: #fff;
  padding: 1px 5px; border-radius: 3px;
  margin-top: 2px; white-space: nowrap;
}
.housing-ratio-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted);
}
.housing-ratio-verdict {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.housing-ratio-verdict .material-icons { font-size: 22px; flex-shrink: 0; }
.housing-ratio-verdict-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.housing-ratio-verdict-sub { font-size: 12px; color: var(--text-secondary); }
.housing-ratio-zones { display: flex; flex-direction: column; gap: 6px; }
.housing-ratio-zone-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.housing-ratio-zone-item.current { background: var(--surface-2); font-weight: 700; }
.housing-ratio-zone-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.housing-ratio-zone-range { width: 50px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.housing-ratio-zone-label { flex: 1; }
.housing-ratio-zone-you { font-size: 11px; color: var(--accent); font-weight: 700; }

/* ============================================================
   BUY ADVANTAGE SECTION
   ============================================================ */
.buy-advantage-card {
  background: linear-gradient(135deg, #0a1628 0%, #1a3050 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 20px;
  border: 1px solid rgba(184,146,46,0.3);
}
.buy-advantage-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.buy-advantage-header > .material-icons { color: var(--accent); font-size: 24px; }
.buy-advantage-header > span:nth-child(2) { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: #fff; }
.buy-advantage-sub { font-size: 12px; color: rgba(255,255,255,0.5); }
.buy-advantage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.buy-adv-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
}
.buy-adv-icon {
  width: 44px; height: 44px;
  border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
}
.buy-adv-icon .material-icons { font-size: 22px; }
.buy-adv-icon-gold  { background: rgba(184,146,46,0.3); color: var(--accent); }
.buy-adv-icon-blue  { background: rgba(74,144,217,0.3); color: #4a90d9; }
.buy-adv-icon-green { background: rgba(67,160,71,0.3);  color: #43a047; }
.buy-adv-title { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.buy-adv-value { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.buy-adv-desc { font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.5; }

.buy-advantage-breakeven {
  display: flex; align-items: center; gap: 12px;
  background: rgba(184,146,46,0.15);
  border: 1px solid rgba(184,146,46,0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.buy-adv-be-icon .material-icons { font-size: 28px; color: var(--accent); }
.buy-adv-be-title { font-size: 14px; color: rgba(255,255,255,0.9); margin-bottom: 4px; }
.buy-adv-be-sub { font-size: 12px; color: rgba(255,255,255,0.6); }
.buy-adv-be-amount { color: var(--accent); font-family: var(--font-serif); font-size: 16px; }

@media (max-width: 768px) {
  .model-case-grid { grid-template-columns: repeat(2, 1fr); }
  .buy-advantage-grid { grid-template-columns: 1fr; }
}

/* =============================================
   心理分析テキスト入力パネル
   ============================================= */
.psych-text-panel {
  background: var(--surface-2, #f8f7f4);
  border: 1px solid var(--border, #e8e4dc);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.psych-text-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.psych-text-header .material-icons {
  font-size: 32px;
  color: var(--accent, #b8922e);
  margin-top: 2px;
  flex-shrink: 0;
}
.psych-text-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary, #0a1628);
  margin-bottom: 4px;
}
.psych-text-sub {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}
.psych-textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  border: 1.5px solid var(--border, #e0dbd2);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  color: var(--primary, #0a1628);
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.psych-textarea:focus {
  outline: none;
  border-color: var(--accent, #b8922e);
  box-shadow: 0 0 0 3px rgba(184, 146, 46, 0.12);
}
.psych-textarea::placeholder {
  color: #aaa;
  font-size: 13px;
  line-height: 1.8;
}
.psych-hint-row {
  margin: 12px 0;
}
.psych-hint {
  font-size: 12px;
  color: #888;
  background: rgba(184, 146, 46, 0.06);
  border-left: 3px solid var(--accent, #b8922e);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  line-height: 1.6;
}
.psych-analyze-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
}
.psych-analyze-btn .material-icons {
  font-size: 20px;
}

/* ============================================================
   Client Section Divider & Form Grid
   ============================================================ */
.client-section-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--primary, #0a1628);
  border-bottom: 2px solid var(--accent, #b8922e);
  padding-bottom: 8px; margin: 28px 0 18px;
  letter-spacing: 0.05em;
}
.client-section-divider .material-icons { font-size: 20px; color: var(--accent, #b8922e); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ============================================================
   FA Auto-fill Notice Banner
   ============================================================ */
.fa-auto-fill-notice {
  display: flex; align-items: center; gap: 8px;
  background: rgba(184,146,46,0.08); border: 1px solid rgba(184,146,46,0.3);
  border-radius: 8px; padding: 10px 16px; margin-bottom: 16px;
  font-size: 13px; color: #666;
}
.fa-auto-fill-notice .material-icons { font-size: 18px; color: var(--accent, #b8922e); }

/* =============================================
   銀行ローン比較テーブル
   ============================================= */
.bank-compare-table { margin: 12px 0; border: 1px solid var(--border, #e0dbd2); border-radius: 10px; overflow: hidden; }
.bank-compare-header, .bank-compare-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1fr 1fr; align-items: center; gap: 0; }
.bank-compare-header { background: var(--primary, #0a1628); color: white; font-size: 11px; font-weight: 700; padding: 10px 0; }
.bank-compare-row { padding: 12px 0; border-bottom: 1px solid var(--border, #e8e4dc); transition: background 0.15s; }
.bank-compare-row:hover { background: rgba(184,146,46,0.04); }
.bank-compare-row:last-child { border-bottom: none; }
.bct-recommended { background: rgba(184,146,46,0.06); border-left: 3px solid var(--accent, #b8922e); }
.bct-col { padding: 4px 12px; font-size: 13px; }
.bct-bank { padding-left: 14px; }
.bct-badge { display: inline-block; background: var(--accent,#b8922e); color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-bottom: 4px; }
.bct-name { font-weight: 700; font-size: 13px; color: var(--primary, #0a1628); }
.bct-type { font-size: 11px; color: #888; }
.bct-warning { font-size: 11px; color: #e53935; }
.bct-highlight { font-size: 15px; font-weight: 700; color: var(--primary, #0a1628); }
@media (max-width: 600px) { .bct-hide-sm { display: none; } .bank-compare-header, .bank-compare-row { grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1fr; } }

/* ============================================================
   REMOTE SETTINGS (リモート設定)
   ============================================================ */

.remoteset-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.remoteset-toggle-info {
  flex: 1;
  min-width: 0;
}

.remoteset-toggle-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.remoteset-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.toggle-label-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Remote session history */
.remote-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.remote-history-item {
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.remote-history-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.remote-history-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remote-history-header > .material-icons {
  font-size: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.remote-history-meta {
  flex: 1;
  min-width: 0;
}

.remote-history-client {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.remote-history-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.remote-history-platform {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent-pale);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.remote-history-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== New vs Used (NVU) Tab ===== */
.nvu-summary-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
}

.nvu-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.nvu-new {
  background: #e3f2fd;
  color: #1565c0;
}

.nvu-used {
  background: #e8f5e9;
  color: #2e7d32;
}

.nvu-sum-label {
  font-weight: 600;
  font-size: 14px;
}

.nvu-sum-count {
  font-size: 28px;
  font-weight: 800;
  margin-left: auto;
}

.nvu-summary-divider {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nvu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nvu-table thead th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.nvu-table tbody tr:nth-child(even) {
  background: var(--surface-2);
}

.nvu-table tbody tr:hover {
  background: var(--accent-pale);
}

.nvu-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.5;
}

.nvu-item-label {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  width: 120px;
}

.nvu-cell-win {
  background: rgba(46,125,50,0.07) !important;
  font-weight: 600;
}

.nvu-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.nvu-badge-new  { background: #e3f2fd; color: #1565c0; }
.nvu-badge-used { background: #e8f5e9; color: #2e7d32; }
.nvu-badge-eq   { background: var(--surface-2); color: var(--text-muted); }

/* ===== Housing Cost Guideline ===== */
.guideline-card {
  background: linear-gradient(135deg, #f8f6f2 0%, #fff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 20px;
}

.guideline-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}

.guideline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.guideline-stat {
  text-align: center;
  padding: 10px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.guideline-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.guideline-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.guideline-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--accent-pale);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}
