:root {
  /* Mirror the Windows client's src/index.css and Tailwind color tokens. */
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: hsl(222 47% 11%);
  background: #eff6ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --bg: #eff6ff;
  --ink: hsl(222 47% 11%);
  --sub: hsl(215 16% 47%);
  --border: hsl(214 32% 88%);
  --primary: hsl(201 91% 40%);
  --primary-dark: hsl(201 91% 35%);
  --primary-soft: hsl(201 91% 94%);
  --accent: hsl(199 89% 48%);
  --sidebar: #10273e;
  --sidebar-soft: #163956;
  --green: #16866d;
  --radius: .9rem;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .54; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
svg { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; flex: none; }
svg use { pointer-events: none; }
.svg-defs { width: 0; height: 0; position: absolute; overflow: hidden; }
[hidden], .page-section[hidden] { display: none !important; }
code { padding: 1px 5px; border-radius: 5px; background: #e9f4fb; color: #0a719c; font-size: .93em; }
.app-shell {
  display: flex;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, .18), transparent 36%),
    radial-gradient(circle at 90% 0%, rgba(6, 182, 212, .12), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.sidebar { background: var(--sidebar); width: 252px; min-width: 252px; min-height: 100vh; padding: 29px 16px 24px; display: flex; flex-direction: column; color: #c0c8dd; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 1px 12px 47px; display: flex; align-items: center; gap: 13px; }
.brand-icon {
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  object-fit: contain;
  flex: none;
  /* The Tauri app icon already has a transparent background. */
  background: transparent;
}
.brand-name { font-size: 16px; font-weight: 750; color: white; line-height: 1.14; letter-spacing: -.5px; }
.brand-name > span, .login-brand > div:last-child > span { color: #8adfff; }
.brand-name small { display: block; font-weight: 650; font-size: 9px; line-height: 2.8; letter-spacing: 2.5px; color: #75839e; }
.sidebar-label { padding: 0 19px 12px; font-size: 10px; color: #829bb5; font-weight: 750; letter-spacing: 1.8px; }
.secondary-label { margin-top: 36px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 14px; background: transparent; color: #b6c9dc; font-size: 13px; font-weight: 600; border: 1px solid transparent; border-radius: 10px; text-align: left; transition: color .16s, background .16s; }
.nav-link svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-link:hover { background: #1b4362; color: #fff; }
.nav-link.is-active { background: #174d70; color: #fff; border-color: #23648a; box-shadow: inset 3px 0 #38bdf8; }
.nav-count { margin-left: auto; border-radius: 7px; padding: 2px 7px; background: #26475f; color: #cbdfec; font-size: 10px; }
.nav-link.is-active .nav-count { background: #27719a; color: white; }
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-note { border: 1px solid #2b5570; padding: 15px; border-radius: 12px; background: #183953; display: grid; column-gap: 10px; row-gap: 6px; grid-template-columns: 26px 1fr; }
.sidebar-note-icon { grid-row: span 2; display: flex; align-items: flex-start; justify-content: center; padding-top: 1px; color: #73d5ff; }
.sidebar-note-icon svg { width: 21px; height: 21px; }
.sidebar-note strong { color: #e4e8f2; font-size: 12px; font-weight: 700; }
.sidebar-note span:last-child { color: #8996b0; font-size: 11px; line-height: 1.6; }
.sidebar-bottom { display: flex; align-items: center; gap: 9px; border-top: 1px solid #2a4a64; padding: 20px 5px 0; margin-top: 22px; color: #9eafbf; font-size: 10px; }
.sidebar-bottom > span:last-child { margin-left: auto; }
.sidebar-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #5dcdb1; box-shadow: 0 0 0 3px #5dcdb117; }

.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 74px; min-height: 74px; background: #ffffffeb; backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 38px; }
.crumbs, .topbar-right { display: flex; align-items: center; gap: 13px; }
.crumbs { font-size: 12px; color: #9aa4b6; white-space: nowrap; }
.crumbs svg { width: 13px; height: 13px; color: #c3cad7; }
.crumbs strong { color: #2b3247; font-weight: 650; }
.topbar-right { gap: 20px; }
.demo-chip { display: flex; align-items: center; gap: 8px; background: #eaf7fe; color: #087aa7; padding: 7px 11px; border: 1px solid #bde7f9; border-radius: 8px; font-weight: 700; font-size: 11px; white-space: nowrap; }
.demo-chip > span { height: 6px; width: 6px; border-radius: 50%; background: #0ea5e9; }
.topbar-separator { height: 29px; border-left: 1px solid #e8eaf2; }
.account-button { display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 5px; color: #29324a; text-align: left; border-radius: 10px; }
.account-button:hover { background: #f5f6fb; }
.account-button > svg { width: 14px; height: 14px; transform: rotate(90deg); color: #a1a9b8; margin-left: 9px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #0877a3; background: #e2f4ff; border-radius: 11px; width: 37px; height: 37px; }
.account-text { display: grid; gap: 4px; }
.account-text strong { font-size: 12px; font-weight: 750; }
.account-text small { font-size: 10px; color: #a0a8b8; }
.main-content { padding: 35px 39px 35px; width: 100%; max-width: 1700px; margin: 0 auto; flex: 1; }
.page-section { animation: fade-in .16s ease; }
@keyframes fade-in { from { opacity: .58; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 2.3px; font-weight: 780; color: #087fa9; margin-bottom: 12px; }
.eyebrow-line { display: inline-block; height: 2px; width: 18px; background: #0ea5e9; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(28px, 3vw, 37px); line-height: 1.22; font-weight: 760; letter-spacing: -1.5px; color: #212a3e; }
.title-period { color: var(--accent); }
.page-subtitle { font-size: 13px; color: var(--sub); margin: 0; line-height: 1.7; }
.primary-button, .secondary-button, .danger-button { border: 1px solid transparent; border-radius: 10px; min-height: 40px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 650; font-size: 12px; line-height: 1.2; white-space: nowrap; transition: background-color .17s ease, border-color .17s ease, box-shadow .17s ease; }
.primary-button { color: white; background: var(--primary); box-shadow: 0 2px 5px #16456b1c; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--border); }
.secondary-button:hover { background: #f1f7fc; }
.danger-button { background: #d44859; color: white; }
.danger-button:hover { background: #b9394a; }
.primary-button svg, .secondary-button svg { width: 15px; height: 15px; }
.icon-button { border: 1px solid var(--border); width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: #fff; color: #64748b; }
.icon-button:hover { background: #eef7fd; color: var(--primary); }
.icon-button svg { width: 16px; height: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; margin: 22px 0 23px; }
.stat-card { min-height: 141px; border: 1px solid var(--border); background: #ffffffed; border-radius: var(--radius); padding: 19px 19px 17px; box-shadow: 0 2px 6px #14385808; }
.stat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; color: #8a93a5; font-size: 11px; font-weight: 640; }
.stat-icon { display: grid; place-items: center; border-radius: 9px; width: 33px; height: 33px; margin-top: -2px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.sage { background: #e6f8f3; color: #3bab96; }
.stat-icon.blue { background: #e4f4ff; color: #098ac2; }
.stat-icon.aqua { background: #e8f5fc; color: #1788a7; }
.stat-icon.amber { background: #fff4e4; color: #dd9e4b; }
.stat-value { font-weight: 770; color: #20283e; font-size: 31px; letter-spacing: -1px; margin: 5px 0 10px; line-height: 1; }
.stat-value small { font-size: 17px; font-weight: 500; color: #a7adba; }
.stat-foot { font-size: 10px; color: #a3aab7; display: flex; align-items: center; gap: 7px; }
.positive-dot, .neutral-dot { height: 7px; width: 7px; background: #35c1a4; border-radius: 50%; }
.neutral-dot { background: #9fc4d6; }
.section-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(285px,1fr); gap: 18px; }
.surface-card { background: #ffffffef; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 6px #1438580a; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 21px 15px; }
.card-heading h2 { font-size: 15px; font-weight: 770; letter-spacing: -.3px; color: #283047; margin-bottom: 4px; }
.card-heading p { font-size: 11px; line-height: 1.5; color: #a2aaba; margin: 0; }
.text-action { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--primary); font-size: 11px; font-weight: 730; white-space: nowrap; }
.text-action:hover { color: var(--primary-dark); }
.text-action svg { width: 13px; height: 13px; }
.overview-node { min-height: 64px; margin: 0 21px; border-top: 1px solid #f2f3f7; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.overview-node:first-child { border-top: 0; }
.node-identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.node-flag { width: 36px; height: 36px; border-radius: 10px; background: #ebf5fc; display: grid; place-items: center; font-size: 19px; flex: none; }
.node-identity strong { display: block; color: #2c3449; font-size: 12px; font-weight: 760; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-identity small { display: block; font-size: 10px; color: #a3aab9; margin-top: 5px; }
.overview-node-details { display: flex; align-items: center; gap: 12px; }
.node-ping { font-size: 10px; color: #a3aabb; white-space: nowrap; }
.status-badge { padding: 6px 9px; border-radius: 7px; font-size: 10px; font-weight: 720; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.status-badge::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-badge.online, .status-badge.active { background: #e8f8f2; color: #2b9e7d; }
.status-badge.blocked, .status-badge.revoked, .status-badge.expired { background: #fff0ef; color: #dc766d; }
.status-badge.pending, .status-badge.revoking { background: #fff7e8; color: #c8943c; }
.status-badge.subtle { background: #eef3f8; color: #687b8c; }
.activity-preview { padding: 0 20px 8px; }
.activity-item { display: flex; align-items: flex-start; gap: 11px; border-top: 1px solid #f3f4f8; padding: 15px 0; }
.activity-preview .activity-item:first-child { border-top: 0; }
.activity-icon { height: 32px; width: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: #e5f5ff; color: #1686bd; }
.activity-icon.ok { background: #ecf8f4; color: #36ac96; }
.activity-icon.warn { background: #fff2ea; color: #d6a164; }
.activity-icon svg { height: 15px; width: 15px; }
.activity-content { flex: 1; min-width: 0; }
.activity-content strong { font-size: 11px; color: #323b50; line-height: 1.5; display: block; }
.activity-content p { font-size: 10px; line-height: 1.6; color: #a2aaba; margin: 4px 0 0; }
.activity-time { font-size: 10px; color: #b0b7c3; white-space: nowrap; margin-top: 2px; }

.info-banner { border: 1px solid #c6e8f9; background: #eaf7ff; color: #1488b8; border-radius: 12px; padding: 16px 19px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 12px; }
.info-banner svg { height: 20px; width: 20px; margin-top: 1px; }
.info-banner strong { font-size: 12px; color: #086e98; }
.info-banner p { font-size: 11px; color: #598a9e; line-height: 1.65; margin: 5px 0 0; }
.info-banner.lighter { background: #edf8fe; border-color: #d5eaf6; color: #488caf; }
.info-banner.lighter strong { color: #296e91; }
.info-banner.lighter p { color: #6b95a8; }
.page-table-card { margin-top: 1px; min-height: 310px; }
.page-table-card .card-heading { padding-top: 23px; padding-bottom: 21px; }
.muted-count { font-size: 11px; color: #aaaec1; font-weight: 500; margin-left: 4px; }
.select-control { height: 36px; max-width: 200px; color: #536479; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0 11px; font-size: 11px; }
.filter-header { flex-wrap: wrap; }
.filter-controls { display: flex; gap: 9px; align-items: center; }
.search-control { display: flex; align-items: center; height: 36px; border: 1px solid var(--border); border-radius: 10px; gap: 7px; padding: 0 10px; background: #fff; }
.search-control svg { width: 14px; height: 14px; color: #a6adba; }
.search-control input { min-width: 0; width: 170px; border: 0; outline: 0; background: transparent; color: #30374a; font-size: 11px; }
.search-control input::placeholder { color: #adb5c2; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 11px; }
.data-table thead { background: #f4f9fd; }
.data-table th { padding: 15px 20px; color: #9ca5b6; font-size: 10px; letter-spacing: .3px; font-weight: 760; }
.data-table td { padding: 15px 20px; border-top: 1px solid #f0f2f6; color: #6e788c; vertical-align: middle; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f2f9fd; }
.data-table td .node-identity { gap: 10px; }
.data-table td .node-identity .node-flag { width: 33px; height: 33px; font-size: 17px; }
.data-table td .node-identity strong { font-size: 11px; }
.data-table td .node-identity small { font-size: 10px; }
.table-strong { display: block; font-size: 11px; color: #343d50; font-weight: 740; }
.table-secondary { display: block; font-size: 10px; margin-top: 4px; color: #a2aabb; }
.role-chip { display: inline-block; background: #e7f5fe; color: #1681b4; font-size: 10px; padding: 5px 9px; border-radius: 7px; font-weight: 680; }
.role-chip.reserve { color: #8792a7; background: #f4f6fa; }
.table-action { color: var(--primary); background: #edf8fe; border: 1px solid #ccebf9; border-radius: 9px; padding: 7px 10px; font-size: 10px; font-weight: 700; transition: background-color .17s; }
.table-action:hover { background: #dff2fd; }
.table-action.danger { color: #d45d69; background: #fff5f5; border-color: #ffebec; }
.table-empty { text-align: center; padding: 40px 20px !important; color: #a0a8b7 !important; }
.after-table-note { margin: 15px 4px; color: #a3aab9; font-size: 11px; display: flex; align-items: center; gap: 9px; line-height: 1.6; }
.after-table-note svg { width: 15px; height: 15px; color: #50a9d1; }
.profile-microstats { grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 21px; gap: 15px; }
.microstat { border-radius: var(--radius); background: #fff; border: 1px solid var(--border); padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 2px 6px #14385808; }
.microstat span { font-size: 11px; color: #8a94a6; }
.microstat strong { font-size: 22px; color: #30394c; }
.audit-card { max-width: 970px; }
.audit-timeline { padding: 0 26px 22px; }
.audit-timeline .activity-item { padding: 22px 0; }
.audit-timeline .activity-icon { width: 38px; height: 38px; }
.audit-timeline .activity-content strong { font-size: 12px; }
.audit-timeline .activity-content p { font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 19px; }
.setting-card { padding: 27px; }
.setting-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px; }
.setting-icon.blue { background: #e4f4ff; color: #0b84bc; }
.setting-icon.softblue { background: #e7f7fc; color: #1196ac; }
.setting-icon svg { width: 22px; height: 22px; }
.setting-card h2 { color: #293047; font-size: 18px; margin-bottom: 11px; }
.setting-card > p { color: #8792a7; line-height: 1.85; font-size: 12px; min-height: 88px; }
.setting-details { border-block: 1px solid #eff1f5; margin: 19px 0 19px; }
.setting-details > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 46px; border-top: 1px solid #f0f2f7; }
.setting-details > div:first-child { border-top: 0; }
.setting-details > div > span:first-child { color: #9aa2b2; font-size: 11px; }
.setting-details strong { font-weight: 720; font-size: 11px; color: #394357; text-align: right; }
.security-inline { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #969eb1; line-height: 1.5; }
.security-inline svg { width: 16px; height: 16px; color: #319ec6; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 39px 23px; font-size: 10px; color: #b0b7c5; }
.footer-divider { padding: 0 8px; color: #d1d5e0; }

.modal-overlay { position: fixed; z-index: 20; inset: 0; background: #111a30a8; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; overscroll-behavior: none; }
html.modal-scroll-lock { overflow: hidden; }
html.modal-scroll-lock body { padding-right: var(--modal-scrollbar-gap, 0px); }
html.modal-scroll-lock .toast { right: calc(25px + var(--modal-scrollbar-gap, 0px)); }
.modal-overlay:not([hidden]) { animation: modal-overlay-in .28s ease; }
.modal-overlay:not([hidden]) .modal-dialog { animation: modal-dialog-in .48s cubic-bezier(.16, 1, .3, 1); }
@keyframes modal-overlay-in {
  from { background-color: transparent; }
  to { background-color: #111a30a8; }
}
@keyframes modal-dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(.965); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay:not([hidden]),
  .modal-overlay:not([hidden]) .modal-dialog { animation: none; }
}
.modal-dialog {
  width: min(100%, 490px);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  padding: 4px 4px 4px 0;
  border-radius: 16px;
  box-shadow: 0 30px 80px #0a12354d;
}
.modal-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: calc(100vh - 44px);
  padding: 24px 10px 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: #b7cfe0 transparent;
}
.modal-scroll::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
.modal-scroll::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.modal-scroll::-webkit-scrollbar-thumb {
  background-color: #c5d6e4;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.modal-scroll::-webkit-scrollbar-thumb:hover { background-color: #8eb6cc; }
.modal-scroll::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.modal-scroll::-webkit-scrollbar-corner { background: transparent; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.modal-kicker { font-size: 10px; letter-spacing: 2px; font-weight: 800; color: var(--primary); }
.modal-heading h2 { font-size: 22px; color: #273049; margin: 8px 0 7px; letter-spacing: -.6px; }
.modal-heading p { font-size: 12px; color: #99a2b2; margin: 0; line-height: 1.6; }
.modal-tip { display: flex; gap: 10px; background: #fff8eb; border: 1px solid #faeccd; border-radius: 8px; padding: 12px; margin-bottom: 19px; color: #ab8844; font-size: 11px; line-height: 1.6; }
.modal-tip svg { width: 17px; height: 17px; flex: none; }
.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 7px; color: #454f64; font-weight: 700; font-size: 11px; }
.field input, .field select { display: block; width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 11px 12px; color: #343d52; font-size: 12px; min-height: 41px; }
.field input::placeholder { color: #b7bdc9; }
.field input:disabled { background: #eff5f9; opacity: .7; }
.field-hint { display: block; margin-top: 7px; color: #a0a9ba; font-size: 10px; }
.form-two-columns { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.small-modal { width: min(100%, 440px); }

.login-preview-overlay { position: fixed; z-index: 30; inset: 0; background: radial-gradient(circle at 70% 20%,#1b628b,#102b45 60%); overflow-y: auto; display: grid; place-items: center; padding: 30px 20px; }
.login-back { position: absolute; top: 25px; left: 27px; display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid #ffffff2c; color: #c7d0ed; border-radius: 9px; padding: 10px 13px; font-size: 11px; }
.login-back:hover { background: #ffffff13; }
.login-back svg { width: 14px; height: 14px; transform: rotate(180deg); }
.login-content { width: 100%; max-width: 405px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 13px; color: #fff; font-size: 20px; font-weight: 750; margin-bottom: 27px; letter-spacing: -.4px; }
.login-card { border-radius: 18px; background: #fff; padding: 36px; box-shadow: 0 26px 100px #060b2566; }
.login-card-icon { display: grid; place-items: center; background: #e5f5ff; color: var(--primary); height: 45px; width: 45px; border-radius: 13px; margin-bottom: 22px; }
.login-card h2 { font-size: 24px; letter-spacing: -.6px; margin-bottom: 10px; color: #28314b; }
.login-card > p { color: #8792a8; line-height: 1.6; font-size: 12px; }
.login-preview-alert { font-size: 10px; color: #227b9d; background: #e9f7ff; padding: 11px 12px; border-radius: 9px; margin: 21px 0; line-height: 1.6; }
.login-error { color: #b8303e; background: #fff2f2; border: 1px solid #f9dcdc; border-radius: 9px; padding: 10px 12px; font-size: 11px; line-height: 1.6; }
.login-submit { width: 100%; margin-top: 13px; padding-block: 14px; }
.login-footnote { border-top: 1px solid #f0f1f6; margin-top: 22px; padding-top: 20px; color: #a8aebc; font-size: 10px; text-align: center; }
.login-bottom { display: block; color: #a3aec6; font-size: 10px; text-align: center; line-height: 1.5; margin: 24px auto 0; }

.toast { position: fixed; z-index: 40; bottom: 23px; right: 25px; max-width: min(460px,calc(100vw - 45px)); border: 1px solid #dce9e7; background: #fff; box-shadow: 0 14px 36px #1c234333; color: #344354; border-radius: 11px; display: flex; align-items: center; padding: 15px 17px; gap: 12px; font-size: 12px; line-height: 1.6; }
.toast svg { color: #2da78d; width: 18px; height: 18px; }

@media (max-width: 1250px) {
  .sidebar { width: 223px; min-width: 223px; }
  .main-content { padding: 30px 26px; }
  .topbar { padding: 0 26px; }
  .footer { padding-inline: 26px; }
  .stat-grid { gap: 11px; }
  .stat-card { padding: 17px 13px; }
  .stat-header { font-size: 10px; }
}
@media (max-width: 1000px) {
  .section-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .setting-card > p { min-height: 0; }
}
@media (max-width: 720px) {
  html, body { overflow-x: clip; }
  .app-shell { display: block; max-width: 100%; }
  .sidebar { position: static; height: auto; min-height: 0; width: 100%; max-width: 100%; min-width: 0; padding: 13px 14px 11px; }
  .brand { padding: 0 3px 13px; min-width: 0; }
  .brand-name { min-width: 0; }
  .brand-name small { line-height: 2; }
  .sidebar-label, .sidebar-note, .sidebar-bottom, .secondary-label { display: none; }
  .sidebar-nav { flex-direction: row; gap: 4px; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 3px; }
  .sidebar-nav + .sidebar-label + .sidebar-nav { margin-top: 6px; }
  .nav-link { min-width: max-content; padding: 10px 12px; font-size: 11px; gap: 6px; }
  .nav-link svg { width: 16px; height: 16px; }
  .nav-count { display: none; }
  .app-body, .main-content, .page-section, .surface-card, .table-scroll, .page-title-row { min-width: 0; max-width: 100%; }
  .topbar {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    padding: 10px 14px 12px;
  }
  .crumbs { grid-column: 1; grid-row: 1; min-width: 0; }
  .crumbs > span:first-child, .crumbs > svg { display: none; }
  .crumbs strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
  .account-text, .account-button > svg, .topbar-separator { display: none; }
  .topbar-right { display: contents; }
  .demo-chip { grid-column: 1; grid-row: 2; justify-self: start; max-width: 100%; min-width: 0; font-size: 10px; padding: 6px 10px; }
  .account-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 0; }
  .main-content { padding: 22px 16px 27px; }
  .page-title-row { align-items: flex-start; flex-direction: column; }
  .page-title-row > div, .card-heading > div { min-width: 0; max-width: 100%; }
  h1, .page-subtitle, .footer { overflow-wrap: break-word; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 129px; }
  .stat-header { min-width: 0; }
  .stat-header > span:first-child { min-width: 0; overflow-wrap: break-word; }
  .card-heading { flex-wrap: wrap; align-items: flex-start; }
  .filter-controls { width: 100%; max-width: 100%; flex-wrap: wrap; }
  .search-control { max-width: 100%; }
  .search-control input { width: min(170px, 100%); }
  .footer { padding: 16px; display: grid; font-size: 9px; }
  .modal-scroll { padding: 18px 8px 18px 22px; }
  .login-card { padding: 25px; }
}
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-two-columns { grid-template-columns: 1fr; }
}

/* Custom select. The native control stays in the form for value, validation
 * and change events; its OS popup cannot be styled. */
.pretty-select { position: relative; display: inline-flex; vertical-align: middle; max-width: 100%; }
.pretty-select.is-compact { width: max-content; min-width: 148px; max-width: 240px; }
.field .pretty-select { display: flex; width: 100%; }
.pretty-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  appearance: none;
}
.pretty-select-trigger {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #314055;
  text-align: left;
  box-shadow: 0 1px 2px #1438580a;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.pretty-select.is-compact .pretty-select-trigger { height: 36px; padding: 0 8px 0 12px; font-size: 11px; font-weight: 680; color: #536479; }
.field .pretty-select-trigger { min-height: 41px; padding: 10px 10px 10px 12px; font-size: 12px; font-weight: 650; }
.pretty-select-trigger:hover { border-color: #b7d7ea; }
.pretty-select.is-open .pretty-select-trigger,
.pretty-select-trigger:focus-visible { border-color: #49a9d8; box-shadow: 0 0 0 3px #d7f1ff; outline: none; }
.pretty-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pretty-select-caret {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  color: #6d7e92;
  background: #f3f7fb;
  transition: background-color .16s ease, color .16s ease;
}
.pretty-select-caret svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .16s ease; }
.pretty-select.is-open .pretty-select-caret { color: var(--primary); background: #e5f4fc; }
.pretty-select.is-open .pretty-select-caret svg { transform: rotate(-90deg); }
.pretty-select-menu {
  position: fixed;
  z-index: 80;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  border: 1px solid #d5e4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px #10283c33;
}
.pretty-select-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 8px 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #314055;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}
.pretty-select-option > span:first-child { min-width: 0; }
.pretty-select-option:hover { background: #f4f9fd; }
.pretty-select-option:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; background: #f4f9fd; }
.pretty-select-option.is-selected { background: #e7f6ff; color: #0b78aa; }
.pretty-select-option.is-selected:hover,
.pretty-select-option.is-selected:focus-visible { background: #dff2fd; }
.pretty-select-check { width: 16px; height: 16px; display: grid; place-items: center; flex: none; color: transparent; }
.pretty-select-check svg { width: 15px; height: 15px; }
.pretty-select-option.is-selected .pretty-select-check { color: #0877a3; }
.pretty-select-option.is-selected .pretty-select-check svg { stroke-width: 2.4; }
