/* ================================================================
   Global Trade Quoting Tool — styles.css (Modern UI)
   ================================================================ */

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

:root {
  --primary:        #FA1D4C;
  --primary-light:  #ff4d72;
  --primary-hover:  #e01040;
  --primary-glow:   rgba(250,29,76,.15);
  --accent:         #f59e0b;
  --accent-light:   #fffbeb;
  --success:        #059669;
  --success-light:  #d1fae5;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --info:           #0ea5e9;
  --info-light:     #e0f2fe;
  --purple:         #7c3aed;
  --purple-light:   #ede9fe;
  --pink:           #db2777;
  --pink-light:     #fce7f3;

  --bg:             #f1f5f9;
  --card:           #ffffff;
  --sidebar-bg:     #0d0d0d;
  --sidebar-hover:  rgba(255,255,255,.07);
  --sidebar-active: rgba(250,29,76,.18);
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --border:         #e2e8f0;
  --border-focus:   #FA1D4C;
  --shadow-sm:      0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:         0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  --shadow-lg:      0 20px 60px rgba(15,23,42,.15), 0 4px 16px rgba(15,23,42,.08);
  --shadow-glow:    0 0 0 3px var(--primary-glow);
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition:     .18s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }

/* ---- Background texture ---- */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 300px; z-index: -1;
  background: linear-gradient(135deg, #0d0d0d 0%, #7a0020 50%, #FA1D4C 100%);
  opacity: .06;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
}

.sidebar-header {
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.sidebar-logo-img { width: 140px; height: auto; display: block; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 16px; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -.3px; }
.logo-sub   { font-size: 9.5px; color: var(--accent); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-top: 1px; }

.sidebar-section { padding: 18px 10px 6px; }
.sidebar-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.28); padding: 0 8px 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 1px 0; border-radius: var(--radius);
  color: rgba(255,255,255,.6);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  position: relative;
}
.nav-item svg { flex-shrink: 0; opacity: .7; transition: opacity var(--transition); }
.nav-item:hover  { background: var(--sidebar-hover); color: rgba(255,255,255,.9); transform: translateX(2px); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-footer .version { font-size: 11px; color: rgba(255,255,255,.22); text-align: center; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.page-header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 22px 28px; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.page-header p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }
.page-body { padding: 24px 28px; flex: 1; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, #fafbfc, #fff);
}
.card-header h2 { font-size: 15px; font-weight: 700; }
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body  { padding: 22px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfc; display: flex; gap: 8px; justify-content: flex-end; }

/* ================================================================
   STAT CARDS (dashboard)
   ================================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden; position: relative;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::after   { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.stat-card.green::after  { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::after { background: linear-gradient(90deg, #f59e0b, #f97316); }
.stat-card.purple::after { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.stat-icon.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.stat-icon.green  { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.stat-icon.orange { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.stat-card .stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1; letter-spacing: -.5px; margin-bottom: 4px; }
.stat-card .stat-sub   { font-size: 12px; color: var(--text-muted); }

/* ================================================================
   ANALYTICS — Status Breakdown, Monthly Trend, Top Customers
   ================================================================ */
.analytics-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
@media (max-width: 900px) { .analytics-row { grid-template-columns: 1fr; } }

/* Status breakdown horizontal bars */
.status-row {
  display: grid; grid-template-columns: 110px 1fr 40px;
  align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: 0; }
.status-row-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); text-transform: capitalize;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.status-row-bar {
  position: relative; height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.status-row-fill {
  height: 100%; border-radius: 99px; transition: width .4s ease;
}
.status-row-count {
  font-size: 14px; font-weight: 700; color: var(--text); text-align: right;
}

/* Monthly trend bars */
.trend-chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; height: 180px; padding: 10px 0 0;
}
.trend-bar-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; gap: 6px;
}
.trend-bar-count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  min-height: 14px;
}
.trend-bar {
  width: 100%; max-width: 50px;
  background: linear-gradient(180deg, var(--primary) 0%, #5a0018 100%);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height .5s ease;
  cursor: default;
}
.trend-bar:hover { opacity: .85; }
.trend-bar-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .4px;
}

/* Top customers */
.top-customer-row {
  display: grid; grid-template-columns: 40px minmax(140px, 1.4fr) 1.6fr auto;
  align-items: center; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.top-customer-row:last-child { border-bottom: 0; }
.top-customer-rank {
  font-size: 14px; font-weight: 800; color: var(--primary);
  background: #fff1f3; border-radius: 8px; padding: 6px 0; text-align: center;
}
.top-customer-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-customer-bar {
  position: relative; height: 10px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.top-customer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ff5070);
  border-radius: 99px; transition: width .4s ease;
}
.top-customer-stats {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.top-customer-stats .text-muted { font-weight: 400; }

/* Country rows (IOR Destinations / EOR Origins) */
.country-row {
  display: grid; grid-template-columns: minmax(100px, 1.4fr) 2fr auto;
  align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.country-row:last-child { border-bottom: 0; }
.country-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.country-bar {
  position: relative; height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.country-fill {
  height: 100%; border-radius: 99px; transition: width .4s ease;
}
.country-fill-ior { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.country-fill-eor { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.country-stats {
  font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.country-stats .text-muted { font-weight: 500; }

/* Trade lanes */
.lane-row {
  display: grid; grid-template-columns: 36px minmax(160px, 1.4fr) 1.2fr auto;
  align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.lane-row:last-child { border-bottom: 0; }
.lane-rank {
  font-size: 12px; font-weight: 800; color: var(--primary);
  background: #fff1f3; border-radius: 6px; padding: 5px 0; text-align: center;
}
.lane-route {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden;
}
.lane-country {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lane-arrow { color: var(--primary); font-weight: 700; }
.lane-bar {
  position: relative; height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.lane-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #ff5070);
  transition: width .4s ease;
}
.lane-stats {
  font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.lane-stats .text-muted { font-weight: 500; }

/* Service mix stacked bar */
.service-mix-bar {
  display: flex; height: 40px; border-radius: 8px; overflow: hidden;
  margin: 10px 0 18px; box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}
.service-mix-segment {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
  transition: flex .4s ease;
}
.service-mix-legend {
  display: flex; flex-direction: column; gap: 10px;
}
.service-legend-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
}
.service-legend-item .text-muted { margin-left: 4px; }

/* Expiring soon alert */
.alert-banner {
  display: flex; gap: 14px; padding: 14px 18px;
  border-radius: var(--radius); margin-bottom: 24px;
  border: 1px solid transparent;
}
.alert-warning {
  background: #fffbeb; border-color: #fcd34d; color: #78350f;
}
.alert-icon {
  font-size: 24px; line-height: 1;
}
.alert-body { flex: 1; }
.alert-title {
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.alert-list {
  display: flex; flex-direction: column; gap: 4px;
}
.alert-item {
  font-size: 12.5px; color: #78350f; text-decoration: none;
  padding: 3px 0; transition: opacity .15s;
}
.alert-item:hover { opacity: .7; text-decoration: underline; }
.alert-item strong { color: var(--primary); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition); text-decoration: none;
  white-space: nowrap; letter-spacing: -.1px;
}
.btn svg { flex-shrink: 0; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; box-shadow: 0 2px 8px rgba(30,64,175,.35);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover) 0%, #2563eb 100%); box-shadow: 0 4px 16px rgba(30,64,175,.4); transform: translateY(-1px); }

.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(5,150,105,.4); transform: translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.btn-danger:hover { transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, #d97706, var(--accent));
  color: #fff; box-shadow: 0 2px 8px rgba(217,119,6,.3);
}
.btn-accent:hover { transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid #bfdbfe;
}
.btn-outline:hover { background: #eff6ff; border-color: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }

.btn-sm  { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg  { padding: 12px 24px; font-size: 14.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ================================================================
   FORMS
   ================================================================ */
.form-grid   { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: #374151; }
.form-group label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  padding: 9px 13px; border: 1.5px solid #d1d5db; border-radius: var(--radius);
  font-size: 13.5px; font-family: var(--font); color: var(--text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition); width: 100%;
}
.form-control:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}
.form-control::placeholder { color: #c4c9d4; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.form-hint  { font-size: 11.5px; color: var(--text-muted); }
.form-error { font-size: 11.5px; color: var(--danger); }
.form-row   { display: flex; gap: 12px; align-items: flex-end; }
.form-row > * { flex: 1; }
.form-row .form-group-narrow { flex: 0 0 90px; }

/* Radio cards */
.radio-group { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-card {
  flex: 1; min-width: 130px; border: 2px solid #e5e7eb; border-radius: var(--radius-lg);
  padding: 16px 18px; cursor: pointer; transition: all var(--transition); position: relative;
  background: #fff;
}
.radio-card:hover { border-color: #93c5fd; background: #f0f7ff; transform: translateY(-1px); box-shadow: var(--shadow); }
.radio-card.selected {
  border-color: var(--primary); background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.1), var(--shadow);
}
.radio-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card .rc-icon  { font-size: 26px; margin-bottom: 8px; }
.radio-card .rc-label { font-size: 15px; font-weight: 800; color: var(--text); }
.radio-card .rc-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.radio-card.selected .rc-label { color: var(--primary); }

/* Toggle */
.fee-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #d1d5db; border-radius: 20px;
  transition: .25s; cursor: pointer;
}
.toggle-slider:before {
  content: ''; position: absolute; width: 14px; height: 14px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary-light); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }

/* ================================================================
   STEPPER
   ================================================================ */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step-item { display: flex; align-items: center; flex: 1; }
.step-item:last-child { flex: 0; }
.step-bubble {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; transition: all .25s;
  border: 2px solid #d1d5db; background: #fff; color: var(--text-muted);
}
.step-item.active .step-bubble  { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(30,64,175,.15); }
.step-item.done  .step-bubble   { border-color: var(--success); background: var(--success); color: #fff; }
.step-info { margin-left: 10px; }
.step-info .step-num   { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.step-info .step-label { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.step-item.active .step-label { color: var(--primary); }
.step-item.done  .step-label  { color: var(--success); }
.step-line { flex: 1; height: 2px; background: #e5e7eb; margin: 0 10px; border-radius: 2px; }
.step-line.done { background: var(--success); }

/* ================================================================
   TABLE
   ================================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: linear-gradient(to bottom, #f8fafc, #f1f5f9); }
th {
  padding: 11px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted);
  border-bottom: 2px solid var(--border); text-align: left; white-space: nowrap;
}
td { padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f8fafc; }
.td-right  { text-align: right; }
.td-center { text-align: center; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-draft    { background: #f1f5f9; color: #64748b; }
.badge-sent     { background: #e0f2fe; color: #0369a1; }
.badge-accepted { background: #d1fae5; color: #065f46; }
.badge-declined { background: #fee2e2; color: #991b1b; }
.badge-expired  { background: #f8fafc; color: #94a3b8; }
.badge-ior      { background: #ede9fe; color: #6d28d9; }
.badge-eor      { background: #fce7f3; color: #9d174d; }
.badge-both     { background: #fff1f3; color: #FA1D4C; }

/* ================================================================
   FEE ROWS (Step 3)
   ================================================================ */
.fee-row {
  display: grid; grid-template-columns: 40px 1fr 100px 130px 120px 36px;
  gap: 10px; align-items: center; padding: 12px 14px;
  border: 1.5px solid #e5e7eb; border-radius: var(--radius);
  margin-bottom: 8px; background: #fff; transition: all var(--transition);
}
.fee-row.disabled { opacity: .45; background: #fafbfc; }
.fee-row:hover    { border-color: #bfdbfe; box-shadow: var(--shadow-sm); }
.fee-row .fee-label  { font-size: 13px; font-weight: 600; }
.fee-row .fee-note   { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.fee-row .fee-amount { font-size: 13.5px; font-weight: 700; color: var(--primary); text-align: right; }

.fee-totals-box {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 20px 22px; margin-top: 22px;
  box-shadow: 0 8px 24px rgba(30,64,175,.3);
}
.fee-totals-box .totals-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.fee-totals-box .totals-row.total-line { border-top: 1px solid rgba(255,255,255,.2); margin-top: 10px; padding-top: 14px; }
.fee-totals-box .totals-label { font-size: 13px; opacity: .8; }
.fee-totals-box .totals-value { font-size: 14px; font-weight: 700; }
.fee-totals-box .totals-row.total-line .totals-label { font-size: 15px; opacity: 1; font-weight: 700; }
.fee-totals-box .totals-row.total-line .totals-value { font-size: 22px; color: var(--accent); font-weight: 900; letter-spacing: -.5px; }

/* ================================================================
   REVIEW (Step 4)
   ================================================================ */
.review-section { margin-bottom: 22px; }
.review-section h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.review-item .rv-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.review-item .rv-value { font-size: 13.5px; font-weight: 500; color: var(--text); }

/* ================================================================
   QUOTE LIST FILTERS
   ================================================================ */
.quote-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.quote-filters .search-box { position: relative; flex: 1; min-width: 220px; }
.quote-filters .search-box .form-control { padding-left: 36px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.filter-select {
  padding: 9px 14px; border: 1.5px solid #d1d5db; border-radius: var(--radius);
  font-size: 13px; background: #fff; color: var(--text); cursor: pointer;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
  transition: border-color var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--shadow-glow); }

/* ================================================================
   MODAL
   ================================================================ */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; z-index: 1; background: var(--card); border-radius: var(--radius-xl);
  width: 92%; max-width: 820px; max-height: 92vh; display: flex; flex-direction: column;
  margin: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.92) translateY(20px); } to { opacity: 1; transform: none; } }

.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, #fafbfc, #fff); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h2 { font-size: 17px; font-weight: 800; }
.modal-close {
  background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 8px;
  font-size: 18px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: #e2e8f0; color: var(--text); transform: rotate(90deg); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: #fafbfc; border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ================================================================
   QUOTE PAPER (preview)
   ================================================================ */
.quote-paper {
  background: #fff; border: 1px solid #e8ecf0; border-radius: 6px;
  padding: 36px 40px; font-family: 'Georgia', serif; font-size: 12px;
  max-width: 700px; margin: 0 auto; box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.qp-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 3px solid var(--primary); }
.qp-company-name { font-size: 20px; font-weight: bold; color: var(--primary); font-family: var(--font); }
.qp-company-sub  { font-size: 11px; color: var(--text-muted); font-family: var(--font); margin-top: 2px; }
.qp-company-info { font-size: 11px; color: var(--text-muted); margin-top: 8px; line-height: 1.7; font-family: var(--font); }
.qp-title-block  { text-align: right; }
.qp-title { font-size: 28px; font-weight: bold; color: var(--primary); letter-spacing: 3px; font-family: var(--font); }
.qp-ref  { font-size: 12px; font-family: var(--font); color: var(--text); margin-top: 4px; }
.qp-date { font-size: 11px; font-family: var(--font); color: var(--text-muted); margin-top: 2px; }

.qp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 24px; }
.qp-meta-block h4 { font-size: 9.5px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-family: var(--font); margin-bottom: 8px; padding-bottom: 5px; border-bottom: 2px solid #e5e7eb; }
.qp-meta-block p  { font-size: 11.5px; line-height: 1.7; font-family: var(--font); color: var(--text); }
.qp-meta-block .lbl { color: var(--text-muted); font-size: 10.5px; }

.qp-table-title { font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-family: var(--font); margin-bottom: 6px; }
.qp-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.qp-table thead tr { background: var(--primary); }
.qp-table thead th { color: #fff; padding: 8px 10px; font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px; font-family: var(--font); text-align: left; }
.qp-table thead th:last-child { text-align: right; }
.qp-table tbody tr:nth-child(even) { background: #f8fafc; }
.qp-table tbody td { padding: 8px 10px; font-size: 11.5px; border-bottom: 1px solid #eee; font-family: var(--font); }
.qp-table tbody td:last-child { text-align: right; font-weight: 600; }

.qp-totals { margin-bottom: 22px; }
.qp-total-row { display: flex; justify-content: flex-end; padding: 4px 0; }
.qp-total-row .tl { width: 160px; font-size: 11.5px; color: var(--text-muted); font-family: var(--font); }
.qp-total-row .tv { width: 130px; text-align: right; font-size: 12px; font-weight: 600; font-family: var(--font); }
.qp-total-row.grand { background: linear-gradient(135deg, #1e3a8a, #1e40af); color: #fff; border-radius: 6px; padding: 10px 14px; margin-top: 8px; }
.qp-total-row.grand .tl { font-size: 14px; font-weight: bold; color: #fff; }
.qp-total-row.grand .tv { font-size: 16px; font-weight: 900; color: #fbbf24; }

.qp-section-title { font-size: 9.5px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-family: var(--font); margin-bottom: 5px; }
.qp-notes   { margin-bottom: 18px; }
.qp-notes p { font-size: 11px; font-family: var(--font); color: var(--text); line-height: 1.7; }
.qp-terms { margin-bottom: 22px; }
.qp-terms p { font-size: 10.5px; font-family: var(--font); color: var(--text-muted); line-height: 1.8; white-space: pre-line; }
.qp-footer { border-top: 2px solid var(--primary); padding-top: 16px; display: flex; justify-content: space-between; align-items: flex-end; }
.qp-sig-line { border-bottom: 1px solid #94a3b8; width: 180px; margin-bottom: 5px; height: 30px; }
.qp-sig p { font-size: 10px; color: var(--text-muted); font-family: var(--font); margin-top: 1px; }
.qp-badge {
  background: linear-gradient(135deg, #1e3a8a, #1e40af); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 10px; font-weight: bold;
  font-family: var(--font); text-align: center; box-shadow: 0 4px 12px rgba(30,64,175,.3);
}
.qp-badge span { display: block; font-size: 17px; font-weight: 900; color: #fbbf24; margin: 3px 0; }

/* ================================================================
   SETTINGS
   ================================================================ */
.settings-tabs { display: flex; gap: 0; border-bottom: 2px solid #f1f5f9; margin-bottom: 24px; padding-bottom: 0; }
.settings-tab {
  padding: 10px 20px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2.5px solid transparent; cursor: pointer; transition: all var(--transition);
  margin-bottom: -2px;
}
.settings-tab.active  { color: var(--primary); border-bottom-color: var(--primary); }
.settings-tab:hover:not(.active) { color: var(--text); }

.fee-default-row {
  display: grid; grid-template-columns: 40px 1fr 90px 110px 1fr 34px;
  gap: 8px; align-items: center; padding: 10px 12px;
  border: 1.5px solid #e5e7eb; border-radius: var(--radius); margin-bottom: 6px; background: #fff;
  transition: all var(--transition);
}
.fee-default-row:hover { border-color: #bfdbfe; }
.fee-default-row.disabled { opacity: .45; background: #fafbfc; }

/* ================================================================
   ACTION MENU
   ================================================================ */
.action-menu { position: relative; display: inline-block; }
.action-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 200;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); min-width: 170px; overflow: hidden; display: none;
  animation: dropIn .15s ease-out;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.action-dropdown.open { display: block; }
.action-dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; background: none; border: none; font-size: 13px;
  color: var(--text); cursor: pointer; text-align: left; transition: background var(--transition);
}
.action-dropdown button:hover { background: #f8fafc; }
.action-dropdown button.danger { color: var(--danger); }
.action-dropdown button.danger:hover { background: #fff5f5; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state { text-align: center; padding: 64px 20px; }
.empty-state .es-icon { font-size: 52px; margin-bottom: 14px; opacity: .25; }
.empty-state h3 { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ================================================================
   TOAST
   ================================================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #0f172a; color: #fff; padding: 13px 20px; border-radius: var(--radius-lg);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0; transition: all .35s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; gap: 10px; max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: linear-gradient(135deg, #065f46, #059669); }
.toast.error   { background: linear-gradient(135deg, #991b1b, #dc2626); }
.toast.warning { background: linear-gradient(135deg, #92400e, #d97706); }

/* ================================================================
   HELPERS
   ================================================================ */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-small  { font-size: 12px; }
.font-bold   { font-weight: 700; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mb-0        { margin-bottom: 0 !important; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.mt-16       { margin-top: 16px; }
.divider     { border: none; border-top: 1px solid #f1f5f9; margin: 22px 0; }
.required-note { font-size: 11.5px; color: var(--text-muted); margin-bottom: 16px; }

/* Info callout */
.info-callout {
  background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px;
  color: #1d4ed8; margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start;
}

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, #0d0d0d 0%, #5a0018 55%, #FA1D4C 100%);
  border-radius: var(--radius-xl); padding: 28px 32px; margin-bottom: 22px;
  color: #fff; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 8px 32px rgba(250,29,76,.3); overflow: hidden; position: relative;
}
.welcome-banner::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.welcome-banner::after {
  content: ''; position: absolute; bottom: -60px; right: 80px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.wb-title { font-size: 22px; font-weight: 900; letter-spacing: -.4px; margin-bottom: 6px; }
.wb-sub   { font-size: 13.5px; opacity: .8; }
.wb-logo {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.wb-logo-img {
  height: 160px; width: auto; display: block; max-width: 260px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
}
.wb-tagline {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; opacity: .75;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .fee-row { grid-template-columns: 36px 1fr 100px 80px; }
  .fee-row .fee-note, .fee-row .fee-type-col { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .sidebar { width: 60px; min-width: 60px; }
  .logo-text, .nav-item span, .sidebar-section-label, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item::before { display: none; }
  .page-header { padding: 16px 18px; }
  .page-body   { padding: 16px 18px; }
  .welcome-banner { padding: 20px; }
  .wb-title { font-size: 17px; }
}

/* ================================================================
   LOGIN SCREEN
   ================================================================ */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0d0d0d 0%, #2a0010 60%, #FA1D4C 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-screen.hidden { display: none; }
.login-card {
  background: #fff; border-radius: 20px; padding: 52px 48px;
  text-align: center; max-width: 420px; width: 90%;
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
}
.login-logo { width: 220px; height: auto; margin-bottom: 20px; }
.login-title { font-size: 22px; font-weight: 900; color: #0d0d0d; margin-bottom: 8px; letter-spacing: -.4px; }
.login-sub { font-size: 14px; color: #64748b; margin-bottom: 36px; line-height: 1.6; }
.btn-ms {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  width: 100%; padding: 14px 20px; border-radius: 10px;
  background: #fff; border: 1.5px solid #e2e8f0; color: #0d0d0d;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: var(--transition); box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn-ms:hover { background: #fef2f4; border-color: #FA1D4C; box-shadow: 0 4px 16px rgba(250,29,76,.15); }
.btn-ms:disabled { opacity: .6; cursor: not-allowed; }
.login-status { font-size: 13px; color: #64748b; margin-top: 16px; min-height: 20px; }
.login-status.error { color: #dc2626; }

/* ================================================================
   SIDEBAR USER INFO
   ================================================================ */
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 0 8px; }
.su-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.su-info { min-width: 0; }
.su-name  { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-email { font-size: 10px; color: rgba(255,255,255,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-signout {
  width: 100%; padding: 7px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12);
  background: transparent; color: rgba(255,255,255,.5); font-size: 12px; cursor: pointer;
  transition: var(--transition); margin-top: 4px;
}
.btn-signout:hover { background: rgba(250,29,76,.15); color: #fff; border-color: rgba(250,29,76,.3); }

/* ================================================================
   CUSTOMER PICKER (wizard autocomplete)
   ================================================================ */
.customer-picker { position: relative; }
.customer-picker-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 280px; overflow-y: auto;
  z-index: 50; display: none;
}
.customer-picker-results.open { display: block; }
.customer-picker-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.customer-picker-item:last-child { border-bottom: none; }
.customer-picker-item:hover { background: #f5f5f5; }
.customer-picker-empty {
  padding: 12px; color: var(--text-muted); font-size: 13px; font-style: italic;
}

