@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #00786f;
  --primary-hover: #00665f;
  --primary-active: #005750;
  --primary-soft: #d8edec;
  --primary-wash: #f0f8f7;
  --accent: #8dfdf5;
  --ink: #142c2a;
  --text: #314240;
  --muted: #6b7d7a;
  --muted-strong: #526562;
  --border: #dbe6e3;
  --border-strong: #c9d7d4;
  --surface: #ffffff;
  --canvas: #f4f8f7;
  --canvas-deep: #edf4f2;
  --danger: #c23b3b;
  --danger-hover: #a92f2f;
  --danger-soft: #fdeeee;
  --warning: #946200;
  --warning-soft: #fff7df;
  --blue: #2c6e9b;
  --blue-soft: #eaf3fb;
  --violet: #6750a4;
  --violet-soft: #f1edfb;
  --amber: #9a6a13;
  --amber-soft: #fdf3df;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(18, 48, 44, 0.04);
  --shadow-sm: 0 2px 8px rgba(18, 48, 44, 0.05);
  --shadow-md: 0 12px 32px rgba(10, 42, 38, 0.1);
  --shadow-lg: 0 28px 80px rgba(7, 35, 31, 0.2);
  --sidebar-width: 240px;
}

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

html {
  min-width: 320px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.025em;
}

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

a:hover {
  color: var(--primary-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: #fff;
  background: rgba(0, 120, 111, 0.82);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: rgba(226, 255, 251, 0.82);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-logo {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 34px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand--light {
  color: #fff;
}

.brand--light:hover {
  color: #fff;
}

.brand--light .brand-logo {
  width: 66px;
  height: 38px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 8px;
}

.brand--light .brand-copy strong {
  color: #fff;
}

.brand--light .brand-copy span {
  color: rgba(232, 255, 252, 0.68);
}

.btn {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn svg {
  flex: 0 0 auto;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 120, 111, 0.18);
}

.btn-primary:hover {
  color: #fff;
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(0, 120, 111, 0.2);
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  color: var(--primary);
  background: var(--primary-wash);
  border-color: #b9d7d3;
}

.btn-ghost {
  color: var(--muted-strong);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--canvas-deep);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  color: #fff;
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-icon-text {
  padding-inline: 12px;
}

.btn.is-loading,
.icon-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.icon-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--muted-strong);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--canvas-deep);
}

.icon-btn--danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-btn--sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.alert > svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.alert strong {
  font-weight: 650;
}

.alert span {
  color: inherit;
  opacity: 0.88;
}

.alert code {
  padding: 1px 4px;
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.alert-error {
  color: #8d2929;
  background: var(--danger-soft);
  border-color: #f4cccc;
}

.alert-warning {
  color: #78520a;
  background: var(--warning-soft);
  border-color: #f1dfae;
}

.alert-success {
  color: #17625b;
  background: #e9f7f4;
  border-color: #bde6df;
}

.login-page {
  min-height: 100vh;
  background: var(--canvas);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.06fr) minmax(430px, 0.94fr);
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 48px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 8%, rgba(141, 253, 245, 0.18), transparent 34%),
    linear-gradient(145deg, #005a53 0%, #00786f 48%, #0a8e83 100%);
}

.login-visual::before {
  position: absolute;
  top: -230px;
  right: -180px;
  width: 540px;
  height: 540px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.03), 0 0 0 140px rgba(255, 255, 255, 0.025);
}

.login-visual::after {
  position: absolute;
  bottom: -170px;
  left: -130px;
  width: 390px;
  height: 390px;
  content: "";
  background: rgba(141, 253, 245, 0.11);
  border-radius: 50%;
  filter: blur(2px);
}

.login-visual-top,
.login-visual-content,
.login-visual-footer {
  position: relative;
  z-index: 1;
}

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

.login-badge {
  padding: 6px 10px;
  color: rgba(238, 255, 252, 0.9);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.login-visual-content {
  width: min(100%, 620px);
  padding: 6vh 0 2vh;
}

.login-visual-content h1 {
  color: #fff;
  font-size: clamp(2.7rem, 4.1vw, 4.2rem);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.login-visual-content h1 span {
  color: var(--accent);
}

.login-lead {
  max-width: 500px;
  margin-top: 18px;
  color: rgba(235, 255, 252, 0.76);
  font-size: 15px;
  line-height: 1.65;
}

.login-illustration {
  width: min(100%, 580px);
  margin-top: 32px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(0, 31, 28, 0.22);
}

.login-illustration img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
}

.login-visual-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(232, 255, 252, 0.58);
  font-size: 11.5px;
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: rgba(232, 255, 252, 0.82);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.login-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background:
    radial-gradient(circle at 82% 16%, rgba(0, 120, 111, 0.06), transparent 30%),
    var(--canvas);
}

.login-mobile-brand {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 430px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid rgba(219, 230, 227, 0.9);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(27, 62, 56, 0.11), var(--shadow-xs);
}

.login-heading h2 {
  margin-top: 2px;
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.login-heading p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-alert {
  margin-top: 20px;
}

.login-form {
  margin-top: 24px;
}

.field + .field {
  margin-top: 16px;
}

.field label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}

.input-shell {
  position: relative;
}

.input-shell > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  color: #8a9b98;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-shell input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  color: var(--ink);
  background: #fbfdfc;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-shell input::placeholder {
  color: #9aa9a6;
}

.input-shell input:hover {
  border-color: #b8cbc7;
}

.input-shell input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 111, 0.12);
}

.input-shell input[type="password"] {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  padding: 6px 7px;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--primary-wash);
}

.login-submit {
  height: 44px;
  margin-top: 22px;
  font-size: 13.5px;
}

.login-submit svg {
  margin-left: 2px;
  transition: transform 160ms ease;
}

.login-submit:hover svg {
  transform: translateX(2px);
}

.login-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  background: #f5f9f8;
  border: 1px solid #e7efed;
  border-radius: var(--radius);
}

.login-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--primary);
}

.login-copyright {
  position: absolute;
  bottom: 22px;
  color: #8a9a97;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.app-page {
  overflow-x: hidden;
  background: var(--canvas);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  overflow-x: hidden;
  overflow-x: clip;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.sidebar-close {
  display: none;
}

.sidebar-body {
  flex: 1;
  min-height: 0;
  margin-top: 28px;
}

.nav-label {
  padding: 0 10px;
  margin-bottom: 8px;
  color: #8a9a97;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 550;
  border-radius: var(--radius);
  transition: color 160ms ease, background-color 160ms ease;
}

.nav-item svg {
  flex: 0 0 auto;
  color: #7f918d;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-wash);
}

.nav-item.is-active {
  color: var(--primary);
  font-weight: 650;
  background: var(--primary-soft);
}

.nav-item.is-active svg {
  color: var(--primary);
}

.nav-count {
  min-width: 24px;
  padding: 1px 7px;
  margin-left: auto;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
}

.sidebar-note {
  padding: 13px;
  margin: 24px 4px 0;
  background: #f5f9f8;
  border: 1px solid #e7efed;
  border-radius: 12px;
}

.sidebar-note-icon {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
}

.sidebar-note p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 10.5px;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: #35a77f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(53, 167, 127, 0.12);
}

.sidebar-foot {
  padding: 15px 4px 0;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 4px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
  background: var(--primary-soft);
  border-radius: 10px;
}

.user-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.user-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy span {
  color: var(--muted);
  font-size: 10.5px;
}

.logout-form {
  margin-top: 12px;
}

.logout-form .btn {
  justify-content: flex-start;
  padding-left: 12px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(10, 34, 31, 0.46);
  backdrop-filter: blur(2px);
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-button {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 650;
}

.breadcrumb-sep {
  color: #a7b5b2;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  color: var(--muted-strong);
  font-size: 10.5px;
  font-weight: 600;
  background: #f4f8f7;
  border: 1px solid #e4eeeb;
  border-radius: 999px;
}

.topbar-date {
  color: var(--muted);
  font-size: 11.5px;
}

.content {
  width: 100%;
  max-width: 1560px;
  padding: 28px 28px 44px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading h1 {
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.page-description {
  max-width: 620px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

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

.stat-card {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

.stat-icon--teal {
  color: var(--primary);
  background: var(--primary-soft);
}

.stat-icon--blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon--violet {
  color: var(--violet);
  background: var(--violet-soft);
}

.stat-icon--amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.stat-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-copy p {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
}

.stat-copy strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.stat-copy span {
  overflow: hidden;
  margin-top: 2px;
  color: #879692;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.table-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.panel-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

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

.search-box {
  position: relative;
  width: 276px;
}

.search-box > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #8b9b98;
  pointer-events: none;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 37px;
  color: var(--ink);
  font-size: 12.5px;
  background: #fbfdfc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.search-box input::placeholder {
  color: #98a7a4;
}

.search-box input:hover {
  border-color: var(--border-strong);
}

.search-box input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 111, 0.1);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 5px;
  place-items: center;
  transform: translateY(-50%);
}

.search-clear:hover {
  color: var(--ink);
  background: var(--canvas-deep);
}

.select-field {
  display: inline-flex;
  height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.select-field select {
  height: 32px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
  outline: 0;
}

.table-alert {
  margin: 14px 20px 0;
}

.table-alert .btn {
  margin-left: auto;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-color: #b9cbc7 transparent;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table thead {
  background: var(--primary);
}

.data-table th {
  padding: 11px 16px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-align: left;
  white-space: nowrap;
}

.data-table th:last-child {
  width: 104px;
  text-align: right;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.sort-button:hover {
  color: var(--accent);
}

.sort-indicator {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}

.sort-button.is-sorted .sort-indicator {
  color: var(--accent);
}

.data-table tbody tr {
  border-bottom: 1px solid #edf2f1;
  transition: background-color 140ms ease;
}

.data-table tbody tr:last-child {
  border-bottom: 0;
}

.data-table tbody tr:not(.skeleton-row):hover {
  background: #f8fbfa;
}

.data-table td {
  padding: 12px 16px;
  color: var(--text);
  font-size: 12.5px;
  vertical-align: middle;
}

.data-table td:last-child {
  text-align: right;
}

.cell-code {
  color: var(--muted-strong);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.customer-cell {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 10px;
}

.customer-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: -0.02em;
  background: var(--primary-soft);
  border-radius: 9px;
}

.customer-avatar--personal {
  color: var(--violet);
  background: var(--violet-soft);
}

.customer-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.customer-name {
  overflow: hidden;
  max-width: 300px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.customer-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 1px 5px;
  color: #5f4b96;
  font-size: 9px;
  font-weight: 650;
  background: var(--violet-soft);
  border-radius: 4px;
}

.type-badge--company {
  color: var(--primary);
  background: var(--primary-soft);
}

.contact-cell {
  display: flex;
  min-width: 170px;
  flex-direction: column;
  gap: 2px;
}

.contact-main {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-cell {
  color: var(--muted-strong);
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}

.row-actions .icon-btn {
  color: #7b8d89;
}

.row-actions .icon-btn:hover {
  color: var(--primary);
  background: var(--primary-wash);
}

.row-actions .icon-btn--danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.skeleton {
  display: block;
  height: 11px;
  margin: 3px 0;
  background: linear-gradient(90deg, #edf3f1 25%, #f7faf9 45%, #edf3f1 65%);
  background-size: 220% 100%;
  border-radius: 5px;
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.skeleton-xs {
  width: 68px;
}

.skeleton-sm {
  width: 92px;
}

.skeleton-md {
  width: 130px;
}

.skeleton-lg {
  width: 190px;
}

.skeleton-row td {
  height: 58px;
}

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 46px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  color: var(--primary);
  background: var(--primary-wash);
  border: 1px solid #dcece9;
  border-radius: 15px;
  place-items: center;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 700;
}

.empty-state p {
  max-width: 390px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state .btn {
  margin-top: 16px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
}

.range-label {
  color: var(--muted);
  font-size: 11.5px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  place-items: center;
}

.page-btn:hover:not(:disabled) {
  color: var(--primary);
  background: var(--primary-wash);
}

.page-btn.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.page-ellipsis {
  display: inline-grid;
  min-width: 24px;
  height: 30px;
  color: var(--muted);
  font-size: 11px;
  place-items: center;
}

.modal {
  max-width: 980px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  padding: 0;
  margin: auto;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.modal::backdrop {
  background: rgba(7, 32, 29, 0.56);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: flex;
  max-height: calc(100vh - 32px);
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(219, 230, 227, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease both;
}

.modal--sm {
  max-width: 520px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.modal-head .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}

.modal-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 12px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.modal-tab:hover {
  color: var(--ink);
}

.modal-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

#customer-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.modal-body {
  flex: 1;
  padding: 20px 24px 24px;
  overflow-y: auto;
  background: #fcfefd;
}

.modal-body > .alert {
  margin-bottom: 16px;
}

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

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field > label {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.required-mark {
  color: var(--danger);
  font-size: 12px;
  line-height: 1;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--ink);
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input {
  height: 38px;
  padding-block: 0;
}

.form-field textarea {
  min-height: 96px;
  line-height: 1.55;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #9aa8a5;
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: #b6cac6;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 111, 0.1);
}

.form-field input[type="date"] {
  color: var(--ink);
}

.field-error {
  margin-top: 4px;
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.4;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #df9b9b;
  background: #fffafa;
}

.form-field--switch {
  justify-content: center;
  padding: 10px 12px;
  background: #f7fbfa;
  border: 1px solid #e7efed;
  border-radius: var(--radius-sm);
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: #c8d6d3;
  border-radius: 999px;
  transition: background-color 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 42, 38, 0.18);
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.switch-hint {
  color: var(--muted);
  font-size: 10.5px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.modal-foot-note {
  color: var(--muted);
  font-size: 10.5px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-actions--end {
  margin-left: auto;
}

.confirm-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.confirm-text strong {
  color: var(--ink);
  font-weight: 650;
}

.danger-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  color: #8d2929;
  font-size: 11.5px;
  line-height: 1.55;
  background: var(--danger-soft);
  border: 1px solid #f4cccc;
  border-radius: var(--radius-sm);
}

.danger-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms ease both;
}

.toast.is-leaving {
  animation: toast-out 160ms ease both;
}

.toast-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-wash);
  border-radius: 7px;
  place-items: center;
}

.toast--error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast--info .toast-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.toast-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.toast-copy strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
}

.toast-copy span {
  color: var(--muted);
  font-size: 11px;
}

.toast-close {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 5px;
  place-items: center;
}

.toast-close:hover {
  color: var(--ink);
  background: var(--canvas-deep);
}

.error-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 120, 111, 0.08), transparent 40%),
    var(--canvas);
  place-items: center;
}

.error-card {
  width: min(100%, 460px);
  padding: 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.error-brand {
  justify-content: center;
  margin-bottom: 26px;
}

.error-code {
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.error-card h1 {
  margin-top: 7px;
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.error-message {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.is-spinning svg {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 1240px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .search-box {
    width: min(100%, 340px);
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 24px 20px 36px;
  }

  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .login-visual {
    padding: 28px 32px;
  }

  .login-visual-content h1 {
    font-size: clamp(2.4rem, 4.6vw, 3.4rem);
  }

  .login-panel {
    padding: 32px;
  }
}

@media (max-width: 900px) {
  .login-layout {
    display: block;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    flex-direction: column;
    padding: 30px 20px 64px;
  }

  .login-mobile-brand {
    display: flex;
    width: 100%;
    max-width: 430px;
    justify-content: center;
    margin-bottom: 20px;
  }

  .login-card {
    padding: 28px;
  }

  .login-copyright {
    bottom: 20px;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .topbar-date {
    display: none;
  }

  .breadcrumb span:first-child,
  .breadcrumb-sep {
    display: none;
  }

  .content {
    padding: 20px 14px 32px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .page-heading h1 {
    font-size: 1.7rem;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    width: 100%;
  }

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

  .stat-card {
    padding: 13px;
  }

  .stat-copy strong {
    font-size: 19px;
  }

  .panel-head {
    padding: 15px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
    order: -1;
  }

  .select-field {
    flex: 1;
    justify-content: center;
  }

  .table-alert {
    margin: 12px 15px 0;
    flex-wrap: wrap;
  }

  .table-alert .btn {
    width: 100%;
    margin-left: 0;
  }

  .data-table {
    min-width: 0;
    table-layout: fixed;
  }

  .data-table th:nth-child(1),
  .data-table td:nth-child(1),
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) {
    display: none;
  }

  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    width: 50%;
  }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    width: 28%;
  }

  .data-table th:nth-child(6),
  .data-table td:nth-child(6),
  .data-table th:last-child {
    width: 22%;
  }

  .data-table th,
  .data-table td {
    padding-inline: 8px;
  }

  .customer-cell,
  .contact-cell {
    min-width: 0;
  }

  .customer-name {
    max-width: 100%;
  }

  .data-table th,
  .data-table td {
    padding-inline: 12px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 15px;
  }

  .pagination {
    width: 100%;
    justify-content: flex-end;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-card {
    max-height: calc(100vh - 16px);
    border-radius: 13px;
  }

  .modal-head {
    padding: 16px 16px 12px;
  }

  .modal-tabs {
    padding: 0 8px;
  }

  .modal-tab {
    padding-inline: 9px;
  }

  .modal-body {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .modal-foot {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px;
  }

  .modal-foot-note {
    order: 2;
  }

  .modal-actions {
    width: 100%;
  }

  .modal-actions .btn {
    flex: 1;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    align-items: center;
  }

  .login-panel {
    padding: 22px 12px 58px;
  }

  .login-card {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .login-heading h2 {
    font-size: 1.7rem;
  }

  .login-mobile-brand {
    margin-bottom: 16px;
  }

  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    width: 74%;
  }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }

  .data-table th:nth-child(6),
  .data-table td:nth-child(6),
  .data-table th:last-child {
    width: 26%;
  }

  .pagination {
    gap: 2px;
  }

  .page-btn {
    min-width: 28px;
    height: 28px;
    padding-inline: 5px;
  }

  .error-page {
    padding: 12px;
  }

  .error-card {
    padding: 24px 18px;
  }

  .error-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
