:root {
  --primary: #0f6b70;
  --primary-hover: #0b5a5f;
  --primary-strong: #09494e;
  --primary-soft: #e8f4f3;
  --primary-soft-strong: #d6ecea;
  --navy: #163447;
  --navy-deep: #102b3b;
  --ink: #1d2d38;
  --ink-soft: #3d505d;
  --muted: #677986;
  --muted-light: #667985;
  --line: #dfe7e9;
  --line-strong: #ccd8dc;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --canvas: #f3f6f6;
  --success: #157457;
  --success-soft: #e8f5ef;
  --warning: #97621a;
  --warning-soft: #fff4df;
  --danger: #b43b49;
  --danger-hover: #9e2e3b;
  --danger-soft: #fff0f1;
  --info: #3568a8;
  --info-soft: #edf4fb;
  --shadow-xs: 0 1px 2px rgba(19, 51, 62, 0.04);
  --shadow-sm: 0 8px 24px rgba(19, 51, 62, 0.055);
  --shadow-md: 0 16px 42px rgba(17, 48, 61, 0.11);
  --shadow-lg: 0 26px 70px rgba(10, 35, 48, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 256px;
  --topbar-height: 76px;
}

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

html {
  min-width: 0;
  min-height: 100%;
  color-scheme: light;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button,
input,
select,
textarea {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(15, 107, 112, 0.22);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--primary);
}

.is-hidden {
  display: none !important;
}

.visually-hidden,
.icon-sprite {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--navy-deep);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  background: linear-gradient(145deg, #17868a, #0b6065);
  box-shadow: 0 9px 22px rgba(9, 82, 86, 0.2);
}

.brand-mark::after {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  content: "";
}

.brand-mark i {
  position: absolute;
  z-index: 1;
  width: 20px;
  height: 5px;
  border-radius: 5px;
  background: #fff;
}

.brand-mark i:last-child {
  transform: rotate(90deg);
}

.brand-mark-inverse {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}

.brand-mark-large {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 15px;
}

/* Common controls */

.primary-button,
.soft-button,
.outline-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button .ui-icon,
.soft-button .ui-icon,
.outline-button .ui-icon {
  width: 17px;
  height: 17px;
}

.primary-button {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(10, 92, 97, 0.15);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  box-shadow: 0 8px 18px rgba(10, 92, 97, 0.2);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled),
.soft-button:active:not(:disabled),
.outline-button:active:not(:disabled),
.danger-button:active:not(:disabled) {
  transform: translateY(0);
}

.soft-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.soft-button:hover:not(:disabled) {
  border-color: #b9d3d4;
  color: var(--primary-hover);
  background: var(--primary-soft);
}

.outline-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: #fff;
}

.outline-button:hover:not(:disabled) {
  border-color: #a9c8ca;
  color: var(--primary-hover);
  background: #f7fbfa;
}

.danger-button {
  min-width: 96px;
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.danger-button:hover:not(:disabled) {
  border-color: var(--danger-hover);
  background: var(--danger-hover);
}

.text-button,
.icon-text-button {
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover,
.icon-text-button:hover {
  background: var(--primary-soft);
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.inline-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.72;
  animation: spin 700ms linear infinite;
}

.is-loading .button-spinner {
  display: block;
}

.is-loading .button-text {
  opacity: 0.82;
}

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

/* Boot */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(36, 139, 141, 0.08), transparent 30%),
    var(--canvas);
}

.boot-card {
  display: flex;
  align-items: center;
  width: min(100%, 390px);
  padding: 22px;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

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

.boot-copy strong {
  color: var(--navy);
  font-size: 15px;
}

.boot-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.boot-spinner,
.state-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 2px solid #d9e9e8;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

/* Login */

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(560px, 1.12fr) minmax(480px, 0.88fr);
  background: var(--surface);
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(42px, 5vw, 78px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #102f41 0%, #174654 54%, #155b5e 100%);
}

.login-visual::before {
  position: absolute;
  right: -130px;
  bottom: -160px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(160, 230, 225, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 84px rgba(255, 255, 255, 0.018), 0 0 0 168px rgba(255, 255, 255, 0.012);
  content: "";
}

.login-grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom right, #000, transparent 74%);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.login-orb-one {
  top: -150px;
  left: -120px;
  width: 380px;
  height: 380px;
  background: rgba(55, 171, 171, 0.1);
}

.login-orb-two {
  right: 12%;
  bottom: 19%;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(161, 228, 223, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.login-visual-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 760px);
  margin: 0 auto;
  flex-direction: column;
}

.login-brand-row,
.mobile-login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-brand-row > div:last-child,
.mobile-login-brand > div:last-child {
  display: flex;
  flex-direction: column;
}

.login-brand-row strong,
.mobile-login-brand strong {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.login-brand-row span,
.mobile-login-brand span {
  margin-top: 2px;
  color: rgba(233, 247, 245, 0.72);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.login-visual-main {
  max-width: 620px;
  margin-top: auto;
  padding-top: 70px;
}

.visual-kicker {
  display: flex;
  align-items: center;
  margin: 0 0 21px !important;
  gap: 9px;
  color: rgba(224, 244, 241, 0.72) !important;
  font-size: 12px !important;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.visual-kicker span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #72c4be;
}

.login-visual h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 4.35vw, 64px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.login-visual-main > p:last-child {
  max-width: 590px;
  margin: 24px 0 0;
  color: rgba(231, 245, 244, 0.68);
  font-size: 15px;
  line-height: 1.85;
}

.visual-points {
  display: grid;
  max-width: 720px;
  margin-top: 48px;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-points article {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 13px 14px;
  gap: 11px;
  border: 1px solid rgba(218, 244, 241, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.visual-points article > .ui-icon {
  width: 24px;
  height: 24px;
  color: #8ed2cc;
}

.visual-points article div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.visual-points strong {
  color: rgba(255, 255, 255, 0.93);
  font-size: 12px;
}

.visual-points span {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(229, 245, 243, 0.68);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-footnote {
  display: flex;
  align-items: center;
  margin: auto 0 0;
  padding-top: 48px;
  gap: 8px;
  color: rgba(226, 244, 241, 0.68);
  font-size: 11px;
}

.visual-footnote .ui-icon {
  width: 16px;
  height: 16px;
}

.login-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 48px clamp(38px, 5.5vw, 86px);
  place-items: center;
  background:
    radial-gradient(circle at 100% 0, rgba(15, 107, 112, 0.055), transparent 29%),
    #fff;
}

.login-panel-inner {
  width: min(100%, 440px);
}

.mobile-login-brand {
  display: none;
  margin-bottom: 50px;
  color: var(--navy);
}

.mobile-login-brand span {
  color: var(--muted);
}

.login-card {
  width: 100%;
}

.login-context {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  gap: 7px;
  border: 1px solid #cfe3e2;
  border-radius: 999px;
  color: var(--primary-hover);
  background: #f4faf9;
  font-size: 11px;
  font-weight: 650;
}

.login-context span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #29a47e;
  box-shadow: 0 0 0 3px rgba(41, 164, 126, 0.12);
}

.login-card h2 {
  margin: 21px 0 0;
  color: var(--navy-deep);
  font-size: 32px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.login-description {
  margin: 10px 0 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.field-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.login-card .field-block + .field-block {
  margin-top: 19px;
}

.field-block > span {
  color: #3d505b;
  font-size: 12px;
  font-weight: 650;
}

.field-block > span b {
  color: var(--danger);
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfcfc;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

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

.input-shell:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 107, 112, 0.09);
}

.input-shell input {
  min-width: 0;
  height: 50px;
  flex: 1;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 14px;
}

.input-shell input:focus-visible,
.filter-bar input:focus-visible,
.filter-bar select:focus-visible,
.field-block input:focus-visible,
.field-block select:focus-visible,
.field-block textarea:focus-visible {
  outline: none;
}

.input-shell input::placeholder,
.field-block input::placeholder,
.field-block textarea::placeholder {
  color: #98a6ae;
}

.input-shell .input-icon {
  width: 19px;
  height: 19px;
  color: #71838c;
}

.login-button {
  width: 100%;
  min-height: 52px;
  margin-top: 27px;
  border-radius: 10px;
  font-size: 14px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  margin-top: 19px;
  padding: 12px 13px;
  gap: 9px;
  border: 1px solid #e1e9e8;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.6;
}

.security-note .ui-icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--success);
}

.login-copyright {
  margin: 38px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.form-error {
  position: relative;
  margin-top: 15px;
  padding: 11px 13px 11px 37px;
  border: 1px solid #efc6cb;
  border-radius: 9px;
  color: #96323d;
  background: var(--danger-soft);
  font-size: 12px;
  line-height: 1.55;
}

.form-error::before {
  position: absolute;
  top: 11px;
  left: 14px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  content: "!";
  font-size: 10px;
  font-weight: 800;
}

/* Application shell */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  padding: 22px 16px 18px;
  flex-direction: column;
  color: #e7f1f2;
  background:
    radial-gradient(circle at 15% -3%, rgba(60, 157, 154, 0.19), transparent 27%),
    linear-gradient(180deg, #17394b 0%, #112f40 100%);
  box-shadow: 7px 0 25px rgba(14, 42, 55, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 8px;
  gap: 12px;
}

.sidebar-brand .brand-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
}

.sidebar-brand .brand-mark i {
  width: 18px;
  height: 4px;
}

.sidebar-brand > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.sidebar-brand span {
  margin-top: 3px;
  color: rgba(221, 237, 238, 0.7);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.nav-section-label {
  margin: 32px 12px 10px;
  color: rgba(221, 237, 238, 0.64);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.side-nav {
  display: flex;
  gap: 5px;
  flex-direction: column;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: rgba(230, 241, 242, 0.68);
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.nav-item::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #82d1ca;
  content: "";
  opacity: 0;
  transform: translateY(-50%);
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  border-color: rgba(179, 225, 222, 0.1);
  color: #fff;
  background: rgba(95, 175, 171, 0.14);
}

.nav-item.is-active::after {
  opacity: 1;
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  color: #9bbabd;
  background: rgba(255, 255, 255, 0.05);
}

.nav-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.nav-item.is-active .nav-icon {
  color: #b5e7e2;
  background: rgba(115, 200, 193, 0.13);
}

.sidebar-assurance {
  display: flex;
  align-items: flex-start;
  margin: auto 2px 15px;
  padding: 12px;
  gap: 9px;
  border: 1px solid rgba(203, 232, 231, 0.08);
  border-radius: 9px;
  color: rgba(222, 238, 239, 0.66);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  line-height: 1.55;
}

.sidebar-assurance .ui-icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: rgba(142, 210, 204, 0.7);
}

.sidebar-assurance span {
  display: flex;
  flex-direction: column;
}

.sidebar-assurance strong {
  margin-bottom: 2px;
  color: rgba(235, 246, 246, 0.72);
  font-size: 10px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  min-height: 57px;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(220, 238, 239, 0.09);
}

.sidebar-user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  color: #143849;
  background: #b9ddd9;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-user-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  margin-left: 10px;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy span {
  margin-top: 2px;
  color: rgba(222, 237, 238, 0.66);
  font-size: 9px;
}

.logout-icon {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: rgba(226, 240, 241, 0.58);
  background: transparent;
}

.logout-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.logout-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 12px clamp(22px, 2.6vw, 38px);
  border-bottom: 1px solid rgba(216, 226, 228, 0.92);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(18, 50, 60, 0.018);
  backdrop-filter: blur(15px);
}

.topbar-copy {
  min-width: 0;
  flex: 1;
}

.topbar-copy h1 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 19px;
  font-weight: 690;
  letter-spacing: -0.02em;
}

.topbar-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.topbar-actions button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 11px;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: var(--line);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 2px;
  background: #536873;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(12, 32, 43, 0.5);
  backdrop-filter: blur(2px);
}

.content-area {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 28px clamp(22px, 2.6vw, 38px) 54px;
}

.view-section {
  animation: view-in 180ms ease-out;
}

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

/* Overview */

.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 146px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid #d8e6e7;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(227, 242, 241, 0.78), rgba(255, 255, 255, 0.96) 52%),
    #fff;
  box-shadow: var(--shadow-xs);
}

.welcome-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
  content: "";
}

.welcome-panel::after {
  position: absolute;
  right: 13%;
  bottom: -95px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(15, 107, 112, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 47px rgba(15, 107, 112, 0.018), 0 0 0 94px rgba(15, 107, 112, 0.012);
  content: "";
}

.welcome-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.section-kicker {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 7px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.section-kicker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #42a99d;
}

.welcome-panel h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.welcome-panel p {
  max-width: 700px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-date {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 250px;
  padding: 15px 17px;
  gap: 12px;
  border: 1px solid #dbe7e8;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-xs);
}

.welcome-date > .ui-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.welcome-date div {
  display: flex;
  flex-direction: column;
}

.welcome-date span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
}

.welcome-date small {
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 9px;
}

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

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 116px;
  padding: 20px;
  gap: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat-card::after {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: currentColor;
  content: "";
  opacity: 0.55;
}

.stat-card:hover {
  border-color: #d4e1e2;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

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

.stat-icon .ui-icon {
  width: 23px;
  height: 23px;
}

.stat-blue { color: #326e9e; }
.stat-blue .stat-icon { color: #326e9e; background: #edf5fb; }
.stat-cyan { color: #0f7a78; }
.stat-cyan .stat-icon { color: #0f7a78; background: #e9f6f4; }
.stat-indigo { color: #5d639c; }
.stat-indigo .stat-icon { color: #5d639c; background: #f0f1f8; }
.stat-amber { color: #9b6a25; }
.stat-amber .stat-icon { color: #9b6a25; background: #fff5e5; }

.stat-card > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-card strong {
  margin-top: 4px;
  color: var(--navy-deep);
  font-size: 27px;
  font-weight: 720;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card small {
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 10px;
}

.inline-state {
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid #efc8cc;
  border-radius: 9px;
  color: #933640;
  background: var(--danger-soft);
  font-size: 11px;
}

.overview-grid {
  display: grid;
  margin-top: 18px;
  gap: 16px;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
}

.content-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.quick-panel,
.guidance-panel {
  padding: 22px;
}

.card-heading,
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-heading h3,
.table-heading h3 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 14px;
  font-weight: 680;
}

.card-heading p,
.table-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.quick-actions {
  display: grid;
  margin-top: 17px;
  gap: 8px;
}

.quick-actions button {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 10px 13px;
  gap: 12px;
  border: 1px solid #e5ebec;
  border-radius: 10px;
  color: var(--ink);
  background: #fafcfc;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.quick-actions button:hover {
  border-color: #c4d9da;
  background: #f4f9f8;
  transform: translateX(2px);
}

.quick-actions button > span {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}

.quick-actions button > span .ui-icon {
  width: 19px;
  height: 19px;
}

.quick-actions button div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.quick-actions button strong {
  font-size: 12px;
  font-weight: 650;
}

.quick-actions button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.quick-actions button b {
  color: #8da0a7;
}

.quick-actions button b .ui-icon {
  width: 17px;
  height: 17px;
}

.guidance-list {
  display: grid;
  margin: 18px 0 0;
  padding: 0;
  gap: 0;
  list-style: none;
}

.guidance-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 0 0 18px;
}

.guidance-list li:last-child {
  padding-bottom: 0;
}

.guidance-list li:not(:last-child)::after {
  position: absolute;
  top: 27px;
  bottom: 3px;
  left: 13px;
  width: 1px;
  background: #dce9e8;
  content: "";
}

.guidance-list li > span {
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  margin-right: 11px;
  border: 1px solid #cbe2df;
  border-radius: 50%;
  color: var(--primary);
  background: #f4faf9;
}

.guidance-list li > span .ui-icon {
  width: 14px;
  height: 14px;
}

.guidance-list strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.guidance-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

/* Page sections and tables */

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 78px;
  margin-bottom: 18px;
}

.section-toolbar .section-kicker {
  margin-bottom: 5px;
}

.section-toolbar h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 24px;
  font-weight: 710;
  letter-spacing: -0.035em;
}

.section-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.compact-button {
  min-height: 40px;
  padding: 0 15px;
}

.data-card {
  overflow: hidden;
}

.table-heading {
  min-height: 68px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: #c4d1d4 transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 8px;
  background: #cbd7d9;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid #e8edee;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #647782;
  background: #f7f9f9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover td {
  background: #fafcfc;
}

.actions-column {
  min-width: 126px;
  text-align: right;
}

.cell-primary {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-secondary {
  display: block;
  max-width: 260px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-stack {
  display: flex;
  min-width: 125px;
  flex-direction: column;
}

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

.table-avatar {
  position: relative;
  display: grid;
  width: 38px;
  height: 42px;
  flex: 0 0 38px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #d6e5e3;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #79b9b4, #287b7d);
  font-size: 13px;
  font-weight: 750;
}

.table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-active,
.status-confirmed,
.status-completed {
  border-color: #cce8dc;
  color: var(--success);
  background: var(--success-soft);
}

.status-inactive,
.status-cancelled {
  border-color: #e6dadd;
  color: #82545b;
  background: #f7f1f2;
}

.status-pending {
  border-color: #ecdcb9;
  color: var(--warning);
  background: var(--warning-soft);
}

.status-unknown {
  border-color: #dae1e4;
  color: #667983;
  background: #f0f3f4;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d6e1e3;
  border-radius: 7px;
  color: #2e6870;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.table-action:hover {
  border-color: #a9cdcd;
  color: var(--primary-hover);
  background: #f3f9f8;
}

.table-action.danger {
  color: var(--danger);
}

.table-action.danger:hover {
  border-color: #e8bcc2;
  background: var(--danger-soft);
}

.data-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 38px 20px;
  flex-direction: column;
  color: var(--muted);
  text-align: center;
}

.data-state .state-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 15px;
  border-width: 3px;
}

.state-icon {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid #d8e6e5;
  border-radius: 14px;
  color: var(--primary);
  background: #f1f8f7;
  font-size: 18px;
  font-weight: 750;
}

.data-state[data-state="error"] .state-icon {
  border-color: #efc9ce;
  color: var(--danger);
  background: var(--danger-soft);
}

.data-state strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.data-state p {
  max-width: 420px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.retry-button {
  min-height: 34px;
  margin-top: 14px;
  padding: 0 13px;
  border: 1px solid #bcd4d4;
  border-radius: 8px;
  color: var(--primary-hover);
  background: #f3f9f8;
  font-size: 10px;
  font-weight: 650;
}

/* Filters and pagination */

.filter-bar {
  display: flex;
  align-items: flex-end;
  padding: 18px 20px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fafcfc;
}

.filter-bar label {
  display: flex;
  min-width: 150px;
  flex-direction: column;
  gap: 6px;
}

.filter-bar label > span {
  color: #5d707b;
  font-size: 10px;
  font-weight: 700;
}

.filter-bar select,
.filter-bar input {
  width: 100%;
  height: 39px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 12px;
}

.filter-bar select {
  padding: 0 30px 0 11px;
}

.filter-search {
  max-width: 390px;
  flex: 1;
}

.filter-input-shell {
  position: relative;
}

.filter-input-shell .ui-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 16px;
  height: 16px;
  color: #83949c;
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-input-shell input {
  padding: 0 12px 0 34px;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 112, 0.08);
}

.filter-button {
  min-height: 39px;
  white-space: nowrap;
}

.appointment-heading {
  border-top: 0;
}

.appointment-table {
  min-width: 1080px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 62px;
  padding: 12px 20px;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fafcfc;
  font-size: 11px;
}

.pagination button {
  min-height: 33px;
  padding: 0 12px;
  font-size: 11px;
}

.status-select {
  min-width: 92px;
  height: 32px;
  padding: 0 25px 0 8px;
  border: 1px solid #ccdadd;
  border-radius: 7px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}

.status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 112, 0.08);
}

/* Forms and dialogs */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 22px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(12, 33, 44, 0.56);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 700px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  scrollbar-color: #c6d2d5 transparent;
  scrollbar-width: thin;
  animation: modal-in 170ms ease-out;
}

.modal-card-wide {
  width: min(100%, 980px);
}

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

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.modal-title-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #d5e6e4;
  border-radius: 9px;
  color: var(--primary);
  background: #f0f8f7;
}

.modal-title-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.modal-header p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.modal-header h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 17px;
  font-weight: 690;
}

.modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #647780;
  background: #f8fafa;
  font-size: 21px;
  line-height: 1;
}

.modal-close:hover {
  border-color: #d1dcdc;
  color: var(--ink);
  background: #f2f5f5;
}

.entity-form {
  padding: 22px;
}

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

.form-span-two {
  grid-column: span 2;
}

.form-section-heading {
  display: flex;
  align-items: baseline;
  margin: 3px 0 -2px;
  padding: 0 0 9px;
  gap: 9px;
  border-bottom: 1px solid #e7eded;
}

.form-section-heading:not(:first-child) {
  margin-top: 8px;
}

.form-section-heading strong {
  color: var(--navy-deep);
  font-size: 12px;
  font-weight: 700;
}

.form-section-heading span {
  color: var(--muted-light);
  font-size: 10px;
}

.entity-form .field-block input,
.entity-form .field-block select,
.entity-form .field-block textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfc;
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.entity-form .field-block input,
.entity-form .field-block select {
  height: 41px;
  padding: 0 11px;
}

.entity-form .field-block textarea {
  min-height: 104px;
  padding: 10px 11px;
  line-height: 1.65;
  resize: vertical;
}

.entity-form .field-block input:hover,
.entity-form .field-block select:hover,
.entity-form .field-block textarea:hover {
  border-color: #b9cacc;
}

.entity-form .field-block input:focus,
.entity-form .field-block select:focus,
.entity-form .field-block textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 107, 112, 0.08);
}

.entity-form .field-block input[readonly] {
  cursor: default;
  color: #64767f;
  background: #f0f3f3;
}

.entity-form .field-block input[readonly]:hover,
.entity-form .field-block input[readonly]:focus {
  border-color: var(--line-strong);
  box-shadow: none;
}

.field-hint {
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.55;
}

.field-callout {
  position: relative;
  margin: -4px 0 2px;
  padding: 10px 12px 10px 32px;
  border: 1px solid #dce9e8;
  border-radius: 8px;
  color: #64787f;
  background: #f6f9f9;
}

.field-callout::before {
  position: absolute;
  top: 9px;
  left: 12px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid #9abdbb;
  border-radius: 50%;
  color: var(--primary);
  content: "i";
  font-size: 9px;
  font-weight: 800;
}

.modal-footer {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: 23px -22px -22px;
  padding: 14px 22px;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: rgba(249, 251, 251, 0.97);
  backdrop-filter: blur(10px);
}

.doctor-form-layout {
  display: grid;
  align-items: start;
  gap: 24px;
  grid-template-columns: 145px minmax(0, 1fr);
}

.avatar-editor {
  position: sticky;
  top: 92px;
  display: flex;
  align-items: center;
  padding: 15px 12px;
  flex-direction: column;
  border: 1px solid #e1e9e9;
  border-radius: 11px;
  background: #f9fbfb;
}

.avatar-preview {
  position: relative;
  display: grid;
  width: 112px;
  height: 128px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #a9ccca;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #9bcac6, #3a8585);
  box-shadow: 0 7px 18px rgba(34, 104, 106, 0.12);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview > span {
  font-size: 33px;
  font-weight: 750;
}

.avatar-uploading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  background: rgba(12, 55, 62, 0.78);
}

.avatar-uploading .button-spinner {
  display: block;
}

.avatar-uploading b {
  margin-top: 7px;
  font-size: 9px;
}

.avatar-button {
  width: 112px;
  min-height: 34px;
  margin-top: 11px;
  padding: 0 8px;
  font-size: 10px;
}

.avatar-editor .text-button {
  margin-top: 4px;
  font-size: 10px;
}

.avatar-editor p {
  margin: 7px 0 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.confirm-card {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modal-in 170ms ease-out;
}

.confirm-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  place-items: center;
  border: 1px solid #efc8cd;
  border-radius: 14px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 20px;
  font-weight: 800;
}

.confirm-card h2 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 17px;
  font-weight: 690;
}

.confirm-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

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

.confirm-actions button {
  min-width: 102px;
}

/* Toasts */

.toast-region {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 120;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 58px;
  padding: 12px 14px;
  gap: 10px;
  overflow: hidden;
  border: 1px solid #d7e3e4;
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
  animation: toast-in 190ms ease-out;
}

.toast::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
  content: "";
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-5px);
}

.toast-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.toast.success::before,
.toast.success .toast-icon { background: var(--success); }
.toast.error::before,
.toast.error .toast-icon { background: var(--danger); }
.toast.warning::before,
.toast.warning .toast-icon { background: var(--warning); }

.toast-copy {
  min-width: 0;
  flex: 1;
}

.toast-copy strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.toast-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

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

body.has-modal {
  overflow: hidden;
}

/* Responsive */

@media (max-width: 1240px) {
  .login-screen {
    grid-template-columns: minmax(500px, 1fr) minmax(440px, 0.85fr);
  }

  .visual-points {
    grid-template-columns: 1fr;
  }

  .visual-points article {
    min-height: 58px;
  }

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

@media (max-width: 960px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 38px 24px;
    background:
      radial-gradient(circle at 100% 0, rgba(15, 107, 112, 0.08), transparent 36%),
      linear-gradient(180deg, #f8fbfa 0%, #fff 48%);
  }

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

  .sidebar {
    width: 252px;
    visibility: hidden;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform 200ms ease, opacity 160ms ease, visibility 0s linear 200ms;
  }

  .admin-app.menu-open .sidebar {
    visibility: visible;
    box-shadow: 10px 0 32px rgba(9, 29, 40, 0.2);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .admin-app.menu-open .mobile-overlay {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .menu-button {
    display: block;
  }

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

@media (max-width: 700px) {
  :root {
    --topbar-height: 66px;
  }

  .topbar {
    padding: 9px 14px;
  }

  .topbar-copy h1 {
    font-size: 17px;
  }

  .topbar-copy p,
  .topbar-divider,
  #topLogout {
    display: none;
  }

  .topbar-actions .soft-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .topbar-actions .soft-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .content-area {
    padding: 17px 12px 38px;
  }

  .welcome-panel {
    align-items: flex-start;
    min-height: 204px;
    padding: 23px 20px;
    flex-direction: column;
  }

  .welcome-panel h2 {
    font-size: 22px;
  }

  .welcome-date {
    min-width: 0;
    width: 100%;
    margin-top: 20px;
    padding: 12px 14px;
  }

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

  .stat-card {
    min-height: 120px;
    padding: 15px;
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 10px;
  }

  .stat-icon .ui-icon {
    width: 19px;
    height: 19px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .quick-panel,
  .guidance-panel {
    padding: 18px;
  }

  .section-toolbar {
    align-items: flex-start;
    min-height: 0;
    margin: 6px 0 16px;
    gap: 14px;
  }

  .section-toolbar h2 {
    font-size: 21px;
  }

  .section-toolbar .compact-button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .table-heading {
    min-height: 64px;
    padding: 14px 15px;
  }

  .filter-bar {
    align-items: stretch;
    padding: 15px;
    flex-wrap: wrap;
  }

  .filter-bar label,
  .filter-search {
    min-width: 0;
    max-width: none;
    width: 100%;
    flex-basis: 100%;
  }

  .filter-bar .filter-button {
    flex: 1;
  }

  .table-wrap {
    padding: 0 10px 10px;
    overflow: visible;
    background: #f7f9f9;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-xs);
  }

  tbody tr:hover td {
    background: #fff;
  }

  td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 43px;
    padding: 11px 12px;
    gap: 16px;
    border-bottom: 1px solid #edf1f1;
    font-size: 12px;
    text-align: right;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    flex: 0 0 72px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: left;
  }

  td > * {
    min-width: 0;
  }

  .cell-primary,
  .cell-secondary {
    max-width: 210px;
    text-align: right;
  }

  .cell-secondary {
    font-size: 10px;
  }

  .table-action,
  .status-select {
    font-size: 11px;
  }

  .status-badge {
    font-size: 10px;
  }

  .doctor-cell {
    justify-content: flex-end;
    min-width: 0;
  }

  .doctor-cell > span:last-child {
    min-width: 0;
  }

  .row-actions {
    flex: 1;
  }

  .actions-column {
    min-width: 0;
  }

  .appointment-table {
    min-width: 0;
  }

  .pagination {
    justify-content: center;
    padding: 13px 14px;
  }

  .status-select {
    margin-left: auto;
  }

  .data-state {
    min-height: 220px;
  }

  .modal-layer {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 15px 15px 0 0;
  }

  .modal-header {
    min-height: 68px;
    padding: 12px 15px;
  }

  .modal-title-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .entity-form {
    padding: 16px;
  }

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

  .form-span-two {
    grid-column: auto;
  }

  .doctor-form-layout {
    grid-template-columns: 1fr;
  }

  .avatar-editor {
    position: static;
  }

  .avatar-editor p {
    max-width: 220px;
  }

  .modal-footer {
    bottom: -16px;
    margin: 21px -16px -16px;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  }

  .confirm-card {
    width: calc(100% - 24px);
    margin-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .toast-region {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 430px) {
  .login-panel {
    padding-inline: 19px;
  }

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

  .login-card h2 {
    font-size: 28px;
  }

  .login-copyright {
    margin-top: 30px;
  }

  .stat-card {
    min-height: 116px;
  }

  .section-toolbar .compact-button span {
    display: none;
  }

  .section-toolbar .compact-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }
}

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

  .stat-card {
    min-height: 90px;
    align-items: center;
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .stat-icon,
  .nav-icon,
  .status-badge,
  .state-icon,
  .confirm-icon {
    forced-color-adjust: none;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid CanvasText;
  }
}

@media print {
  .sidebar,
  .topbar,
  .section-toolbar button,
  .filter-bar,
  .actions-column,
  .toast-region {
    display: none !important;
  }

  .workspace {
    margin-left: 0;
  }

  .content-area {
    padding: 0;
  }

  .content-card,
  .stat-card,
  .welcome-panel {
    box-shadow: none;
  }
}
