/* storage-planner — app-specific overrides only
   base theme: https://css.hybridlabs.dev/v1/theme.css */

body { align-items: flex-start; }

#app {
  width: 100%;
  padding: 20px 24px;
  color: var(--dim);
  font-size: 13px;
  overflow: auto;
  position: relative;
  z-index: 1;
}

#app h2,
#app h3,
#app h4 {
  font-family: var(--font-mono);
  font-weight: normal;
}
#app h2 {
  font-size: 14px;
  color: #ccc;
  margin: 18px 0 10px;
  letter-spacing: 0.03em;
}
#app h2::before { content: '# '; color: var(--green); }
#app h3 {
  font-size: 12px;
  color: var(--amber);
  text-transform: lowercase;
  margin: 14px 0 8px;
}
#app h3::before { content: '>> '; color: var(--muted); }
#app h4 {
  font-size: 12px;
  color: var(--amber);
  text-transform: lowercase;
  margin: 12px 0 6px;
}

#app p { margin: 6px 0; line-height: 1.65; }
#app ul { list-style: none; padding-left: 0; margin: 6px 0; }
#app ul li { position: relative; padding-left: 14px; margin: 2px 0; }
#app ul li::before {
  content: '\203A';
  position: absolute; left: 0;
  color: var(--green);
}
#app strong { color: var(--amber); font-weight: normal; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

.step {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: 20px;
}
.step:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field > label {
  font-size: 11px;
  color: var(--muted);
  text-transform: lowercase;
}
.field > label::before { content: '// '; color: var(--border-bright); }

.drive-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  margin: 10px 0 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}
.stat {
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 10px 12px;
}
.stat .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: lowercase;
}
.stat .value {
  font-size: 20px;
  color: var(--green);
  font-weight: bold;
  margin-top: 2px;
  line-height: 1.1;
  font-family: var(--font-mono);
}
.stat .unit {
  font-size: 11px;
  color: var(--dim);
  margin-left: 4px;
}
.stat .bar {
  height: 4px;
  background: #111;
  margin-top: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.stat .bar > .fill {
  height: 100%;
  background: var(--green);
  transition: width 0.15s ease;
}
.stat .bar > .fill.amber { background: var(--amber); }
.stat .bar > .fill.red   { background: var(--red); }
.stat .bar > .fill.blue  { background: var(--blue); }

.alloc {
  display: flex;
  width: 100%;
  height: 22px;
  border: 1px solid var(--border-bright);
  overflow: hidden;
  margin: 6px 0;
  font-family: var(--font-mono);
}
.alloc-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: #000;
  font-weight: bold;
  white-space: nowrap;
}
.alloc-seg.avail { background: var(--green); }
.alloc-seg.prot  { background: var(--amber); }

.legend { display: flex; gap: 16px; font-size: 11px; color: var(--dim); margin: 6px 0 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-sw { width: 10px; height: 10px; display: inline-block; }
.legend-sw.avail { background: var(--green); }
.legend-sw.prot  { background: var(--amber); }

.rack {
  border: 1px solid var(--border-bright);
  background: var(--bg-sunken);
  padding: 10px;
}
.rack-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.rack-bar.top    { margin-bottom: 8px; }
.rack-bar.bot    { margin-top: 8px; }
.rack-bar .model { color: var(--dim); }

.rack-leds { display: flex; gap: 12px; align-items: center; }
.rack-led  { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.led-dot   { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.led-dot.green { background: var(--green); box-shadow: 0 0 4px var(--green); }
.led-dot.amber { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.led-dot.blue  { background: var(--blue);  box-shadow: 0 0 4px var(--blue); }

.usb { display: flex; gap: 3px; }
.usb-port {
  width: 16px; height: 22px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.usb-port::after {
  content: '';
  display: block;
  width: 8px; height: 5px;
  background: var(--blue);
}

.bays {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.bay {
  aspect-ratio: 3 / 1;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.bay.empty {
  border-style: dashed;
  color: var(--muted);
}
.bay.empty::after {
  content: '+';
  color: var(--border-bright);
  font-size: 14px;
}
.bay.filled {
  cursor: pointer;
  color: var(--green);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  padding: 0;
}
.bay.filled:hover {
  border-color: var(--red);
  background: rgba(255, 68, 68, 0.1);
  color: var(--red);
}
.bay.filled::before {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}
.bay.filled:hover::before {
  background: var(--red);
  box-shadow: 0 0 4px var(--red);
}
.bay.static {
  color: var(--green);
  background: var(--bg-raise);
}
.bay.static::before {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

.vdev {
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.vdev-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.vdev-title {
  color: var(--amber);
  font-size: 12px;
  font-family: var(--font-mono);
}
.vdev-title::before { content: '[ '; color: var(--muted); }
.vdev-title::after  { content: ' ]'; color: var(--muted); }
.vdev-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 12px;
  margin-top: 8px;
  font-family: var(--font-mono);
}
.vdev-stats .k { color: var(--muted); }
.vdev-stats .v { color: var(--green); }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-bright);
  margin: 8px 0 14px;
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--dim);
  padding: 5px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  margin-right: -1px;
  line-height: 1.4;
}
.tab:hover { color: var(--green); }
.tab.active {
  background: var(--bg-raise);
  color: var(--green);
  border-color: var(--border-bright);
  border-bottom-color: var(--bg-raise);
  position: relative;
  z-index: 1;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.compare-panel {
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 14px;
}
.compare-panel > h3:first-child {
  margin-top: 0;
}

.cmp-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border-bright);
  background: var(--bg-sunken);
}
.cmp-row {
  display: grid;
  grid-template-columns: 180px 1fr 140px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
}
.cmp-row:first-of-type { border-top: none; }
.cmp-row .metric { color: var(--amber); }
.cmp-row .val {
  background: var(--bg);
  padding: 6px 10px;
  text-align: center;
  color: var(--green);
  border: 1px solid var(--border);
}
.cmp-row .diff {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.cmp-row .diff .arrow { font-size: 14px; }
.cmp-row .diff .arrow.w0 { color: var(--green); }
.cmp-row .diff .arrow.w1 { color: var(--blue); }
@media (max-width: 700px) {
  .cmp-row { grid-template-columns: 1fr; }
}

.cmp-summary {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--green);
  background: var(--bg);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.7;
}
.cmp-summary .tag { color: var(--green); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border-bright);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
}
.modal-title {
  background: var(--titlebar);
  color: #ccc;
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-title .close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 0 4px;
}
.modal-title .close:hover { color: var(--red); }
.modal-body {
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--dim);
  overflow-y: auto;
}
.modal-body h4 {
  font-size: 12px;
  color: var(--amber);
  text-transform: lowercase;
  margin: 12px 0 6px;
  font-family: var(--font-mono);
  font-weight: normal;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 6px 0; line-height: 1.65; }
.modal-body ul { list-style: none; padding-left: 0; margin: 6px 0; }
.modal-body ul li { position: relative; padding-left: 14px; margin: 3px 0; }
.modal-body ul li::before { content: '\203A'; position: absolute; left: 0; color: var(--green); }
.modal-body strong { color: var(--amber); font-weight: normal; }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.app-footer {
  margin-top: 20px;
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
}
.app-footer a { color: var(--green); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .sep-dot { color: var(--border-bright); }

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--dim);
}
.status-line .k { color: var(--muted); }
.status-line .v { color: var(--green); }

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border-bright); }

.abtn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--muted);
}
.abtn[disabled]:hover {
  border-color: var(--border);
  color: var(--muted);
  background: var(--bg);
}
