/* Shared Capia Insight theme — tokens + common components */
:root {
  --primary: #21979f;
  --primary-hover: #1a7d84;
  --primary-soft: rgba(33, 151, 159, 0.14);
  --secondary: #002a4e;
  --bg: #f0f4f7;
  --surface: #ffffff;
  --surface-muted: #f7fafc;
  --border: #c5d4de;
  --text: #002a4e;
  --muted: #5a7285;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #027a48;
  --success-bg: #ecfdf3;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 42, 78, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 42, 78, 0.08);
  --focus-ring: 0 0 0 3px var(--primary-soft);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --btn-height: 2.25rem;
  --btn-padding-x: 1rem;
  --btn-font-size: 0.9rem;
  --btn-gap: 0.75rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --content-max: 1080px;
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
}

.button,
a.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-height);
  padding: 0 var(--btn-padding-x);
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--btn-font-size);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover,
a.button:hover,
button.button:hover {
  background: var(--primary-hover);
  color: #fff;
  text-decoration: none;
}

.button.secondary,
a.button.secondary,
button.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button.secondary:hover,
a.button.secondary:hover,
button.button.secondary:hover {
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

.button.danger,
a.button.danger,
button.button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.button.danger:hover,
a.button.danger:hover,
button.button.danger:hover {
  background: #912018;
  border-color: #912018;
  color: #fff;
  text-decoration: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-block;
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.15rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
}

.message {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--success-bg);
  border: 1px solid #abefc6;
  color: var(--success);
}

.message-danger,
.error-panel,
.field .error {
  color: var(--danger);
}

.message-danger {
  background: var(--danger-bg);
  border: 1px solid #fecdca;
}

.error-panel {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--danger-bg);
  border: 1px solid #fecdca;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--btn-gap);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

.field {
  margin-bottom: var(--space-4);
}

.field > label,
.field > .field-label,
.detail-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.detail-value {
  margin: 0;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field input[type="text"],
.field input[type="search"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.text-input,
.field select,
.field textarea {
  width: 100%;
  height: var(--btn-height);
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.field textarea {
  height: auto;
  min-height: 6rem;
  padding: 0.65rem 0.75rem;
}

.field input:focus,
.text-input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.field .error {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  height: 1.85rem;
  width: 1.85rem;
}

.auth-brand {
  align-items: center;
  color: var(--secondary);
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 0.55rem;
  margin-bottom: var(--space-5);
  text-decoration: none;
}

.auth-brand:hover {
  color: var(--primary);
  text-decoration: none;
}

.auth-brand .brand-mark {
  height: 2.5rem;
  width: 2.5rem;
}
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  min-height: 100vh;
}

.auth-panel {
  width: 100%;
  max-width: 420px;
}

.auth-panel.auth-panel-wide {
  max-width: 480px;
}

.auth-panel h1 {
  font-size: 1.5rem;
  margin: 0 0 var(--space-2);
}

.auth-panel .intro {
  color: var(--muted);
  margin: 0 0 var(--space-5);
  font-size: 0.95rem;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.auth-actions .button {
  width: 100%;
}

.auth-footer {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: 0.95rem;
}

.lookup-status {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.locale-switcher-menu {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0 0.65rem;
}

.menu-section-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 0.15rem 1rem 0.4rem;
  text-transform: uppercase;
}

.nav-org,
.org-switcher-nav {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  max-width: 14rem;
  min-width: 0;
}

.nav-org {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locale-switcher,
.org-switcher {
  margin: 0;
}

.locale-switcher-select {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%235a7285' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 0.7rem center;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 2rem 0.4rem 0.7rem;
}

.locale-switcher-select:hover,
.locale-switcher-select:focus {
  border-color: var(--primary);
  box-shadow: none;
  outline: none;
}

.locale-switcher-select:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.locale-switcher-menu .locale-switcher-select {
  display: block;
  margin: 0 1rem;
  width: calc(100% - 2rem);
}

.org-switcher-nav .locale-switcher-select {
  background-color: transparent;
  background-position: right 0.35rem center;
  border-color: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  max-width: 14rem;
  padding: 0.3rem 1.5rem 0.3rem 0.4rem;
  width: 100%;
}

.org-switcher-nav .locale-switcher-select:hover,
.org-switcher-nav .locale-switcher-select:focus {
  background-color: var(--surface-muted);
  border-color: var(--border);
}