/* ============================================================
   Equipment Inventory — purchases, items, receivables
   All rules scoped under .inv-* (every stylesheet loads on every page)
   ============================================================ */

/* ── Shared layout wrapper ── */
.inv-page {
    padding: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}
.inv-form-page {
    padding: 1.5rem;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Page header banner ── */
.inv-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 1.75rem 2rem;
    border-radius: 12px;
    margin-bottom: .75rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.inv-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: #fff;
    text-align: left;
}
.inv-header p {
    font-size: .875rem;
    opacity: .75;
    margin: 0;
    color: #fff;
    text-align: left;
}
.inv-header-green { background: linear-gradient(135deg, #064e3b 0%, #059669 100%); }
.inv-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.inv-header-actions .inv-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.inv-header-actions .inv-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Sub-navigation tabs ── */
.inv-tabs {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.inv-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .9rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
}
.inv-tab:hover { background: #f1f5f9; color: #1e293b; }
.inv-tab.active { background: #1e293b; border-color: #1e293b; color: #fff; }
.inv-tab .inv-tab-count {
    background: rgba(0,0,0,.08);
    border-radius: 10px;
    padding: 0 .45rem;
    font-size: .72rem;
}
.inv-tab.active .inv-tab-count { background: rgba(255,255,255,.2); }

/* ── Stat cards row ── */
.inv-stat-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.inv-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    flex: 1 1 140px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid #64748b;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: inherit;
}
a.inv-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.inv-stat-card.inv-sc-blue   { border-left-color: #3b82f6; }
.inv-stat-card.inv-sc-green  { border-left-color: #10b981; }
.inv-stat-card.inv-sc-amber  { border-left-color: #f59e0b; }
.inv-stat-card.inv-sc-purple { border-left-color: #8b5cf6; }
.inv-stat-card.inv-sc-red    { border-left-color: #ef4444; }
.inv-stat-val {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #1e293b;
}
.inv-stat-lbl {
    font-size: .75rem;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.inv-stat-action { font-size: 1.05rem; font-weight: 700; color: #065f46; }

/* ── Dashboard grid ── */
.inv-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: start;
}
.inv-col { display: flex; flex-direction: column; gap: 1.25rem; }
.inv-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
}
.inv-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}
.inv-card-head a { font-size: .78rem; font-weight: 600; color: #3b82f6; text-decoration: none; }
.inv-card-head a:hover { text-decoration: underline; }
.inv-card-body { padding: .9rem 1.1rem; }
.inv-list { list-style: none; margin: 0; padding: 0; }
.inv-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .84rem;
    color: #374151;
}
.inv-list li:last-child { border-bottom: none; }
.inv-list .inv-sub { display: block; font-size: .74rem; color: #94a3b8; margin-top: 1px; }
.inv-list a { color: #1e293b; text-decoration: none; font-weight: 600; }
.inv-list a:hover { color: #3b82f6; }
.inv-spend-val { font-size: 1.25rem; font-weight: 700; color: #1e293b; }
.inv-bar-row { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: #475569; padding: .3rem 0; }
.inv-bar-row .inv-bar-lbl { flex: 0 0 150px; }
.inv-bar-track { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.inv-bar-fill { height: 100%; background: #3b82f6; border-radius: 4px; }
.inv-bar-row .inv-bar-n { flex: 0 0 2rem; text-align: right; font-weight: 600; color: #1e293b; }
@media (max-width: 960px) {
    .inv-grid { grid-template-columns: 1fr; }
}

/* ── Filter bar ── */
.inv-filter-bar {
    background: #fff;
    border-radius: 10px;
    padding: .85rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.inv-filter-form {
    display: flex;
    flex-direction: row;
    gap: .75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}
.inv-filter-group { display: flex; flex-direction: column; gap: .25rem; }
.inv-filter-group label {
    font-size: .7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.inv-filter-group select,
.inv-filter-group input[type="text"],
.inv-filter-group input[type="search"] {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: .45rem .75rem;
    font-size: .875rem;
    background: #fff;
    color: #374151;
    outline: none;
    height: 36px;
    min-width: 160px;
    box-sizing: border-box;
}
.inv-filter-group select:focus,
.inv-filter-group input:focus { border-color: #6366f1; }
.inv-filter-actions {
    display: flex;
    flex-direction: row;
    gap: .6rem;
    align-items: center;
    margin-left: auto;
    align-self: flex-end;
    flex-wrap: wrap;
}
.inv-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 .9rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}
.inv-filter-btn:hover { background: #f1f5f9; color: #1e293b; }
/* Override base-site styles on the submit button (reports.css sets
   form button[type=submit] to display:block + width:100%) */
button.inv-filter-btn {
    background: #3b82f6 !important;
    color: #fff !important;
    border: 1px solid #3b82f6 !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    height: 36px !important;
    width: auto !important;
    padding: 0 .9rem !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1 !important;
    margin: 0 !important;
}
button.inv-filter-btn:hover { background: #2563eb !important; border-color: #2563eb !important; }

/* ── Data table ── */
.inv-table-wrap {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
    overflow-x: auto;
}
.inv-table-wrap table { width: 100%; border-collapse: collapse; }
.inv-table-wrap th {
    background: #f8fafc;
    padding: .7rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.inv-table-wrap td {
    padding: .8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .86rem;
    vertical-align: middle;
    color: #374151;
}
.inv-table-wrap tr:last-child td { border-bottom: none; }
.inv-table-wrap tbody tr:hover td { background: #f8fafc; }
.inv-table-wrap td a.inv-link { color: #1e293b; font-weight: 600; text-decoration: none; }
.inv-table-wrap td a.inv-link:hover { color: #3b82f6; }
.inv-muted { font-size: .74rem; color: #94a3b8; margin-top: 1px; }
.inv-empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.inv-empty-state i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.inv-empty { color: #94a3b8; font-style: italic; }
.inv-overdue { color: #dc2626; font-weight: 600; }
.inv-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Status badges ── */
.inv-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
/* item statuses */
.inv-badge-ordered        { background: #dbeafe; color: #1d4ed8; }
.inv-badge-in_stock       { background: #f1f5f9; color: #475569; }
.inv-badge-assigned       { background: #d1fae5; color: #065f46; }
.inv-badge-pending_return { background: #fef3c7; color: #92400e; }
.inv-badge-returned       { background: #e0e7ff; color: #3730a3; }
.inv-badge-retired        { background: #e2e8f0; color: #64748b; }
.inv-badge-lost           { background: #fee2e2; color: #b91c1c; }
/* purchase statuses */
.inv-badge-shipped        { background: #ede9fe; color: #5b21b6; }
.inv-badge-received       { background: #d1fae5; color: #065f46; }
.inv-badge-cancelled      { background: #e2e8f0; color: #64748b; }
/* misc */
.inv-badge-team     { background: #e0e7ff; color: #3730a3; }
.inv-badge-category { background: #f1f5f9; color: #475569; font-weight: 500; }

/* ── Action buttons ── */
.inv-action-row { display: flex; flex-direction: row; gap: .35rem; flex-wrap: wrap; align-items: center; }
.inv-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}
.inv-btn:hover { background: #f1f5f9; color: #1e293b; }
.inv-btn-view { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.inv-btn-view:hover { background: #dbeafe; color: #1e40af; }
.inv-btn-edit { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.inv-btn-edit:hover { background: #fef3c7; color: #78350f; }
.inv-btn-primary { color: #fff; border-color: #10b981; background: #10b981; }
.inv-btn-primary:hover { background: #059669; border-color: #059669; color: #fff; }
button.inv-btn-delete,
button.inv-btn-received {
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
}
button.inv-btn-delete {
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    background: #fef2f2 !important;
}
button.inv-btn-delete:hover { background: #fee2e2 !important; color: #991b1b !important; }
button.inv-btn-received {
    color: #fff !important;
    border: 1px solid #10b981 !important;
    background: #10b981 !important;
}
button.inv-btn-received:hover { background: #059669 !important; border-color: #059669 !important; }
.inv-inline-form { display: inline; margin: 0; padding: 0; border: none; background: none; }

/* ── Form page ── */
.inv-form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.inv-form-card h3 {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem;
    text-align: left;
}
.inv-form-group { margin-bottom: 1rem; }
.inv-form-group:last-child { margin-bottom: 0; }
.inv-form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .35rem;
}
.inv-form-group .inv-hint {
    display: block;
    font-size: .76rem;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 2px;
}
.inv-form-group select,
.inv-form-group input[type="text"],
.inv-form-group input[type="date"],
.inv-form-group input[type="number"],
.inv-form-group textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: .55rem .75rem;
    font-size: .875rem;
    background: #fff;
    color: #374151;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}
.inv-form-group select:focus,
.inv-form-group input:focus,
.inv-form-group textarea:focus { border-color: #6366f1; }
.inv-field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.inv-field-row .inv-form-group { flex: 1 1 220px; }
.inv-errorlist {
    list-style: none;
    margin: .35rem 0 0;
    padding: 0;
    color: #dc2626;
    font-size: .78rem;
}
.inv-form-actions { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; }
button.inv-btn-save {
    background: #10b981 !important;
    color: #fff !important;
    border: 1px solid #10b981 !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: .85rem !important;
    font-weight: 700 !important;
    padding: .55rem 1.4rem !important;
    box-shadow: none !important;
    cursor: pointer;
    margin: 0 !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
}
button.inv-btn-save:hover { background: #059669 !important; border-color: #059669 !important; }
.inv-btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: .55rem 1.2rem;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    text-decoration: none;
}
.inv-btn-cancel:hover { background: #f1f5f9; color: #1e293b; }

/* ── Detail page ── */
.inv-detail-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: .82rem;
    margin-top: .5rem;
    opacity: .85;
}
.inv-dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: .5rem 1rem;
    margin: 0;
    font-size: .86rem;
}
.inv-dl dt { color: #64748b; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.inv-dl dd { margin: 0; color: #1e293b; }
.inv-dl dd.inv-pre { white-space: pre-wrap; line-height: 1.5; }
@media (max-width: 600px) {
    .inv-dl { grid-template-columns: 1fr; }
}

/* ── Profile "My equipment" card ── */
.inv-profile-list { display: flex; flex-direction: column; gap: .5rem; }
.inv-profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .7rem 1rem;
    background: #fff;
    flex-wrap: wrap;
}
.inv-profile-item .inv-profile-name { font-weight: 700; color: #1e293b; font-size: .92rem; }
.inv-profile-item .inv-profile-sub { font-size: .76rem; color: #94a3b8; margin-top: 2px; }
