﻿/* =============================================================
   ORTHAVAX — OvGrid Component Styles
   Requires: orthavax-theme.css  (loaded first in _Layout)
   All colour values reference global --ov-* tokens — no local
   overrides needed for light/dark mode.
   ============================================================= */

:root {
    --ov-grid-radius-sm: 5px;
    --ov-grid-radius-md: 8px;
    --ov-grid-radius-lg: 10px;
    --ov-grid-radius-pill: 20px;
    --ov-grid-transition: 0.12s ease;
}

.ov-grid {
    font-size: 13px;
    font-family: inherit;
    color: var(--ov-text-primary);
}

.ov-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ov-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ov-toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ov-item-count-bar {
    text-align: left;
    padding: 4px 0 2px 0;
}

.ov-item-count {
    font-size: 13px;
    font-weight: bold;
    color: var(--ov-text-muted);
    white-space: nowrap;
}

.ov-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--ov-grid-radius-md);
    border: 0.5px solid var(--ov-border-strong);
    background: var(--ov-surface-base);
    color: var(--ov-text-primary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
    transition: background var(--ov-grid-transition), color var(--ov-grid-transition), border-color var(--ov-grid-transition);
}

    .ov-btn:hover {
        background: var(--ov-surface-subtle);
    }

    .ov-btn.ov-btn-primary {
        background: var(--ov-brand);
        color: var(--ov-brand-text);
        border-color: var(--ov-brand);
    }

        .ov-btn.ov-btn-primary:hover {
            background: var(--ov-brand-hover);
            border-color: var(--ov-brand-hover);
        }

    .ov-btn.ov-btn-active {
        background: var(--ov-brand);
        color: var(--ov-brand-text);
        border-color: var(--ov-brand);
    }

.ov-btn-filter {
    position: relative;
}

.ov-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--ov-text-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

    .ov-filter-badge.visible {
        display: flex;
    }

.ov-filter-panel {
    border: 0.5px solid var(--ov-border-brand);
    border-radius: var(--ov-grid-radius-lg);
    background: var(--ov-surface-base);
    margin-bottom: 10px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    box-shadow: var(--ov-shadow-md);
    transition: max-height 0.22s ease, opacity 0.22s ease;
}

    .ov-filter-panel.open {
        max-height: 600px;
        opacity: 1;
    }

.ov-filter-panel-body {
    padding: 14px 16px 12px;
}

.ov-filter-section-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--ov-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    margin-top: 4px;
}

    .ov-filter-section-label:not(:first-child) {
        margin-top: 14px;
    }

.ov-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.ov-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

    .ov-filter-group label {
        font-size: 11px;
        color: var(--ov-text-muted);
        font-weight: 400;
    }

    .ov-filter-group input,
    .ov-filter-group select {
        font-size: 12px;
        padding: 5px 8px;
        border-radius: var(--ov-grid-radius-sm);
        border: 0.5px solid var(--ov-input-border);
        background: var(--ov-input-bg);
        color: var(--ov-input-text);
        font-family: inherit;
        transition: border-color var(--ov-grid-transition), box-shadow var(--ov-grid-transition);
    }

        .ov-filter-group input:focus, .ov-filter-group select:focus {
            outline: none;
            border-color: var(--ov-input-border-focus);
            box-shadow: 0 0 0 3px var(--ov-focus-ring);
        }

        .ov-filter-group input::placeholder {
            color: var(--ov-input-placeholder);
        }

.ov-filter-with-op {
    display: flex;
    gap: 4px;
}

    .ov-filter-with-op select {
        width: 52px;
        flex-shrink: 0;
    }

    .ov-filter-with-op input {
        flex: 1;
        min-width: 60px;
    }

.ov-filter-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-top: 0.5px solid var(--ov-border);
    padding: 8px 16px;
    background: var(--ov-surface-subtle);
}

.ov-filter-clear-btn {
    font-size: 11px;
    color: var(--ov-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 6px;
    font-family: inherit;
}

    .ov-filter-clear-btn:hover {
        color: var(--ov-text-primary);
    }

.ov-filter-apply-btn {
    font-size: 12px;
    padding: 5px 14px;
    border-radius: var(--ov-grid-radius-md);
    border: 0.5px solid var(--ov-brand);
    background: var(--ov-brand);
    color: var(--ov-brand-text);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--ov-grid-transition);
}

    .ov-filter-apply-btn:hover {
        background: var(--ov-brand-hover);
    }

.ov-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    min-height: 0;
}

    .ov-pills-row:empty {
        display: none;
    }

.ov-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    border-radius: var(--ov-grid-radius-pill);
    background: var(--ov-brand);
    color: var(--ov-brand-text);
    font-size: 12px;
    white-space: nowrap;
}

.ov-pill-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.70);
    font-size: 15px;
    line-height: 1;
    padding: 0;
    margin-left: 1px;
    display: flex;
    align-items: center;
    font-family: inherit;
    transition: color var(--ov-grid-transition);
}

    .ov-pill-remove:hover {
        color: #ffffff;
    }

.ov-clear-all-btn {
    font-size: 11px;
    color: var(--ov-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 4px;
    font-family: inherit;
}

    .ov-clear-all-btn:hover {
        color: var(--ov-text-primary);
    }

.ov-table-wrap {
    border: 0.5px solid var(--ov-border-strong);
    border-radius: var(--ov-grid-radius-lg);
    overflow: hidden;
    background: var(--ov-surface-base);
}

.ov-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

    .ov-table thead th {
        background: var(--ov-surface-subtle);
        border-bottom: 0.5px solid var(--ov-border-strong);
        padding: 8px 10px;
        text-align: left;
        font-weight: 500;
        font-size: 12px;
        color: var(--ov-text-muted);
        white-space: nowrap;
        user-select: none;
    }

        .ov-table thead th.ov-sortable {
            cursor: pointer;
            transition: color var(--ov-grid-transition), background var(--ov-grid-transition);
        }

            .ov-table thead th.ov-sortable:hover {
                color: var(--ov-brand);
                background: var(--ov-brand-subtle);
            }

        .ov-table thead th.ov-sort-asc,
        .ov-table thead th.ov-sort-desc {
            color: var(--ov-brand);
            background: var(--ov-brand-subtle);
        }

.ov-sort-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 1.5px;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.30;
}

.ov-table thead th.ov-sort-asc .ov-sort-icon,
.ov-table thead th.ov-sort-desc .ov-sort-icon {
    opacity: 1;
}

.ov-sort-icon .si-up, .ov-sort-icon .si-dn {
    display: block;
    width: 0;
    height: 0;
}

.ov-sort-icon .si-up {
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-bottom: 4px solid currentColor;
}

.ov-sort-icon .si-dn {
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
}

.ov-table thead th.ov-sort-asc .ov-sort-icon .si-dn {
    opacity: 0.25;
}

.ov-table thead th.ov-sort-desc .ov-sort-icon .si-up {
    opacity: 0.25;
}

.ov-table tbody td {
    padding: 8px 10px;
    border-bottom: 0.5px solid var(--ov-border-subtle);
    color: var(--ov-text-primary);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-table tbody tr:last-child td {
    border-bottom: none;
}

.ov-table tbody tr {
    transition: background var(--ov-grid-transition);
}

    .ov-table tbody tr:nth-child(even):not([class*="ov-row-"]) {
        background: var(--ov-surface-subtle);
    }

    .ov-table tbody tr:hover {
        background: var(--ov-brand-subtle) !important;
        cursor: default;
    }

    .ov-table tbody tr.ov-row-selected {
        background: var(--ov-brand) !important;
    }

        .ov-table tbody tr.ov-row-selected td {
            color: var(--ov-brand-text);
        }

    .ov-table tbody tr.ov-row-warn {
        background: var(--ov-surface-warn);
        border-left: 3px solid var(--ov-border-warn);
    }

    .ov-table tbody tr.ov-row-danger {
        background: var(--ov-surface-danger);
        border-left: 3px solid var(--ov-border-danger);
    }

    .ov-table tbody tr.ov-row-success {
        background: var(--ov-surface-success);
        border-left: 3px solid var(--ov-border-success);
    }

    .ov-table tbody tr.ov-row-info {
        background: var(--ov-surface-info);
        border-left: 3px solid var(--ov-border-info);
    }

    .ov-table tbody tr.ov-group-header td {
        font-weight: 500;
        font-size: 12px;
        color: var(--ov-brand);
        background: var(--ov-brand-subtle);
        border-bottom: 0.5px solid var(--ov-brand-border);
        padding: 6px 10px;
        cursor: pointer;
        user-select: none;
    }

    .ov-table tbody tr.ov-group-header:hover td {
        background: var(--ov-brand-muted);
    }

.ov-group-caret {
    display: inline-block;
    transition: transform 0.15s ease;
    margin-right: 4px;
}

    .ov-group-caret.open {
        transform: rotate(90deg);
    }

.ov-action-cell {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.ov-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--ov-grid-radius-sm);
    border: 0.5px solid var(--ov-brand-border);
    background: var(--ov-surface-base);
    color: var(--ov-brand);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    font-family: inherit;
    transition: background var(--ov-grid-transition), color var(--ov-grid-transition), border-color var(--ov-grid-transition);
}

    .ov-action-btn:hover {
        background: var(--ov-brand);
        color: var(--ov-brand-text);
        border-color: var(--ov-brand);
    }

    .ov-action-btn.ov-action-danger {
        color: var(--ov-text-danger);
        border-color: var(--ov-border-danger);
    }

        .ov-action-btn.ov-action-danger:hover {
            background: var(--ov-text-danger);
            color: #ffffff;
            border-color: var(--ov-text-danger);
        }

.ov-row-selected .ov-action-btn {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
}

    .ov-row-selected .ov-action-btn:hover {
        background: rgba(255,255,255,0.30);
    }

.ov-empty-row td {
    text-align: center;
    color: var(--ov-text-muted);
    padding: 32px 16px;
    font-size: 13px;
}
