/* Oncalls.ai - Sidebar Styles (Dark Theme) */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background-color: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1B2951 0%, #0f172a 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo i {
    display: none;
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Upload Section */
.upload-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-dropzone i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-dropzone p {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.upload-dropzone span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.upload-dropzone small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* File List Section */
.file-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.file-list-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-tertiary);
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* File Item */
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    background-color: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.file-item:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.file-item.active {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.file-item.active .file-item-name {
    color: var(--primary-color);
    font-weight: 600;
}

.file-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--primary-color);
}

.file-item.active .file-item-icon {
    background-color: var(--primary-color);
    color: white;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.file-item-status i {
    font-size: 0.5rem;
}

.file-item-status.analyzed {
    color: var(--success-color);
}

.file-item-status.processing {
    color: var(--warning-color);
}

.file-item-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: all var(--transition-fast);
}

.file-item:hover .file-item-delete {
    opacity: 1;
}

.file-item-delete:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Empty file list */
.file-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.file-list-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.file-list-empty p {
    font-size: 0.875rem;
}

/* Voice Settings Section */
.voice-settings-section {
    padding: 1rem;
    background-color: var(--bg-tertiary);
}

.voice-settings-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.voice-selector label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.voice-selector select {
    width: 100%;
    padding: 0.5rem;
}

/* Mobile toggle button (visible outside sidebar) */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    width: 40px;
    height: 40px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* Minimal Sidebar (for batch mode) */
.sidebar-minimal {
    width: 280px;
    min-width: 280px;
}

.sidebar-minimal .upload-section,
.sidebar-minimal .file-list-section {
    display: none;
}

.sidebar-minimal .voice-settings-section {
    flex: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background-color: rgba(27, 41, 81, 0.6);
    color: white;
    font-weight: 600;
    border-left: 3px solid #E74C3C;
}

.nav-item i {
    width: 1.25rem;
    text-align: center;
}

/* Sidebar Module */
.sidebar-module {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-module.hidden {
    display: none !important;
}

/* Sidebar Info Box */
.sidebar-info {
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.sidebar-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.sidebar-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-info li {
    font-size: 0.813rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.sidebar-info li strong {
    color: var(--text-primary);
}

/* Settings Section */
.settings-section {
    margin-bottom: 1rem;
}

.settings-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* Templates Section */
.templates-header {
    margin-bottom: 1rem;
}

.templates-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.templates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.templates-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.templates-empty p {
    font-size: 0.875rem;
}

/* Template Item */
.template-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-item:hover {
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
}

.template-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.template-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

.template-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.template-state {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.template-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.template-phone i {
    font-size: 0.625rem;
}

.template-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.template-duration i {
    font-size: 0.625rem;
}

.template-actions {
    display: flex;
    gap: 0.25rem;
}

.template-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0;
}

.template-item:hover .template-action-btn {
    opacity: 1;
}

.template-edit-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.template-delete-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Automation Module */
.automation-header {
    margin-bottom: 1rem;
}

.automation-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.automation-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.automation-status {
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.idle {
    color: var(--text-muted);
}

.status-indicator.idle i {
    color: var(--text-muted);
}

.status-indicator.listening {
    color: var(--primary-color);
}

.status-indicator.listening i {
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.status-indicator.speaking {
    color: var(--success-color);
}

.status-indicator.speaking i {
    color: var(--success-color);
    animation: pulse 0.8s infinite;
}

.status-indicator.matched {
    color: var(--warning-color);
}

.status-indicator.matched i {
    color: var(--warning-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.automation-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-block {
    width: 100%;
}

.automation-log {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
}

.automation-log h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-entry {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.log-entry.insurance {
    background-color: var(--insurance-bg);
    color: var(--insurance-color);
}

.log-entry.provider {
    background-color: var(--provider-bg);
    color: var(--provider-color);
}

.log-entry.system {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-style: italic;
}

.log-entry-time {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.current-segment {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.current-segment-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.current-segment-text {
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* ==========================================
   Main Content - Templates List View
   ========================================== */

.templates-list-view {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.templates-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.templates-list-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.templates-list-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.templates-count {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.templates-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    align-content: start;
}

.templates-empty-main {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.templates-empty-main i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.templates-empty-main h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.templates-empty-main p {
    font-size: 0.875rem;
    max-width: 300px;
}

/* Template Card in main view */
.template-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.template-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.template-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

.template-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.template-card-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.75rem;
}

.template-card-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.template-card-btn.delete:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.template-card-description {
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.template-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.template-card-badge.state {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.template-card-badge i {
    font-size: 0.625rem;
}

.template-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.template-card-footer .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

/* ==========================================
   Main Content - Automation View
   ========================================== */

.automation-view {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.automation-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.automation-template-info h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.automation-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.automation-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.automation-meta i {
    color: var(--text-muted);
}

.automation-state {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.automation-main-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Automation Status Banner */
.automation-status-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.automation-status-banner .status-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
}

.automation-status-banner .status-icon.idle {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

.automation-status-banner .status-icon.listening {
    background-color: var(--primary-light);
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.automation-status-banner .status-icon.speaking {
    background-color: var(--success-light);
    color: var(--success-color);
    animation: pulse 0.8s infinite;
}

.automation-status-banner .status-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.speech-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
}

.speech-indicator i {
    animation: pulse 1s infinite;
}

/* Two Column Layout */
.automation-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    overflow: hidden;
}

.template-steps-section,
.live-call-log-section {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Template Steps List */
.template-steps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.template-step {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    transition: all var(--transition-fast);
}

.template-step.current {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.template-step.completed {
    opacity: 0.6;
    background-color: var(--bg-tertiary);
}

.step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.template-step.insurance .step-number {
    background-color: var(--insurance-bg);
    color: var(--insurance-color);
}

.template-step.provider .step-number {
    background-color: var(--provider-bg);
    color: var(--provider-color);
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-role {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.template-step.insurance .step-role {
    color: var(--insurance-color);
}

.template-step.provider .step-role {
    color: var(--provider-color);
}

.step-text {
    font-size: 0.813rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.step-timing {
    font-size: 0.688rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.step-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-play-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.75rem;
}

.step-play-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step-play-btn.playing {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* Live Call Log */
.live-call-log {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.call-log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.call-log-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.call-log-placeholder p {
    font-size: 0.875rem;
}

.call-log-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
}

.call-log-entry.insurance {
    background-color: var(--insurance-bg);
    border-left: 3px solid var(--insurance-color);
}

.call-log-entry.provider {
    background-color: var(--provider-bg);
    border-left: 3px solid var(--provider-color);
}

.call-log-entry.system {
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--text-muted);
    font-style: italic;
}

.call-log-role {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.call-log-entry.insurance .call-log-role {
    color: var(--insurance-color);
}

.call-log-entry.provider .call-log-role {
    color: var(--provider-color);
}

.call-log-entry.system .call-log-role {
    color: var(--text-muted);
}

.call-log-text {
    font-size: 0.813rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.call-log-time {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================
   Main Content - Template Detail View
   ========================================== */

.template-detail-view {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.template-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.template-detail-info h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
}

.template-detail-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.template-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.template-detail-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.template-detail-meta i {
    color: var(--text-muted);
}

.template-detail-state {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.template-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Template Segments Section */
.template-segments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.template-segments-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.template-segment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.template-segment-item.insurance {
    border-left: 4px solid var(--insurance-color);
}

.template-segment-item.provider {
    border-left: 4px solid var(--provider-color);
}

.segment-index {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.template-segment-item.insurance .segment-index {
    background-color: var(--insurance-bg);
    color: var(--insurance-color);
}

.template-segment-item.provider .segment-index {
    background-color: var(--provider-bg);
    color: var(--provider-color);
}

.segment-content {
    flex: 1;
    min-width: 0;
}

.segment-role {
    font-size: 0.688rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.template-segment-item.insurance .segment-role {
    color: var(--insurance-color);
}

.template-segment-item.provider .segment-role {
    color: var(--provider-color);
}

.segment-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.segment-timing {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    display: flex;
    gap: 1rem;
}

.segment-timing span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Sidebar User Section */
.sidebar-user-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    flex: 1;
}

.user-avatar {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.813rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-org {
    font-size: 0.688rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Sidebar Proprietary Footer */
.sidebar-proprietary-footer {
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 1024px) {
    .automation-content-grid {
        grid-template-columns: 1fr;
    }

    .template-steps-section {
        max-height: 50vh;
    }

    .live-call-log-section {
        max-height: 40vh;
    }
}
