.icon-device {
    background-color: currentColor;
    display: inline-block;
    flex: 0 0 auto;
    height: 1em;
    -webkit-mask: url('../images/brelok.svg') center / contain no-repeat;
    mask: url('../images/brelok.svg') center / contain no-repeat;
    vertical-align: -.1em;
    width: 1.25em;
}

.stat-card {
    align-content: center;
    column-gap: 1rem;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto;
}

.stat-card .stat-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.stat-card .stat-value {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
}

.stat-card .stat-label {
    grid-column: 2;
    grid-row: 2;
}

.stat-card-link {
    color: inherit;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stat-card-link:hover,
.stat-card-link:focus {
    border-color: #d8dbe0;
    box-shadow: 0 10px 32px rgba(16, 17, 20, .075);
    color: inherit;
    transform: translateY(-2px);
}

.stat-card-link:focus-visible {
    outline: 2px solid rgba(220, 53, 69, .35);
    outline-offset: 3px;
}

.dashboard-chart-card .panel-card-header > i,
.dashboard-chart-card .panel-card-header .icon-device {
    font-size: 1.25rem;
}

.dashboard-chart-list {
    display: grid;
    gap: .9rem;
}

.dashboard-chart-row {
    align-items: center;
    column-gap: .9rem;
    display: grid;
    grid-template-columns: minmax(145px, 1.15fr) minmax(80px, 1.6fr) minmax(2.5rem, auto);
}

.dashboard-chart-label {
    align-items: center;
    display: flex;
    font-size: .88rem;
    font-weight: 700;
    gap: .65rem;
    min-width: 0;
}

.dashboard-chart-label span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-chart-device {
    flex: 0 0 auto;
    height: 34px;
    object-fit: contain;
    width: 30px;
}

.dashboard-chart-swatch {
    border: 1px solid rgba(16, 17, 20, .16);
    border-radius: 999px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55);
    flex: 0 0 auto;
    height: 1rem;
    width: 1rem;
}

.dashboard-chart-track {
    background: #eef0f3;
    border-radius: 999px;
    height: .65rem;
    overflow: hidden;
}

.dashboard-chart-track span {
    background: var(--chart-color, linear-gradient(90deg, var(--mt-red), #ef8c2f));
    border-radius: inherit;
    display: block;
    height: 100%;
    width: var(--chart-value);
}

.dashboard-chart-count {
    color: var(--mt-ink);
    font-size: .9rem;
    font-weight: 800;
    text-align: right;
}

.dashboard-chart-row-link {
    border-radius: .6rem;
    color: inherit;
    margin: -.35rem -.45rem;
    padding: .35rem .45rem;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}

.dashboard-chart-row-link:hover,
.dashboard-chart-row-link:focus {
    background: #f8f9fb;
    color: inherit;
}

.dashboard-chart-row-link:focus-visible {
    outline: 2px solid rgba(220, 53, 69, .35);
    outline-offset: 2px;
}

.filter-select-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid var(--mt-border);
    color: var(--mt-ink);
    display: flex;
    justify-content: space-between;
    min-height: 38px;
    text-align: left;
}

.filter-select-toggle:hover,
.filter-select-toggle:focus,
.filter-select-toggle.show {
    background: #fff;
    border-color: #c9ccd2;
    color: var(--mt-ink);
}

.filter-select-value,
.filter-select-option {
    align-items: center;
    display: flex;
    gap: .55rem;
    min-width: 0;
}

.filter-select-value span:last-child,
.filter-select-option span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-select-menu {
    border: 0;
    box-shadow: 0 16px 42px rgba(16, 17, 20, .12);
    max-height: 18rem;
    overflow-y: auto;
    padding: .4rem;
}

.filter-select-menu-searchable {
    max-height: 22rem;
}

.filter-select-search {
    background: #fff;
    padding: .2rem .2rem .45rem;
    position: sticky;
    top: -.4rem;
    z-index: 1;
}

.filter-select-option {
    border-radius: .5rem;
    font-weight: 700;
    min-height: 2.35rem;
}

.filter-select-option.active,
.filter-select-option:active {
    background: #fcebea;
    color: var(--mt-red);
}

.filter-select-device {
    flex: 0 0 auto;
    height: 30px;
    object-fit: contain;
    width: 26px;
}

.filter-select-placeholder {
    align-items: center;
    background: #f3f4f6;
    border-radius: 999px;
    color: var(--mt-muted);
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.45rem;
    justify-content: center;
    width: 1.45rem;
}

.filter-select-swatch {
    border: 1px solid rgba(16, 17, 20, .16);
    border-radius: 999px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55);
    flex: 0 0 auto;
    height: 1rem;
    width: 1rem;
}

.filter-select-swatch-empty {
    background: #fff;
    border-style: dashed;
    box-shadow: none;
}

.filter-form-actions {
    display: flex;
    gap: .5rem;
}

.filter-clear-button {
    align-items: center;
    display: inline-flex;
    flex: 0 0 38px;
    justify-content: center;
    min-height: 38px;
}

.battery-meter {
    background: #eceef1;
    border-radius: 999px;
    height: 5px;
    overflow: hidden;
    width: 110px;
}

.battery-meter span { display: block; height: 100%; }
.battery-excellent { color: #198754; }
.battery-good { color: #69a947; }
.battery-medium { color: #d39b09; }
.battery-low { color: #dc3545; }
.battery-unknown { color: #9ba0a8; }
.battery-meter .battery-excellent { background: #198754; }
.battery-meter .battery-good { background: #69a947; }
.battery-meter .battery-medium { background: #d39b09; }
.battery-meter .battery-low { background: #dc3545; }

.battery-chart { min-height: 260px; }
.battery-chart svg { height: 260px; overflow: visible; width: 100%; }
.battery-chart line { stroke: #e4e6e9; stroke-dasharray: 5 5; stroke-width: 1; }
.battery-chart polyline { fill: none; stroke: var(--mt-red); stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; vector-effect: non-scaling-stroke; }
.battery-chart-labels { color: var(--mt-muted); display: flex; font-size: .75rem; justify-content: space-between; }

.password-field,
.auth-password-field { position: relative; }
.password-field .form-control,
.auth-password-field .form-control { padding-right: 3.2rem; }
.password-field .form-control.is-invalid,
.auth-password-field .form-control.is-invalid {
    background-position: right 3.1rem center;
    padding-right: 5.2rem;
}
.password-toggle,
.auth-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #7e838b;
    display: inline-flex;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: .65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
}
.password-toggle:hover,
.password-toggle:focus,
.auth-password-toggle:hover,
.auth-password-toggle:focus { color: var(--mt-red); }
.password-toggle:focus-visible,
.auth-password-toggle:focus-visible { outline: 2px solid rgba(220, 53, 69, .35); outline-offset: 2px; }

.table-sort { align-items: center; color: inherit; display: inline-flex; gap: .45rem; text-decoration: none; }
.table-sort:hover { color: var(--mt-red); }
.table-sort i { font-size: .7rem; opacity: .65; }
.table-sort.is-current i { color: #000; opacity: 1; }
.table-card-header { gap: 1rem; }
.table-header-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.table-footer { display: flex; flex-direction: column; gap: 1rem; }
.table-actions { align-items: center; display: flex; gap: .75rem; justify-content: space-between; }
.table-per-page { min-height: 34px; width: 78px; }
.table-pagination nav { gap: 1rem; }
.table-pagination .pagination { margin-bottom: 0; }

.quick-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.quick-filter { background: #fff; border: 1px solid var(--mt-border); border-radius: 999px; color: var(--mt-muted); font-size: .82rem; font-weight: 700; padding: .5rem .85rem; text-decoration: none; }
.quick-filter:hover { border-color: #c9ccd2; color: var(--mt-ink); }
.quick-filter.active { background: var(--mt-black); border-color: var(--mt-black); color: #fff; }
.quick-filter-count { opacity: .65; }

.device-type {
    align-items: center;
    display: inline-flex;
    gap: .7rem;
    min-width: 150px;
}

.device-type-image {
    flex: 0 0 auto;
    height: 58px;
    object-fit: contain;
    width: 44px;
}

.device-type-copy { line-height: 1.25; }
.device-type-label { font-weight: 700; }
.device-type-placeholder {
    align-items: center;
    background: #f2f2f4;
    border-radius: .6rem;
    color: var(--mt-muted);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.15rem;
    height: 58px;
    justify-content: center;
    width: 44px;
}

.device-type-compact { gap: .55rem; min-width: 120px; }
.device-type-compact .device-type-image { height: 46px; width: 35px; }
.device-type-compact .device-type-placeholder { height: 46px; width: 35px; }
.device-type-compact .device-type-label { font-size: .82rem; }
.device-type-compact small { font-size: .72rem; }

.transfer-code { background: #fcebea; border-radius: .6rem; color: var(--mt-red); display: inline-block; font-family: monospace; font-size: 1.05rem; font-weight: 800; letter-spacing: .08em; padding: .45rem .65rem; }
.transfer-actions { align-items: center; display: inline-flex; gap: .5rem; white-space: nowrap; }
.transfer-details-row > td { background: #fafafa; }
.transfer-toggle { align-items: center; display: inline-flex; gap: .45rem; justify-content: center; min-width: 2.25rem; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.transfer-toggle .transfer-chevron { color: currentColor; display: inline-block; flex: 0 0 .75rem; transform: rotate(0deg); transform-origin: center; transition: transform .18s ease; width: .75rem; }
.transfer-toggle[aria-expanded="true"] { background: #fcebea; border-color: var(--mt-red); color: var(--mt-red); }
.transfer-toggle[aria-expanded="true"] .transfer-chevron { transform: rotate(180deg); }
.transfer-content { background: #fafafa; border-bottom: 1px solid var(--mt-border); padding: 1.2rem 1.35rem; }
.sales-history-toggle { align-items: center; display: inline-flex; height: 1.8rem; justify-content: center; padding: 0; width: 1.8rem; }
.sales-history-toggle i { transition: transform .18s ease; }
.sales-history-toggle[aria-expanded="true"] i { transform: rotate(45deg); }
.sales-history-details-row > td { background: #fafafa; }
.sales-history-content { background: #fafafa; border-bottom: 1px solid var(--mt-border); padding: 1rem 1.25rem 1.25rem; }
.sales-history-content .table { background: #fff; border: 1px solid var(--mt-border); margin: 0; }
.transfer-detail-sort {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: .35rem;
    padding: 0;
    text-align: left;
}
.transfer-detail-sort:hover { color: var(--mt-red); }
.transfer-detail-sort i { font-size: .7rem; opacity: .65; }

@media (max-width: 575.98px) {
    .table-card-header { align-items: flex-start; flex-direction: column; }
    .table-header-actions { justify-content: flex-start; width: 100%; }
    .table-actions { align-items: stretch; flex-direction: column; }
    .table-actions form { justify-content: space-between; }
    .table-pagination nav { align-items: stretch !important; }
}
