*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body { height: 100%; font-family: var(--font); color: var(--gray-900); background: var(--gray-50); }

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

.container { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.container-lg { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gray-400); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 15px; font-family: var(--font);
  background: #fff; transition: border-color 0.15s; outline: none; color: var(--gray-900); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 120px; }

/* Cards */
.card { background: #fff; border-radius: 12px; border: 1px solid var(--gray-200); padding: 20px; }
.card + .card { margin-top: 12px; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-not-opened { background: var(--gray-100); color: var(--gray-600); }
.badge-opened { background: #FEF3C7; color: #92400E; }
.badge-submitted { background: #D1FAE5; color: #065F46; }
.badge-expired { background: #FEE2E2; color: #991B1B; }

/* Nav */
.nav { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 14px 0; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info { background: #EEF2FF; color: #3730A3; border: 1px solid #C7D2FE; }

/* Spinner */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { border-color: rgba(79,70,229,0.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 16px; }
.tab { padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--gray-600);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Progress bar */
.progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; }

/* Utility */
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-gray { color: var(--gray-600); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
