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

body {
  font-family: 'Inter', sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  min-height: 100vh;
}

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

/* Header */
.header {
  background: #0d1b2a;
  color: #fff;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-logo span {
  color: #4fc3f7;
}

.header-tag {
  font-size: 11px;
  color: #7eb8d4;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-left: 1px solid #2d4a6e;
  padding-left: 12px;
}

/* Main */
.main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 48px 24px;
}

/* Upload zone */
.upload-section {
  background: #fff;
  border: 2px dashed #c8d6e5;
  border-radius: 12px;
  padding: 56px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 40px;
}

.upload-section:hover, .upload-section.drag-over {
  border-color: #4fc3f7;
  background: #f0f9ff;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #0d1b2a;
}

.upload-section p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
}

.upload-btn {
  background: #0d1b2a;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-btn:hover { background: #1a3a5c; }
.upload-btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* Status */
.status-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 32px;
  border: 1px solid #e5e7eb;
}

.status-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #0d1b2a;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.queued { background: #fef3c7; color: #92400e; }
.status-badge.processing { background: #dbeafe; color: #1e40af; }
.status-badge.complete { background: #d1fae5; color: #065f46; }
.status-badge.error { background: #fee2e2; color: #991b1b; }

/* Results */
.results-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #0d1b2a;
}

.results-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 28px;
}

.parties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.party-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px;
}

.party-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4fc3f7;
  margin-bottom: 6px;
}

.party-name {
  font-size: 14px;
  font-weight: 600;
  color: #0d1b2a;
}

.party-detail {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* Obligations table */
.obligations-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.obligations-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.obligations-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #0d1b2a;
}

.obligation-count {
  font-size: 13px;
  color: #6b7280;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}

tbody tr:hover { background: #f9fafb; }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 14px 16px;
  vertical-align: top;
  color: #374151;
  line-height: 1.5;
}

.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.critical { background: #fee2e2; color: #991b1b; }
.priority-badge.high { background: #ffedd5; color: #9a3412; }
.priority-badge.medium { background: #fef3c7; color: #92400e; }
.priority-badge.low { background: #f3f4f6; color: #6b7280; }

.clause-ref {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #4b5563;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
}

.due-date {
  font-weight: 500;
  color: #0d1b2a;
}

.due-condition {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  font-style: italic;
}

.error-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 24px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #dbeafe;
  border-top-color: #1e40af;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }
