html {
  direction: ltr;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  direction: ltr;
  text-align: left;
}

.app-shell {
  padding: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-card,
.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.auth-card {
  width: min(420px, 100%);
}

.topbar,
.hero {
  margin-bottom: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero {
  background: linear-gradient(120deg, #0f172a, #2563eb, #06b6d4);
  color: white;
  border-radius: 16px;
  padding: 28px 32px;
}

.hero h1,
.hero p {
  color: white;
}

.hero .eyebrow {
  color: #bfdbfe;
}

.connection-card {
  border: 2px solid #dbeafe;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2563eb;
}

.dashboard-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input,
textarea,
button {
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
  direction: ltr;
  text-align: left;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: white;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button-link.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: #64748b;
}

.field-hint {
  font-size: 12px;
  color: #64748b;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

.status {
  margin-top: 12px;
  min-height: 1.25rem;
}

.status.success {
  color: #15803d;
}

.status.error {
  color: #b91c1c;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.alert {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.chat-log {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  margin-bottom: 12px;
}

.chat-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
}

.chat-message.user {
  background: #dbeafe;
}

.chat-message.assistant {
  background: #e2e8f0;
}

.chat-message.assistant.applied {
  background: #dcfce7;
}

.chat-message.assistant.pending {
  background: #fef3c7;
}

.chat-status {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.super-admin-shell .hero,
.super-admin-shell .topbar h1 {
  color: #0f172a;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.75rem;
  color: #2563eb;
}

.stat span {
  color: #64748b;
  font-size: 0.85rem;
}

.inline-role-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
}

.finding-group {
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: white;
}

.finding-form {
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.document-preview-card .preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.document-preview-card .preview-toolbar h2 {
  margin: 0;
}

.document-preview-frame {
  width: 100%;
  height: min(85vh, 1100px);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #d8dee6;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }
}
