/* ==========================================================================
   KubaOS commander.css - v1.1 M4 File Commander styles.
   Dual-pane layout, active-pane highlight, on-screen function bar. References
   the shared design tokens from desktop.css; never redeclares the palette.
   ========================================================================== */

.kt-cmd-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* two panes side by side */
.kt-cmd-panes {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  min-height: 0;
}

.kt-cmd-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(28, 36, 51, 0.16);
  border-radius: var(--radius-btn);
  overflow: hidden;
}

/* the active pane gets the amber edge */
.kt-cmd-pane.kt-cmd-active {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.kt-cmd-path {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  background: #efe9dd;
  border-bottom: 1px solid rgba(28, 36, 51, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kt-cmd-pane.kt-cmd-active .kt-cmd-path {
  color: var(--ink);
}

.kt-cmd-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 1px solid rgba(28, 36, 51, 0.1);
  user-select: none;
  -webkit-user-select: none;
}

.kt-cmd-list {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 3px;
  overflow-y: auto;
  outline: none;
  min-height: 0;
}

.kt-cmd-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  cursor: default;
  border: 1px solid transparent;
  user-select: none;
  -webkit-user-select: none;
}

.kt-cmd-row:hover { background: rgba(30, 41, 59, 0.06); }

/* selection highlights only in the active pane; the inactive pane shows a
   muted marker so you can still see where focus will return */
.kt-cmd-row.kt-cmd-sel {
  background: rgba(232, 160, 32, 0.14);
  border-color: rgba(232, 160, 32, 0.4);
}
.kt-cmd-pane.kt-cmd-active .kt-cmd-row.kt-cmd-sel {
  background: rgba(232, 160, 32, 0.22);
  border-color: rgba(232, 160, 32, 0.6);
}

.kt-cmd-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.kt-cmd-name svg { width: 17px; height: 17px; flex: 0 0 auto; }
.kt-cmd-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kt-cmd-type {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kt-cmd-empty {
  padding: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-style: italic;
}

/* function bar: on-screen buttons are the guaranteed path (spec 16.2) */
.kt-cmd-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  background: var(--navy);
  border-top: 1px solid rgba(15, 23, 42, 0.5);
  flex-wrap: wrap;
}

.kt-cmd-fbtn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 86px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: #f4f6fb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-btn);
  cursor: pointer;
}

.kt-cmd-fbtn:hover {
  background: rgba(232, 160, 32, 0.28);
  border-color: var(--amber);
}

.kt-cmd-fbtn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.kt-cmd-fkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 12px;
  color: var(--navy-deep);
  background: var(--amber);
  border-radius: 4px;
}

.kt-cmd-flabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kt-cmd-hint {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: rgba(244, 246, 251, 0.7);
}

/* narrow windows: drop the alias-label text to the key chip only */
@media (max-width: 560px) {
  .kt-cmd-fbtn { min-width: 44px; }
  .kt-cmd-flabel { display: none; }
  .kt-cmd-hint { display: none; }
}

/* mobile: stack the panes so a single-column phone view stays usable */
@media (max-width: 820px) {
  .kt-cmd-panes { grid-template-columns: 1fr; }
}
