/*
 * Panel-specific tweaks on top of AdminLTE 4 / Bootstrap 5 (loaded last by AdminLte4Asset).
 * Mostly keeps migrated pages as dense and familiar as the AdminLTE 2 ones.
 */

/* kartik's dropDownList() renders <select class="form-control"> (not .form-select), which has no
   arrow in Bootstrap 5 - give those the standard .form-select arrow, in both color modes. */
select.form-control:not([multiple]):not([size]) {
    --app-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    appearance: none;
    padding-right: 2.25rem;
    background-image: var(--app-select-arrow);
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}
[data-bs-theme=dark] select.form-control:not([multiple]):not([size]) {
    --app-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Data grids (kartik .kv-grid-table; views often replace the .grid-view container class): denser
   text/padding like the old panel, so wide grids fit without a horizontal scroll. */
.app-content .kv-grid-table,
.app-content .grid-view .table {
    font-size: .8125rem;
}
.app-content .kv-grid-table > :not(caption) > * > *,
.app-content .grid-view .table > :not(caption) > * > * {
    padding: .4rem .5rem;
    vertical-align: middle;
}

/* Row action icons (ActionColumn and similar link-only cells): wrap in a few compact rows like the
   old panel (one long line would push most of them behind the grid's horizontal scroll). */
.kv-grid-table td:has(> a > i[class*="fa-"]),
.grid-view td:has(> a > i[class*="fa-"]) {
    min-width: 6.5rem;
    line-height: 1.9;
}
.kv-grid-table td > a + a,
.grid-view td > a + a {
    margin-left: .4rem;
}

/* Wide grids scroll horizontally - keep the row actions (last column) pinned to the right edge so
   they stay visible and clickable without scrolling. */
.kv-grid-table > thead > tr > th.action-column,
.kv-grid-table > tbody > tr > td:last-child:has(> a > i[class*="fa-"]) {
    position: sticky;
    right: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
    box-shadow: inset 1px 0 0 var(--bs-border-color);
}

/* Card headers: icon before the title on one line; card-tools pushed to the end. */
.card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.card-header > .card-tools {
    margin-left: auto;
}
.card-header > .card-title {
    margin-bottom: 0;
}

/* Sidebar brand text sized to fit the 250px sidebar. */
.app-sidebar .brand-text {
    font-size: 1.1rem;
}

/* Login page brand (icon + product name instead of a raster logo; follows light/dark mode). */
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.login-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.25rem;
    font-size: 2.1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--bs-primary), #6610f2);
    box-shadow: 0 .5rem 1.25rem rgba(13, 110, 253, .25);
}
.login-brand-text {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--bs-emphasis-color);
}

/* Status badges: model helpers (getStatusColor() etc.) wrap them in Html::a(..., '#') - no link underline. */
a.badge {
    text-decoration: none;
}
