/* ══════════════════════════════════════════════════════════════════
   Purchase Orders WebApp — component styles
   Layered on top of site.css (design tokens come from there).
   ══════════════════════════════════════════════════════════════════ */

/* ── Banners ──────────────────────────────────────────────────────── */
.po-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--bdr-2);
    background: var(--bg-surface);
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--txt-hi);
}
.po-banner i { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.po-banner-sub { color: var(--txt-mid); font-size: 12px; margin-top: 3px; }

.po-banner-error { background: var(--red-dim);  border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.po-banner-error i { color: var(--red); }

.po-banner-warn  { background: rgba(247, 176, 27, 0.10); border-color: rgba(247, 176, 27, 0.30); }
.po-banner-warn i  { color: #f7b01b; }

.po-banner-ok    { background: var(--grn-dim);  border-color: color-mix(in srgb, var(--grn) 30%, transparent); }
.po-banner-ok i  { color: var(--grn); }

/* ── Card grid ────────────────────────────────────────────────────── */
.po-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.po-card {
    background: var(--bg-surface);
    border: 1px solid var(--bdr-1);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.po-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.po-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--txt-hi);
}
.po-card-title i { color: var(--accent); }

.po-card-actions {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    gap: 8px;
}

/* ── Panel (single section) ───────────────────────────────────────── */
.po-panel {
    background: var(--bg-surface);
    border: 1px solid var(--bdr-1);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    margin-bottom: 18px;
}

/* ── Sections ─────────────────────────────────────────────────────── */
.po-section { margin-top: 30px; }
.po-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.po-section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--txt-hi);
    display: flex;
    align-items: center;
    gap: 8px;
}
.po-section-header h2 i { color: var(--accent); }

/* ── Definition list (label/value pairs) ──────────────────────────── */
.po-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 14px;
    font-size: 13px;
}
.po-dl dt { color: var(--txt-mid); font-weight: 500; }
.po-dl dd { color: var(--txt-hi); margin: 0; word-break: break-word; }

/* ── Tables ───────────────────────────────────────────────────────── */
.po-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--bdr-1);
    border-radius: var(--r-md);
    overflow: hidden;
    font-size: 13px;
}
.po-table th,
.po-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bdr-1);
}
.po-table thead th {
    background: var(--bg-raised);
    color: var(--txt-mid);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.po-table tbody tr:hover { background: var(--bg-raised); }
.po-table tbody tr:last-child td { border-bottom: none; }
.po-table form { display: contents; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.po-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    background: var(--bg-raised);
    border: 1px solid var(--bdr-2);
    color: var(--txt-hi);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t1) var(--ease), border-color var(--t1) var(--ease);
    text-decoration: none;
}
.po-btn:hover:not(:disabled) { background: var(--bg-overlay); border-color: var(--bdr-3); }
.po-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.po-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.po-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 85%, white);
    border-color: color-mix(in srgb, var(--accent) 85%, white);
}

.po-btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Checkboxes & inputs ──────────────────────────────────────────── */
.po-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--txt-hi);
    cursor: pointer;
}
.po-check code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--txt-mid);
    background: var(--bg-void);
    padding: 1px 5px;
    border-radius: var(--r-xs);
}
.po-check-inline { font-size: 12px; color: var(--txt-mid); }

.po-input {
    background: var(--bg-void);
    border: 1px solid var(--bdr-2);
    border-radius: var(--r-sm);
    color: var(--txt-hi);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
}
.po-input:focus { border-color: var(--accent); }

/* ── Run page specifics ───────────────────────────────────────────── */
.po-run-form {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.po-run-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bdr-1);
    font-size: 12px;
    color: var(--txt-mid);
}
.po-run-meta strong { color: var(--txt-hi); font-weight: 500; }

/* ── Console ──────────────────────────────────────────────────────── */
.po-console-wrap {
    margin-top: 18px;
    background: var(--bg-void);
    border: 1px solid var(--bdr-2);
    border-radius: var(--r-md);
    overflow: hidden;
}
.po-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--bdr-2);
    font-size: 12px;
    color: var(--txt-mid);
    font-weight: 500;
}
.po-console-header i { margin-right: 6px; color: var(--accent); }

.po-console {
    max-height: 60vh;
    overflow-y: auto;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--txt-hi);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.po-line { display: inline; }
.po-line-stderr { color: var(--red); }

/* ── Status pills ─────────────────────────────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--bdr-2);
}
.status-ok       { background: var(--grn-dim);  color: var(--grn); border-color: color-mix(in srgb, var(--grn) 30%, transparent); }
.status-err      { background: var(--red-dim);  color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.status-warn     { background: rgba(247, 176, 27, 0.12); color: #f7b01b; border-color: rgba(247, 176, 27, 0.30); }
.status-running  { background: var(--accent-dim); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.status-neutral  { background: var(--bg-raised); color: var(--txt-mid); }

/* ── Utilities ────────────────────────────────────────────────────── */
.po-mono     { font-family: var(--font-mono); font-size: 12px; }
.po-muted    { color: var(--txt-mid); font-size: 13px; }
.po-nowrap   { white-space: nowrap; }
.po-ellipsis { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-link     { color: var(--accent); font-size: 12px; }
.po-link:hover { text-decoration: underline; }
