﻿* { box-sizing: border-box; }
    body { margin: 0; font-family: 'Archivo', sans-serif; color: var(--grey-900); background: var(--grey-0); min-height: 100vh; }

    .layout {
      display: flex;
      min-height: 100vh;
    }

    /* Sidebar */
    .sidebar {
      width: 272px;
      flex-shrink: 0;
      background: var(--grey-0);
      border-right: 1px solid var(--grey-100);
      display: flex;
      flex-direction: column;
      transition: width 0.2s ease;
    }
    .sidebar.is-collapsed {
      width: 80px;
    }
    .sidebar.is-collapsed .sidebar__title,
    .sidebar.is-collapsed .sidebar__search,
    .sidebar.is-collapsed .sidebar__nav-label,
    .sidebar.is-collapsed .sidebar__nav-link-text {
      overflow: hidden;
      opacity: 0;
      width: 0;
      padding: 0;
      margin: 0;
      pointer-events: none;
      white-space: nowrap;
    }
    .sidebar.is-collapsed .sidebar__header {
      padding: 12px 8px;
      justify-content: center;
    }
    .sidebar.is-collapsed .sidebar__nav-link {
      justify-content: center;
      padding: 0 8px;
    }
    .sidebar.is-collapsed .sidebar__nav-section {
      padding: 0 8px;
    }
    .sidebar__header {
      padding: 12px 16px;
      border-bottom: 1px solid var(--grey-100);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .sidebar__logo {
      width: 32px;
      height: 32px;
      background: var(--primary-500);
      border: 1px solid var(--primary-600);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .sidebar__logo img { width: 20px; height: 20px; object-fit: contain; }
    .sidebar__title { font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--grey-900); white-space: nowrap; transition: opacity 0.2s ease; }
    .sidebar__collapse {
      width: 24px; height: 24px;
      border: 1px solid var(--grey-100);
      border-radius: 6px;
      background: var(--grey-0);
      cursor: pointer;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      line-height: 1;
      transition: transform 0.2s ease;
    }
    .sidebar.is-collapsed .sidebar__collapse {
      transform: rotate(180deg);
    }
    .sidebar__search {
      margin: 20px 16px 0;
      height: 40px;
      padding: 8px 12px;
      border: 1px solid var(--grey-100);
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--grey-0);
      transition: opacity 0.2s ease;
    }
    .sidebar.is-collapsed .sidebar__search {
      margin: 20px 8px 0;
      width: 48px;
      min-width: 48px;
      padding: 8px;
      justify-content: center;
    }
    .sidebar.is-collapsed .sidebar__search input,
    .sidebar.is-collapsed .sidebar__search kbd {
      display: none;
    }
    .sidebar__search input { flex: 1; min-width: 0; border: none; background: none; font: 400 14px/1.5 Archivo; color: var(--grey-900); }
    .sidebar__search input::placeholder { color: var(--grey-400); }
    .sidebar__search kbd { font-family: inherit; font-size: 12px; color: var(--grey-400); background: var(--grey-50); padding: 2px 4px; border-radius: 4px; }
    .sidebar__nav { flex: 1; padding: 8px 16px 16px; overflow-y: auto; }
    .sidebar.is-collapsed .sidebar__nav { padding: 8px 8px 16px; }
    .sidebar__nav-section { margin-bottom: 16px; }
    .sidebar__nav-label { font-size: 12px; font-weight: 500; color: var(--grey-300); letter-spacing: 0.24px; padding: 4px 12px; margin-bottom: 2px; transition: opacity 0.2s ease; }
    .sidebar__nav-link {
      display: flex;
      align-items: center;
      gap: 8px;
      height: 40px;
      padding: 0 12px;
      border-radius: 8px;
      font-size: 16px; font-weight: 500; color: var(--grey-500);
      text-decoration: none;
      margin-bottom: 2px;
      transition: justify-content 0.2s ease, padding 0.2s ease;
    }
    .sidebar__nav-link:hover { background: var(--grey-25); color: var(--grey-900); }
    .sidebar__nav-link.is-active { background: var(--grey-25); color: var(--primary-500); }
    .sidebar__nav-link.logout { color: var(--error-100); }
    .sidebar__nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
    .sidebar__nav-link-text { white-space: nowrap; transition: opacity 0.2s ease; }

    /* Main */
    .main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 24px 24px; }
    .main__profile { display: flex; align-items: center; gap: 8px; }
    .main__profile-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
    .main__profile-name { font-size: 12px; font-weight: 600; color: var(--grey-900); }
    .main__profile-role { font-size: 12px; font-weight: 400; color: var(--grey-500); }
    .main__header { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
    .main__title { font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--grey-900); margin: 0; }
    .main__btns { display: flex; gap: 12px; }
    .btn { height: 40px; padding: 0 16px; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 1px solid transparent; }
    .btn--secondary { background: var(--grey-0); border-color: var(--grey-100); color: var(--grey-900); }
    .btn--primary { background: var(--primary-500); color: var(--grey-0); border-color: var(--primary-600); }

    /* KPI cards */
    .cards { display: flex; gap: 20px; margin-top: 24px; }
    .card { flex: 1; min-width: 0; background: var(--grey-0); border: 1px solid var(--grey-100); border-radius: 16px; padding: 16px; box-shadow: 0 2px 4px -1px rgba(13,13,18,0.06); }
    .card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
    .card__icon { width: 40px; height: 40px; background: var(--primary-500); border: 1px solid var(--primary-600); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
    .card__icon img { width: 20px; height: 20px; object-fit: contain; filter: brightness(0) invert(1); }
    .card__info { width: 20px; height: 20px; color: var(--grey-400); cursor: pointer; }
    .card__body { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
    .card__label { font-size: 14px; font-weight: 400; color: var(--grey-500); margin: 0 0 4px; }
    .card__value { font-size: 18px; font-weight: 600; color: var(--grey-900); margin: 0; letter-spacing: 0.36px; }
    .card__trend { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 4px; background: var(--error-0); border: 1px solid var(--error-25); border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--error-100); }

    /* Charts row */
    .charts { display: flex; gap: 20px; margin-top: 24px; height: 400px; }
    .chart-card { background: var(--grey-0); border: 1px solid var(--grey-100); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 4px -1px rgba(13,13,18,0.06); display: flex; flex-direction: column; }
    .chart-card--wide { flex: 1; min-width: 0; }
    .chart-card--narrow { width: 420px; flex-shrink: 0; }
    .chart-card__head { height: 64px; padding: 0 20px; border-bottom: 1px solid var(--grey-100); display: flex; align-items: center; justify-content: space-between; }
    .chart-card__title { font-size: 16px; font-weight: 600; color: var(--grey-900); margin: 0; }
    .chart-card__controls { display: flex; align-items: center; gap: 8px; }
    .chart-card__body { flex: 1; padding: 20px; display: flex; flex-direction: column; min-height: 0; }
    .chart-card__stats { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
    .chart-card__amount { font-size: 24px; font-weight: 600; color: var(--grey-900); }
    .chart-card__legend { display: flex; gap: 12px; margin-top: auto; flex-wrap: wrap; }
    .chart-card__legend-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--grey-500); }
    .chart-card__legend-dot { width: 8px; height: 8px; border-radius: 2px; }
    .chart-card__chart { flex: 1; min-height: 120px; background: no-repeat center/contain; }
    .chart-donut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; }
    .chart-donut__img { width: 232px; height: 232px; object-fit: contain; }
    .chart-donut__center { text-align: center; }
    .chart-donut__center div:first-child { font-size: 12px; font-weight: 500; color: var(--grey-500); }
    .chart-donut__center div:last-child { font-size: 20px; font-weight: 600; color: var(--grey-900); }

    /* Table */
    .table-section { margin-top: 24px; background: var(--grey-0); border: 1px solid var(--grey-100); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 4px -1px rgba(13,13,18,0.06); }
    .table-section__head { padding: 16px 20px; border-bottom: 1px solid var(--grey-100); display: flex; align-items: center; justify-content: space-between; }
    .table-section__title { font-size: 16px; font-weight: 600; color: var(--grey-900); margin: 0; }
    .table-section__search { height: 40px; padding: 0 12px; border: 1px solid var(--grey-100); border-radius: 8px; width: 240px; font: 400 14px Archivo; }
    .table { width: 100%; border-collapse: collapse; }
    .table th { background: var(--grey-25); height: 40px; padding: 0 12px; text-align: left; font-size: 14px; font-weight: 500; color: var(--grey-500); }
    .table td { height: 64px; padding: 0 12px; border-bottom: 1px solid var(--grey-100); font-size: 14px; color: var(--grey-900); }
    .table td:last-child { width: 40px; }
    .badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; }
    .badge--low { background: var(--success-0); border: 1px solid var(--success-25); color: var(--success-200); }
    .badge--medium { background: #fff6e0; border: 1px solid #faedcc; color: #966422; }
    .badge--high { background: var(--error-0); border: 1px solid var(--error-25); color: #b21634; }
    .badge__dot { width: 6px; height: 6px; border-radius: 50%; }
    .badge--low .badge__dot { background: var(--success-200); }
    .badge--medium .badge__dot { background: #f6c03c; }
    .badge--high .badge__dot { background: var(--error-100); }
    .badge--danger { background: var(--error-0); border: 1px solid var(--error-25); color: var(--error-100); }
    .badge--warning { background: #fff6e0; border: 1px solid #faedcc; color: #966422; }
    .badge--success { background: var(--success-0); border: 1px solid var(--success-25); color: var(--success-200); }
    .badge--danger .badge__dot { background: var(--error-100); }
    .badge--warning .badge__dot { background: var(--risk-medium); }
    .badge--success .badge__dot { background: var(--success-200); }

    /* Dash grid: Active alerts + Recent analyses (from 01-dashboard) */
    .dash-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-top: 24px;
    }
    .dash-grid .card {
      margin: 0;
    }
    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--grey-100);
    }
    .card-header .card-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--grey-900);
      margin: 0;
    }
    .card-header .btn--ghost {
      background: none;
      border: none;
      color: var(--primary-500);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      text-decoration: none;
      padding: 4px 8px;
    }
    .card-header .btn--ghost:hover { text-decoration: underline; }
    /* Alerts list */
    .alert-list { list-style: none; margin: 0; padding: 0; }
    .alert-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 20px;
      border-bottom: 1px solid var(--grey-100);
    }
    .alert-item:last-child { border-bottom: none; }
    .alert-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-top: 5px;
      flex-shrink: 0;
    }
    .alert-dot.critical { background: #dc2626; }
    .alert-dot.high { background: var(--risk-high); }
    .alert-dot.medium { background: var(--risk-medium); }
    .alert-text { flex: 1; min-width: 0; }
    .alert-title {
      font-size: 13px;
      font-weight: 500;
      color: var(--grey-900);
      margin-bottom: 2px;
    }
    .alert-meta {
      font-size: 12px;
      color: var(--grey-500);
    }
    .alert-time {
      font-size: 11px;
      color: var(--grey-400);
      white-space: nowrap;
      margin-top: 2px;
    }
    /* Recent analyses: score circle + status dot */
    .score-circle {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
      border: 2.5px solid;
    }
    .score-circle.critical { border-color: #dc2626; color: #dc2626; }
    .score-circle.high { border-color: var(--risk-high); color: var(--risk-high); }
    .score-circle.medium { border-color: var(--risk-medium); color: var(--risk-medium); }
    .score-circle.low { border-color: var(--success-200); color: var(--success-200); }
    .status-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 6px;
    }
    .status-dot.complete { background: var(--success-200); }
    .status-dot.processing { background: var(--primary-500); }
    .status-dot.review { background: var(--secondary-500); }
    .row-link { color: var(--primary-500); font-weight: 500; text-decoration: none; }
    .row-link:hover { text-decoration: underline; }

    /* Command palette (Search / Jump to) */
    .command-palette-overlay {
      position: fixed;
      inset: 0;
      background: rgba(13, 13, 18, 0.6);
      backdrop-filter: blur(1px);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .command-palette-overlay.is-open { display: flex; }
    .command-palette {
      width: 100%;
      max-width: 700px;
      background: var(--grey-0);
      border-radius: 16px;
      overflow: hidden;
      box-shadow: 0 4px 24px rgba(13, 13, 18, 0.15);
      display: flex;
      flex-direction: column;
    }
    .command-palette__search-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 20px;
      border-bottom: 1px solid var(--grey-100);
    }
    .command-palette__search-bar .search-icon { width: 20px; height: 20px; flex-shrink: 0; }
    .command-palette__search-bar .search-icon img { width: 100%; height: 100%; object-fit: contain; }
    .command-palette__search-bar input {
      flex: 1;
      border: none;
      background: none;
      font: 500 14px/1.5 Archivo;
      color: var(--grey-900);
    }
    .command-palette__search-bar input::placeholder { color: var(--grey-400); }
    .command-palette__search-bar input:focus { outline: none; }
    .command-palette__jump {
      padding: 20px;
      border-bottom: 1px solid var(--grey-100);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .command-palette__jump-label {
      font-size: 12px; font-weight: 500; color: var(--grey-500);
      letter-spacing: 0.24px;
    }
    .command-palette__jump-list { display: flex; flex-direction: column; }
    .command-palette__jump-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      text-decoration: none;
      color: var(--grey-500);
      font-size: 16px; font-weight: 500;
      border-radius: 8px;
      transition: background 0.15s, color 0.15s;
    }
    .command-palette__jump-item:hover,
    .command-palette__jump-item.is-focused { background: var(--grey-25); color: var(--grey-900); }
    .command-palette__jump-item .item-icon {
      width: 32px; height: 32px;
      flex-shrink: 0;
      background: var(--grey-25);
      border: 1px solid var(--grey-100);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .command-palette__jump-item .item-icon img { width: 18px; height: 18px; object-fit: contain; }
    .command-palette__footer {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 20px;
      padding: 20px;
      background: var(--grey-25);
    }
    .command-palette__shortcut {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px; font-weight: 400; color: var(--grey-500);
    }
    .command-palette__shortcut kbd {
      font-family: Archivo, sans-serif;
      font-size: 10px; font-weight: 500;
      color: var(--grey-500);
      background: var(--grey-0);
      border: 1px solid var(--grey-50);
      border-radius: 6px;
      padding: 4px 8px;
    }
    .command-palette__kbd-group { display: inline-flex; gap: 4px; align-items: center; }

    /* Logout confirmation modal */
    .logout-overlay {
      position: fixed;
      inset: 0;
      background: rgba(13, 13, 18, 0.6);
      backdrop-filter: blur(1px);
      z-index: 1001;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .logout-overlay.is-open { display: flex; }
    .logout-modal {
      width: 100%;
      max-width: 450px;
      background: var(--grey-0);
      border-radius: 16px;
      padding: 32px;
      display: flex;
      flex-direction: column;
      gap: 32px;
      box-shadow: 0 4px 24px rgba(13, 13, 18, 0.15);
    }
    .logout-modal__content { display: flex; flex-direction: column; gap: 16px; align-items: center; width: 100%; }
    .logout-modal__icon-wrap {
      background: linear-gradient(180deg, rgba(255,240,243,0.48) 0%, rgba(255,240,243,0) 100%);
      border: 1px solid var(--error-0);
      padding: 16px;
      border-radius: 96px;
    }
    .logout-modal__icon-inner {
      background: var(--grey-0);
      border: 1px solid var(--error-25);
      padding: 14px;
      border-radius: 96px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 4px 0 rgba(223,28,65,0.04);
    }
    .logout-modal__icon-inner img { width: 24px; height: 24px; display: block; object-fit: contain; }
    .logout-modal__text { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; width: 100%; }
    .logout-modal__title { font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--grey-900); margin: 0; }
    .logout-modal__message { font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--grey-500); letter-spacing: 0.32px; margin: 0; }
    .logout-modal__actions { display: flex; gap: 16px; width: 100%; }
    .logout-modal__btn {
      flex: 1;
      height: 52px;
      padding: 8px 16px;
      border-radius: 14px;
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: 0.32px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--grey-100);
      background: var(--grey-0);
      color: var(--grey-900);
      box-shadow: 0 1px 2px 0 rgba(13,13,18,0.06);
      text-decoration: none;
    }
    .logout-modal__btn--primary { background: var(--error-100); color: var(--grey-0); border: none; border-radius: 12px; }
  



