@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');
  @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&family=Inter:wght@400;500;600&display=swap');
  :root {
    --bg-page: #f0f4f8;
    --bg-card: #ffffff;
    --bg-input: #f7f9fc;
    --bg-hover: #f0f6ff;
    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-muted: #8896a6;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-light: #dbeafe;
    --blue-bg: #eff6ff;
    --red: #dc2626;
    --red-light: #fee2e2;
    --red-bg: #fef2f2;
    --yellow: #d97706;
    --yellow-light: #fef3c7;
    --yellow-bg: #fffbeb;
    --green: #16a34a;
    --green-light: #dcfce7;
    --green-bg: #f0fdf4;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  }
  * { margin:0; padding:0; box-sizing:border-box; }
  body {
    font-family: 'Be Vietnam Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
  }
  .container { max-width: 1440px; margin: 0 auto; padding: 24px; }

  /* Header */
  .header {
    text-align: center;
    padding: 28px 24px 24px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #1e40af, #2563eb, #3b82f6);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
  }
  .header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
  }
  .header-logo-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
  }
  .header-logo-wrap {
    background: rgba(255,255,255,0.13);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 12px;
    padding: 12px 20px 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  }
  .header-logo-wrap:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  }
  .header-logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
  }
  .header-logo-name {
    font-family: 'Montserrat', 'Be Vietnam Pro', sans-serif;
    font-size: 1.45em;
    font-weight: 900;
    letter-spacing: 0.03em;
    display: flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
  }
  .header-logo-name .hada { color: #ffffff; }
  .header-logo-name .plus { color: #f59e0b; }
  .header-logo-vn {
    font-family: 'Montserrat', 'Be Vietnam Pro', sans-serif;
    font-size: 0.6em;
    font-weight: 700;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 3px;
  }
  .header-logo-divider {
    width: 1px;
    height: 44px;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
  }
  .header-logo-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .header-logo-tagline {
    font-family: 'Inter', 'Be Vietnam Pro', sans-serif;
    font-size: 0.8em;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .header-logo-hotline {
    font-family: 'Montserrat', 'Be Vietnam Pro', sans-serif;
    font-size: 0.78em;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 0.04em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .header-logo-hotline::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
    animation: pulse-dot 1.8s ease-in-out infinite;
  }
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
  }
  .header h1 {
    font-size: 1.85em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    position: relative;
  }
  .header p { color: rgba(255,255,255,0.85); font-size: 0.95em; position: relative; }

  /* Cards */
  .card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
  }
  .card:hover { box-shadow: var(--shadow); }
  .card-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--blue-light);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .card-title .icon { font-size: 1.15em; }

  /* Grid layouts */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }

  /* Form elements */
  .form-group { margin-bottom: 14px; }
  .form-group label {
    display: block;
    font-size: 0.82em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
  }
  .form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.93em;
    font-family: inherit;
    transition: all 0.2s;
  }
  .form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #fff;
  }
  .form-group input::placeholder { color: var(--text-muted); }
  .form-group .unit { font-size: 0.78em; color: var(--text-muted); }

  /* Buttons */
  .btn {
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .btn-primary { background: var(--blue); color: #fff; }
  .btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
  .btn-secondary { background: #fff; color: var(--text-secondary); border: 1.5px solid var(--border); }
  .btn-secondary:hover { background: var(--bg-input); border-color: var(--blue); color: var(--blue); }
  .btn-danger { background: var(--red); color: #fff; }
  .btn-danger:hover { background: #b91c1c; }
  .btn-success { background: var(--green); color: #fff; }
  .btn-success:hover { background: #15803d; }
  .btn-sm { padding: 7px 14px; font-size: 0.82em; }

  /* Result boxes */
  .result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
  .result-box {
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    border: 1.5px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .result-box:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .result-box.breakeven { background: var(--yellow-bg); border-color: #fbbf24; }
  .result-box.profit { background: var(--green-bg); border-color: #86efac; }
  .result-box.info { background: var(--blue-bg); border-color: #93c5fd; }
  .result-box .label { font-size: 0.78em; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
  .result-box .value { font-size: 1.4em; font-weight: 700; }
  .result-box.breakeven .value { color: var(--yellow); }
  .result-box.profit .value { color: var(--green); }
  .result-box.info .value { color: var(--blue); }
  .result-box .sub { font-size: 0.75em; color: var(--text-muted); margin-top: 4px; }

  /* Table */
  .table-wrapper { overflow-x: auto; margin-top: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
  table { width: 100%; border-collapse: collapse; font-size: 0.87em; }
  thead th {
    background: var(--blue);
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.85em;
  }
  thead th:first-child { border-radius: 7px 0 0 0; }
  thead th:last-child { border-radius: 0 7px 0 0; }
  tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  tbody tr:hover { background: var(--bg-hover); }
  tbody tr:nth-child(even) { background: #fafbfd; }
  tbody tr:nth-child(even):hover { background: var(--bg-hover); }
  .text-right { text-align: right; }
  .text-center { text-align: center; }
  .text-green { color: var(--green); font-weight: 600; }
  .text-yellow { color: var(--yellow); font-weight: 600; }
  .text-red { color: var(--red); font-weight: 600; }

  /* Fee summary bar */
  .fee-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    background: var(--blue-bg);
    border: 1.5px solid var(--blue-light);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .fee-summary .fee-item { font-size: 0.88em; color: var(--text-secondary); }
  .fee-summary .fee-item span { color: var(--blue); font-weight: 700; }

  /* Toggle */
  .seller-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
    width: fit-content;
  }
  .seller-toggle button {
    padding: 9px 22px;
    border: none;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
  }
  .seller-toggle button:first-child { border-right: 1.5px solid var(--border); }
  .seller-toggle button.active {
    background: var(--blue);
    color: #fff;
  }
  .seller-toggle button:hover:not(.active) { background: var(--blue-bg); color: var(--blue); }

  /* Actions bar */
  .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

  /* Empty state */
  .empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
  }
  .empty-state-icon { font-size: 2.5em; margin-bottom: 10px; opacity: 0.4; }

  /* Margin inputs */
  .margin-inputs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .margin-inputs input {
    width: 68px;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9em;
    font-family: inherit;
    text-align: center;
  }
  .margin-inputs input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
  .margin-inputs span { color: var(--text-secondary); font-size: 0.85em; font-weight: 500; }

  .cost-rows {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }
  .cost-rows-header {
    display: grid;
    grid-template-columns: minmax(130px, 1.4fr) minmax(110px, 1fr) minmax(105px, 0.8fr) 42px;
    gap: 8px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .cost-rows-header .vat-col {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--blue);
  }
  .cost-rows-header .vat-col input[type="checkbox"] {
    width: 12px; height: 12px;
    accent-color: var(--blue);
    cursor: pointer;
    margin: 0;
  }
  .cost-row {
    display: grid;
    grid-template-columns: minmax(130px, 1.4fr) minmax(110px, 1fr) minmax(105px, 0.8fr) auto;
    gap: 8px;
    align-items: center;
  }
  .cost-row-vat-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .cost-row-vat-wrap input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--blue);
    cursor: pointer;
    flex-shrink: 0;
  }
  .cost-row-vat-amt {
    flex: 1;
    min-width: 0;
  }
  .cost-row-vat-amt:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }
  .cost-row input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.93em;
    font-family: inherit;
  }
  .cost-row input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #fff;
  }
  .cost-row-remove {
    height: 42px;
    min-width: 42px;
    border: 1.5px solid #fecaca;
    background: #fff;
    color: var(--red);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
  }
  .cost-row-remove:hover {
    background: var(--red-bg);
  }
  .cost-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
  }

  /* Responsive */
  @media (max-width: 960px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 600px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .cost-row { grid-template-columns: 1fr; }
    .container { padding: 12px; }
    .header h1 { font-size: 1.3em; }
    .header { padding: 20px 14px 18px; }
    .header-logo-name { font-size: 1.15em; }
    .header-logo-wrap { padding: 9px 14px; gap: 12px; }
    .header-logo-divider { height: 36px; }
    .header-logo-tagline { font-size: 0.72em; }
    .header-logo-hotline { font-size: 0.7em; }
  }

  /* Collapsible */
  .collapsible-header { cursor: pointer; user-select: none; }
  .collapsible-header::after {
    content: ' [Thu gọn]';
    font-size: 0.72em;
    color: var(--text-muted);
    font-weight: 400;
  }
  .collapsible-header.collapsed::after { content: ' [Mở rộng]'; }

  /* Autocomplete search */
  .search-wrapper { position: relative; }
  .search-wrapper input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.93em;
    font-family: inherit;
    transition: all 0.2s;
  }
  .search-wrapper input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #fff;
  }
  .search-wrapper input::placeholder { color: var(--text-muted); }
  .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1em;
    pointer-events: none;
  }
  .search-icon svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15em;
    padding: 4px 6px;
    border-radius: 4px;
    display: none;
  }
  .search-clear:hover { color: var(--red); background: var(--red-light); }
  .autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .autocomplete-dropdown.show { display: block; }
  .ac-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .ac-item:last-child { border-bottom: none; }
  .ac-item:hover, .ac-item.active { background: var(--blue-bg); }
  .ac-item-path {
    font-size: 0.85em;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ac-item-path .highlight {
    color: var(--blue);
    font-weight: 700;
    background: var(--blue-light);
    border-radius: 2px;
    padding: 0 2px;
  }
  .ac-item-rate {
    font-size: 0.82em;
    font-weight: 700;
    color: var(--blue);
    white-space: nowrap;
    padding: 3px 10px;
    background: var(--blue-light);
    border-radius: 20px;
  }
  .ac-group-label {
    padding: 8px 16px;
    font-size: 0.72em;
    color: var(--blue);
    background: var(--blue-bg);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--blue-light);
  }
  .selected-category {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--blue-bg);
    border: 1.5px solid var(--blue);
    border-radius: var(--radius-sm);
    margin-top: 10px;
  }
  .selected-category .cat-path {
    flex: 1;
    font-size: 0.88em;
    color: var(--text-primary);
  }
  .selected-category .cat-path span { color: var(--text-muted); }
  .selected-category .cat-rate {
    font-weight: 700;
    color: var(--blue);
    font-size: 1em;
    background: var(--blue-light);
    padding: 3px 12px;
    border-radius: 20px;
  }
  .selected-category .cat-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15em;
    padding: 2px 6px;
    border-radius: 4px;
  }
  .selected-category .cat-remove:hover { color: var(--red); background: var(--red-light); }
  .ac-hint {
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.85em;
    text-align: center;
  }

  /* Ref analysis */
  .ref-analysis {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
  }
  .ref-analysis.positive { background: var(--green-bg); border: 1.5px solid #86efac; }
  .ref-analysis.negative { background: var(--red-bg); border: 1.5px solid #fca5a5; }
  .ref-analysis-title { font-weight: 600; margin-bottom: 6px; }
  .ref-analysis.positive .ref-analysis-title { color: var(--green); }
  .ref-analysis.negative .ref-analysis-title { color: var(--red); }
  /* Custom fast tooltip */
  .ref-row[data-tip] { cursor: help; position: relative; }
  .ref-row[data-tip]:hover { background: var(--bg-hover); border-radius: 4px; }
  .ref-row[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 0; top: calc(100% + 4px);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.78em;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    max-width: 360px;
    min-width: 200px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  }
  .ref-row[data-tip]:hover::after { opacity: 1; }
  .ref-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 4px 0; font-size: 0.88em; border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  .ref-row-label { color: var(--text-secondary); flex-shrink: 0; max-width: 55%; }
  .ref-row-val { text-align: right; }
  .ref-row-val em { font-style: normal; font-size: 0.85em; color: var(--text-muted); }
  .ref-divider {
    font-size: 0.8em; font-weight: 700; color: var(--blue);
    margin: 10px 0 4px; padding-top: 6px; border-top: 1.5px solid var(--blue-light);
  }
  .ref-verdict { margin-top: 10px; font-weight: 700; font-size: 0.95em; }
  .ref-note { margin-top: 6px; color: var(--red); font-size: 0.8em; font-weight: 600; }

  /* ===== Cost Breakdown Card ===== */
  .cost-breakdown-card {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
  }
  .cost-breakdown-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1em;
    color: var(--text-primary);
    margin-bottom: 14px;
  }
  .cost-breakdown-title svg { color: var(--blue); flex-shrink:0; }
  .cb-row { margin-bottom: 12px; }
  .cb-row:last-child { margin-bottom: 0; }
  .cb-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
  }
  .cb-label { font-size: 0.88em; font-weight: 600; color: var(--text-primary); }
  .cb-meta { display: flex; align-items: center; gap: 8px; }
  .cb-badge {
    font-size: 0.75em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    background: var(--bg-input);
  }
  .cb-amount { font-size: 0.88em; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
  .cb-bar-track {
    height: 7px;
    border-radius: 9999px;
    background: var(--bg-input);
    overflow: hidden;
  }
  .cb-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
    min-width: 2px;
  }

  /* ===== Metric Mini Cards ===== */
  .metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s;
  }
  .metric-card:hover { box-shadow: var(--shadow); }
  .metric-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .metric-icon svg { width: 16px; height: 16px; color: #fff; }
  .metric-label { font-size: 0.78em; color: var(--text-secondary); margin-bottom: 2px; }
  .metric-value { font-size: 1.05em; font-weight: 700; }

  /* ===== Deductible expense table ===== */
  .deduct-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.875em;
  }
  .deduct-header {
    background: var(--bg-input);
    padding: 7px 12px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85em;
    letter-spacing: 0.02em;
  }
  .deduct-legend {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    padding: 5px 12px;
    background: var(--blue-bg);
    font-size: 0.78em;
    font-weight: 700;
    color: var(--blue);
  }
  .deduct-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    align-items: center;
    padding: 7px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
  }
  .deduct-row:hover { background: var(--bg-hover); }
  .deduct-row input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer;
    accent-color: var(--blue);
    justify-self: center;
  }
  .deduct-col-label { font-weight: 700; }

  /* ===== Label + badge toggle ===== */
  .label-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    line-height: 1.3;
  }
  .badge-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72em;
    font-weight: 700;
    cursor: pointer;
    background: var(--blue-bg);
    color: var(--blue);
    padding: 2px 7px 2px 5px;
    border-radius: 20px;
    border: 1px solid var(--blue-light);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
  }
  .badge-toggle:hover { background: var(--blue-light); }
  .badge-toggle input[type="checkbox"] {
    width: 11px; height: 11px;
    accent-color: var(--blue);
    cursor: pointer;
    margin: 0;
  }

  /* ===== Ops combined summary ===== */
  .ops-combined-summary {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.875em;
  }
  .ops-combined-header, .ops-combined-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 8px;
    padding: 8px 14px;
    align-items: center;
  }
  .ops-combined-header {
    background: var(--bg-input);
    font-size: 0.82em;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
  }
  .ops-combined-header span:nth-child(2) { color: #7c3aed; }
  .ops-combined-header span:nth-child(3) { color: #0891b2; }
  .ops-combined-row {
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.88em;
  }
  .ops-combined-row:first-of-type { border-top: none; }
  .ops-combined-row span { font-weight: 500; }
  .ops-combined-row strong {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
  }
  .ops-combined-row.vat-row { background: var(--blue-bg); }
  .ops-combined-row.vat-row strong { color: var(--blue); }
  .ops-stat-block { display: none; } /* hidden, replaced by combined */

  /* Commission display */
  .commission-display {
    padding: 10px 14px;
    background: var(--yellow-bg);
    border: 1.5px solid #fbbf24;
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--yellow);
    font-size: 1.05em;
    text-align: center;
  }

  /* Footer */
  .footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 10px;
  }