/* Avevox — Premium SaaS UI (Tailwind + custom) */
:root {
    --bg: #0a0e14;
    --bg-gradient: linear-gradient(135deg, #0a0e14 0%, #141923 100%);
    --bg-card: rgba(26, 35, 50, 0.8);
    --bg-card-hover: rgba(35, 47, 66, 0.95);
    --bg-elevated: rgba(40, 52, 72, 0.6);
    --bg-glass: rgba(26, 35, 50, 0.7);
    --text: #f0f3f6;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --border: rgba(55, 65, 81, 0.5);
    --border-light: rgba(75, 85, 99, 0.3);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --backdrop-blur: blur(20px);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar layout: light main area (premium SaaS style) */
body.bg-gray-50 {
    background: #f9fafb !important;
    background-image: none;
    color: #111827;
}

/* Sidebar nav active state */
aside .nav-item.active {
    background: rgb(55 65 81) !important;
    color: white !important;
}

aside .nav-item.active::before {
    display: none;
}

.app {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: 0;
    padding: 20px 32px;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    min-height: 72px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
    padding: 0 16px;
}

.nav-item {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: var(--text);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

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

.profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-btn:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.profile-name {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

.btn-main {
    margin-top: 8px;
    padding: 14px 28px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-main:hover::before {
    left: 100%;
}

.btn-main:active {
    transform: translateY(0);
}

.btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    padding: 12px 20px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-icon {
    font-size: 1.1em;
}

/* Main */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Content Container */
.main {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
}

.section-list {
    width: 100%;
    box-sizing: border-box;
}

/* Analytics */
.analytics-section {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 0;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-filters label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.9rem; }
.analytics-input { 
    padding: 10px 16px; 
    border-radius: var(--radius-sm); 
    border: 1px solid var(--border-light); 
    background: var(--bg-elevated); 
    color: var(--text); 
    font-family: var(--font); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.analytics-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

.analytics-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
}

.analytics-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
}

.analytics-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.analytics-by-tag {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.analytics-by-tag .tag-chip {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text);
}

.analytics-by-tag .tag-chip span { color: var(--text-muted); margin-left: 6px; }

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

.section-header .section-title { margin-bottom: 0; }

.filter-tags { display: flex; align-items: center; gap: 8px; }
.filter-select { 
    padding: 10px 16px; 
    border-radius: var(--radius-sm); 
    border: 1px solid var(--border-light); 
    background: var(--bg-elevated); 
    color: var(--text); 
    font-family: var(--font); 
    min-width: 160px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}

.filter-select:hover {
    border-color: var(--accent);
}

/* Filters Panel */
.filters-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

body.bg-gray-50 .filters-panel {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-input {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    min-width: 150px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}

.filter-input:hover {
    border-color: var(--accent);
}

.filter-checkbox {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Critical error icon */
.critical-error-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1rem;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Low score styling */
.call-score-low {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Tags on cards */
.call-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.tag-chip:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.tag-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 1rem;
    line-height: 1;
}

.tag-remove:hover { color: var(--text); }

.detail-tags-block { margin-bottom: 20px; }
.detail-tags-block h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.detail-tags-block .filter-select { margin-right: 8px; }

/* Settings */
/* Страница просмотра звонка */
.call-detail-section {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
    box-sizing: border-box;
    background: #f9fafb !important;
}
.call-detail-inner {
    max-width: 100%;
    margin: 0 auto;
}
.call-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}
.call-detail-header .btn-ghost {
    margin-right: 8px;
}
.call-detail-title {
    margin-bottom: 0;
    font-size: 1.25rem;
}
.call-detail-body {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px;
    padding: 28px;
}
.call-detail-body .detail-dialog {
    max-height: 70vh;
    min-height: 200px;
}

/* Блоки в шапке карточки звонка: CRM link и Цель звонка */
.call-header-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
}
.call-header-block {
    padding: 10px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
.call-header-block.crm-link-block .btn-crm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.call-header-block.crm-link-block .btn-crm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}
.call-header-block.intent-block {
    display: flex;
    align-items: center;
    gap: 8px;
}
.call-header-block.intent-block .intent-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.call-header-block.intent-block .intent-value {
    font-weight: 600;
    color: var(--accent);
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.settings-header .section-title { margin-bottom: 0; }

.settings-block { margin-bottom: 28px; }

.settings-block-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.settings-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.settings-tags-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.settings-tags-form .analytics-input { flex: 1; min-width: 180px; }

.settings-tags-list {
    list-style: none;
}

.settings-tags-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.settings-tags-list li .tag-name { font-weight: 500; }
.settings-tags-list li .btn-ghost { padding: 6px 12px; font-size: 0.85rem; }

/* Batch */
.batch-file-list { margin-top: 16px; max-height: 200px; overflow-y: auto; }
.batch-file-list li { padding: 8px 12px; background: var(--bg-elevated); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 0.9rem; }
.upload-label-batch { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.batch-progress-section { margin-top: 20px; padding: 20px; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.batch-progress-section h4 { margin-bottom: 12px; font-size: 1rem; }
.batch-progress-text { color: var(--text-muted); margin-bottom: 12px; font-size: 0.9rem; }
.batch-progress-list { list-style: none; }
.batch-progress-list li { padding: 8px 12px; margin-bottom: 4px; border-radius: var(--radius-sm); font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; }
.batch-progress-list li.status-pending { background: var(--bg-card); color: var(--text-muted); }
.batch-progress-list li.status-processing { background: rgba(29, 155, 240, 0.15); color: var(--accent); }
.batch-progress-list li.status-done { background: rgba(0, 186, 124, 0.15); color: var(--success); }
.batch-progress-list li.status-error { background: rgba(220, 53, 69, 0.15); color: #dc3545; }

.calls-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

body.bg-gray-50 .calls-grid {
    grid-template-columns: 1fr;
}

.pagination {
    margin-top: 24px;
    padding: 16px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pagination-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}
.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.pagination-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pagination-pages {
    display: flex;
    gap: 4px;
}
.pagination-page {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.pagination-page:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination-page.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    cursor: default;
}
.pagination-prev, .pagination-next {
    min-width: 90px;
}
.pagination-prev:disabled, .pagination-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.call-card {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

body.bg-gray-50 .call-card {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1) !important;
}

body.bg-gray-50 .call-card .call-card-title,
body.bg-gray-50 .call-card .call-stat-value { color: #111827 !important; }
body.bg-gray-50 .call-card .call-card-summary,
body.bg-gray-50 .call-card .call-stat-label { color: #6b7280 !important; }
body.bg-gray-50 .call-card .call-card-meta { color: #6b7280 !important; }

.call-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.call-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-4px);
}

.call-card:hover::before {
    transform: scaleY(1);
}

.call-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
    position: relative;
}

.call-card-title {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text);
    word-break: break-word;
}

.call-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.call-card-status {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.call-card-status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #b38600;
}

.call-card-status-error {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.call-card-error {
    font-size: 0.85rem;
    color: #dc3545;
    margin-bottom: 12px;
    line-height: 1.4;
}

.call-card-summary {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.call-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.call-stat {
    font-size: 0.85rem;
}

.call-stat-label {
    color: var(--text-muted);
}

.call-stat-value {
    color: var(--text);
    font-weight: 600;
}

.call-card-actions {
    display: flex;
    gap: 10px;
}

.call-card-actions .btn-main {
    margin-top: 0;
    padding: 10px 18px;
    font-size: 0.9rem;
}

.call-card-actions .btn-ghost {
    padding: 10px 18px;
    font-size: 0.9rem;
}

/* Loading & Empty */
.loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 56px 24px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-desc {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 320px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-panel {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-wide {
    max-width: 720px;
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-top h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

.modal-inner {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Upload */
.upload-section {
    text-align: center;
}

.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-elevated);
    backdrop-filter: blur(10px);
}

.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.upload-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-info {
    margin-top: 20px;
}

.file-info-inner {
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    display: inline-block;
}

#uploadBtn {
    margin-top: 24px;
}

/* Progress */
.progress-section {
    text-align: center;
    padding: 24px 0;
}

.progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.progress-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.3s;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.25rem;
}

.progress-label {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Results in modal */
.results-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.result-stat {
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.result-stat strong {
    display: block;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.result-summary {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.55;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.result-summary h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-dialog-wrap {
    margin-bottom: 16px;
}

.result-dialog-wrap h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dialog-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.phrase {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid transparent;
}

.phrase.client {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left-color: var(--accent);
    backdrop-filter: blur(10px);
}

.phrase.operator {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-left-color: var(--success);
    backdrop-filter: blur(10px);
}

.phrase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.phrase .speaker {
    font-weight: 600;
    color: var(--text);
}

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

.phrase-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

/* Detail view (modal body) */
.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-pending-msg,
.detail-error-msg {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.detail-pending-msg {
    background: rgba(255, 193, 7, 0.1);
    color: #b38600;
}
.detail-pending-msg p { margin: 0 0 12px 0; }
.detail-error-msg {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}
.detail-error-msg p { margin: 0; font-size: 0.95rem; }

.detail-summary-block {
    padding: 20px;
    background: rgba(29, 155, 240, 0.08);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.detail-summary-block h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-summary-block p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.detail-dialog {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.btn-danger {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Postprocess */
.postprocess-opts {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.opt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
}

.opt-row input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.postprocess-progress {
    text-align: center;
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.postprocess-progress .spinner {
    margin-bottom: 12px;
}

.postprocess-progress p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Profile Modal */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.profile-input {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.profile-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}

.profile-avatar-edit {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 8px 0;
    }
    
    .nav-item {
        white-space: nowrap;
    }
    
    .profile-name {
        display: none;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Selection */
::selection {
    background: var(--accent-light);
    color: var(--accent);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .btn-main,
    .btn-ghost,
    .profile-btn,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .call-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .call-card:active {
        transform: scale(0.98);
    }
    
    .btn-main:active,
    .btn-ghost:active,
    .btn-danger:active {
        transform: scale(0.95);
    }
    
    .nav-item:active {
        transform: scale(0.95);
    }
    
    .profile-btn:active {
        transform: scale(0.95);
    }
}

/* Print Styles */
@media print {
    .header,
    .modal,
    .call-card-actions,
    .btn-main,
    .btn-ghost {
        display: none;
    }
    
    .main {
        padding: 0;
        max-width: 100%;
    }
    
    .call-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon,
    .profile-avatar,
    .profile-avatar-large {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Form Styles for Scorecards */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.criteria-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.criterion-item {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* Templates Section */
.templates-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.templates-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.templates-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.template-card {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.template-card-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.template-card-body {
    flex: 1;
}

.template-card-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.template-card-footer {
    margin-top: auto;
}

.template-use-btn {
    width: 100%;
    justify-content: center;
}

.templates-divider {
    display: flex;
    align-items: center;
    margin: 40px 0;
    text-align: center;
}

.templates-divider::before,
.templates-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.templates-divider span {
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-secondary {
    padding: 14px 28px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Dashboard / Analytics */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.summary-card-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    min-height: 350px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

.loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

