  /* ── Fixed Costs page-specific styles ── */

  /* Widen the content area for this page */
  #main-content { max-width: 1200px; }
  .page-header { max-width: 100%; }

  /* KPI cards — uses page-kpi-* classes from base.css */

  /* ── Visual breakdown bar ── */
  .fc-breakdown-section {
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .fc-breakdown-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .fc-breakdown-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-700);
    margin: 0 0 12px;
  }

  .fc-bar-container {
    display: flex;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
  }

  .fc-bar-segment {
    height: 100%;
    transition: width 0.5s ease;
    min-width: 2px;
  }

  .fc-bar-segment.contracts { background: linear-gradient(90deg, var(--navy-500), var(--navy-700)); }
  .fc-bar-segment.salary    { background: linear-gradient(90deg, var(--gold-500), var(--gold-600)); }
  .fc-bar-segment.vehicle   { background: linear-gradient(90deg, #34D399, var(--success)); }
  .fc-bar-segment.other     { background: linear-gradient(90deg, #a78bfa, #7c3aed); }

  .fc-bar-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    font-size: 13px;
    color: var(--gray-700);
    flex-wrap: wrap;
  }

  .fc-bar-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .fc-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
  }

  /* ── Category grid layout ── */
  .fc-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
  }

  /* ── Category sections ── */
  .fc-section-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--navy-700);
    display: inline-block;
  }

  .fc-category {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
  }

  .fc-category-other {
    grid-column: 1 / -1;
  }

  .fc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
  }

  .fc-category-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .fc-category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .fc-category-icon.contracts { background: var(--navy-100); color: var(--navy-600); }
  .fc-category-icon.salary    { background: var(--gold-100); color: var(--gold-600); }
  .fc-category-icon.vehicle   { background: var(--success-bg); color: var(--success); }
  .fc-category-icon.other     { background: #ede9fe; color: #7c3aed; }

  .fc-category-icon svg {
    width: 16px;
    height: 16px;
  }

  .fc-category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-700);
  }

  .fc-category-count {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 1px;
  }

  .fc-category-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-700);
    font-variant-numeric: tabular-nums;
  }

  .fc-category-total-label {
    font-size: 11px;
    color: var(--gray-500);
    text-align: right;
  }

  /* ── Item rows ── */
  .fc-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    line-height: 1.3;
  }

  .fc-item-row.fci-row {
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px;
  }

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

  .fc-item-label {
    font-weight: 500;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fc-item-detail {
    color: var(--gray-500);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fc-item-amount {
    font-weight: 600;
    color: var(--navy-700);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-left: 8px;
  }

  .fc-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
  }

  /* ── FCI action buttons ── */
  .fci-actions {
    display: flex;
    gap: 4px;
    align-items: center;
  }

  .fci-action-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
    color: var(--gray-400);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .fci-action-btn svg { width: 14px; height: 14px; }

  .fci-action-btn.edit:hover { color: #1565c0; background: #e3ecfa; }
  .fci-action-btn.toggle.active:hover { color: #ef6c00; background: #fff3e0; }
  .fci-action-btn.toggle.inactive:hover { color: #2e7d32; background: #e8f5e9; }
  .fci-action-btn.delete:hover { color: #c62828; background: #ffebee; }

  /* ── Add button in header ── */
  .fci-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--navy-700);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }

  .fci-add-btn:hover { background: var(--navy-600); }

  /* ── Modal styles ── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 300;
    align-items: center;
    justify-content: center;
  }
  .modal-overlay.open { display: flex; }

  .modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid #e3ecfa;
  }
  .modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d47a1;
    margin: 0;
    border: none;
    padding: 0;
  }
  .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    padding: 0 0.25rem;
  }
  .modal-close:hover { color: #c62828; }

  .modal-body { padding: 1.5rem; }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .form-row.full { grid-template-columns: 1fr; }

  .form-group { display: flex; flex-direction: column; }
  .form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.5rem 0.65rem;
    border: 1.5px solid #d0d7e2;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #fff;
  }
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21,101,192,0.12);
  }
  .form-group textarea { resize: vertical; min-height: 60px; }

  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e8edf5;
  }
  .btn-cancel {
    padding: 0.55rem 1.25rem;
    background: #f0f2f5;
    color: #333;
    border: 1.5px solid #d0d7e2;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .btn-cancel:hover { background: #e3ecfa; }
  .btn-save {
    padding: 0.55rem 1.5rem;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .btn-save:hover { background: #0d47a1; }
  .btn-save:disabled { background: #90b4e8; cursor: not-allowed; }

  /* AI suggest button */
  .btn-ai-suggest {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid #d4b96a;
    border-radius: 6px;
    background: linear-gradient(135deg, #fdf6e3, #fff9ed);
    color: #8b6914;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
  }
  .btn-ai-suggest:hover { background: linear-gradient(135deg, #f9edc7, #fdf6e3); border-color: #b8933a; }
  .btn-ai-suggest:disabled { opacity: 0.5; cursor: wait; }

  /* ── Responsive ── */
  @media (min-width: 1100px) {
    .fc-categories-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    .fc-category-other {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 768px) {
    .fc-categories-grid {
      grid-template-columns: 1fr;
    }
    .fc-item-row { grid-template-columns: 1fr auto; }
    .fc-item-row.fci-row { grid-template-columns: 1fr auto auto; }
    .fc-item-detail { display: none; }
    .form-row { grid-template-columns: 1fr; }
  }
