/* Global tweaks for a cleaner, modern look using system fonts + Inter */
:root {
  --color-primary: #0f766e;
  --color-primary-strong: #0b5a52;
  --color-primary-muted: #ecfdf5;
  --color-accent: #fb7185;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-border: rgba(15, 118, 110, 0.1);
  --color-muted: rgba(15, 23, 42, 0.62);
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --shadow-card: 0 24px 48px -24px rgba(15, 23, 42, 0.25);
  --ring: 160 94% 35%;
}

html, body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: rgb(15 23 42);
  font-size: 16px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
}

main {
  min-height: calc(100vh - 4rem);
}

h1, h2, h3, h4 {
  font-weight: 600;
  color: rgb(15 23 42);
}

h1 { font-size: 2.25rem; line-height: 1.2; }
h2 { font-size: 1.75rem; line-height: 1.25; }
h3 { font-size: 1.35rem; line-height: 1.3; }
h4 { font-size: 1.1rem; line-height: 1.4; }

p {
  margin-top: 0.5rem;
  color: var(--color-muted);
}

small { color: rgba(15, 23, 42, 0.55); }

/* Form styling */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: var(--color-surface);
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

input[readonly], textarea[readonly], select[disabled] {
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.6);
}

.form-grid {
  display: grid;
  gap: 1.25rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.75);
  margin-bottom: 0.35rem;
}

.field-help {
  font-size: 0.7rem;
  color: rgba(15, 23, 42, 0.5);
  margin-top: 0.25rem;
}

.field-error {
  font-size: 0.7rem;
  color: rgba(220, 38, 38, 0.9);
  margin-top: 0.35rem;
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.card-section {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.card-muted {
  background: linear-gradient(135deg, rgba(15,118,110,0.08), rgba(15,118,110,0.02));
  border: none;
}

.nbu-suggestion-item--active {
  background: var(--color-primary-muted);
  color: var(--color-primary);
}

.nbu-suggestion-item--active .text-xs {
  color: var(--color-primary-strong);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 10px 18px -12px rgba(15, 118, 110, 0.6);
}
.btn-primary:hover {
  background: var(--color-primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 24px -18px rgba(15, 118, 110, 0.8);
}

.btn-muted {
  background: rgba(15, 23, 42, 0.05);
  color: rgb(30 41 59);
}
.btn-muted:hover {
  background: rgba(15, 23, 42, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn-ghost:hover {
  background: rgba(15, 118, 110, 0.1);
}

.btn-ghost-muted {
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.75);
}
.btn-ghost-muted:hover {
  background: rgba(15, 23, 42, 0.08);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.25);
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.btn-icon:hover {
  background: rgba(15, 118, 110, 0.12);
}

.btn[disabled],
.btn:disabled,
.btn-icon[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Badges & chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-pill {
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-primary-strong);
}
.badge-warn {
  background: rgba(251, 113, 133, 0.12);
  color: var(--color-accent);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.9);
}

/* Tables */
.table-wrap {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
}
.table-modern th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.55);
  background: rgba(15, 118, 110, 0.08);
}
.table-modern td {
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.table-modern tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.08);
}

.table-modern tbody tr:hover,
.table-modern tbody tr:nth-child(even):hover {
  background: rgba(15, 118, 110, 0.08);
}

.table-modern thead.sticky th {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.table-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(15, 23, 42, 0.45);
  font-size: 0.9rem;
}

/* Skeleton / shimmer */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.15);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Layout helpers */
.stack-on-mobile { display: grid; gap: 0.5rem; }
@media(min-width: 640px){ .stack-on-mobile { display: table-row; } }

/* Collapsible cues */
details[open] .cue-collapsed { display: none; }

/* Panels */
.panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.04);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
  backdrop-filter: blur(6px);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgb(15 23 42);
}

.meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(15, 23, 42, 0.46);
}
