﻿* { 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 - same as dashboard/contracts */
    .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); }
    .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; }
    .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;
    }
    .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; }

    /* Main */
    .main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 24px 24px; }
    .breadcrumbs { font-size: 14px; font-weight: 500; color: var(--grey-400); }
    .breadcrumbs a { color: var(--grey-400); text-decoration: none; }
    .breadcrumbs a:hover { color: var(--primary-500); }
    .breadcrumbs span { color: var(--grey-900); }
    .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); }

    /* Upload container (03-upload flow) */
    .upload-container { max-width: 800px; margin: 0 auto; width: 100%; }
    .upload-container .page-header { text-align: center; margin-top: 24px; margin-bottom: 32px; }
    .upload-container .page-title { font-size: 20px; font-weight: 600; color: var(--grey-900); margin: 0 0 12px; }
    .upload-container .page-desc { font-size: 14px; color: var(--grey-500); margin: 0; line-height: 1.5; }

    .stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 40px; flex-wrap: wrap; }
    .step { display: flex; align-items: center; gap: 10px; }
    .step-circle {
      width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 600; border: 2px solid var(--grey-300); color: var(--grey-400); background: var(--grey-0);
    }
    .step.active .step-circle { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
    .step.done .step-circle { background: var(--success-200); border-color: var(--success-200); color: #fff; }
    .step-label { font-size: 13px; color: var(--grey-400); font-weight: 500; }
    .step.active .step-label { color: var(--primary-600); }
    .step.done .step-label { color: var(--success-200); }
    .step-line { width: 60px; height: 2px; background: var(--grey-200); margin: 0 8px; }
    .step-line.done { background: var(--success-200); }

    .card { background: var(--grey-0); border: 1px solid var(--grey-100); border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 4px -1px rgba(13,13,18,0.06); }
    .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--grey-100); }
    .card-title { font-size: 16px; font-weight: 600; color: var(--grey-900); margin: 0; }
    .badge { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--grey-25); color: var(--grey-500); }

    .upload-zone {
      border: 2px dashed var(--grey-300); border-radius: 16px; padding: 48px 40px; text-align: center; background: var(--grey-25);
      cursor: pointer; transition: border-color 0.2s, background 0.2s;
    }
    .upload-zone:hover { border-color: var(--primary-500); background: rgba(18, 152, 123, 0.06); }
    .upload-zone .upload-icon {
      width: 64px; height: 64px; border-radius: 50%; background: rgba(18, 152, 123, 0.12);
      display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
    }
    .upload-zone .upload-icon svg { width: 28px; height: 28px; color: var(--primary-600); }
    .upload-zone h3 { font-size: 16px; font-weight: 600; color: var(--grey-800); margin-bottom: 4px; }
    .upload-zone p { font-size: 13px; color: var(--grey-500); margin-bottom: 16px; }
    .file-types { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
    .file-type-chip { padding: 4px 12px; background: var(--grey-0); border: 1px solid var(--grey-100); border-radius: 999px; font-size: 12px; color: var(--grey-600); font-weight: 500; }

    .file-preview {
      display: flex; align-items: center; gap: 14px; padding: 16px;
      background: var(--success-0); border: 1px solid var(--success-200); border-radius: 12px; margin-top: 16px;
    }
    .file-preview .file-icon { width: 44px; height: 44px; background: rgba(40, 128, 111, 0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
    .file-preview .file-icon svg { width: 22px; height: 22px; color: var(--success-200); }
    .file-preview .file-info { flex: 1; }
    .file-preview .file-name { font-size: 14px; font-weight: 500; color: var(--grey-900); }
    .file-preview .file-meta { font-size: 12px; color: var(--grey-500); }
    .file-preview .file-remove { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,0.05); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--grey-500); }

    .or-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; font-size: 12px; color: var(--grey-400); text-transform: uppercase; }
    .or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-200); }

    .paste-area {
      width: 100%; min-height: 160px; border: 1px solid var(--grey-300); border-radius: 12px; padding: 14px;
      font-size: 13px; font-family: inherit; resize: vertical; line-height: 1.6; color: var(--grey-800);
    }
    .paste-area:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(18,152,123,0.12); }

    .meta-form { margin-top: 0; }
    .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
    .form-group { margin-bottom: 16px; }
    .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--grey-700); margin-bottom: 6px; }
    .form-input {
      width: 100%; height: 40px; border: 1px solid var(--grey-300); border-radius: 10px; padding: 0 12px;
      font-size: 13px; font-family: inherit; background: var(--grey-0);
    }
    .form-input:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(18,152,123,0.12); }

    .upload-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; margin-bottom: 32px; padding-top: 24px; border-top: 1px solid var(--grey-100); }

    .processing-card { text-align: center; padding: 48px 24px; display: none; }
    .processing-card.is-visible { display: block; }
    .processing-spinner {
      width: 56px; height: 56px; border: 4px solid var(--grey-200); border-top-color: var(--primary-600);
      border-radius: 50%; margin: 0 auto 20px; animation: spin 1s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .processing-card h3 { font-size: 18px; font-weight: 600; color: var(--grey-800); margin-bottom: 8px; }
    .processing-card p { font-size: 14px; color: var(--grey-500); margin-bottom: 24px; }
    .processing-steps { text-align: left; max-width: 360px; margin: 0 auto; }
    .processing-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; }
    .processing-step .step-status { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
    .processing-step.done { color: var(--success-200); }
    .processing-step.active { color: var(--primary-600); font-weight: 500; }
    .processing-step.pending { color: var(--grey-400); }
  


