/* Skorozvon Telephony Carousel Manager Stylesheet */

:root {
    --bg-primary: #0a0c10;
    --bg-surface: rgba(22, 28, 38, 0.45);
    --bg-surface-hover: rgba(30, 38, 52, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(94, 92, 230, 0.4);
    
    --text-primary: #f5f6f8;
    --text-secondary: #9aa5b5;
    --text-muted: #626e7f;
    
    --color-primary: #5e5ce6;
    --color-primary-hover: #4e4cd1;
    --color-success: #32d74b;
    --color-success-bg: rgba(50, 215, 75, 0.1);
    --color-danger: #ff453a;
    --color-danger-bg: rgba(255, 69, 58, 0.1);
    --color-warning: #ff9f0a;
    --color-warning-bg: rgba(255, 159, 10, 0.1);
    --color-spam: #ff9f0a;
    
    /* Operator tags */
    --op-beeline: #f1c40f;
    --op-megafon: #2ecc71;
    --op-mts: #e74c3c;
    --op-tele2: #34495e;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Gradients */
.background-decor {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.18;
    filter: blur(120px);
    pointer-events: none;
}

.blur-1 {
    background: radial-gradient(circle, var(--color-primary) 0%, rgba(94,92,230,0) 70%);
    top: -200px;
    right: -100px;
}

.blur-2 {
    background: radial-gradient(circle, #00d2ff 0%, rgba(0,210,255,0) 70%);
    bottom: -200px;
    left: -100px;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-circle {
    background: linear-gradient(135deg, var(--color-primary), #00d2ff);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(94, 92, 230, 0.3);
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-badge .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-badge .value {
    font-size: 1rem;
    font-weight: 600;
}

.status-badge {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge .dot.active {
    background-color: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
}

/* LAYOUT GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.panel-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.count-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* CAROUSELS PANEL */
.pools-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    flex-grow: 1;
}

.pool-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-normal);
}

.pool-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.pool-card-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.pool-card-header .title-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pool-card-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

.pool-card-header .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pool-card-header .arrow {
    transition: var(--transition-fast);
}

.pool-card.expanded .pool-card-header .arrow {
    transform: rotate(90deg);
}

.pool-card-body {
    padding: 1rem;
    display: none;
    max-height: 450px;
    overflow-y: auto;
}

.pool-card.expanded .pool-card-body {
    display: block;
}

.pool-numbers-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pool-number-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.pool-number-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pool-number-item .top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.pool-number-item .num-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* SOURCES PANEL */
.search-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-input-wrapper input,
.search-input-wrapper textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-input-wrapper textarea {
    resize: vertical;
    min-height: 42px;
    max-height: 180px;
    line-height: 1.4;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.search-input-wrapper input:focus,
.search-input-wrapper textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--border-color-focus);
}

.filter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.filter-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-group select:focus {
    border-color: var(--color-primary);
}

.selection-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.stats-update-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* TABLES */
.sources-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.table-responsive {
    width: 100%;
}

.numbers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.numbers-table th {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.8rem 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.numbers-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.numbers-table th.sortable:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.numbers-table th.sortable::after {
    content: " ↕";
    font-size: 0.75rem;
    color: var(--text-muted);
}

.numbers-table th.sortable.asc::after {
    content: " ▲";
    color: var(--color-primary);
}

.numbers-table th.sortable.desc::after {
    content: " ▼";
    color: var(--color-primary);
}

.numbers-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.numbers-table tr.main-row {
    cursor: pointer;
    transition: var(--transition-fast);
}

.numbers-table tr.main-row:hover td {
    background: var(--bg-surface-hover);
}

/* ACCORDION ROW FOR STATS DETAIL */
.stats-details-row {
    display: none;
}

.stats-details-row.show {
    display: table-row;
}

.stats-details-row td {
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.stats-details-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .stats-details-container {
        grid-template-columns: 1fr;
    }
}

.stat-group-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* PROGRESS BARS */
.stat-bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stat-bar-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.fill-contact { background-color: var(--color-success); }
.fill-no-answer { background-color: var(--color-primary); }
.fill-error { background-color: var(--color-danger); }
.fill-other { background-color: var(--text-muted); }

/* STATS LIST (SPECIFIC OUTCOMES) */
.outcome-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: start;
    max-height: 140px;
    overflow-y: auto;
}

.outcome-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.outcome-tag .val {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 0.3rem;
}

/* HEALTH DOTS */
.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.health-dot.healthy { background-color: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.health-dot.warning { background-color: var(--color-warning); box-shadow: 0 0 8px var(--color-warning); }
.health-dot.spam { background-color: #ff9f0a; box-shadow: 0 0 8px #ff9f0a; }
.health-dot.dead { background-color: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); }
.health-dot.unknown { background-color: var(--text-muted); }

.health-badge-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* CUSTOM CHECKBOX */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--text-muted);
    border-radius: 4px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

input[type="checkbox"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

input[type="checkbox"]:checked::before {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* TAGS & LABELS */
.operator-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.op-beeline { background-color: var(--op-beeline); color: #000; }
.op-megafon { background-color: var(--op-megafon); }
.op-mts { background-color: var(--op-mts); }
.op-tele2 { background-color: var(--op-tele2); }
.op-other { background-color: var(--text-muted); }

.status-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.status-tag.unused {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.status-tag.used {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

.stat-number-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-rate-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.contact-rate-badge.high { background-color: var(--color-success-bg); color: var(--color-success); }
.contact-rate-badge.medium { background-color: var(--color-warning-bg); color: var(--color-warning); }
.contact-rate-badge.low { background-color: var(--color-danger-bg); color: var(--color-danger); }
.contact-rate-badge.zero { background-color: rgba(255,255,255,0.03); color: var(--text-muted); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(94, 92, 230, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #e03b30;
    box-shadow: 0 4px 12px rgba(255, 69, 58, 0.3);
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* SPINNING LOADERS */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refreshing .refresh-icon {
    animation: spin 1s linear infinite;
}

/* FLOATING ACTION BAR */
.floating-action-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    max-width: 1000px;
    background: rgba(18, 24, 38, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 1rem 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-action-bar.show {
    bottom: 2rem;
}

.bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.selected-info .count {
    background: var(--color-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.floating-action-bar .actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.floating-action-bar .action-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.floating-action-bar .btn-group {
    display: flex;
    gap: 0.5rem;
}

.floating-action-bar .divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

/* TOAST SYSTEM */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 1000;
}

.toast {
    background: rgba(22, 28, 38, 0.9);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-primary);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.toast-content {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 1rem;
}

@keyframes slideIn {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.mt-2 { margin-top: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }

/* MINI ACCORDION CAROUSEL */
.carousel-stats-details {
    margin-top: 0.5rem;
    border-top: 1px dashed rgba(255,255,255,0.05);
    padding-top: 0.5rem;
}

.pool-bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pool-num-select {
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* Checker Badges */
.checker-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.checker-badge.clean {
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.2);
}
.checker-badge.spam {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.2);
}
.checker-badge.checking {
    background: rgba(255, 159, 67, 0.1);
    color: #ff9f43;
    border: 1px solid rgba(255, 159, 67, 0.2);
}
.checker-badge.unknown {
    background: rgba(164, 176, 190, 0.1);
    color: #a4b0be;
    border: 1px solid rgba(164, 176, 190, 0.2);
}

/* SOURCE ANALYTICS */
.sources-analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.source-analytics-panel {
    min-height: 620px;
}

.source-toolbar {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.source-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    min-width: 190px;
}

.source-access-field {
    min-width: 280px;
    flex: 1;
}

.source-field input,
.source-field select {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.75rem 0.9rem;
    outline: none;
    font: inherit;
}

.source-field input:focus,
.source-field select:focus {
    border-color: var(--border-color-focus);
}

.source-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.source-metric {
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.source-metric .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.source-metric .value {
    font-size: 1.35rem;
    font-weight: 700;
}

.source-analytics-table td {
    vertical-align: top;
}

.budget-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.budget-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(94, 92, 230, 0.12);
    border: 1px solid rgba(94, 92, 230, 0.22);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
    padding: 0.25rem 0.45rem;
}

@media (max-width: 768px) {
    .source-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .source-field,
    .source-access-field,
    .source-toolbar .btn {
        width: 100%;
    }
}


/* LOGIN */
.login-page {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(420px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.login-logo {
    margin-bottom: 1rem;
}

.login-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-field input {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.85rem 0.95rem;
    outline: none;
    font: inherit;
}

.login-field input:focus {
    border-color: var(--border-color-focus);
}

.login-error {
    min-height: 1.2rem;
    margin: 0.8rem 0 0;
    color: var(--danger);
    font-size: 0.85rem;
}

.date-range-trigger {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.75rem 0.9rem;
    outline: none;
    font: inherit;
    text-align: left;
    min-width: 250px;
    cursor: pointer;
}

.source-date-range-field {
    position: relative;
    min-width: 270px;
}

.date-range-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 320px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.date-range-popover.hidden {
    display: none;
}

.calendar-header,
.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-header {
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    margin-bottom: 0.75rem;
}

.calendar-header strong {
    text-align: center;
}

.icon-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    height: 34px;
    cursor: pointer;
    font-size: 1.2rem;
}

.calendar-weekdays {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 0.35rem;
}

.calendar-day {
    height: 34px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
}

.calendar-day:hover {
    border-color: var(--border-color-focus);
}

.calendar-day.muted {
    color: var(--text-muted);
    opacity: 0.55;
}

.calendar-day.in-range {
    background: rgba(94, 92, 230, 0.16);
}

.calendar-day.range-start,
.calendar-day.range-end {
    background: var(--primary);
    color: white;
}

.source-sort-header {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.source-sort-btn {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0 0.05rem;
}

.source-sort-btn.active {
    color: var(--primary);
}

.source-cell-main {
    display: inline-block;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.35rem;
}

.source-cell-share {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.budget-value-cell {
    min-width: 92px;
}


/* Source analytics wide table */
.source-analytics-panel {
    overflow: hidden;
}

.source-analytics-panel .sources-container {
    max-width: 100%;
    overflow: auto;
}

.source-analytics-panel .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.source-analytics-table {
    width: max-content;
    min-width: 100%;
}

.source-analytics-table th,
.source-analytics-table td {
    white-space: nowrap;
    min-width: 110px;
}

.source-analytics-table th:first-child,
.source-analytics-table td:first-child {
    min-width: 180px;
}

.source-analytics-table th:nth-child(2),
.source-analytics-table td:nth-child(2) {
    min-width: 190px;
}

.source-analytics-table th:nth-child(5),
.source-analytics-table td:nth-child(5) {
    min-width: 140px;
}

.source-analytics-panel .sources-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.source-analytics-panel .sources-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.source-analytics-panel .sources-container::-webkit-scrollbar-thumb {
    background: rgba(154, 165, 181, 0.35);
    border-radius: 999px;
}

.source-analytics-panel .sources-container::-webkit-scrollbar-thumb:hover {
    background: rgba(154, 165, 181, 0.55);
}


/* Budget columns are secondary metrics */
.source-analytics-table th:nth-child(n+6),
.source-analytics-table td:nth-child(n+6) {
    min-width: 82px;
    max-width: 96px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    background: rgba(255, 255, 255, 0.018);
}

.source-analytics-table th:nth-child(n+6) {
    color: rgba(154, 165, 181, 0.72);
    font-size: 0.82rem;
}

.source-analytics-table td:nth-child(n+6) .source-cell-main {
    font-size: 0.92rem;
    color: rgba(245, 246, 248, 0.82);
    margin-right: 0.2rem;
}

.source-analytics-table td:nth-child(n+6) .source-cell-share {
    font-size: 0.76rem;
    color: rgba(98, 110, 127, 0.78);
}

.source-analytics-table th:nth-child(n+6) .source-sort-header {
    gap: 0.15rem;
}

.source-analytics-table th:nth-child(n+6) .source-sort-btn {
    font-size: 0.78rem;
}

.source-analytics-table tr.main-row:hover td:nth-child(n+6) {
    background: rgba(255, 255, 255, 0.035);
}


/* Calendar readability */
.date-range-popover {
    background: #151b24;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
    z-index: 100;
}

.date-range-popover::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: #151b24;
    z-index: -1;
}

.calendar-header,
.calendar-weekdays,
.calendar-days {
    background: #151b24;
}

.calendar-day {
    background: #111721;
}

.calendar-day.muted {
    background: #10151d;
}

.calendar-day.in-range {
    background: rgba(94, 92, 230, 0.28);
}

.calendar-day.range-start,
.calendar-day.range-end {
    background: #5e5ce6;
}


/* Compact source analytics columns */
.source-analytics-table th,
.source-analytics-table td {
    min-width: 84px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.source-analytics-table th:first-child,
.source-analytics-table td:first-child {
    min-width: 150px;
}

.source-analytics-table th:nth-child(2),
.source-analytics-table td:nth-child(2) {
    min-width: 150px;
}

.source-analytics-table th:nth-child(3),
.source-analytics-table td:nth-child(3),
.source-analytics-table th:nth-child(4),
.source-analytics-table td:nth-child(4) {
    min-width: 86px;
}

.source-analytics-table th:nth-child(5),
.source-analytics-table td:nth-child(5) {
    min-width: 118px;
}

.source-analytics-table th:nth-child(n+6),
.source-analytics-table td:nth-child(n+6) {
    min-width: 86px;
    max-width: 92px;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.source-analytics-table .source-sort-header {
    gap: 0.12rem;
}

.source-analytics-table .source-sort-btn {
    min-width: 0;
}

.source-analytics-table td:nth-child(n+6) .source-cell-main {
    min-width: 1ch;
}

.source-analytics-table td:nth-child(n+6) .source-cell-share {
    margin-left: 0.12rem;
}


.source-cabinet-field {
    min-width: 190px;
}

.source-field select {
    appearance: none;
    cursor: pointer;
}
