/* Solstice components */

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
    border: none; border-radius: var(--sol-radius-md); font-size: 14px; font-weight: 500; cursor: pointer;
    white-space: nowrap; transition: background var(--sol-transition), color var(--sol-transition); text-decoration: none; }
  .btn:hover { text-decoration: none; }
  .btn .material-symbols-outlined { font-size: 18px; color: inherit; }
  .btn-primary { background: var(--sol-surface-primary); color: var(--sol-text-reversed); }
  .btn-primary:hover { background: var(--sol-surface-primary-hover); }
  .btn-secondary { background: var(--sol-surface-secondary-btn); color: var(--sol-text-default); }
  .btn-secondary:hover { background: var(--sol-surface-secondary-btn-hover); }
  .btn-outline { background: transparent; color: var(--sol-text-default); border: 1px solid var(--sol-stroke-default); }
  .btn-outline:hover { background: var(--sol-surface-overlay-l1); }
  .btn-ghost { background: transparent; color: var(--sol-text-interaction-default); padding: 0 8px; }
  .btn-ghost:hover { background: var(--sol-surface-overlay-l1); }
  .btn-danger { background: transparent; color: var(--sol-danger-text); border: 1px solid var(--sol-danger-border); }
  .btn-danger:hover { background: var(--sol-danger-bg); }
  .btn-sm { height: 28px; padding: 0 12px; font-size: 13px; }
  .btn-sm.btn-ghost { padding: 0 8px; }
  .btn-icon { width: 36px; height: 36px; padding: 0; background: transparent; border: none; border-radius: var(--sol-radius-md);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--sol-icon-subdued); position: relative; }
  .btn-icon:hover { background: var(--sol-surface-overlay-l2); }
  .btn-icon .material-symbols-outlined { color: inherit; }
  .btn[disabled] { opacity: .5; cursor: default; }
  
  /* Badges: tonal, no border, pill */
  .badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--sol-radius-full);
    font-size: 12px; font-weight: 500; white-space: nowrap; border: none; background: var(--sol-surface-secondary); color: var(--sol-text-subdued); }
  .badge .material-symbols-outlined { font-size: 14px; color: inherit; }
  .badge-success { background: var(--sol-success-bg); color: var(--sol-success-text); }
  .badge-danger { background: var(--sol-danger-bg); color: var(--sol-danger-text); }
  .badge-warning { background: var(--sol-warning-bg); color: var(--sol-warning-text); }
  .badge-science { background: var(--sol-tonal-science-bg); color: var(--sol-tonal-science-text); }
  .badge-amber { background: var(--sol-tonal-amber-bg); color: var(--sol-tonal-amber-text); }
  .badge-lima { background: var(--sol-tonal-lima-bg); color: var(--sol-tonal-lima-text); }
  .badge-atoll { background: var(--sol-tonal-atoll-bg); color: var(--sol-tonal-atoll-text); }
  .badge-royal { background: var(--sol-tonal-royal-bg); color: var(--sol-tonal-royal-text); }
  .badge-violet { background: var(--sol-tonal-violet-bg); color: var(--sol-tonal-violet-text); }
  .badge-sand { background: var(--sol-tonal-sand-bg); color: var(--sol-tonal-sand-text); }
  .badge-ai { background: var(--sol-surface-interaction-default); color: var(--sol-text-interaction-default); }
  .count-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--sol-radius-full);
    background: var(--sol-danger-strong); color: var(--sol-text-reversed); font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
  
  /* Chips (interactive filters) */
  .chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: var(--sol-radius-md);
    font-size: 13px; border: 1px solid transparent; background: var(--sol-surface-whisper); color: var(--sol-text-subdued); cursor: pointer; transition: all var(--sol-transition); }
  .chip:hover { background: var(--sol-surface-overlay-l2); color: var(--sol-text-default); }
  .chip.selected { background: var(--sol-surface-interaction-default); border-color: var(--sol-stroke-interaction); color: var(--sol-text-interaction-default); }
  
  /* Cards */
  .card { background: var(--sol-surface-default); border-radius: var(--sol-radius-xl); padding: 24px; }
  .card-compact { padding: 16px; }
  .card-bordered { border: 1px solid var(--sol-stroke-subdued); box-shadow: var(--sol-shadow-xs); }
  .card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px;
    margin-bottom: 16px; border-bottom: 1px solid var(--sol-stroke-subdued); }
  .card-title { font-size: 16px; font-weight: 400; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
  .card-sub { font-size: 12px; color: var(--sol-text-tertiary); }
  .section-label { font-size: 12px; color: var(--sol-text-tertiary); margin-bottom: 8px; }
  
  /* KPI */
  .kpi { background: var(--sol-surface-default); border-radius: var(--sol-radius-xl); padding: 24px; display: flex; flex-direction: column; gap: 4px; }
  .kpi-label { font-size: 12px; color: var(--sol-text-subdued); font-weight: 500; }
  .kpi-value { font-size: 30px; line-height: 36px; font-weight: 500; letter-spacing: -0.02em; }
  .kpi-delta { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
  .kpi-delta .material-symbols-outlined { font-size: 16px; color: inherit; }
  .delta-up { color: var(--sol-success-strong); }
  .delta-down { color: var(--sol-danger-strong); }
  .delta-flat { color: var(--sol-text-tertiary); }
  
  /* Inputs */
  .input, .select, .textarea { width: 100%; height: 36px; border: 1px solid var(--sol-stroke-default); border-radius: var(--sol-radius-md);
    padding: 0 12px; font-size: 14px; font-family: inherit; color: var(--sol-text-default); background: var(--sol-surface-default); outline: none;
    transition: border-color var(--sol-transition); }
  .textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; line-height: 20px; }
  .input::placeholder, .textarea::placeholder { color: var(--sol-text-placeholder); }
  .input:focus, .select:focus, .textarea:focus { border-color: var(--sol-stroke-interaction); box-shadow: var(--sol-focus-ring); }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field-label { font-size: 14px; font-weight: 500; }
  .field-help { font-size: 12px; color: var(--sol-text-subdued); }
  .search { position: relative; }
  .search .material-symbols-outlined { position: absolute; left: 10px; top: 8px; }
  .search .input { padding-left: 36px; }
  .search-lg .material-symbols-outlined { top: 12px; left: 12px; }
  
  /* Switch */
  .switch { position: relative; width: 36px; height: 20px; border-radius: var(--sol-radius-full); background: var(--sol-stroke-default);
    border: none; cursor: pointer; transition: background var(--sol-transition); flex-shrink: 0; padding: 0; }
  .switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--sol-surface-default); transition: left var(--sol-transition); box-shadow: var(--sol-shadow-xs); }
  .switch.on { background: var(--sol-surface-primary); }
  .switch.on::after { left: 18px; }
  
  /* Tables */
  .table-wrap { background: var(--sol-surface-default); border-radius: var(--sol-radius-xl); overflow: auto; }
  table.table { width: 100%; border-collapse: collapse; }
  .table thead th { background: var(--sol-surface-whisper); padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--sol-text-subdued);
    text-align: left; border-bottom: 1px solid var(--sol-stroke-subdued); white-space: nowrap; position: sticky; top: 0; }
  .table thead th.num { text-align: right; }
  .table tbody td { padding: 8px 16px; height: 48px; border-bottom: 1px solid var(--sol-stroke-subdued); vertical-align: middle; }
  .table tbody tr:last-child td { border-bottom: none; }
  .table tbody tr.clickable { cursor: pointer; }
  .table tbody tr:hover td { background: var(--sol-surface-overlay-l1); }
  
  /* List rows (action lists) */
  .list { display: flex; flex-direction: column; }
  .list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sol-stroke-subdued); }
  .list-item:last-child { border-bottom: none; padding-bottom: 0; }
  .list-item:first-child { padding-top: 0; }
  .list-icon { width: 36px; height: 36px; border-radius: var(--sol-radius-md); background: var(--sol-surface-whisper);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .list-icon.ai { background: var(--sol-surface-interaction-default); }
  .list-icon.ai .material-symbols-outlined { color: var(--sol-icon-interaction); }
  .list-title { font-weight: 500; }
  .list-meta { font-size: 12px; color: var(--sol-text-tertiary); }
  
  /* Avatar */
  .avatar { width: 32px; height: 32px; border-radius: var(--sol-radius-full); background: var(--sol-surface-default);
    border: 1px solid var(--sol-stroke-default); display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; color: var(--sol-text-subdued); flex-shrink: 0; }
  .avatar-lg { width: 56px; height: 56px; font-size: 18px; font-weight: 400; }
  .avatar-xl { width: 96px; height: 96px; font-size: 32px; font-weight: 400; background: var(--sol-surface-subdued); }
  
  /* AI elements */
  .ai-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--sol-text-interaction-default); }
  .ai-tag .material-symbols-outlined { font-size: 16px; color: inherit; }
  .evidence { font-size: 12px; color: var(--sol-text-tertiary); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
  .evidence .material-symbols-outlined { font-size: 14px; }
  .src-line { font-size: 12px; color: var(--sol-text-tertiary); display: flex; gap: 4px; align-items: flex-start; line-height: 16px; }
  .src-line .material-symbols-outlined { font-size: 14px; line-height: 16px; flex-shrink: 0; }
  .ai-brief { background: var(--sol-surface-default); border-radius: var(--sol-radius-xl); padding: 24px; display: flex; gap: 16px; align-items: flex-start; }
  .ai-brief-icon { width: 40px; height: 40px; border-radius: var(--sol-radius-full); background: var(--sol-surface-interaction-default);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .ai-brief-icon .material-symbols-outlined { color: var(--sol-icon-interaction); }
  
  /* Alert */
  .alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--sol-radius-lg);
    background: var(--sol-surface-interaction-default); font-size: 14px; }
  .alert .material-symbols-outlined { color: var(--sol-icon-interaction); }
  .alert-warning { background: var(--sol-warning-bg); }
  .alert-warning .material-symbols-outlined { color: var(--sol-warning-strong); }
  .alert-danger { background: var(--sol-danger-bg); }
  .alert-danger .material-symbols-outlined { color: var(--sol-danger-strong); }
  
  /* Progress */
  .progress { height: 6px; border-radius: var(--sol-radius-full); background: var(--sol-surface-secondary); overflow: hidden; }
  .progress > span { display: block; height: 100%; background: var(--sol-text-interaction-default); border-radius: var(--sol-radius-full); }
  
  /* Tabs */
  .tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--sol-stroke-subdued); }
  .tab { background: none; border: none; padding: 12px 0; font-size: 14px; color: var(--sol-text-subdued); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .tab:hover { color: var(--sol-text-default); }
  .tab.active { color: var(--sol-text-default); border-bottom-color: var(--sol-stroke-interaction); }
  
  /* Modal */
  .scrim { position: fixed; inset: 0; background: var(--sol-scrim); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
  .modal { background: var(--sol-surface-default); border-radius: var(--sol-radius-xl); box-shadow: var(--sol-shadow-lg); width: 100%; max-width: 640px;
    max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
  .modal-header { padding: 24px 24px 16px; border-bottom: 1px solid var(--sol-stroke-subdued); display: flex; justify-content: space-between; gap: 16px; }
  .modal-body { padding: 24px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
  .modal-footer { padding: 16px 24px; border-top: 1px solid var(--sol-stroke-subdued); display: flex; justify-content: flex-end; gap: 8px; }
  
  /* Toasts */
  .toasts { position: fixed; left: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
  .toast { background: var(--sol-surface-primary); color: var(--sol-text-reversed); padding: 12px 16px; border-radius: var(--sol-radius-lg);
    box-shadow: var(--sol-shadow-lg); display: flex; gap: 12px; align-items: center; max-width: 420px; animation: toast-in 200ms ease; }
  .toast .material-symbols-outlined { color: var(--sol-text-interaction-bright); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  
  /* Empty state */
  .empty { text-align: center; padding: 32px; color: var(--sol-text-tertiary); }
  .empty .material-symbols-outlined { font-size: 32px; display: block; margin: 0 auto 8px; }
  
  /* Data rows (striped label/value) */
  .kv { display: grid; grid-template-columns: 160px 1fr; }
  .kv > div { padding: 8px 12px; }
  .kv > div:nth-child(4n+1), .kv > div:nth-child(4n+2) { background: var(--sol-surface-whisper); }
  .kv .k { color: var(--sol-text-subdued); }
  
  /* Charts */
  .chart text { font-family: 'Source Sans 3', sans-serif; font-size: 11px; fill: var(--sol-text-tertiary); }
  .chart .grid { stroke: var(--sol-stroke-subdued); stroke-width: 1; }
  .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--sol-text-subdued); }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
  