@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
  --bg: #eef3f6;
  --ink: #132235;
  --muted: #607284;
  --nav: #213447;
  --nav-border: #2f465e;
  --accent: #19b1ad;
  --accent-strong: #0e8f8b;
  --accent-soft: #e4f6f5;
  --panel: #ffffff;
  --border: #d8e1ea;
  --shadow: 0 12px 30px rgba(17, 34, 56, 0.12);
  --radius: 16px;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  background:
    radial-gradient(900px 400px at 10% -10%, #d8f3f2 0%, rgba(216, 243, 242, 0) 70%),
    radial-gradient(900px 450px at 100% 0%, #e9eef9 0%, rgba(233, 238, 249, 0) 70%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(135deg, #22384e, #1b2f42);
  color: #f4f8fb;
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 6px 18px rgba(15, 27, 41, 0.22);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(25, 177, 173, 0.2);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.6px;
  display: block;
}

.brand-sub {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(244, 248, 251, 0.68);
  display: block;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  background: rgba(244, 248, 251, 0.12);
  color: #f4f8fb;
  border: 1px solid rgba(244, 248, 251, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.nav-button {
  font-size: 12px;
  padding: 8px 12px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(244, 248, 251, 0.78);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-color: rgba(25, 177, 173, 0.6);
  color: #ffffff;
  background: rgba(25, 177, 173, 0.18);
}

.nav-details {
  position: relative;
}

.nav-summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.nav-details[open] .nav-link {
  border-color: rgba(25, 177, 173, 0.8);
  color: #ffffff;
  background: rgba(25, 177, 173, 0.22);
}

.nav-summary-icon {
  font-size: 12px;
  opacity: 0.7;
}

.dropdown-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 180px;
  padding: 8px;
  box-shadow: 0 18px 32px rgba(12, 26, 41, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.dropdown-link {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.dropdown-link:hover {
  background: #e8f6f5;
  color: #0f5d5b;
}

.page-container {
  max-width: 1400px;
  margin: 24px auto 40px;
  padding: 0 24px 40px;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-hero {
  background: linear-gradient(120deg, #ffffff, #f3fbfb);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 177, 173, 0.22), rgba(25, 177, 173, 0));
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.badges {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  background: var(--accent-soft);
  color: #0f5d5b;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.badge.dark {
  background: #e5edf3;
  color: #27415b;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.summary-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #f7fbff;
}

.summary-title {
  margin: 0;
  font-size: 14px;
  font-family: var(--font-display);
}

.summary-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.summary-count {
  font-weight: 700;
  color: var(--ink);
}

.summary-link {
  color: #0f5d5b;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #bfe9e7;
  background: #e8f6f5;
}

.summary-link:hover {
  background: #d8f0ef;
  border-color: #8bd6d2;
}

.summary-group {
  margin-top: 10px;
}

.summary-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.summary-empty {
  font-size: 12px;
  color: var(--muted);
}


.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.panel-meta {
  font-size: 12px;
  color: var(--muted);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.input-field {
  flex: 1 1 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: var(--font-body);
}

.input-field:focus {
  outline: 2px solid rgba(25, 177, 173, 0.3);
  border-color: var(--accent);
}

.primary-button {
  border: none;
  background: linear-gradient(135deg, #1bb6b1, #149a96);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.ghost-button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.ghost-button:hover {
  background: #f0f5f8;
}

.topbar .ghost-button {
  background: transparent;
  color: #f4f8fb;
  border-color: rgba(244, 248, 251, 0.35);
}

.topbar .ghost-button:hover {
  background: rgba(244, 248, 251, 0.12);
}

.nav-form {
  margin: 0;
}

.filter-panel {
  padding: 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-field {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-columns {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.filter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 10px;
}

.filter-help {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.multi-select {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  background: #ffffff;
}

.multi-select:focus {
  outline: 2px solid rgba(25, 177, 173, 0.25);
  border-color: var(--accent);
}

.multi-select option {
  padding: 4px 6px;
}

.choices {
  width: 100%;
}

.choices__inner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--font-body);
  max-width: 100%;
}

.choices__input {
  font-family: var(--font-body);
  font-size: 13px;
}

.choices__list--multiple .choices__item {
  background: #e8f6f5;
  color: #0f5d5b;
  border: 1px solid #bfe9e7;
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
}

.choices__list--multiple {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.choices__list--multiple .choices__item.is-highlighted {
  background: #d8f0ef;
  border-color: #8bd6d2;
}

.choices__list--dropdown {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(12, 26, 41, 0.12);
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: #e8f6f5;
  color: #0f5d5b;
}

.status-text {
  font-size: 13px;
  color: var(--muted);
}

.note {
  background: #f6fbff;
  border: 1px dashed #b9d9e6;
  border-radius: 12px;
  padding: 10px 14px;
  color: #2d4d62;
  font-size: 13px;
  margin-top: 10px;
}

.table-wrap {
  margin-top: 8px;
  overflow-x: auto;
}

.dash-table-container .dash-spreadsheet-container {
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .page-title {
    font-size: 24px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}


.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12px;
  background: #ffffff;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background-color: #213447;
  color: #ffffff;
  border: 1px solid #213447;
  font-weight: 700;
}

.data-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.data-table tbody tr:nth-child(odd) {
  background: #f7f9fb;
}

.data-table td.editable-cell {
  background: #f1fbfb;
}

.table-input {
  width: 100%;
  min-width: 120px;
  max-width: 240px;
  border-radius: 8px;
  border: 1px solid #cfe3e8;
  padding: 6px 8px;
  font-size: 12px;
  font-family: var(--font-body);
}

.table-input:focus {
  outline: 2px solid rgba(25, 177, 173, 0.25);
  border-color: var(--accent);
}

.table-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-panel {
  max-width: 520px;
  margin: 0 auto;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .input-field {
  flex: 0 0 auto;
  height: 44px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.page-link {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.page-link:hover {
  background: #e8f6f5;
  color: #0f5d5b;
}

.page-link.disabled {
  opacity: 0.5;
  cursor: default;
}

.page-status {
  font-size: 12px;
  color: var(--muted);
}
