/* ═══════════════════════════════════════════════════
   ID Portal — Design System & Component Library
   Font: Inter | Primary: #1E74E8 | Grid: 4px
   ═══════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Typography */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;

  /* Colors */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-placeholder: #999999;
  --text-white: #FFFFFF;
  --text-disabled: #BDBDBD;

  --primary: #1E74E8;
  --primary-hover: #1A65CC;
  --primary-active: #1558B3;
  --primary-light: #E8F0FE;
  --primary-ultra-light: #F0F6FF;

  --success: #2EA043;
  --success-light: #E8F8E8;
  --warning: #E65100;
  --warning-light: #FFF3E0;
  --error: #D32F2F;
  --error-light: #FDECEA;
  --info: #0288D1;
  --info-light: #E1F5FE;

  --bg: #F5F7FA;
  --bg-subtle: #F8F9FA;
  --surface: #FFFFFF;
  --border: #E0E0E0;
  --border-light: #EEEEEE;
  --border-focus: #1E74E8;
  --divider: #EEEEEE;
  --overlay: rgba(0, 0, 0, 0.5);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-elevated: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-modal: 0 8px 32px rgba(0,0,0,0.2);
  --shadow-primary: 0 4px 12px rgba(30,116,232,0.3);

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Typography ── */
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }

.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }

.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* ═══════════════════════════════════════════════════
   LAYOUT — Customer Portal
   ═══════════════════════════════════════════════════ */

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Nav */
.portal-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}

.portal-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.portal-nav__logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #4A9AF5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}

.portal-nav__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.portal-nav__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.portal-nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

/* Main Content Area */
.portal-main {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

/* ── Progress Stepper (Top) ── */
.progress-stepper {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
  padding: var(--sp-4) 0;
}

.progress-stepper__step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
}

.progress-stepper__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.progress-stepper__dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.progress-stepper__dot.completed {
  background: var(--primary);
}

.progress-stepper__line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background var(--transition-normal);
}

.progress-stepper__line.completed {
  background: var(--primary);
}

.progress-stepper__label {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  margin-top: var(--sp-1);
  white-space: nowrap;
}

.progress-stepper__label.active {
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

/* ── Page Header ── */
.page-header {
  margin-bottom: var(--sp-6);
}

.page-header__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  cursor: pointer;
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) 0;
  border: none;
  background: none;
  font-family: var(--font-family);
  transition: color var(--transition-fast);
}

.page-header__back:hover {
  color: var(--primary);
  text-decoration: none;
}

.page-header__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-2);
}

.page-header__subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

/* ═══════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════ */

/* ── Selection Card ── */
.selection-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  position: relative;
  overflow: hidden;
}

.selection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform var(--transition-normal);
  border-radius: 0 2px 2px 0;
}

.selection-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-elevated);
  transform: translateY(-2px);
}

.selection-card:hover::before {
  transform: scaleY(1);
}

.selection-card.selected {
  border-color: var(--primary);
  background: var(--primary-ultra-light);
}

.selection-card.selected::before {
  transform: scaleY(1);
}

.selection-card + .selection-card {
  margin-top: var(--sp-4);
}

.selection-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.selection-card__content {
  flex: 1;
}

.selection-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.selection-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.selection-card__arrow {
  color: var(--text-placeholder);
  font-size: var(--fs-lg);
  transition: transform var(--transition-fast);
  align-self: center;
}

.selection-card:hover .selection-card__arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* ── Section Card ── */
.section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  background: var(--surface);
  margin-bottom: var(--sp-5);
}

.section-card__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
}

.badge--primary { background: var(--primary-light); color: var(--primary); }
.badge--success { background: var(--success-light); color: var(--success); }
.badge--warning { background: var(--warning-light); color: var(--warning); }
.badge--error   { background: var(--error-light);   color: var(--error); }
.badge--neutral { background: var(--bg-subtle);     color: var(--text-placeholder); }
.badge--info    { background: var(--info-light);     color: var(--info); }

/* ── Form Elements ── */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.form-label .required {
  color: var(--error);
  margin-left: var(--sp-1);
}

.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: var(--surface);
  transition: all var(--transition-fast);
  min-height: 44px;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-placeholder);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-light);
}

.form-input.readonly {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: not-allowed;
  border-style: dashed;
}

.form-input-wrapper {
  position: relative;
}

.form-input-wrapper .lock-icon {
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-placeholder);
  font-size: var(--fs-sm);
}

.form-helper {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: var(--sp-2);
  line-height: var(--lh-relaxed);
}

.form-helper.error {
  color: var(--error);
}

.form-helper.success {
  color: var(--success);
}

/* ── Radio Card ── */
.radio-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--surface);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}

.radio-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.radio-card.selected {
  border-color: var(--primary);
  background: var(--primary-ultra-light);
}

.radio-card + .radio-card {
  margin-top: var(--sp-3);
}

.radio-card__indicator {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.radio-card.selected .radio-card__indicator {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-card.selected .radio-card__indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: white;
}

.radio-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.radio-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn--primary:active {
  background: var(--primary-active);
  transform: translateY(0);
}

.btn--primary:disabled, .btn--primary.disabled {
  background: var(--text-disabled);
  border-color: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-ultra-light);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--success {
  background: var(--success);
  color: var(--text-white);
  border-color: var(--success);
}

.btn--success:hover {
  background: #268F3A;
  border-color: #268F3A;
}

.btn--danger {
  background: var(--surface);
  color: var(--error);
  border-color: var(--error);
}

.btn--danger:hover {
  background: var(--error-light);
}

.btn--warning {
  background: var(--warning);
  color: var(--text-white);
  border-color: var(--warning);
}

.btn--warning:hover {
  background: #D14700;
  border-color: #D14700;
}

.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  min-height: 36px;
}

.btn--full {
  width: 100%;
}

.btn--link {
  background: none;
  border: none;
  color: var(--primary);
  padding: var(--sp-1) 0;
  min-height: auto;
  font-weight: var(--fw-medium);
}

.btn--link:hover {
  text-decoration: underline;
}

/* Button Group */
.btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--divider);
}

/* ── File Checklist Item ── */
.file-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--sp-3);
  transition: all var(--transition-fast);
}

.file-item:hover {
  box-shadow: var(--shadow-sm);
}

.file-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.file-item__info {
  flex: 1;
  min-width: 0;
}

.file-item__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
}

.file-item__meta {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-item__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* ── Upload Area ── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-subtle);
  position: relative;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-ultra-light);
}

.upload-area__icon {
  font-size: 40px;
  margin-bottom: var(--sp-4);
  opacity: 0.7;
}

.upload-area__text {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.upload-area__text a {
  font-weight: var(--fw-semibold);
}

.upload-area__hint {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── Checklist ── */
.checklist {
  list-style: none;
}

.checklist__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.checklist__item:hover {
  color: var(--primary);
}

.checklist__checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: var(--surface);
}

.checklist__checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.checklist__checkbox.checked::after {
  content: '✓';
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: white;
}

/* ── Signature Canvas ── */
.signature-area {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.signature-area__canvas {
  width: 100%;
  height: 200px;
  cursor: crosshair;
  display: block;
}

.signature-area__actions {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

/* ── Info Box ── */
.info-box {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-5);
}

.info-box--info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid rgba(2,136,209,0.2);
}

.info-box--warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(230,81,0,0.2);
}

.info-box--error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid rgba(211,47,47,0.2);
}

.info-box--success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(46,160,67,0.2);
}

.info-box__icon {
  font-size: var(--fs-lg);
  flex-shrink: 0;
  margin-top: -2px;
}

/* ── Ticket Stepper (Vertical) ── */
.ticket-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.ticket-step {
  display: flex;
  gap: var(--sp-4);
  position: relative;
  padding-bottom: var(--sp-6);
}

.ticket-step:last-child {
  padding-bottom: 0;
}

.ticket-step__indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  z-index: 1;
}

.ticket-step__dot {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
}

.ticket-step__dot.completed {
  background: var(--primary);
  border-color: var(--primary);
}

.ticket-step__dot.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.ticket-step__dot.warning {
  background: var(--warning);
  border-color: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-light);
}

.ticket-step__dot.success {
  background: var(--success);
  border-color: var(--success);
}

.ticket-step__dot.error {
  background: var(--error);
  border-color: var(--error);
}

.ticket-step__line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: var(--sp-1);
}

.ticket-step__line.completed {
  background: var(--primary);
}

.ticket-step__content {
  flex: 1;
  padding-top: 0;
}

.ticket-step__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ticket-step__title.muted {
  color: var(--text-placeholder);
}

.ticket-step__time {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
}

/* ── Success Screen ── */
.success-screen {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  animation: fadeInUp 0.5s ease;
}

.success-screen__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto var(--sp-6);
  animation: scaleIn 0.4s ease 0.2s both;
}

.success-screen__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

.success-screen__desc {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin-bottom: var(--sp-8);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Help Link ── */
.help-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-8);
  padding: var(--sp-4);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.help-link a {
  font-weight: var(--fw-medium);
}

/* ── Summary Table ── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-table td {
  padding: var(--sp-3) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

.summary-table td:first-child {
  color: var(--text-secondary);
  width: 160px;
  padding-right: var(--sp-4);
}

.summary-table td:last-child {
  font-weight: var(--fw-medium);
}

.summary-table tr:last-child td {
  border-bottom: none;
}

/* ── Alert / Rejection Banner ── */
.alert-banner {
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-5);
}

.alert-banner--warning {
  background: var(--warning-light);
  border: 1px solid rgba(230,81,0,0.3);
}

.alert-banner--error {
  background: var(--error-light);
  border: 1px solid rgba(211,47,47,0.3);
}

.alert-banner__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.alert-banner--warning .alert-banner__title { color: var(--warning); }
.alert-banner--error .alert-banner__title { color: var(--error); }

.alert-banner__content {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: var(--lh-relaxed);
}

.alert-banner__content p { margin-bottom: var(--sp-2); }

.alert-banner__content ul {
  margin-left: var(--sp-5);
  margin-top: var(--sp-2);
}

/* ── History Timeline ── */
.timeline {
  list-style: none;
}

.timeline__item {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--divider);
}

.timeline__item:last-child { border-bottom: none; }

.timeline__time {
  color: var(--text-placeholder);
  white-space: nowrap;
  min-width: 100px;
  font-size: var(--fs-xs);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.timeline__event {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   OP DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════ */

.op-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.op-sidebar {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.op-sidebar__header {
  padding: var(--sp-5) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.op-sidebar__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.op-sidebar__badge {
  background: var(--error);
  color: white;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  min-width: 24px;
  text-align: center;
}

.op-sidebar__filters {
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.op-filter-btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-family);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.op-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.op-filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.op-sidebar__list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
}

/* Ticket List Item */
.ticket-list-item {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ticket-list-item:hover { background: var(--bg-subtle); }
.ticket-list-item.active { background: var(--primary-ultra-light); border-left: 3px solid var(--primary); }

.ticket-list-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.ticket-list-item__id {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.ticket-list-item__time {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
}

.ticket-list-item__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-list-item__type {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.ticket-list-item__badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* OP Main Content */
.op-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.op-main__header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.op-main__header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.op-main__header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.op-main__ticket-id {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.op-main__content {
  flex: 1;
  overflow: auto;
  padding: var(--sp-5);
}

/* OP 4-Panel Grid */
.op-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--sp-5);
  height: calc(100vh - 200px);
}

.op-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.op-panel__header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.op-panel__header-icon {
  font-size: var(--fs-md);
}

.op-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
}

/* OP Compare Table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.compare-table th {
  background: var(--bg-subtle);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.compare-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

.compare-table .diff {
  background: var(--warning-light);
  font-weight: var(--fw-semibold);
}

.compare-table .match { color: var(--success); }

/* OCR Result */
.ocr-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-sm);
}

.ocr-field:last-child { border-bottom: none; }

.ocr-field__label {
  color: var(--text-secondary);
  min-width: 120px;
}

.ocr-field__value {
  font-weight: var(--fw-medium);
  flex: 1;
  text-align: right;
}

.ocr-field__status {
  margin-left: var(--sp-3);
  font-size: var(--fs-md);
}

/* OP Action Bar */
.op-action-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-4);
}

/* OP File Preview */
.file-preview {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.file-preview__icon {
  font-size: 36px;
  opacity: 0.6;
}

.file-preview__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.file-preview__size {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
}

/* Tab component for OP */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}

.tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--border);
}

.modal__body {
  padding: var(--sp-4) var(--sp-6);
}

.modal__footer {
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* ── Select Dropdown ── */
.form-select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: var(--surface);
  min-height: 44px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23666'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Textarea ── */
.form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: var(--surface);
  resize: vertical;
  min-height: 100px;
  outline: none;
  line-height: var(--lh-relaxed);
}

.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ═══════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════ */

.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0D1B3E 0%, #1E3A6E 40%, #1E74E8 100%);
  padding: var(--sp-6);
}

.landing__container {
  text-align: center;
  max-width: 600px;
}

.landing__logo {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-8);
  font-size: var(--fs-2xl);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.landing__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: white;
  margin-bottom: var(--sp-3);
}

.landing__subtitle {
  font-size: var(--fs-md);
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--sp-10);
  line-height: var(--lh-relaxed);
}

.landing__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.landing-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  padding: var(--sp-8) var(--sp-6);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
}

.landing-card:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  text-decoration: none;
}

.landing-card__icon {
  font-size: 36px;
  margin-bottom: var(--sp-4);
}

.landing-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: white;
  margin-bottom: var(--sp-2);
}

.landing-card__desc {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.6);
  line-height: var(--lh-relaxed);
}

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: var(--sp-5);
  right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 300px;
  max-width: 420px;
  animation: slideInRight 0.3s ease;
  font-size: var(--fs-sm);
}

.toast--success { border-left: 4px solid var(--success); }
.toast--error   { border-left: 4px solid var(--error); }
.toast--warning { border-left: 4px solid var(--warning); }
.toast--info    { border-left: 4px solid var(--info); }

/* ── OP Ticket Info Table ── */
.info-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
}

.info-grid__label {
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.info-grid__value {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in { animation: fadeIn 0.4s ease; }
.fade-in-up { animation: fadeInUp 0.4s ease; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-subtle) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Step Transition ── */
.step-panel {
  display: none;
  animation: fadeInUp 0.35s ease;
}

.step-panel.active {
  display: block;
}

/* ── Uploaded file item ── */
.uploaded-file {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
}

.uploaded-file__icon { font-size: var(--fs-lg); }

.uploaded-file__name {
  flex: 1;
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploaded-file__size { color: var(--text-placeholder); font-size: var(--fs-xs); }

.uploaded-file__status { font-size: var(--fs-md); }

.uploaded-file__remove {
  background: none;
  border: none;
  color: var(--text-placeholder);
  cursor: pointer;
  font-size: var(--fs-md);
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.uploaded-file__remove:hover { color: var(--error); background: var(--error-light); }

/* ═══════════════════════════════════════════════════
   DEMO CONFIG PANEL (for prototype switching)
   ═══════════════════════════════════════════════════ */

.demo-config {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  padding: var(--sp-5);
  z-index: var(--z-toast);
  width: 280px;
  font-size: var(--fs-sm);
}

.demo-config__title {
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.demo-config__group {
  margin-bottom: var(--sp-3);
}

.demo-config__group label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.demo-config__group select {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--fs-sm);
  background: var(--surface);
}

.demo-config__toggle {
  cursor: pointer;
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-elevated);
  font-size: var(--fs-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast);
  transition: all var(--transition-fast);
}

.demo-config__toggle:hover { transform: scale(1.1); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .portal-main {
    padding: var(--sp-5) var(--sp-4);
  }

  .landing__cards {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column-reverse;
  }

  .btn-group .btn {
    width: 100%;
  }

  .op-panels {
    grid-template-columns: 1fr;
    height: auto;
  }
}
