/* CRM-style backing card tinted with the current platform theme. */
.data-table.it-roles-table {
    min-width: 0;
    table-layout: fixed;
}

.data-table.it-roles-table :is(th, td) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.card.accounting-dashboard,
.card.tools-dashboard {
    --accounting-table-height: 24rem;
    padding: clamp(1rem, 2vw, 1.5rem);
    background: var(--app-primary-soft, #e4f4f5);
    color: #1f2933;
    border: 1px solid color-mix(in srgb, var(--app-primary, #087f8c) 25%, white);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgb(15 23 42 / 12%);
}

body.seasonal-active:not([data-platform="portal"]) .app .main :is(.card.accounting-dashboard, .card.tools-dashboard) {
    background-color: color-mix(in srgb, var(--app-primary-soft, #e4f4f5) 96%, transparent);
}

:is(.accounting-dashboard, .tools-dashboard) section.card {
    margin: 0;
}

:is(.accounting-dashboard, .tools-dashboard) .card-head {
    flex: none;
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
}

:is(.accounting-dashboard, .tools-dashboard) :is(.accounting-table-scroll, .tools-dashboard-scroll) {
    flex: none;
    height: var(--accounting-table-height);
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

:is(.accounting-dashboard, .tools-dashboard) .data-table {
    width: 100%;
    margin: 0;
}

:is(.accounting-dashboard, .tools-dashboard) .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
}

:is(.accounting-dashboard, .tools-dashboard) :is(.accounting-table-scroll, .tools-dashboard-scroll):focus-visible {
    outline: 3px solid var(--app-primary, #2563eb);
    outline-offset: -3px;
}

/* Tools record pages share the app's cards, typography, and platform palette. */
.tools-detail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.tools-detail .card { margin: 0; }
.tools-detail .card-head {
    height: auto;
    min-height: 48px;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 10px 20px;
}
.tools-detail .tools-detail-summary-head {
    background: var(--app-primary-soft);
}
.tools-detail-summary-head h2,
.tools-detail-summary-head p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.tools-detail-summary-head h2 { margin-right: auto; }
.tools-detail-summary-head p { color: var(--slate-600); font-size: .85rem; font-weight: 400; }
.tools-detail .tools-detail-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 18px;
}
.tools-detail-body hr { margin: 0; border-color: var(--slate-200); opacity: 1; }
.tools-detail-search-form { padding: 18px; }
.tools-detail-search-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 16px;
}
.tools-detail-search-fields .field {
    flex: 1 1 14rem;
    min-width: 0;
}
.tools-detail-search-fields .field label {
    font-size: .8rem;
    color: var(--slate-600);
}
.tools-detail-search-fields .form-control { min-height: 40px; width: 100%; }
.tools-detail-search-actions .btn { min-height: 40px; padding: 8px 24px; }
.tools-detail-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    font-size: .85rem;
    cursor: pointer;
}
.tools-detail-checkbox .form-check-input { margin: 0; }
.tools-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 18px 24px;
}
.tools-detail-fact {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--slate-300, #cbd5e1);
    border-radius: 8px;
    background: var(--white, #fff);
}
.tools-detail-label {
    display: block;
    margin-bottom: 6px;
    color: var(--slate-600);
    font-size: .8rem;
    font-weight: 500;
}
.tools-detail-value {
    color: var(--slate-900);
    font-size: .9rem;
    line-height: 1.6;
    min-height: 1.6em;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.tools-detail .btn-anchor {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--app-primary);
    font: inherit;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.tools-detail .btn-anchor:hover { text-decoration: underline; }
.tools-detail :is(button, input, select):focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: 3px;
}
.tools-detail .table-wrap { overflow-x: auto; }
.tools-detail .data-table { width: 100%; }
.tools-detail .data-table th { white-space: nowrap; }
.tools-detail .data-table td { vertical-align: top; }
.tools-detail .tools-detail-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--slate-600);
    font-size: .9rem;
}
.tools-detail-drawing {
    display: flex;
    justify-content: center;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white, #fff);
}
.tools-detail-drawing img { max-width: 100%; width: auto; max-height: 36rem; object-fit: contain; }
@media (max-width: 575.98px) {
    .tools-detail .card-head, .tools-detail .tools-detail-body, .tools-detail-search-form { padding: 14px; }
    .tools-detail-search-fields { align-items: stretch; }
    .tools-detail-search-fields .field, .tools-detail-search-actions { flex-basis: 100%; }
    .tools-detail-search-actions .btn { width: 100%; }
    .tools-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
