/* ── Inventory settings shared styles ── */
.inv-steps {
    display: flex;
    border-bottom: 1px solid #f0f2f5;
    overflow-x: auto;
}
.inv-step {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 16px 8px 12px;
    border-top: 3px solid #e5e7eb;
    font-size: 0.78rem;
    color: #9ca3af;
    background: #fff;
}
.inv-step.done  { border-color: #16a34a; color: #16a34a; }
.inv-step.active { border-color: #1e40af; color: #1e40af; font-weight: 600; }
.inv-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #fff;
    margin-bottom: 6px;
}
.inv-step.done  .inv-step-num { background: #16a34a; }
.inv-step.active .inv-step-num { background: #1e40af; }
.inv-step-label { display: block; }

@media (max-width: 480px) {
    .inv-step {
        min-width: 60px;
        padding: 10px 4px 8px;
        font-size: 0.72rem;
    }
    .inv-step-label {
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 56px;
    }
}

/* Callout boxes */
.inv-callout {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #1e40af;
    line-height: 1.6;
}
.inv-callout strong { display: block; margin-bottom: 4px; font-size: 0.95rem; }
.inv-callout--success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.inv-callout--warn    { background: #fff8e1; border-color: #f0c040; color: #7a5600; }

/* Form inputs */
.inv-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}
.inv-form-group label,
.inv-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    display: block;
}
.inv-optional { font-weight: 400; text-transform: none; color: #9ca3af; font-size: 0.78rem; }
.inv-form-group input,
.inv-form-group select,
.inv-form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.inv-form-group input:focus,
.inv-form-group select:focus,
.inv-form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Monospace readonly inputs */
.inv-mono-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #374151;
    background: #f8f9fb;
    box-sizing: border-box;
}

/* Mapping / normalization tables */
.inv-map-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.inv-map-table th {
    background: #1e40af;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.inv-map-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f2f5;
    color: #374151;
    vertical-align: middle;
}
.inv-map-table tbody tr:nth-child(even) td { background: #f8f9fb; }
.inv-map-table tbody tr:hover td { background: #eef4ff; }
.inv-map-table select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
}
.inv-map-table select:focus { outline: none; border-color: #1e40af; }
.inv-map-table code {
    background: #f0f2f5;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #374151;
}

/* Cancel btn */
.cancel-btn { background-color: #dc2626 !important; }
.cancel-btn:hover { background-color: #b91c1c !important; }

/* ── Dealer subscription page ── */
.sub-action-pad {
    padding: 0 24px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.btn--sub-action {
    width: auto;
    padding: 10px 24px;
}
.sub-form-wrap {
    padding: 24px 28px;
    max-width: 480px;
}

/* The proration note sits between the plan select and the submit button, so it
   needs to breathe on both sides — scoped here rather than on .inv-hint, which
   elsewhere is the last element in its group and needs no bottom margin. */
.sub-form-wrap .inv-hint {
    margin-top: 10px;
    margin-bottom: 18px;
}

/* ── Dealer hours grid (views/editDealership.ejs) ──
   Lives here, not in dealershipPage.css, because editDealership.ejs never links
   that file — it loads adminDashboard/navbar/sitewide/footer in <head> and
   invShared.css last, so these rules win without !important. */
.inv-hint {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.78rem;
}
.hours-error { color: #b91c1c; }

.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.hours-row {
    display: grid;
    grid-template-columns: 110px 150px 1fr;
    align-items: center;
    gap: 10px;
}

.hours-day {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}

.hours-times {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hours-times[hidden] { display: none; }

.hours-dash {
    color: #6b7280;
    font-size: 0.82rem;
}

.hours-row select {
    padding: 7px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    min-width: 0;
}

.hours-copy {
    justify-self: start;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.hours-copy:hover { background: #f3f4f6; }

/* Stack on narrow screens — three columns of selects will not fit a phone. */
@media (max-width: 640px) {
    .hours-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f3f4f6;
    }
    .hours-times { flex-wrap: wrap; }
    .hours-row select { width: 100%; }
    .hours-times select { flex: 1 1 40%; }
}

/* ── Dealership activity log (views/dealershipAudit.ejs) ── */
.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.audit-field { display: flex; flex-direction: column; gap: 4px; }
.audit-field--grow { flex: 1 1 240px; min-width: 200px; }
.audit-field label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}
.audit-field input,
.audit-field select {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.86rem;
    background: #fff;
}
.audit-field--actions { flex-direction: row; gap: 8px; }
.audit-field--actions .btn { width: auto; padding: 9px 18px; }

.audit-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: #6b7280; }
.audit-sub { font-size: 0.76rem; color: #6b7280; }
.audit-action {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.audit-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px 24px;
    font-size: 0.85rem;
    color: #6b7280;
}
.audit-pager .btn { width: auto; padding: 8px 16px; }

@media (max-width: 640px) {
    .audit-filters { flex-direction: column; align-items: stretch; }
    .audit-field--actions { justify-content: stretch; }
    .audit-field--actions .btn { flex: 1; }
}
