/* Filament CRM Custom Styles */

/* All tables: striped rows */
.fi-ta-table tbody tr:nth-child(even) {
    background-color: rgb(249 250 251);
}

.dark .fi-ta-table tbody tr:nth-child(even) {
    background-color: rgb(31 41 55);
}

/* All tables: cell borders */
.fi-ta-table th,
.fi-ta-table td {
    border: 1px solid rgb(158, 158, 158) !important;
}

.dark .fi-ta-table th,
.dark .fi-ta-table td {
    border: 1px solid rgb(72 83 103) !important;
}

/* Matrix  table */

.matrix-wrapper {
    padding: 0 5% 5% 5%;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 12px;
}

table.matrix {
    border-collapse: collapse;
}

table.matrix th,
table.matrix td {
    border: 1px solid #1f2937;
    padding: 4px 6px;
    text-align: center;

}

table.matrix th {
    position: sticky;
    top: 0;
    background: #020617;
    z-index: 2;
    color: #9ca3af;
}

table.matrix th.sticky-col,
table.matrix td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
}

table.matrix td {
    transition: background-color 0.12s ease-out;
}

.qty-empty {
    background: #0f172a;
    color: #334155;
}

.qty-0 {
    background: #7f1d1d;
    color: #fee2e2;
}

.qty-low {
    background: #f97316;
    color: #111827;
}

.qty-mid {
    background: #facc15;
    color: #111827;
}

.qty-high {
    background: #16a34a;
    color: #022c22;
}

.qty-very {
    background: #116d33;
    color: #ecfdf5;
}

.sphere-neg {
    background: #1e3a8a !important;
    color: #dbeafe !important;
    font-weight: 600;
    border-color: #60a5fa !important;
}

.sphere-pos {
    background: #7f4f4fb5 !important;
    color: #e10303 !important;
    font-weight: 600;
    border-color: #7f1d1d !important;
}

.sphere-zero {
    background: #ffffff !important;
    color: #11214e !important;
    font-weight: 800;
    font-style: oblique;
    border-color: #f9fafb !important;
}

tr.row-neg td {
    border-color: #60a5fa;
}

tr.row-pos td {
    border-color: #e6620a;
}

tr.row-zero td {
    border-color: #f9fafb;
}

/* Crosshair hover effect */
.hover-row td,
.hover-row th {
    background-color: rgba(59, 130, 246, 0.35) !important;
    color: #fff !important;
}

td.hover-col,
th.hover-col {
    background-color: rgba(59, 130, 246, 0.35) !important;
    color: #fff !important;
}

/* Active cell (intersection) */
td.hover-active {
    background-color: rgba(59, 130, 246, 0.6) !important;
    color: #fff !important;
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.legend {
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.legend span.box {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 4px;
}

/* Custom Utilities */
.writing-mode-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}