/* Minimal base styles. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1b1b1b;
  background: #f6f6f4;
  padding-bottom: 72px;
}
:root {
  --brand-navy: #0b1f4d;
  --brand-deep: #143a7a;
  --brand-blue: #1f6fb5;
  --brand-cyan: #24b7e7;
  --brand-ice: #e9f6ff;
  --brand-slate: #2a3a4a;
}
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e2de;
}
.main-nav {
  border-bottom: 1px solid #e2e2de;
  margin-bottom: 16px;
  padding-bottom: 12px;
}
.main-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.main-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.main-nav-brand img {
  height: 28px;
}
.main-nav-title {
  font-size: 16px;
  font-weight: 700;
}
.main-nav-links,
.main-subnav {
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.main-subnav {
  margin-top: 10px;
}
.main-nav-partner {
  display: inline-flex;
  align-items: center;
  padding-left: 10px;
  margin-left: 6px;
  border-left: 1px solid rgba(20, 58, 122, 0.18);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand-slate);
}
.main-nav-partner-label { font-weight: 700; }
.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 32px;
  box-sizing: border-box;
  max-width: 100vw;
  background: #ffffff;
  border-top: 1px solid #e2e2de;
  padding: 8px 14px;
  z-index: 999;
  display: none;
}
.mobile-nav-items {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mobile-nav-items::-webkit-scrollbar {
  display: none;
}
.mobile-nav-link {
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid transparent;
  background: #f2f2ee;
  color: #1b1b1b;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 0;
  min-width: 0;
}
.mobile-nav-link.is-active {
  background: var(--brand-ice);
  border-color: rgba(20, 58, 122, 0.2);
  color: var(--brand-navy);
  font-weight: 700;
}
.mobile-more {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 72px;
  box-sizing: border-box;
  max-width: 100vw;
  z-index: 1000;
  display: none;
}
.mobile-more.is-open { display: block; }
.mobile-more-card {
  background: #ffffff;
  border: 1px solid #e2e2de;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.mobile-more-card a {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f6f4;
  border: 1px solid #e2e2de;
  font-size: 13px;
}
.brand-header { display: flex; align-items: center; gap: 12px; }
.brand-header img { height: 40px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: #6a6a66; }
.env-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: #b3261e;
  color: #ffffff;
}

.layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 20px; }
.card {
  background: #ffffff;
  border: 1px solid #e2e2de;
  border-radius: 10px;
}
.card-pad { padding: 16px; }
.sticky { position: sticky; top: 16px; height: fit-content; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-wrap .table { min-width: 720px; }
.table-wrap .table.stack-mobile { min-width: 0; width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  background: #1b1b1b;
  color: #ffffff;
}
.btn-outline { background: transparent; color: #1b1b1b; border-color: #bfbfba; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-blue));
  color: #ffffff;
  border-color: rgba(11, 31, 77, 0.2);
  box-shadow: 0 10px 18px rgba(20, 58, 122, 0.18);
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-deep));
}
.btn-small { padding: 6px 10px; font-size: 13px; }
.btn-disabled,
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #efefea;
  font-size: 12px;
}
.pill-strong { font-weight: 700; }

.muted { color: #6a6a66; font-size: 13px; }
.req { color: #b3472f; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.row input,
.row textarea,
.row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfcfca;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
}
.row textarea { min-height: 90px; resize: vertical; }

.subcard {
  background: #fbfbf8;
  border: 1px solid #e2e2de;
  border-radius: 8px;
  padding: 12px;
}
.subcard-title { font-weight: 700; font-size: 14px; }

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e2de;
  border-radius: 8px;
  background: #ffffff;
}
.list-item small { color: #6a6a66; display: block; }
.list-actions { display: inline-flex; gap: 8px; }

.is-disabled input,
.is-disabled textarea,
.is-disabled select {
  background: #f0f0ec;
  color: #7a7a74;
}
.is-disabled {
  opacity: 0.9;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #cfcfca;
  background: #ffffff;
  font-size: 13px;
  cursor: pointer;
}
.seg input { display: none; }
.seg label.is-active {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #ffffff;
}
.is-hidden { display: none !important; }

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e2de;
  margin-top: 12px;
  flex-wrap: wrap;
}
.module-actions { display: inline-flex; gap: 8px; align-items: center; }

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e2e2de;
  border-radius: 10px;
  box-shadow: 0 14px 24px rgba(20, 24, 22, 0.12);
  padding: 6px;
  display: none;
  z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #1b1b1b;
  text-decoration: none;
  font-size: 13px;
}
.nav-dropdown-item:hover,
.nav-dropdown-item.is-active {
  background: #f0f0ec;
}

.snap-title { font-weight: 700; }
.snap-sub { color: #6a6a66; font-size: 13px; margin-top: 2px; }
.snap-divider { height: 1px; background: #e2e2de; margin: 12px 0; }
.snap-row { display: flex; justify-content: space-between; font-size: 13px; margin: 6px 0; }
.snap-foot { font-size: 12px; color: #6a6a66; margin-top: 12px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .module-grid { grid-template-columns: 1fr; }
}

/* Auth page */
body.auth {
  background:
    radial-gradient(circle at 15% 20%, rgba(36, 183, 231, 0.35), transparent 48%),
    radial-gradient(circle at 85% 15%, rgba(31, 111, 181, 0.35), transparent 45%),
    linear-gradient(135deg, #f7fbff 0%, #d9e6f3 55%, #c6d7ea 100%);
}
.auth-shell {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(11, 31, 77, 0.18);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 58, 122, 0.15);
  margin-bottom: 12px;
}
.auth-logo { height: 44px; width: auto; }
.auth-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
}
.auth-sub { font-size: 12px; color: #6a6a66; letter-spacing: 0.3px; text-transform: uppercase; }
.auth-form { margin-top: 12px; }
.auth-actions { border-top: none; margin-top: 14px; padding-top: 0; }
.auth-partner {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand-slate);
}
.auth-partner-label { font-weight: 700; }
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(20, 58, 122, 0.18);
  z-index: 30;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--brand-slate);
}
.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--brand-navy);
}
.site-footer-brand img {
  height: 20px;
  width: auto;
}
.site-footer-name { font-weight: 700; }
.site-footer-copy { font-size: 11px; color: #4a5b6c; }

@media (max-width: 900px) {
  .main-nav-links,
  .main-subnav {
    display: none;
  }
  .mobile-nav {
    display: block;
  }
  .wrap {
    padding: 16px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .mobile-nav-link {
    min-width: 72px;
  }
  .sticky {
    position: static;
  }
  body {
    padding-bottom: 120px;
    overflow-x: hidden;
  }
  .site-footer {
    bottom: 0;
    margin-bottom: 0;
    z-index: 998;
  }
  .site-footer-inner {
    padding: 6px 16px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-header img {
    height: 32px;
  }
  img {
    max-width: 100%;
    height: auto;
  }
  .card,
  .subcard,
  .list-item {
    min-width: 0;
  }
  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap .table {
    min-width: 640px;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filters .row {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 400px) {
  .mobile-nav {
    padding: 6px 8px;
  }
  .mobile-nav-items {
    gap: 6px;
  }
  .mobile-nav-link {
    min-width: 0;
    padding: 7px 4px;
    font-size: 11px;
  }
  .site-footer-inner {
    justify-content: center;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 720px) {
  .table.stack-mobile {
    display: block;
  }
  .table.stack-mobile thead {
    display: none;
  }
  .table.stack-mobile tbody,
  .table.stack-mobile tr,
  .table.stack-mobile td {
    display: block;
    width: 100%;
  }
  .table.stack-mobile tr {
    border: 1px solid #e2e2de;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #ffffff;
  }
  .table.stack-mobile td {
    padding: 6px 0;
    border-bottom: 1px dashed #e2e2de;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    word-break: break-word;
  }
  .table.stack-mobile td:last-child {
    border-bottom: none;
  }
  .table.stack-mobile td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6a6a66;
    flex: 0 0 96px;
  }
  .table.stack-mobile td[data-label="Actions"],
  .table.stack-mobile td[data-label="Manage"] {
    flex-direction: column;
    align-items: flex-start;
  }
  .table.stack-mobile td[data-label="Actions"]::before,
  .table.stack-mobile td[data-label="Manage"]::before {
    margin-bottom: 4px;
  }
}
