/* ESP Companion — tab polish layer (additive, token-driven, v1 2026-09-13)
   Fixes: hero noise on working tabs, default file inputs, raw tables,
   mismatched card headings. Rollback: delete the esp-polish.css link tag. */

/* 1) The marketing hero + stat strip only belong on the Projects home */
.maincol:has(.tab-content.active:not(#tab-projects)) .esp-hero,
.maincol:has(.tab-content.active:not(#tab-projects)) .hero-strip {
  display: none;
}

/* 2) Card headings & intro copy consistent across all tabs */
.tab-content .card > h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--txt);
  margin: 0 0 8px;
}
.tab-content .card > p {
  font-size: 0.84rem;
  color: var(--mut);
  line-height: 1.5;
  margin: 0 0 14px;
}

/* 3) Unified form controls (kills the inline-style grab bag) */
.tab-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.tab-content select,
.tab-content textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  margin-top: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--txt);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 9px;
  box-sizing: border-box;
}
.tab-content label > span:first-child {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mut);
}

/* File inputs: no more default grey "Choose File" */
.tab-content input[type="file"] {
  padding: 9px 10px;
  background: var(--input-bg);
  border: 1px dashed var(--input-border);
  border-radius: 9px;
  color: var(--mut);
  font-size: 0.82rem;
  cursor: pointer;
}
.tab-content input[type="file"]::file-selector-button {
  height: 34px;
  margin-right: 12px;
  padding: 0 14px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}
.tab-content input[type="file"]::file-selector-button:hover {
  background: var(--accent-2);
}

/* Buttons inside tab rows sit on the input baseline, same height */
.tab-content .btn {
  min-height: 40px;
  border-radius: 9px;
  font-weight: 700;
}

/* 4) Tables inside the tabs: proper grid, themed headers (delivery editor, etc.) */
.tab-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.tab-content table th {
  padding: 9px 10px;
  text-align: left;
  background: var(--tblhead);
  border-bottom: 1px solid var(--line);
  color: var(--mut);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tab-content table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rowline);
  color: var(--txt);
}
.tab-content table tbody tr:hover td {
  background: var(--accent-glow);
}

/* 5) Delivery meta recap grid: label/value rhythm */
#deliveryMeta > div > div {
  padding: 6px 10px;
  border: 1px solid var(--rowline);
  border-radius: 9px;
  background: var(--input-bg);
}
#deliveryMeta span {
  font-size: 0.68rem !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mut) !important;
}
#deliveryMeta div div div {
  font-weight: 700;
  color: var(--txt);
}

/* 6) Recent deliveries empty state */
#deliveryHistory .empty {
  padding: 18px !important;
  color: var(--mut);
  font-size: 0.85rem;
}

/* Dark mode inherits everything from the tokens; only file dashed border
   needs a touch more visibility */
[data-theme="dark"] .tab-content input[type="file"] {
  border-color: rgba(255, 255, 255, 0.22);
}

/* Mobile: upload row stacks, Parse button goes full width */
@media (max-width: 767px) {
  .tab-content .btn { width: 100%; }
}
