/* Shared UI primitives */

:root {
  --c-dark: #0f172a;
  --c-dark2: #1e293b;
  --c-dark3: #334155;
  --c-blue: #3b82f6;
  --c-blue-dk: #2563eb;
  --c-blue-dk2: #1d4ed8;
  --c-blue-lt: #60a5fa;
  --c-blue-lt2: #93c5fd;
  --c-blue-bg: rgb(59 130 246 / 8%);
  --c-blue-bg2: #f8fbff;
  --c-blue-bg3: #eff6ff;
  --c-blue-bd: #dbe7f5;
  --c-blue-bd2: #bfdbfe;
  --c-blue-bd3: #dbeafe;
  --c-white: #fff;
  --c-gray: #f8fafc;
  --c-gray2: #f1f5f9;
  --c-border: #e2e8f0;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-muted-dk: #475569;
  --c-muted-lt: #94a3b8;
  --c-border-lt: #cbd5e1;
  --c-red: #ef4444;
  --c-red-dk: #dc2626;
  --c-red-bd: #fecaca;
  --c-red-bg: #fef2f2;
  --c-red-bg2: #fee2e2;
  --c-green: #22c55e;
  --c-green-dk: #16a34a;
  --c-green-dk2: #15803d;
  --c-green-bg: #dcfce7;
  --c-green-bg2: #f0fdf4;
  --c-green-bd: #bbf7d0;
  --c-amber: #f59e0b;
  --c-amber-dk: #d97706;
  --c-amber-bg: #fffbeb;
  --c-purple: #8b5cf6;
  --c-sky: #0284c7;
  --c-sky-lt: #0ea5e9;
  --c-sky-dk: #0369a1;
  --c-sky-bg: #e0f2fe;
  --c-sky-bg2: #f0f9ff;
  --c-sky-bd: #bae6fd;
  --sp-xxl: 7.5rem;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 8%), 0 1px 2px rgb(0 0 0 / 4%);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 8%), 0 1px 4px rgb(0 0 0 / 4%);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 10%), 0 4px 12px rgb(0 0 0 / 5%);
  --ctrl-h: 2.25rem;
  --data-table-header-height: 40px;
  --data-table-row-height: 60px;
  --data-table-scrollbar-size: 10px;
  --fs-xs: 0.625rem;
  --fs-sm: 0.75rem;
  --fs-md: 0.875rem;
  --fs-base: 1rem;
  --ff-mono: 'Fira Code', 'Consolas', monospace;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, sans-serif;
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  font-size: var(--fs-base);
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

h6 {
  font-size: var(--fs-base);
}

h5 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.75rem;
}

h2 {
  font-size: 2rem;
  font-weight: 800;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
}

fieldset {
  margin-inline: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--ctrl-h);
  padding: 0 1.25em;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-dark3);
  font-family: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: all .18s ease;
}

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

.btn:disabled,
.btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--c-blue);
  color: var(--c-white);
  border-color: var(--c-blue);
  box-shadow: 0 2px 8px rgb(59 130 246 / 30%);
}

.btn-primary:hover:not(:disabled) {
  background: var(--c-blue-dk);
  border-color: var(--c-blue-dk);
  box-shadow: 0 4px 16px rgb(59 130 246 / 40%);
}

.btn-ghost {
  background: transparent;
  color: var(--c-dark3);
  border-color: var(--c-border);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--c-blue);
  color: var(--c-blue);
  background: var(--c-blue-bg);
}

.btn-outline-light {
  background: transparent;
  color: rgb(255 255 255 / 85%);
  border-color: rgb(255 255 255 / 30%);
}

.btn-outline-light:hover:not(:disabled) {
  border-color: rgb(255 255 255 / 60%);
  background: rgb(255 255 255 / 10%);
  color: var(--c-white);
}

.btn-danger {
  background: var(--c-red);
  color: var(--c-white);
  border-color: var(--c-red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--c-red-dk);
  border-color: var(--c-red-dk);
  box-shadow: 0 4px 16px rgb(239 68 68 / 24%);
}

.btn-sm {
  height: 30px;
  padding: 0 0.75rem;
  font-size: var(--fs-sm);
}

.btn-icon {
  width: 36px;
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
}

.btn-block {
  width: 100%;
  min-width: 110px;
  white-space: nowrap;
}

.btn-danger-text {
  color: var(--c-red);
}

.btn-micro {
  padding: 2px 0.5rem;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.btn-icon-svg {
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: -2px;
}

.btn-group {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--c-border);
  border-radius: 9px;
  background: var(--c-gray);
}

.btn-group .btn {
  min-width: 54px;
  border-radius: 7px;
}

.form-control {
  width: 100%;
  padding: 0.5em 0.75em;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-gray);
  line-height: 1.5;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}

.form-control:is(input, select) {
  height: var(--ctrl-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: normal;
}

select.form-control {
  appearance: none;
  padding-right: 2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6em center;
  cursor: pointer;
}

textarea.form-control {
  display: block;
  resize: vertical;
  line-height: 1.5;
}

.form-control::placeholder {
  color: var(--c-border-lt);
}

.form-control:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 10%);
}

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-radius: 0;
}

.input-group > :first-child {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.input-group > :last-child {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.input-group > :not(:first-child) {
  margin-left: -1px;
}

.input-group > .form-control:focus {
  position: relative;
  z-index: 1;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--c-border);
  background: var(--c-gray2);
  color: var(--c-muted);
  font-size: var(--fs-base);
  white-space: nowrap;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-field label,
.form-field-row label,
.color-input-row label {
  color: var(--c-dark3);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.form-field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  flex-shrink: 0;
  width: auto;
  margin-top: 2px;
  accent-color: var(--c-blue);
}

.form-check span {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.form-check a {
  color: var(--c-blue);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-error {
  margin-bottom: 0.75rem;
  color: var(--c-red);
  font-size: var(--fs-sm);
  text-align: center;
}

.field-hint-inline {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.field-label-micro {
  margin-bottom: 0.25rem;
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

@media (width <=680px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  min-height: 24px;
}

.badge-green {
  background: var(--c-green-bg);
  color: var(--c-green-dk);
  border-color: var(--c-green-bd);
}

.badge-red {
  background: var(--c-red-bg2);
  color: var(--c-red-dk);
  border-color: var(--c-red-bd);
}

.badge-blue {
  background: var(--c-blue-bd3);
  color: var(--c-blue-dk2);
  border-color: var(--c-blue-bd2);
}

.badge-gray {
  background: var(--c-gray2);
  color: var(--c-muted);
  border-color: var(--c-border);
}

.badge-orange {
  background: var(--c-amber-bg);
  color: var(--c-amber-dk);
  border-color: var(--c-amber-bd);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--c-green-bd);
  border-radius: var(--r-sm);
  background: var(--c-green-bg2);
  color: var(--c-green-dk);
  line-height: 1;
}

.status-pill .lucide {
  width: 16px;
  height: 16px;
}

.status-pill-off {
  border-color: var(--c-red-bd);
  background: var(--c-red-bg2);
  color: var(--c-red-dk);
}

.lucide {
  stroke-width: 2.25;
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: var(--c-gray2);
  color: var(--c-muted);
  line-height: 1;
  cursor: pointer;
  transition: all .14s;
}

.icon-btn svg {
  display: block;
  overflow: visible;
  fill: none;
  stroke: var(--c-muted-dk);
  transition: stroke .14s;
}

.icon-btn i {
  color: var(--c-muted-dk);
  font-size: var(--fs-sm);
  transition: color .14s;
}

.icon-btn:hover {
  border-color: var(--c-blue);
  background: var(--c-blue-bg);
}

.icon-btn:hover svg {
  stroke: var(--c-blue);
}

.icon-btn:hover i {
  color: var(--c-blue);
}

.icon-btn:disabled,
.icon-btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.icon-btn:disabled:hover,
.icon-btn[disabled]:hover {
  border-color: #d1d5db;
  background: var(--c-gray2);
}

.icon-btn-danger:hover {
  border-color: #fca5a5;
  background: var(--c-red-bg);
}

.icon-btn-danger:hover svg {
  stroke: var(--c-red-dk);
}

.icon-btn-danger:hover i {
  color: var(--c-red-dk);
}

.icon-btn-success:hover {
  border-color: #86efac;
  background: var(--c-green-bg);
}

.icon-btn-success:hover svg {
  stroke: var(--c-green-dk);
}

.icon-btn-success:hover i {
  color: var(--c-green-dk);
}

.icon-btn-warn:hover {
  border-color: #fde68a;
  background: #fef3c7;
}

.icon-btn-warn:hover svg {
  stroke: #b45309;
}

.icon-btn-warn:hover i {
  color: #b45309;
}

.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-white);
  color: var(--c-dark);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}

.menu-toggle:hover {
  border-color: var(--c-blue);
  background: var(--c-blue-bg);
  color: var(--c-blue);
}

.menu-toggle:active {
  transform: scale(.98);
}

.menu-toggle svg {
  display: block;
}

.wcard {
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: var(--c-white);
  box-shadow: var(--shadow-sm);
}

.wcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.wcard__title {
  font-weight: 700;
}

.wcard__sub {
  color: var(--c-muted);
}

.wcard__body {
  padding: 1.5rem;
}

.wcard__body-sm {
  padding: 0.75rem 1rem;
}

.wcard__body-flush {
  padding: 0;
}

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

.data-table-fixed {
  table-layout: fixed;
}

.data-col-id {
  width: 9%;
}

.data-col-time {
  width: 10%;
}

.data-col-ip {
  width: 15%;
}

.data-col-path {
  width: 25%;
}

.data-col-result {
  width: 19%;
}

.data-col-reason {
  width: 20%;
}

.data-col-decision {
  width: 10%;
}

.data-col-actions {
  width: 11%;
}

.data-col-quarter {
  width: 25%;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--data-table-header-height);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-gray);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  text-transform: uppercase;
}

.data-table td {
  height: var(--data-table-row-height);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  text-align: center;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--c-gray);
}

.table-scroll {
  overflow: auto;
  border-radius: var(--r-sm);
  scrollbar-color: var(--c-muted-lt) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.table-scroll[data-fit-table-viewport] {
  max-height: var(--data-table-viewport-height, none);
}

.table-scroll[data-fit-table-viewport="fill"] {
  height: var(--data-table-viewport-height, auto);
}

.table-scroll::-webkit-scrollbar {
  width: var(--data-table-scrollbar-size);
  height: var(--data-table-scrollbar-size);
}

.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--c-muted-lt);
  background-clip: padding-box;
}

.wcard__body-flush .table-scroll {
  border-radius: 0 0 15px 15px;
}

.wcard:not(:has(> .wcard__head)) > .wcard__body-flush > .table-scroll {
  border-radius: 15px;
}

#users-table-wrap,
#groups-table-wrap {
  container-type: inline-size;
}

.mobile-row-menu {
  display: none;
}

@container (width <=56rem) {
  .mobile-card-table-wrap {
    overflow: visible;
  }

  .mobile-card-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  .mobile-card-table colgroup,
  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
  }

  .mobile-card-table tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    padding: 1rem;
    border: 1px solid var(--c-border);
    border-radius: 10px;
  }

  .mobile-card-table tr:has(.mobile-row-menu[open]) {
    z-index: 3;
  }

  .mobile-card-table td {
    display: block;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .mobile-card-table tr:hover td {
    background: transparent;
  }

  .mobile-card-table td[data-label]::before {
    display: block;
    color: var(--c-muted);
    content: attr(data-label);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-card-table td[data-label] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  :is(.mobile-card-table-users, .mobile-card-table-groups) td:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  :is(.mobile-card-table-users, .mobile-card-table-groups) td:nth-child(1) > span {
    line-height: 1;
  }

  :is(.mobile-card-table-users, .mobile-card-table-groups) td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  :is(.mobile-card-table-users, .mobile-card-table-groups) td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  :is(.mobile-card-table-users, .mobile-card-table-groups) td:nth-child(4) {
    z-index: 2;
    display: block;
    grid-column: 3;
    grid-row: 1;
    place-self: start end;
  }

  .mobile-card-table .row-actions {
    display: none;
  }

  .mobile-row-menu {
    position: relative;
    display: block;
  }

  .mobile-row-menu > summary {
    list-style: none;
  }

  .mobile-row-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-row-menu__list {
    position: absolute;
    z-index: 10;
    inset-block-start: calc(100% + 0.375rem);
    inset-inline-end: 0;
    display: grid;
    min-width: 12rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-white);
    box-shadow: var(--shadow-md);
  }

  .mobile-row-menu__item {
    padding: 0.5rem;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--c-border);
    border-radius: 0;
    background: transparent;
    color: var(--c-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .mobile-row-menu__item:last-child {
    border-bottom: 0;
  }

  .mobile-row-menu__item:hover,
  .mobile-row-menu__item:focus-visible {
    background: var(--c-gray);
    outline: none;
  }

  .mobile-row-menu__item-danger {
    color: var(--c-red-dk);
  }
}

.nav-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.25rem;
  padding: 0;
  border-bottom: 2px solid var(--c-border);
  list-style: none;
}

.nav-tab {
  padding: 0.5rem 1rem;
  margin-bottom: -2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--c-muted);
  font-weight: 600;
  cursor: pointer;
  transition: color .14s, border-color .14s;
}

.nav-tab-bar .nav-tab {
  border-radius: 0;
  outline: none;
}

.nav-tab-active {
  border-bottom-color: var(--c-blue);
  color: var(--c-blue);
}

.nav-tab:hover:not(.nav-tab-active) {
  color: var(--c-dark);
}

.nav-tab-bar .nav-tab:focus,
.nav-tab-bar .nav-tab:focus-visible {
  outline: none;
  box-shadow: none;
}

.empty-state {
  padding: 3.5rem 1.5rem;
  color: var(--c-muted);
  text-align: center;
}

.empty-state__icon {
  margin-bottom: 0.75rem;
  font-size: 2.5rem;
  opacity: .5;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--c-dark);
  font-size: var(--fs-base);
  font-weight: 700;
}

.empty-state p {
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.empty-state-compact {
  padding: 2rem;
}

.empty-state-vert {
  padding: 1.25rem 0;
}

.scroll-list {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--c-border);
  border-radius: 8px;
}

.scroll-list > :is(.loading-text, .render-error) {
  padding: 0.5rem 0.75rem;
}

.scroll-list .check-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
}

.scroll-list li:last-child .check-label {
  border-bottom: 0;
}

.scroll-list .check-label .text-sm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: none;
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--c-border);
  border-radius: 12px;
  background: var(--c-gray);
}

.inline-form.show {
  display: block;
}

.inline-form__title {
  margin-bottom: 1rem;
  color: var(--c-dark);
  font-weight: 700;
}

.inline-form__fields {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.6fr 1.8fr auto;
  gap: 0.75rem;
  align-items: end;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-fieldset-reset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.modal-form-row-compact {
  grid-template-columns: minmax(0, 1fr) 96px auto;
  align-items: end;
}

.modal-form-row-compact .form-field {
  margin: 0;
}

.modal-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.modal-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.modal-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--c-border);
}

.modal-section:first-of-type {
  margin-top: 0;
}

.modal-section__title {
  margin-bottom: 0.75rem;
  color: var(--c-dark);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.modal-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.modal-field-hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.modal-status-text {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
}

.toggle input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle__track {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(0 0 0 / 6%);
  border-radius: 9px;
  background: var(--c-border-lt);
  cursor: pointer;
  transition: background .18s;
}

.toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background: var(--c-white);
  box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
  transition: transform .18s;
}

.toggle input:checked + .toggle__track,
.hero-toggle input:checked + .toggle__track {
  border-color: var(--c-blue-dk);
  background: var(--c-blue);
}

.toggle input:checked + .toggle__track::after,
.hero-toggle input:checked + .toggle__track::after {
  transform: translateX(18px);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--c-gray2);
}

.toggle-row__title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.toggle-row__desc {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border: 1px dashed var(--c-border);
  border-radius: 10px;
  background: var(--c-gray);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}

.file-drop:hover {
  border-color: var(--c-blue);
  background: var(--c-blue-bg);
}

.file-drop.has-file {
  border-color: var(--c-blue);
  border-style: solid;
}

.file-drop.has-file textarea {
  display: block !important;
}

.mono {
  font-family: var(--ff-mono);
}

.code-log {
  min-height: 80px;
  max-height: 300px;
  padding: 1rem;
  overflow-y: auto;
  border: 0;
  border-radius: 8px;
  background: var(--c-dark);
  color: var(--c-border);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
}

.color-input-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto var(--ctrl-h);
  gap: 0.25rem 0.5rem;
}

.color-input-row label {
  grid-column: 2;
}

.color-swatch {
  grid-column: 1;
  grid-row: 2;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
}

.color-swatch::-webkit-color-swatch {
  border-radius: 5px;
}

.color-swatch::-moz-color-swatch {
  border-radius: 5px;
}

.color-hex-input {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  height: var(--ctrl-h);
  padding: 0 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  outline: none;
}

.label-optional {
  color: var(--c-muted);
  font-weight: 400;
}

.form-field-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.form-field-row label {
  display: inline;
  margin-bottom: 0;
  white-space: nowrap;
}

.form-field-flex-md {
  flex: 1.2;
  min-width: 180px;
}

.form-field-flex-type {
  flex: 0 0 150px;
}

.form-field-flex-lg {
  flex: 1.4;
  min-width: 200px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
}

.form-actions-pt {
  padding-top: 0.25rem;
}

.head-controls,
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.head-controls {
  align-items: center;
}

.card-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.info-banner {
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--c-sky-bd);
  border-radius: 10px;
  background: var(--c-sky-bg2);
  color: var(--c-sky-dk);
  font-size: var(--fs-sm);
}

.list-label {
  margin-bottom: 0.5rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
}

.status-text,
.small-hint {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.status-text {
  margin-bottom: 0.25rem;
}

.small-error {
  margin-top: 0.25rem;
  color: var(--c-red);
  font-size: var(--fs-sm);
}

.status-dot {
  display: block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-ok {
  background: var(--c-green);
  box-shadow: 0 0 6px rgb(34 197 94 / 50%);
}

.status-dot-err {
  background: var(--c-red);
  box-shadow: 0 0 6px rgb(239 68 68 / 50%);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.25rem;
  border-radius: 3px;
}

.legend-dot-blue {
  background: var(--c-blue);
}

.legend-dot-red {
  background: var(--c-red);
}

.list-stack {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.d-none {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shrink-0 {
  flex-shrink: 0;
}

.text-nowrap {
  white-space: nowrap;
}

.text-muted {
  color: var(--c-muted);
}

.text-sm {
  font-size: var(--fs-sm);
}

.text-dark {
  color: var(--c-dark);
}

.text-bright {
  color: var(--c-gray);
}

.text-danger-light {
  color: var(--c-red-bd);
}

.text-xs-muted {
  color: var(--c-muted);
  font-size: var(--fs-xs);
}

.sub-text {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.loading-text {
  color: var(--c-muted);
}

.render-error {
  color: var(--c-red);
  font-size: var(--fs-sm);
}

.render-center {
  padding: 2rem;
  text-align: center;
}

.table-cell-muted,
.table-cell-muted-nowrap {
  color: var(--c-muted);
}

.table-cell-muted-nowrap {
  white-space: nowrap;
}

.table-cell-ellipsis,
.table-cell-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table td.table-cell-path {
  text-align: start;
}

.table-cell-code {
  font-family: var(--ff-mono);
}

.table-cell-time {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-time {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--c-dark);
  line-height: 1.1;
}

.time-secondary {
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.font-bold {
  font-weight: 700;
}

.font-medium {
  font-weight: 500;
}

.label-medium {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.flex-wrap-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.min-w-0 {
  min-width: 0;
}

.mono-fill {
  flex: 1;
  word-break: break-all;
}

.mono-val {
  font-size: var(--fs-sm);
  word-break: break-all;
}

.mono-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono-13 {
  font-size: var(--fs-sm);
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-12 {
  margin-bottom: 0.75rem !important;
}

.mb-16 {
  margin-bottom: 1rem !important;
}

.mb-20 {
  margin-bottom: 1.25rem !important;
}

.mb-24 {
  margin-bottom: 1.5rem !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-6 {
  margin-top: 0.5rem;
}

.mt-28 {
  margin-top: 1.75rem;
}

.pad-20 {
  padding: 1.25rem;
}

.pad-v4 {
  padding: 0.25rem 0;
}

.pad-v8 {
  padding: 0.5rem 0;
}

.pad-v10 {
  padding: 0.75rem 0;
}

.inline-error {
  margin-top: 0.25rem;
  color: var(--c-red);
  font-size: var(--fs-sm);
}

.note-center {
  padding: 0.5rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

.note-center-err {
  color: var(--c-red);
}

.note-center-md {
  padding: 0.75rem;
}

.svg-full {
  display: block;
  min-width: 100%;
}

.bar-track {
  overflow: hidden;
  border-radius: 999px;
  background: var(--c-dark2);
}

.bar-track-7 {
  height: 7px;
}

.bar-track-6 {
  height: 6px;
}

.text-transparent {
  color: transparent;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  overflow-y: auto;
  box-sizing: border-box;
  background: rgb(0 0 0 / 52%);
  backdrop-filter: blur(5px);
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 80px);
  margin: auto;
  overflow-y: auto;
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--c-white);
  box-shadow: 0 28px 80px rgb(0 0 0 / 30%);
  animation: modal-in .18s ease;
}

.modal-box-wide {
  max-width: 790px;
}

.modal-box-sm {
  max-width: 440px;
}

.modal-box-form {
  max-width: 460px;
}

.modal-box-560 {
  max-width: 560px;
}

.modal-box-760 {
  max-width: 760px;
}

.modal-box-820 {
  max-width: 820px;
}

.modal__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--c-border);
  border-radius: 16px 16px 0 0;
  background: var(--c-white);
}

.modal__title {
  color: var(--c-dark);
  font-weight: 700;
}

.modal__sub {
  margin-top: 0.25rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: var(--c-gray);
  color: var(--c-muted);
  line-height: 1;
  cursor: pointer;
  transition: all .14s;
}

.modal__close:hover {
  border-color: var(--c-red);
  background: var(--c-red-bg);
  color: var(--c-red);
}

.modal__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(.95) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.toast-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  color: var(--c-white);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
  animation: toast-in .2s ease;
  pointer-events: auto;
}

.toast-ok {
  background: var(--c-green-dk);
}

.toast-err {
  background: var(--c-red-dk);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
