/* =========================================================================
   GridBlazor.css — grid + popup dialog rules only.
   Removed (2026-04): duplicates, .gridtitle, .mediaPopup, .active-tab,
   .custom-loader, .input-icon, duplicate .required-field (see app.css),
   duplicate .grid-header-title/button rules.
   ========================================================================= */

.bold-font {
    font-weight: 600;
}

.grid-change-page-size {
    margin: 0;
}

/* GridBlazor tables — keep cell borders/padding consistent */
.table-bordered > :not(caption) > * {
    border-width: 0;
}

    .table-bordered > :not(caption) > * > * {
        border-width: 0 0;
    }

.table-bordered td,
.table-bordered th {
    border: 1px solid var(--color-border);
}

.table td {
    padding: 0.3rem 0.75rem !important;
    vertical-align: middle !important;
}

table.striped > tbody > tr.grid-row:nth-of-type(odd) {
    background-color: var(--color-surface-alt) !important;
}

body.dark-mode table.striped > tbody > tr.grid-row:nth-of-type(odd) {
    background-color: var(--color-surface-alt) !important;
}

.grid-header-title button {
    text-decoration: none !important;
    background-color: transparent !important;
    font-size: 0.95rem !important;
    cursor: pointer;
    color: var(--color-primary) !important;
}

table.grid-table .grid-header > .grid-header-group > .grid-header-title > button {
    color: var(--color-primary) !important;
    font-size: 0.95rem !important;
}

table.grid-table .grid-header {
    color: var(--color-text) !important;
    font-weight: 600;
}

.table thead th {
    background: var(--color-surface-alt);
    color: var(--color-text);
    text-transform: initial;
    font-size: 0.85rem !important;
    font-weight: 600;
}

.grid-table {
    font-size: 0.825rem !important;
}

    .grid-table .grid-header > .grid-header-group > .grid-header-title > button {
        font-size: 0.85rem !important;
    }

/* =========================================================================
   Grid cells — make every cell (including custom-component cells) follow the
   theme. Custom-component columns don't inherit .table-bordered so they
   previously stayed light in dark mode.
   ========================================================================= */
.grid-table td,
.grid-table th {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
    padding: 0.3rem 0.5rem !important;
    vertical-align: middle !important;
}

body.dark-mode .grid-table td,
body.dark-mode .grid-table th {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

.grid-table thead th {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 0.35rem 0.5rem !important;
}

body.dark-mode .grid-table thead th {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
}

.grid-table .grid-header > .grid-header-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    min-height: 20px !important;
}

.grid-table .grid-header > .grid-header-group > .grid-header-title {
    margin: 0 !important;
    padding: 0 !important;
}

.grid-table .grid-header > .grid-header-group > .grid-header-title > button {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    color: var(--color-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    transition: color 0.15s ease;
}

.grid-table .grid-header > .grid-header-group > .grid-header-title > button:hover {
    color: var(--color-text) !important;
}

.grid-table .grid-filter-button {
    margin: 0 !important;
    padding: 2px !important;
    background: transparent !important;
    border: none !important;
    opacity: 0.5;
    transition: opacity 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.grid-table .grid-filter-button:hover {
    opacity: 0.9;
    transform: scale(1.08);
}

.grid-table .grid-filter-button svg,
.grid-table .grid-filter-button i {
    width: 11px !important;
    height: 11px !important;
    font-size: 11px !important;
    color: var(--color-text-muted) !important;
}

/* Striped rows */
.grid-table tbody tr.grid-row:nth-of-type(odd) > td,
table.striped > tbody > tr.grid-row:nth-of-type(odd) > td {
    background-color: var(--color-surface-alt) !important;
}

body.dark-mode .grid-table tbody tr.grid-row:nth-of-type(odd) > td {
    background-color: var(--color-surface-alt) !important;
}

/* Row hover */
.grid-table tbody tr.grid-row:hover > td {
    background-color: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)) !important;
}

body.dark-mode .grid-table tbody tr.grid-row:hover > td {
    background-color: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface)) !important;
}

/* =========================================================================
   Compact action buttons inside grid cells
   Override inline `border-radius:15px` hacks + make icon-only buttons square.
   ========================================================================= */
.grid-table td .btn,
.grid-table td > button.btn {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    border-radius: var(--radius-sm) !important;
    min-width: 26px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

    .grid-table td .btn > i,
    .grid-table td .btn > .fa,
    .grid-table td .btn > .bi {
        font-size: 0.8rem !important;
        margin: 0 !important;
    }

/* Trim the action-column header/cell width */
.grid-table th.grid-cell,
.grid-table td.grid-cell {
    white-space: nowrap;
}

/* If the grid action cell only contains a single small icon button,
   we can shrink its padding further */
.grid-table td:has(> button.btn-sm) {
    padding: 0.15rem 0.3rem !important;
    text-align: center;
}

/* Action header cells should be centered + compact, matching the buttons below */
.grid-table th.grid-cell:has(+ th.grid-cell),
.grid-table th.grid-cell:last-child {
    text-align: center;
}

/* For GridBlazor custom columns (buttons), reduce the minimum column width */
.grid-table td > button.btn-sm,
.grid-table td > .btn-sm {
    margin: 0;
}

/* ---------- Popup dialog / overlay ---------- */
.dialog {
    width: 320px;
    margin: auto;
    position: relative;
}

.dialog-container {
    width: 100%;
    height: 100vh;
    z-index: 1100 !important; /* above .header (1000) so header is blurred too */
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: dialog-container-entry 0.2s;
}

body.dark-mode .dialog-container {
    background-color: rgba(0, 0, 0, 0.6);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1090;
}

@keyframes dialog-container-entry {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------- Sticky footer pattern ---------- */
.fixed-div {
    position: sticky;
    bottom: 0;
    background-color: var(--color-surface);
    color: var(--color-text);
    padding: 10px;
    border-top: 1px solid var(--color-border);
}

body.dark-mode .fixed-div {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-top-color: var(--color-border);
}

/* ---------- Print ---------- */
@media print {
    .print-table {
        width: 100%;
        table-layout: auto;
        font-size: 12px;
    }

        .print-table td,
        .print-table th {
            word-break: break-word;
        }
}

/* Havit dropdown max-height fix (scoped) */
.dropdown-menu[b-kjzuko47a2] {
    height: 200px !important;
    width: 100%;
}
