/* Metronic 9.5 semantic tokens. Component states (buttons, tabs, switches,
   focus rings and selection) now follow the licensed KTUI source exactly. */
.light {
  --primary: var(--color-blue-500);
  --primary-foreground: var(--color-white);
  --ring: var(--color-zinc-400);
}

.dark {
  --primary: var(--color-blue-600);
  --primary-foreground: var(--color-white);
  --muted-foreground: var(--color-zinc-400);
  --ring: var(--color-zinc-600);
}

/* KTUI's light primary uses blue-500, which is only 3.68:1 against its 13px
   white label. Keep the complete Metronic button state machine and move that
   component one step down the same palette for readable production actions. */
.light .kt-btn,
.light .kt-badge-primary {
  --primary: var(--color-blue-600);
  --primary-foreground: var(--color-white);
}

/* Dark-mode bridges for palette utilities shipped by the Metronic 9.5 build. */
.dark .bg-green-50 {
  background-color: color-mix(in oklab, var(--color-green-500) 12%, transparent);
}

.dark .bg-violet-50 {
  background-color: color-mix(in oklab, var(--color-violet-500) 12%, transparent);
}

.dark .bg-yellow-50 {
  background-color: color-mix(in oklab, var(--color-yellow-500) 12%, transparent);
}

.dark .text-green-600 { color: var(--color-green-500); }
.dark .text-violet-600 { color: var(--color-violet-500); }
.dark .text-yellow-600 { color: var(--color-yellow-500); }

#primary_nav [data-route].is-active {
  border-color: transparent !important;
  color: var(--primary) !important;
  background: color-mix(in oklab, var(--primary) 10%, transparent) !important;
  box-shadow: none;
}

/* Metronic's dark outline badges use the 600 palette step on a near-black
   surface. At the component's 11px label size that is too faint, so retain
   the Metronic geometry/surface treatment and use the brightest matching step
   that is actually retained by the precompiled palette. */
.dark .kt-badge-outline.kt-badge-primary.kt-badge-outline { --otherlay-badge-accent: var(--color-blue-500); }
.dark .kt-badge-outline.kt-badge-success.kt-badge-outline { --otherlay-badge-accent: var(--color-green-500); }
.dark .kt-badge-outline.kt-badge-warning.kt-badge-outline { --otherlay-badge-accent: var(--color-yellow-500); }
.dark .kt-badge-outline.kt-badge-info.kt-badge-outline { --otherlay-badge-accent: var(--color-violet-500); }
.dark .kt-badge-outline.kt-badge-destructive.kt-badge-outline { --otherlay-badge-accent: oklch(70.4% 0.191 22.216); }

.dark .kt-badge-outline.kt-badge-primary.kt-badge-outline,
.dark .kt-badge-outline.kt-badge-success.kt-badge-outline,
.dark .kt-badge-outline.kt-badge-warning.kt-badge-outline,
.dark .kt-badge-outline.kt-badge-info.kt-badge-outline,
.dark .kt-badge-outline.kt-badge-destructive.kt-badge-outline {
  color: var(--otherlay-badge-accent);
  border-color: color-mix(in oklab, var(--otherlay-badge-accent) 26%, var(--border));
  background: color-mix(in oklab, var(--otherlay-badge-accent) 8%, var(--card));
}

.auth-invalid {
  border-color: var(--destructive) !important;
}

/* The precompiled demo omits this Tailwind utility although the Metronic shell uses the pattern. */
.min-h-0 {
  min-height: 0;
}

/* Remote Desktop owns this specialist startup canvas. The surrounding page,
   alerts and actions remain the Metronic/KTUI product shell. */
.desktop-stage .filevault-preboot {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem);
  color: #f8fafc;
  background:
    radial-gradient(circle at 72% 18%, rgb(86 111 167 / 0.48), transparent 38%),
    radial-gradient(circle at 24% 86%, rgb(73 50 111 / 0.38), transparent 44%),
    linear-gradient(145deg, #151925 0%, #10141e 48%, #090c12 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  transition: opacity 380ms cubic-bezier(.2,.8,.2,1), transform 380ms cubic-bezier(.2,.8,.2,1), filter 380ms ease;
}

.desktop-stage .filevault-preboot.is-handing-off {
  opacity: 0;
  transform: scale(1.015);
  filter: blur(6px);
  pointer-events: none;
}

.desktop-stage .filevault-preboot-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.desktop-stage .filevault-preboot-backdrop span {
  position: absolute;
  width: min(44vw, 34rem);
  aspect-ratio: 1;
  border-radius: 9999px;
  opacity: .22;
  filter: blur(64px);
  transform: translate3d(0, 0, 0);
  animation: filevault-materialize 700ms cubic-bezier(.2,.8,.2,1) both;
}

.desktop-stage .filevault-preboot-backdrop span:first-child {
  inset: -24% -8% auto auto;
  background: #87a8ef;
}

.desktop-stage .filevault-preboot-backdrop span:last-child {
  inset: auto auto -36% -10%;
  background: #795f9f;
  animation-delay: 80ms;
}

.desktop-stage .filevault-preboot-status,
.desktop-stage .filevault-preboot-trust {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin: 0;
  color: rgb(241 245 249 / .7);
  font-size: clamp(.68rem, 1.4vw, .78rem);
  font-weight: 560;
  letter-spacing: .025em;
}

.desktop-stage .filevault-preboot-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 1.75rem;
  padding: .35rem .7rem;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 9999px;
  background: rgb(12 16 25 / .38);
  box-shadow: inset 0 1px rgb(255 255 255 / .08);
  backdrop-filter: blur(18px) saturate(135%);
}

.desktop-stage .filevault-secure-dot {
  width: .42rem;
  height: .42rem;
  border-radius: 9999px;
  background: #86efac;
  box-shadow: 0 0 0 .2rem rgb(134 239 172 / .1);
}

.desktop-stage .filevault-preboot-content {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(100%, 21rem);
  text-align: center;
}

.desktop-stage .filevault-avatar {
  display: inline-flex;
  width: clamp(4rem, 10vw, 5.5rem);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 9999px;
  color: rgb(255 255 255 / .9);
  background: linear-gradient(145deg, rgb(255 255 255 / .2), rgb(255 255 255 / .07));
  box-shadow: inset 0 1px rgb(255 255 255 / .26), 0 1.4rem 3.6rem rgb(0 0 0 / .3);
  backdrop-filter: blur(24px) saturate(150%);
}

.desktop-stage .filevault-avatar i { font-size: clamp(1.55rem, 4vw, 2.2rem); }

.desktop-stage .filevault-preboot-content h3 {
  margin-top: clamp(.8rem, 2vw, 1.2rem);
  overflow-wrap: anywhere;
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -.018em;
}

.desktop-stage .filevault-preboot-title {
  margin-top: .35rem;
  color: rgb(241 245 249 / .72);
  font-size: clamp(.74rem, 1.5vw, .86rem);
  line-height: 1.45;
}

.desktop-stage .filevault-unlock-form {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
}

.desktop-stage .filevault-field {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  min-height: 3rem;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: .72rem;
  background: rgb(17 22 32 / .58);
  box-shadow: inset 0 1px rgb(255 255 255 / .08), 0 .55rem 1.8rem rgb(0 0 0 / .12);
  backdrop-filter: blur(20px) saturate(135%);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.desktop-stage .filevault-field:focus-within {
  border-color: rgb(147 197 253 / .82);
  background: rgb(20 27 40 / .78);
  box-shadow: 0 0 0 .18rem rgb(96 165 250 / .2), inset 0 1px rgb(255 255 255 / .1);
}

.desktop-stage .filevault-field-icon {
  display: inline-flex;
  justify-content: center;
  color: rgb(226 232 240 / .58);
  font-size: .9rem;
}

.desktop-stage .filevault-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: .86rem;
  line-height: 1.2;
}

.desktop-stage .filevault-field input::placeholder { color: rgb(226 232 240 / .48); }

.desktop-stage .filevault-submit {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  margin-inline-end: .125rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 9999px;
  color: #111827;
  background: rgb(255 255 255 / .9);
  box-shadow: 0 .25rem .8rem rgb(0 0 0 / .2);
  transition: transform 100ms ease-out, background-color 160ms ease, opacity 160ms ease;
}

.desktop-stage .filevault-submit:hover { background: #fff; }
.desktop-stage .filevault-submit:active { transform: scale(.97); }
.desktop-stage .filevault-submit:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.desktop-stage .filevault-submit:disabled { opacity: .5; }

.desktop-stage .filevault-inline-error {
  margin: .1rem .25rem 0;
  color: #fecaca;
  font-size: .72rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.desktop-stage .filevault-progress {
  display: grid;
  justify-items: center;
  gap: .8rem;
  margin-top: 1.15rem;
  color: rgb(241 245 249 / .74);
  font-size: .8rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.desktop-stage .filevault-progress-ring {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgb(255 255 255 / .2);
  border-top-color: rgb(255 255 255 / .9);
  border-radius: 9999px;
  animation: filevault-spin 850ms linear infinite;
}

.desktop-stage .filevault-secondary-action {
  display: inline-flex;
  min-height: 2.75rem;
  padding-inline: .75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #bfdbfe;
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.desktop-stage .filevault-secondary-action:hover { color: #fff; }
.desktop-stage .filevault-secondary-action:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: .25rem; }

.desktop-stage .filevault-preboot-trust {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  align-self: end;
  max-width: 100%;
  text-align: center;
}

.desktop-stage [data-startup-state="CREDENTIALS_REJECTED"] .filevault-unlock-form {
  animation: filevault-reject 360ms cubic-bezier(.2,.8,.2,1) both;
}

.filevault-startup-alert {
  position: fixed;
  z-index: 80;
  inset: auto 1.25rem 1.25rem auto;
  width: min(calc(100vw - 2rem), 25rem);
  box-shadow: 0 1.2rem 3rem rgb(15 23 42 / .22);
}

.filevault-startup-alert .kt-btn {
  min-height: 2.75rem;
}

@keyframes filevault-materialize {
  from { opacity: 0; transform: scale(.86); }
  to { opacity: .22; transform: scale(1); }
}

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

@keyframes filevault-reject {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-.35rem); }
  62% { transform: translateX(.28rem); }
}

@media (max-width: 639px) {
  .desktop-stage .filevault-preboot { padding: .9rem; }
  .desktop-stage .filevault-preboot-content { width: min(100%, 19rem); }
  .desktop-stage .filevault-avatar { width: 3.7rem; }
  .desktop-stage .filevault-preboot-trust { font-size: .65rem; }
  .filevault-startup-alert { inset: auto 1rem 1rem; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-stage .filevault-preboot,
  .desktop-stage .filevault-submit { transition-duration: 180ms; transform: none !important; filter: none !important; }
  .desktop-stage .filevault-preboot-backdrop span,
  .desktop-stage [data-startup-state="CREDENTIALS_REJECTED"] .filevault-unlock-form { animation: none; }
  .desktop-stage .filevault-progress-ring { animation: none; border-color: rgb(255 255 255 / .35); border-top-color: #fff; }
}

@media (prefers-reduced-transparency: reduce) {
  .desktop-stage .filevault-preboot-status,
  .desktop-stage .filevault-avatar,
  .desktop-stage .filevault-field { backdrop-filter: none; background: #151b27; }
}

@media (prefers-contrast: more) {
  .desktop-stage .filevault-preboot { background: #080b11; }
  .desktop-stage .filevault-preboot-status,
  .desktop-stage .filevault-avatar,
  .desktop-stage .filevault-field { border-color: rgb(255 255 255 / .72); background: #111827; }
}

.language-check.invisible {
  visibility: hidden !important;
}

/* Route focus keeps screen-reader navigation predictable without exposing a
   page-sized browser ring. Interactive descendants retain KTUI focus rings. */
#page_content:focus {
  outline: none;
}

/* An assigned Mac's name is primary identity, so it must remain fully visible
   when customer-defined names exceed the available mobile card width. */
.runtime-machine-name {
  overflow-wrap: anywhere;
}

.customer-section-tabs {
  min-width: max-content;
  border-radius: calc(var(--radius) - 2px);
}

.customer-section-tabs .kt-btn {
  min-width: 0;
  box-shadow: none;
}

/* Metronic file-manager composition: semantic hooks cover utilities omitted by the precompiled demo build. */
.file-browser {
  min-height: 0;
  -webkit-user-select: none;
  user-select: none;
}

.file-browser > .kt-card-content {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
}

.file-browser > .kt-card-content > aside:first-child > div:first-child {
  letter-spacing: 0.05em;
}

.file-details-panel {
  inset-block: 0;
  inset-inline-end: 0;
  box-shadow: 0 1rem 2rem rgb(15 23 42 / 0.14);
}

.file-listing-pane {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--card);
  outline: none;
  cursor: default;
}

.file-listing-state {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  text-align: center;
}

.file-listing-state-icon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.file-listing-state-icon-error {
  color: var(--destructive);
  background: color-mix(in oklab, var(--destructive) 10%, var(--background));
}

.file-listing-state-icon-empty {
  color: var(--primary);
  background: color-mix(in oklab, var(--primary) 10%, var(--background));
}

.file-path-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.file-path-scroll::-webkit-scrollbar {
  display: none;
}

.file-current-folder {
  max-width: min(18rem, 45vw);
}

.file-workspace {
  container-name: file-workspace;
  container-type: inline-size;
}

.file-toolbar {
  display: grid;
  grid-template-areas:
    "navigation utilities"
    "commands commands";
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  align-items: center;
  min-width: 0;
  background: var(--background);
}

.file-toolbar-nav {
  grid-area: navigation;
  padding: 0.75rem 0.5rem 0.75rem 1rem;
}

.file-toolbar-commands {
  grid-area: commands;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 3rem;
  overflow-x: auto;
  padding: 0.4375rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 32%, var(--background));
  scrollbar-width: none;
}

.file-toolbar-commands::-webkit-scrollbar {
  display: none;
}

.file-default-commands,
.file-source-commands,
.file-selection-toolbar {
  flex: 0 0 auto;
}

.file-toolbar-utilities {
  grid-area: utilities;
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 0.5rem;
}

.file-toolbar-search {
  min-width: 10rem;
  flex: 1 1 auto;
}

.file-storage-summary {
  margin-top: auto;
}

.file-storage-summary .kt-progress {
  background: color-mix(in oklab, var(--border) 78%, var(--background));
}

.file-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 24%, var(--background));
}

.file-path-bar {
  min-height: 2rem;
  padding: 0.25rem 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
}

.file-path-list {
  min-height: 1.5rem;
  gap: 0.125rem;
}

.file-path-node {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  height: 1.5rem;
  padding: 0 0.375rem;
  border-radius: 0.3125rem;
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}

button.file-path-node:hover {
  background: var(--muted);
  color: var(--foreground);
}

.file-path-node-current {
  color: var(--foreground);
  font-weight: 500;
}

.file-path-list .kt-breadcrumb-separator {
  width: auto;
  min-width: 0;
  margin: 0;
  color: var(--muted-foreground);
}

.file-status-bar {
  display: flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 1rem;
}

.file-status-bar > span {
  overflow: hidden;
  white-space: nowrap;
}

.transfer-center-label {
  display: none;
}

#page_content[data-route="files"] .transfer-center-button {
  gap: 0.375rem;
}

@media (min-width: 1280px) {
  #page_content[data-route="files"] .transfer-center-button {
    width: auto;
    padding-inline: 0.625rem;
  }

  #page_content[data-route="files"] .transfer-center-label {
    display: inline;
    font-size: 0.75rem;
    font-weight: 500;
  }
}

@container file-workspace (min-width: 56rem) {
  .file-toolbar {
    grid-template-areas: "navigation commands utilities";
    grid-template-columns: minmax(10rem, 1fr) minmax(16rem, 19rem) minmax(18rem, 22rem);
    column-gap: 0.75rem;
  }

  .file-toolbar-nav {
    padding-inline-end: 0;
  }

  .file-toolbar-commands {
    min-height: 3rem;
    padding: 0.5rem 0;
    border-top: 0;
    background: transparent;
  }

  .file-toolbar-utilities {
    padding-inline-start: 0;
  }
}

@container file-workspace (max-width: 44rem) {
  .file-list-table th:first-child,
  .file-list-table td:first-child {
    width: 58%;
  }

  .file-list-table th:nth-child(2),
  .file-list-table td:nth-child(2) {
    width: 27%;
  }

  .file-list-table th:nth-child(3),
  .file-list-table td:nth-child(3) {
    display: none;
  }

  .file-list-table th:last-child,
  .file-list-table td:last-child {
    width: 15%;
  }
}

@container file-workspace (max-width: 34rem) {
  .file-toolbar {
    grid-template-areas:
      "navigation"
      "utilities"
      "commands";
    grid-template-columns: minmax(0, 1fr);
  }

  .file-toolbar-nav,
  .file-toolbar-utilities {
    padding-inline: 0.75rem;
  }

  .file-toolbar-utilities {
    padding-top: 0;
  }

  .file-toolbar-commands {
    padding-inline: 0.75rem;
  }

  .file-list-table th:first-child,
  .file-list-table td:first-child {
    width: 76%;
  }

  .file-list-table th:nth-child(2),
  .file-list-table td:nth-child(2) {
    display: none;
  }

  .file-list-table th:last-child,
  .file-list-table td:last-child {
    width: 24%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .file-browser .kt-btn:active,
  .file-browser .file-path-node:active {
    transform: scale(0.97);
    transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
  }
}

.file-browser .kt-breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
}

.file-browser .kt-breadcrumb-item {
  flex: 0 0 auto;
  min-width: 0;
}

.file-browser .kt-breadcrumb-page,
.file-browser .kt-breadcrumb-link {
  white-space: nowrap;
}

.file-browser [data-file-entry],
.file-browser .kt-breadcrumb,
.file-browser .kt-menu,
.file-browser .file-selection-toolbar,
.file-browser .file-view,
.file-browser .file-history {
  -webkit-user-select: none;
  user-select: none;
}

.file-browser input,
.file-browser textarea {
  -webkit-user-select: text;
  user-select: text;
}

.file-browser [data-file-entry]:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--primary) 70%, transparent);
  outline-offset: -2px;
}

.file-selection-marquee {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border: 1px solid color-mix(in oklab, var(--primary) 72%, transparent);
  border-radius: 0.25rem;
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.3) inset;
}

.file-cut-pending {
  opacity: 0.55;
}

.file-visual-icon {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
}

/* File type is content, not an always-active action state. Keep light mode's
   familiar folder accent, while dark mode uses Metronic's neutral ramp with a
   restrained blue bias. Selection is carried by the tile and label surfaces,
   so the glyph itself never flashes to a brighter blue. */
.file-visual--folder,
.file-current-folder-icon {
  color: var(--primary);
}

.dark .file-visual--folder,
.dark .file-current-folder-icon {
  color: color-mix(in oklab, var(--color-blue-500) 28%, var(--color-zinc-400));
}

.file-grid-card .file-visual-icon {
  width: 3rem;
  height: 3rem;
}

.file-drag-source {
  opacity: 0.48;
}

.file-drop-target {
  background: color-mix(in oklab, var(--primary) 12%, var(--background));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--primary) 72%, transparent) !important;
}

.file-browser [data-file-entry][data-layout="list"][aria-selected="true"],
.file-browser [data-file-entry][data-layout="mobile"][aria-selected="true"] {
  box-shadow: inset 2px 0 0 var(--primary);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.75rem, 7rem));
  align-content: start;
  justify-content: start;
  gap: 0.5rem;
  padding: 1rem;
}

.file-grid-card {
  width: 100%;
  max-width: 7rem;
  background: transparent !important;
  box-shadow: none !important;
}

.file-grid-card .file-open {
  min-height: 7rem;
  padding: 0;
}

.file-grid-selection-target {
  width: 7rem;
  min-height: 6.75rem;
  padding: 0.375rem 0.25rem 0.25rem;
  border-radius: 0.5rem;
}

.file-grid-card .file-visual {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.file-grid-card:hover .file-visual {
  background: var(--muted);
}

.file-grid-card[aria-selected="true"] .file-visual {
  background: color-mix(in oklab, var(--primary) 12%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 24%, transparent);
}

.file-grid-card[aria-selected="true"] .file-grid-name {
  background: color-mix(in oklab, var(--primary) 14%, var(--background));
  color: color-mix(in oklab, var(--primary) 68%, var(--foreground));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 20%, transparent);
}

.file-grid-card.ring-2 {
  background: color-mix(in oklab, var(--primary) 8%, transparent) !important;
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--primary) 32%, transparent) !important;
}

.file-grid-name {
  display: -webkit-box;
  width: fit-content !important;
  max-width: 100%;
  min-height: 1.375rem;
  margin-top: 0.375rem;
  padding: 0.125rem 0.375rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-new-folder-grid {
  width: 7rem;
  min-height: 7rem;
}

.file-new-folder-grid .file-grid-selection-target {
  background: color-mix(in oklab, var(--primary) 10%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 28%, transparent);
}

.file-new-folder-grid .file-visual-icon {
  width: 3rem;
  height: 3rem;
}

.file-new-folder-input {
  display: block;
  min-width: 0;
  height: 1.375rem;
  padding: 0.125rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.125rem;
}

.file-new-folder-input:focus {
  border-color: var(--primary);
  background: var(--background);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 55%, transparent);
}

.file-new-folder-input[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--destructive) 45%, transparent);
}

.file-new-folder-grid .file-new-folder-input {
  width: 100%;
  margin-top: 0.375rem;
  text-align: center;
}

.file-rename-form {
  min-width: 0;
}

.file-rename-list,
.file-rename-mobile {
  width: 100%;
}

.file-rename-list .file-rename-input,
.file-rename-mobile .file-rename-input {
  width: min(100%, 22rem);
}

.file-rename-grid {
  width: 7rem;
  min-height: 7rem;
}

.file-rename-grid .file-grid-selection-target {
  background: color-mix(in oklab, var(--primary) 10%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 28%, transparent);
}

.file-rename-grid .file-visual-icon {
  width: 3rem;
  height: 3rem;
}

.file-rename-grid .file-rename-input {
  width: 100%;
  margin-top: 0.375rem;
  text-align: center;
}

.file-new-folder-row {
  background: color-mix(in oklab, var(--primary) 7%, var(--background));
  box-shadow: inset 2px 0 0 var(--primary);
}

.file-new-folder-list .file-new-folder-input,
.file-new-folder-mobile .file-new-folder-input {
  width: min(100%, 22rem);
  min-width: 0;
}

.file-new-folder-mobile {
  background: color-mix(in oklab, var(--primary) 7%, var(--background));
  box-shadow: inset 2px 0 0 var(--primary);
}

.file-new-folder-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--destructive);
  font-size: 0.6875rem;
  line-height: 1rem;
  overflow-wrap: anywhere;
}

.file-new-folder-error.hidden {
  display: none;
}

.file-grid-card:focus-visible {
  outline: none;
}

.file-grid-card:focus-visible .file-grid-selection-target {
  outline: 2px solid color-mix(in oklab, var(--primary) 70%, transparent);
  outline-offset: -2px;
}

.file-list-view {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.file-list-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.8125rem;
}

.file-list-table thead {
  position: sticky;
  z-index: 5;
  top: 0;
  background: var(--muted);
}

.file-list-table th {
  height: 2.25rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.file-list-table th:first-child,
.file-list-table td:first-child {
  width: 52%;
  padding-inline-start: 1rem;
}

.file-list-table th:nth-child(2),
.file-list-table td:nth-child(2) {
  width: 23%;
}

.file-list-table th:nth-child(3),
.file-list-table td:nth-child(3) {
  width: 17%;
}

.file-list-table th:last-child,
.file-list-table td:last-child {
  width: 8%;
  padding-inline-end: 1rem;
}

.file-list-table td {
  height: 2.625rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
  vertical-align: middle;
}

.file-list-table .file-name-cell {
  position: relative;
  min-width: 14rem;
}

.file-list-table .file-open {
  width: 100%;
}

.file-list-table th:last-child .file-sort {
  width: 100%;
  justify-content: flex-end;
}

.file-selection-toolbar {
  min-height: 1.75rem;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.file-selection-toolbar [data-file-selection-count] {
  color: var(--secondary-foreground);
  font-weight: 500;
}

.light .file-places .kt-menu-link.text-primary .kt-menu-title {
  color: color-mix(in oklab, var(--primary) 82%, black);
}

@media (min-width: 1024px) {
  .workspace-route #app_main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #page_content[data-route="files"] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  #page_content[data-route="files"] .file-browser {
    flex: 1 1 auto;
  }

  .file-details-panel {
    position: static;
    width: 18rem;
    max-width: 18rem;
    box-shadow: none;
  }
}

@media (max-width: 1279px) {
  .file-places {
    display: none !important;
  }

  .file-source-tabs {
    display: flex !important;
  }
}

@media (min-width: 1280px) {
  .file-compact-location-picker {
    display: none !important;
  }

  .file-source-tabs {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .file-browser > .kt-card-content {
    height: auto;
    min-height: 34rem;
    overflow: visible;
  }

  .file-listing-pane {
    min-height: 24rem;
    overflow: visible;
    scrollbar-gutter: auto;
  }

}

@media (max-width: 767px) {
  #page_content[data-route="files"] .page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
  }

  #page_content[data-route="files"] .page-header-heading-row {
    flex-wrap: nowrap;
  }

  #page_content[data-route="files"] .page-header-heading-row nav,
  #page_content[data-route="files"] .page-header-subtitle {
    display: none;
  }

  #page_content[data-route="files"] .page-header-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .file-path-bar {
    display: none;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
    padding: 0.75rem;
  }

  .file-grid-card {
    max-width: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  }

  .file-grid-card .file-open {
    min-height: 8rem;
  }
}

@media (max-width: 767px) and (hover: none), (max-width: 767px) and (pointer: coarse) {
  #page_content[data-route="files"] .file-mobile-select-toggle {
    min-width: 3.5rem;
    min-height: 2.75rem;
  }

  #page_content[data-route="files"] .file-mobile-selecting.file-has-selection .file-toolbar-commands {
    height: 0;
    min-height: 0;
    overflow: visible;
    padding: 0;
    border-top: 0;
  }

  #page_content[data-route="files"] .file-mobile-selecting.file-has-selection .file-listing-pane {
    padding-bottom: 4.75rem;
  }

  #page_content[data-route="files"] .file-mobile-selecting .file-selection-toolbar:not(.hidden) {
    position: fixed;
    z-index: 80;
    inset-inline: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    max-width: calc(100vw - 1.5rem);
    min-height: 3.5rem;
    gap: 0.25rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0.375rem 0.5rem !important;
    border: 1px solid var(--border);
    border-radius: 0.75rem !important;
    background: var(--background) !important;
    box-shadow: 0 0.75rem 2rem rgb(15 23 42 / 16%);
    scrollbar-width: none;
  }

  #page_content[data-route="files"] .file-mobile-selecting .file-selection-toolbar:not(.hidden)::-webkit-scrollbar {
    display: none;
  }

  #page_content[data-route="files"] .file-mobile-selecting .file-selection-toolbar .kt-btn {
    flex: 0 0 auto;
    min-height: 2.75rem;
  }

  #page_content[data-route="files"] .file-mobile-selecting .file-selection-toolbar .kt-btn-icon {
    min-width: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page_content[data-route="files"] .file-browser *,
  #page_content[data-route="files"] .file-browser *::before,
  #page_content[data-route="files"] .file-browser *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  #page_content[data-route="files"] .file-browser .kt-btn:active,
  #page_content[data-route="files"] .file-browser .file-path-node:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #page_content[data-route="files"] .file-browser,
  #page_content[data-route="files"] .file-toolbar,
  #page_content[data-route="files"] .file-places,
  #page_content[data-route="files"] .file-details-panel,
  #page_content[data-route="files"] .file-footer,
  #page_content[data-route="files"] .kt-dropdown-menu,
  #page_content[data-route="files"] .kt-context-menu {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #page_content[data-route="files"] .file-toolbar,
  #page_content[data-route="files"] .file-details-panel,
  #page_content[data-route="files"] .file-footer,
  #page_content[data-route="files"] .kt-dropdown-menu,
  #page_content[data-route="files"] .kt-context-menu {
    background: var(--background) !important;
  }

  #page_content[data-route="files"] .file-places {
    background: var(--muted) !important;
  }
}

@media (prefers-contrast: more) {
  #page_content[data-route="files"] .file-toolbar,
  #page_content[data-route="files"] .file-places,
  #page_content[data-route="files"] .file-details-panel,
  #page_content[data-route="files"] .file-footer,
  #page_content[data-route="files"] .file-list-table th,
  #page_content[data-route="files"] .file-list-table td {
    border-color: color-mix(in oklab, var(--foreground) 58%, var(--background)) !important;
  }

  #page_content[data-route="files"] .file-browser [data-file-entry]:focus-visible {
    outline: 3px solid var(--foreground);
  }

  #page_content[data-route="files"] .file-browser [data-file-entry][data-layout="list"][aria-selected="true"],
  #page_content[data-route="files"] .file-browser [data-file-entry][data-layout="mobile"][aria-selected="true"] {
    box-shadow: inset 4px 0 0 var(--primary);
  }

  #page_content[data-route="files"] .file-grid-card[aria-selected="true"] .file-grid-selection-target,
  #page_content[data-route="files"] .file-drop-target {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
  }
}

@media (forced-colors: active) {
  #page_content[data-route="files"] .file-mobile-selecting .file-selection-toolbar:not(.hidden) {
    border-color: CanvasText;
    background: Canvas !important;
    box-shadow: none;
  }

  #page_content[data-route="files"] .file-browser [data-file-entry][aria-selected="true"] {
    color: HighlightText;
    background: Highlight !important;
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  #page_content[data-route="files"] .file-browser [data-file-entry][aria-selected="true"] * {
    color: HighlightText !important;
  }

  #page_content[data-route="files"] .file-browser [data-file-entry]:focus-visible,
  #page_content[data-route="files"] .file-grid-card:focus-visible .file-grid-selection-target {
    outline: 2px solid CanvasText;
    outline-offset: -2px;
  }

  #page_content[data-route="files"] .file-drop-target,
  #page_content[data-route="files"] .file-selection-marquee {
    outline: 2px dashed Highlight;
    outline-offset: -2px;
    background: transparent !important;
  }

  #page_content[data-route="files"] .file-cut-pending {
    opacity: 1;
    text-decoration: line-through;
  }
}

.light #primary_nav .kt-menu-heading {
  color: color-mix(in oklab, var(--muted-foreground) 90%, var(--foreground));
}

.light #primary_nav .kt-menu-link.text-primary .kt-menu-title {
  color: color-mix(in oklab, var(--primary) 84%, black);
}

.mac-recovery-modal-content {
  max-height: calc(100dvh - 2rem);
}

.recovery-action,
.recovery-action-group {
  width: 100%;
}

@media (min-width: 640px) {
  .recovery-action,
  .recovery-action-group {
    width: auto;
  }
}

@media (max-width: 639px) {
  .home-mac-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .home-mac-actions > :first-child {
    grid-column: 1 / -1;
  }

  .home-mac-actions > * {
    justify-content: center;
  }

  .landing-hero-actions > .kt-btn {
    width: 100%;
    justify-content: center;
  }

  .responsive-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }
}

/* Verified bridge: the precompiled Metronic 9.5 stylesheet omits Tailwind's sr-only utility. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.portal-stat-unavailable {
  display: inline-block;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  font-weight: 500;
  letter-spacing: 0;
}

.portal-stat-skeleton {
  display: inline-block;
  width: 4.5rem;
  height: 1.25rem;
  vertical-align: middle;
}

/* CI run workspace: Metronic cards around a log-first, Buildkite-style split view. */
.ci-filters-toolbar {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 12rem) minmax(10rem, 12rem) auto;
  align-items: end;
  gap: 0.75rem;
  min-width: 0;
}

.ci-filters-toolbar > *,
.ci-filters-search {
  min-width: 0;
}

.ci-filters-apply {
  justify-content: center;
  white-space: nowrap;
}

.ci-run-summary > .kt-card-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding-block: 1rem;
}

.ci-run-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ci-run-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

.ci-run-metadata > div {
  min-width: 0;
  padding-inline: 1rem;
  border-inline-start: 1px solid var(--border);
}

.ci-run-metadata dt {
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 500;
}

.ci-run-metadata dd {
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ci-run-metadata small {
  display: block;
  margin-top: 0.125rem;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  line-height: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ci-run-workspace {
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
  min-width: 0;
}

.ci-run-rail,
.ci-run-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.ci-execution-header,
.ci-log-card-header {
  min-height: auto;
  flex-wrap: nowrap;
  padding-block: 1rem;
}

.ci-execution-header > .kt-badge,
.ci-log-card-header > .kt-badge {
  flex: none;
}

.ci-execution-list {
  padding-block: 0.5rem;
}

.ci-execution-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 6.5rem;
  align-items: flex-start;
  gap: 0.75rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.ci-execution-step:last-child,
.ci-support-row:last-child {
  border-bottom: 0;
}

.ci-execution-step-icon {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.ci-execution-step-content {
  min-width: 0;
}

.ci-execution-step-content h3,
.ci-execution-step-content p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ci-execution-step-status {
  display: flex;
  width: 6.5rem;
  justify-content: flex-end;
  padding-top: 0.125rem;
}

.ci-log-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) 9rem auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 48%, var(--card));
}

.ci-log-search-control {
  min-width: 0;
  width: 100%;
}

.ci-log-surface {
  height: clamp(30rem, 62dvh, 44rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding-block: 0.75rem;
  color: #cbd5e1;
  background: #0f1218;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  scrollbar-gutter: stable;
}

.ci-log-surface:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.ci-log-line {
  display: grid;
  grid-template-columns: 4rem 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.1875rem 1.25rem;
}

.ci-log-line.hidden {
  display: none;
}

.ci-log-line:hover {
  background: rgb(255 255 255 / 0.045);
}

.ci-log-sequence {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.ci-log-kind {
  font-weight: 600;
}

.ci-log-message {
  min-width: 0;
  color: #e2e8f0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ci-log-empty {
  padding: 3rem 1.25rem;
  color: #64748b;
  text-align: center;
}

.ci-log-paging {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.ci-run-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.ci-support-list {
  padding-block: 0.5rem;
}

.ci-support-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 1023px) {
  .ci-filters-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ci-filters-search {
    grid-column: 1 / -1;
  }

  .ci-filters-apply {
    grid-column: 1 / -1;
  }

  .ci-run-summary > .kt-card-content {
    grid-template-columns: 1fr;
  }

  .ci-run-metadata > div:first-child {
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  .ci-run-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .ci-run-main {
    grid-row: 1;
  }
}

@media (max-width: 639px) {
  .ci-filters-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .ci-filters-search,
  .ci-filters-apply {
    grid-column: auto;
  }

  .ci-run-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1rem;
  }

  .ci-run-metadata > div {
    padding-inline: 0.75rem;
  }

  .ci-run-metadata > div:nth-child(odd) {
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  .ci-log-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.75rem;
  }

  .ci-log-search-control {
    grid-column: 1 / -1;
  }

  .ci-log-kind {
    width: 100%;
  }

  .ci-log-download {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .ci-log-surface {
    height: clamp(22rem, 58dvh, 32rem);
    font-size: 0.6875rem;
  }

  .ci-log-line {
    grid-template-columns: 2.5rem 3.25rem minmax(0, 1fr);
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .ci-run-support-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Responsive bridge: keep error content centered unless a short viewport needs safe scrolling. */
.error-page-main {
  align-items: safe center;
}

/* Metronic exposes the paired mono foreground token only inside components. */
.text-mono-foreground {
  color: var(--mono-foreground);
}

.customer-detail-modal-content {
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-detail-modal-content > .kt-modal-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-detail-modal-content > .kt-modal-footer {
  flex-wrap: wrap;
}

.customer-detail-list > div {
  min-width: 0;
}

.customer-detail-list dd {
  overflow-wrap: anywhere;
}
.transfer-center .transfer-operation-message {
  /* Recovery instructions must remain readable in the bounded dropdown. */
  overflow-wrap: anywhere;
}
