/* ===================================
   User Details - Compact Design
   Inspired by Cursor Dashboard UX
   =================================== */

/* ===================================
   STAT TOOLTIPS
   =================================== */

.stat-with-tooltip {
    position: relative;
    cursor: help;
}

.stat-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    white-space: normal;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.stat-with-tooltip:hover .stat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

.stat-tooltip strong {
    color: var(--color-text-primary);
    display: block;
    margin-bottom: 4px;
}

/* Model Premium Highlight (Opus) */
.model-premium {
    color: var(--color-primary) !important;
    font-weight: 600 !important;
    position: relative;
}

.model-premium::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    background: var(--color-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    vertical-align: middle;
}

/* Filter Badge Styles */
#filter-badge {
    animation: slideIn 0.2s ease-out;
}

/* Filtered Stats */
#filtered-stats {
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

#filtered-stats:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}

.filtered-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filtered-stat-item:hover {
    background: rgba(139, 92, 246, 0.05);
}

.filtered-stat-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtered-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.2;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-text-sm {
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-text-sm:hover {
    opacity: 0.7;
}

/* Model Selector Compact */
.model-selector-compact {
    display: flex;
    align-items: center;
    margin-right: 16px;
    position: relative;
}

.model-select-compact {
    transition: all 0.2s;
}

.model-select-compact:hover {
    border-color: var(--color-primary);
}

.model-select-compact:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.model-select-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Icon for Opus option (premium) */
.model-select-compact option[data-premium="true"] {
    font-weight: 600;
}

/* Loading indicator for model selector */
.model-selector-compact::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

.model-selector-compact.loading::after {
    opacity: 1;
}

/* Success state */
.model-selector-compact.success .model-select-compact {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.model-selector-compact.success::after {
    content: '✓';
    width: 16px;
    height: 16px;
    border: none;
    color: #22c55e;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
    opacity: 1;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.header-right {
    display: flex;
    align-items: center;
}

/* Compact Header */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back-compact {
    background: transparent;
    border: 1px solid var(--color-border-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back-compact:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.user-info-compact h2 {
    font-size: 20px;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.user-meta-compact {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.badge-compact {
    background: var(--color-bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-compact .icon {
    vertical-align: middle;
}

.text-muted {
    color: var(--color-text-tertiary);
}

/* Period Selector Compact */
.period-selector-compact {
    display: flex;
    gap: 4px;
    background: var(--color-bg-secondary);
    padding: 4px;
    border-radius: 6px;
}

.period-selector-compact button {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    font-weight: 500;
}

.period-selector-compact button:hover {
    background: var(--color-bg-tertiary);
}

.period-selector-compact button.active {
    background: var(--color-primary);
    color: white;
}

/* Compact Stats Row */
.stats-row-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-mini {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value-big {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.stat-success {
    color: rgb(34, 197, 94);
}

.stat-warning {
    color: rgb(234, 179, 8);
    font-weight: 600;
}

.stat-danger {
    color: rgb(239, 68, 68);
    font-weight: 600;
}

/* Usage Bar Compact */
.usage-bar-compact {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar-mini {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Content Grid 2 Column */
.content-grid-2col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 14px;
    margin-bottom: 14px;
}

.col-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.col-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section Compact */
.section-compact {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.section-title-compact {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--color-text-primary);
}

/* Section Header with Controls */
.section-header-with-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header-with-controls .section-title-compact {
    margin: 0;
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.records-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.records-per-page label {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.records-per-page select {
    padding: 4px 8px;
    border: 1px solid var(--color-border-secondary);
    border-radius: 4px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.records-per-page select:hover {
    border-color: var(--color-border-tertiary);
}

.records-per-page select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.pagination-info {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--color-border-secondary);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-tertiary);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--color-text-tertiary);
    font-size: 12px;
}

/* Tokens Grid Mini */
.tokens-grid-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.token-item-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-bg-tertiary);
    border-radius: 6px;
}

.token-label-mini {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.token-value-mini {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Tabs Compact */
.tabs-compact {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--color-bg-tertiary);
    padding: 4px;
    border-radius: 6px;
}

.tab-button {
    flex: 1;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    font-weight: 600;
}

.tab-button:hover {
    background: var(--color-bg-secondary);
}

.tab-button.active {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Table Compact */
.table-compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-compact thead {
    border-bottom: 1px solid var(--color-border);
}

.table-compact th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-compact td {
    padding: 10px 12px;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
}

.table-compact tbody tr:last-child td {
    border-bottom: none;
}

.table-compact tbody tr:hover:not(.details-row) {
    background: var(--color-bg-tertiary);
}

/* Wide Detailed Table with Horizontal Scroll */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--card-bg);
}

.table-scroll::-webkit-scrollbar {
    height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

.table-detailed {
    width: 100%;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
}

.table-detailed thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-bg-secondary);
}

.table-detailed th {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border);
    background-color: var(--color-bg-secondary);
    white-space: nowrap;
}

/* Sticky Columns */
.table-detailed th.sticky-col,
.table-detailed td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 12;
    background-color: var(--color-bg-secondary);
    border-right: 2px solid var(--color-border);
}

.table-detailed tbody td.sticky-col {
    background-color: inherit; /* Наследует zebra-striping от строки */
}

.table-detailed tbody tr:nth-child(even) td.sticky-col {
    background-color: rgba(0, 0, 0, 0.015);
}

.table-detailed tbody tr:hover td.sticky-col {
    background-color: var(--color-bg-tertiary);
}

/* Header Styles */
.table-detailed th.group-header {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 16px;
    font-weight: 600;
    border-left: 1px solid var(--color-border);
}

.table-detailed th.group-header:first-of-type {
    border-left: none;
}

.table-detailed th.total-header {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-weight: 700;
    border-left: 1px solid var(--color-border);
}

.table-detailed th.sub-header {
    background-color: var(--color-bg-secondary);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 6px 2px;
}

/* Отступы в header для группировки */
.table-detailed thead tr:nth-child(2) th {
    padding-left: 4px;
    padding-right: 4px;
}

/* Убрали вертикальные фоны - оставляем только разделительные линии */

/* Тонкие вертикальные разделители в заголовке */
.table-detailed thead tr:nth-child(2) th:nth-child(2),
.table-detailed thead tr:nth-child(2) th:nth-child(4),
.table-detailed thead tr:nth-child(2) th:nth-child(6),
.table-detailed thead tr:nth-child(2) th:nth-child(8) {
    border-right: 1px solid var(--color-border);
    padding-right: 16px;
}

/* Отступы слева для первых колонок групп */
.table-detailed thead tr:nth-child(2) th:nth-child(1),
.table-detailed thead tr:nth-child(2) th:nth-child(3),
.table-detailed thead tr:nth-child(2) th:nth-child(5),
.table-detailed thead tr:nth-child(2) th:nth-child(7),
.table-detailed thead tr:nth-child(2) th:nth-child(9) {
    padding-left: 16px;
}

.table-detailed th.total-sub {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Table Body */
.table-detailed tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s;
}

/* Zebra-striping для улучшения читаемости строк */
.table-detailed tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.015);
}

.table-detailed tbody tr:hover {
    background-color: var(--color-bg-tertiary);
}

.table-detailed td {
    padding: 10px 2px;
    text-align: center;
    font-size: 12px;
    border-bottom: 1px solid var(--color-border);
    background-color: transparent;
}

/* Визуальное группирование пар токены/стоимость */
.table-detailed td.token-value {
    padding-right: 0px;
    padding-left: 4px;
}

.table-detailed td.cost-value {
    padding-left: 0px;
    padding-right: 4px;
}

/* Убрали вертикальные фоны - оставляем только для hover эффекта */

/* Ховер сохраняет группировку */
.table-detailed tbody tr:hover td {
    background-color: var(--color-bg-tertiary) !important;
}

/* Тонкие вертикальные разделители между группами */
/* Разделители справа от стоимости каждой группы */
.table-detailed tbody td:nth-child(4),
.table-detailed tbody td:nth-child(6),
.table-detailed tbody td:nth-child(8),
.table-detailed tbody td:nth-child(10) {
    border-right: 1px solid var(--color-border);
    padding-right: 16px !important;
}

/* Total группа - более заметный разделитель */
.table-detailed tbody td:nth-child(12) {
    padding-right: 8px !important;
}

/* Отступы слева от первой колонки каждой группы */
.table-detailed tbody td:nth-child(3),
.table-detailed tbody td:nth-child(5),
.table-detailed tbody td:nth-child(7),
.table-detailed tbody td:nth-child(9),
.table-detailed tbody td:nth-child(11) {
    padding-left: 16px !important;
}

/* Column-Specific Styles */
.table-detailed td.time-col {
    text-align: left;
    font-size: 11px;
    width: 140px;
    min-width: 140px;
    color: var(--color-text-secondary);
    padding-left: 12px;
}

/* Token and Cost Values */
.table-detailed td.token-value {
    font-weight: 600;
    color: var(--color-text-tertiary);
    width: 70px;
    font-family: 'Courier New', monospace;
}

.table-detailed td.token-value.has-tokens {
    color: var(--color-text-primary);
}

.table-detailed td.cost-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--color-text-secondary);
    width: 80px;
}

/* Total Columns */
.table-detailed td.total-tokens {
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.table-detailed td.total-cost {
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Стили для TOTAL колонки (токены и стоимость) */
.table-detailed td.total-cell {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 13px;
    background-color: rgba(0, 0, 0, 0.02);
}

.table-compact code {
    background: var(--color-bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.loading-row {
    text-align: center;
    color: var(--color-text-tertiary);
    padding: 20px !important;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(34, 197, 94);
}

.status-badge.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: rgb(251, 191, 36);
}

.status-badge.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: rgb(107, 114, 128);
}

.status-badge.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
}

/* Chart Styling */
.chart-full-width {
    margin-bottom: 0 !important;
}

.chart-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--color-bg-secondary);
    padding: 4px;
    border-radius: 6px;
}

.chart-toggle-btn {
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    font-weight: 500;
}

.chart-toggle-btn:hover {
    background: var(--color-bg-tertiary);
}

.chart-toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

#daily-activity-chart {
    width: 100%;
    height: auto !important;
    max-height: 300px;
}

.breakdown-tables-grid {
    max-width: 600px;
}

/* Grid layout for breakdown tables and projects in one row */
.tables-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

/* Project name cell truncation */
.project-name-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-name-cell:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
    position: relative;
    z-index: 10;
    background-color: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .tables-row-grid {
        grid-template-columns: 1fr;
    }
    
    .col-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .compact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-right {
        width: 100%;
    }
    
    .period-selector-compact {
        width: 100%;
    }
    
    .stats-row-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tokens-grid-mini {
        grid-template-columns: 1fr;
    }
    
    .table-compact {
        font-size: 12px;
    }
    
    .table-compact th,
    .table-compact td {
        padding: 8px;
    }
    
    /* Table scroll hint on mobile */
    .table-scroll::after {
        content: '← прокрутите →';
        position: absolute;
        bottom: 8px;
        right: 12px;
        font-size: 9px;
        color: var(--color-text-tertiary);
        pointer-events: none;
        opacity: 0.6;
    }
    
    /* Pagination responsive */
    .pagination-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .pagination-info {
        order: 2;
    }
    
    /* Section header responsive */
    .section-header-with-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .table-controls {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .records-per-page {
        width: 100%;
        justify-content: space-between;
    }
    
    .table-controls .btn-secondary {
        width: 100%;
    }

    /* Model selector responsive */
    .header-right {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .model-selector-compact {
        width: 100%;
        margin-right: 0;
        order: 2;
    }

    .model-selector-compact label {
        display: none;
    }

    .model-select-compact {
        width: 100%;
    }

    .period-selector-compact {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        order: 1;
    }

    /* Filtered stats responsive */
    #filtered-stats > div:last-child {
        grid-template-columns: repeat(2, 1fr);
    }

    .filtered-stat-value {
        font-size: 16px;
    }
}

/* Scrollbar Styling */
.col-sidebar::-webkit-scrollbar,
.section-compact::-webkit-scrollbar {
    width: 6px;
}

.col-sidebar::-webkit-scrollbar-track,
.section-compact::-webkit-scrollbar-track {
    background: transparent;
}

.col-sidebar::-webkit-scrollbar-thumb,
.section-compact::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.col-sidebar::-webkit-scrollbar-thumb:hover,
.section-compact::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

/* ===================================
   Admin Pricing Display
   =================================== */

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

/* Компактное отображение цен (RUB + USD в скобках) */
.cost-compact,
.cost-compact-total {
    display: inline-block;
    white-space: nowrap;
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.01em;
}

.cost-compact-total {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-primary);
}

/* Подсказка с дополнительной валютой (RUB для админа, пустой для пользователя) */
.cost-usd-hint {
    font-size: 11px;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-left: 4px;
    opacity: 0.75;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-cost {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

.user-cost {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: var(--font-weight-normal);
}

