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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    width: 95%;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 25px 30px;
    border-bottom: 3px solid #34495e;
}

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

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.status-bar {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
}

.progress-container {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d7dee4;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e9eef3;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #5dade2);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* Control Panel */
.control-panel {
    padding: 20px 30px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    opacity: 0.85;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-logout {
    background: #e74c3c;
    color: #fff;
}

.btn-logout:hover:not(:disabled) {
    background: #c0392b;
}

.btn.danger,
.btn-small.danger {
    background: #e74c3c;
    color: #fff;
}

.btn.danger:hover:not(:disabled),
.btn-small.danger:hover:not(:disabled) {
    background: #c0392b;
}

/* Statistics */
.statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: white;
}

.stat-card {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    border-left: 4px solid #95a5a6;
}

.stat-card.stat-success {
    background: #d5f4e6;
    border-left-color: #27ae60;
}

.stat-card.stat-danger {
    background: #fadbd8;
    border-left-color: #e74c3c;
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-card.stat-success .stat-value {
    color: #27ae60;
}

.stat-card.stat-danger .stat-value {
    color: #e74c3c;
}

/* Tabs */
.tabs {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: #f5f5f5;
    color: #2c3e50;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    min-height: 400px;
}

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

/* Selection Info Bar */
.selection-info {
    background: #e3f2fd;
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selection-info span {
    font-weight: 600;
    color: #2c3e50;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.table-container.compact {
    border-radius: 6px;
}

.table-container.compact table {
    font-size: 14px;
}

.audit-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-summary-table th,
.audit-summary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.audit-summary-table th {
    background: #f7f9fb;
    font-weight: 600;
    color: #2c3e50;
}

.audit-summary-table td .btn-small {
    margin-right: 6px;
}


.appointments-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.appointments-table thead {
    background: #34495e;
    color: white;
}

.appointments-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.appointments-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #2c3e50;
    white-space: nowrap;
}

.appointment-slot-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecf0f1;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.appointment-dropdown {
    position: relative;
    width: 100%;
}

.appointment-dropdown .dropdown-toggle {
    width: 100%;
    background: #f6f7f9;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    color: #2c3e50;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.appointment-dropdown .dropdown-toggle .chevron {
    border: solid #2c3e50;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.appointment-dropdown .dropdown-toggle.open .chevron {
    transform: rotate(-135deg);
}

.appointment-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    z-index: 5;
    display: none;
    max-height: 220px;
    overflow-y: auto;
}

.appointment-dropdown .dropdown-menu.open {
    display: block;
}

.appointment-dropdown .dropdown-item {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f1f2f6;
    color: #2c3e50;
}

.appointment-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.appointment-dropdown .dropdown-item strong {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}

.contact-dropdown {
    position: relative;
}

.contact-dropdown .contact-toggle {
    width: 100%;
    text-align: left;
    background: #f6f7f9;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: none;
    z-index: 6;
    padding: 6px;
}

.contact-dropdown .contact-toggle .chevron {
    border: solid #2c3e50;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.contact-dropdown .contact-toggle.open .chevron {
    transform: rotate(-135deg);
}

.contact-dropdown .dropdown-menu.open {
    display: block;
}

.contact-entry {
    display: flex;
    gap: 8px;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f2f6;
}

.contact-entry:last-child {
    border-bottom: none;
}

.contact-entry-muted {
    opacity: 0.65;
}

.contact-entry-alert {
    color: #c0392b;
}

.contact-entry-duplicate {
    background: #fff8d6;
}

.contact-entry-blocked {
    color: #b26a00;
}

.contact-order {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3498db;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-empty {
    color: #c0392b;
    font-size: 12px;
}

.appointment-detail-list {
    margin: 6px 0 10px 18px;
    color: #2c3e50;
}

.appointment-detail-list li {
    margin-bottom: 4px;
}

.appointments-table tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.appointments-table tbody tr:hover {
    background: #f8f9fa;
}

.appointments-table thead th[data-sort-key] {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.appointments-table thead th[data-sort-key]::after {
    content: '';
    margin-left: 6px;
    font-size: 11px;
    color: #95a5a6;
}

.appointments-table thead th.sorted-asc::after {
    content: '▲';
    color: #2c3e50;
}

.appointments-table thead th.sorted-desc::after {
    content: '▼';
    color: #2c3e50;
}

.appointments-table tbody tr.appointment-row-template-match {
    background: #e9f7ef;
}

.appointments-table tbody tr.appointment-row-template-missing {
    background: #fff8e1;
}

.appointments-table tbody tr.selected {
    background: #e3f2fd;
}

.appointments-table tbody tr.appointment-row-excluded {
    background: #fff1f1;
    color: #a52121;
}

.appointments-table tbody tr.appointment-row-excluded:hover {
    background: #ffe8e8;
}

.appointments-table tbody tr.appointment-row-work_only {
    background: #f3e5f5;
    color: #6a1b9a;
}

.appointments-table tbody tr.appointment-row-work_only:hover {
    background: #e1bee7;
}

.appointments-table tbody tr.appointment-row-restricted {
    background: #fff3e0;
    color: #a65a00;
}

.appointments-table tbody tr.appointment-row-restricted:hover {
    background: #ffe0b2;
}

.status-badge.status-excluded {
    background: #fff1f1;
    border-color: #d93025;
    color: #d93025;
}

.status-badge.status-work_only {
    background: #f3e5f5;
    border-color: #8e24aa;
    color: #8e24aa;
}

.status-badge.status-restricted {
    background: #fff3e0;
    border-color: #f39c12;
    color: #b26a00;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #f39c12;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
}

.status-badge.status-inprogress {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1565c0;
}

.status-badge.status-warning {
    background: #fff3cd;
    border-color: #ffe8a1;
    color: #8a6d3b;
}

.status-badge.status-muted {
    background: #eceff1;
    border-color: #cfd8dc;
    color: #455a64;
}

.exclusion-banner {
    background: #ffe8e8;
    border: 1px solid #f2b3b3;
    color: #a52121;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 600;
}
.appointments-table input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.empty-message {
    text-align: center !important;
    color: #95a5a6;
    font-style: italic;
    padding: 40px !important;
    white-space: normal !important;
    display: table-cell !important;
}

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

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-ready {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-not-generated {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-missing {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Action Buttons */
.appointments-table td:last-child {
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
}

.action-btn {
    padding: 4px 8px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.action-btn-view {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.action-btn-view:hover {
    background: #2980b9;
}

.action-btn-play {
    background: #27ae60;
    color: white;
    border-color: #229954;
}

.action-btn-play:hover {
    background: #229954;
}

.action-btn-call {
    background: #16a085;
    color: white;
    border-color: #138d75;
}

.action-btn-call:hover {
    background: #138d75;
}

.action-btn-sms {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.action-btn-sms:hover {
    background: #2980b9;
}

.action-btn-portal {
    background: #9b59b6;
    color: white;
    border-color: #8e44ad;
}

.action-btn-portal:hover {
    background: #8e44ad;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* SMS Status Badges */
.sms-sent {
    background: #27ae60;
    color: white;
}

.sms-pending {
    background: #95a5a6;
    color: white;
}

/* Details Panel */
.details-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.details-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

#detailsContent {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    color: #2c3e50;
}

/* Logs */
.logs-container {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-left: 3px solid #3498db;
    padding-left: 10px;
}

.log-entry:hover {
    background: rgba(52, 152, 219, 0.15);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 4px;
    max-width: 1000px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-small {
    max-width: 500px;
}

.modal-header {
    background: #34495e;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
    }

    .button-group {
        width: 100%;
        justify-content: center;
    }

    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }

    .appointments-table {
        font-size: 12px;
    }

    .appointments-table th,
    .appointments-table td {
        padding: 8px;
    }

    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

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

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    min-width: 300px;
    border-left: 4px solid #95a5a6;
}

.notification.success {
    border-left-color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.info {
    border-left-color: #3498db;
}

.notification strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

/* Settings Page */
.settings-container {
    padding: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.settings-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 25px;
}

.settings-section h2 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.settings-tab {
    border: 1px solid #d0d5dc;
    background: #f6f7f9;
    border-radius: 20px;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.settings-tab.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.section-hint {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 18px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.setting-group small {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 12px;
}

.setting-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.btn-toggle {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.2;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: monospace;
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.setting-group input[type="number"] {
    max-width: 200px;
}

.inline-field-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.inline-field-group .form-control {
    flex: 1 1 220px;
    min-width: 200px;
}

.inline-field-group .btn {
    flex-shrink: 0;
}

.excluded-type-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px dashed #d5dae2;
    border-radius: 6px;
    min-height: 44px;
    background: #f8f9fb;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #e3f2fd;
    color: #1b5fa7;
    font-size: 13px;
    font-weight: 600;
}

.chip button {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chip button:hover,
.chip button:focus {
    color: #c0392b;
}

.chip-empty-text {
    color: #7f8c8d;
    font-size: 13px;
    margin: 0;
    width: 100%;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0;
    align-items: flex-end;
}

.table-toolbar .toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.table-toolbar .toolbar-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.table-toolbar .toolbar-group select {
    min-width: 200px;
}

.table-toolbar .toolbar-group.toolbar-hint {
    flex: 1 1 240px;
}

.table-toolbar .toolbar-group.toolbar-hint p {
    margin: 0;
    font-size: 13px;
    color: #2c3e50;
}

/* Message Builder */
.message-builder {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 18px;
    background: #f8f9fa;
}

.template-switch {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 12px;
}

.builder-clipboard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px dashed #d0d5dc;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 12px;
}

.builder-clipboard .clipboard-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.clipboard-status {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
}

.clipboard-status.has-clipboard {
    color: #2c3e50;
}

.system-alert-list {
    list-style: none;
    padding-left: 0;
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #2c3e50;
}

.system-alert-list li {
    margin-bottom: 4px;
}

.template-tab {
    border: 1px solid #d0d5dc;
    background: white;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
}

.template-tab:hover {
    background: #ecf0f1;
}

.template-tab.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.25);
}

.test-call-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-call-controls .form-control {
    max-width: 340px;
}

.test-call-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.test-call-results {
    border: 1px dashed #d0d7de;
    border-radius: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    max-width: 360px;
    min-height: 56px;
}

.test-call-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-call-result {
    border: 1px solid #e1e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.test-call-result.success {
    border-color: #2ecc71;
}

.test-call-result.error {
    border-color: #e74c3c;
}

.test-call-number {
    font-weight: 600;
    color: #2c3e50;
}

.test-call-status {
    margin-top: 2px;
    font-size: 0.95rem;
}

.test-call-error {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #c0392b;
}

.test-call-placeholder {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.message-composer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.composer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.composer-toolbar .btn {
    flex-shrink: 0;
}

.token-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.token-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-right: 4px;
}

.token-btn {
    background: white;
    border: 1px solid #d0d5dc;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.token-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.message-blocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: white;
    border: 1px solid #d0d5dc;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.message-block.drag-over {
    border-color: #3498db;
    background: #ecf6ff;
}

.message-block.dragging {
    opacity: 0.6;
}

.drag-handle {
    cursor: grab;
    font-size: 16px;
    color: #7f8c8d;
    user-select: none;
    padding: 4px 6px;
    border-radius: 4px;
    background: #f0f2f5;
}

.message-block textarea {
    width: 100%;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 48px;
}

.message-block textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.token-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f4fd;
    color: #1b4f72;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.token-chip small {
    font-weight: 500;
    color: #5d6d7e;
}

.block-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.block-type-label {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.block-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
    background: #f0f2f5;
    color: #c0392b;
}

.btn-icon:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

.empty-state {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.composer-hint {
    color: #7f8c8d;
    font-size: 12px;
    display: block;
}

.message-preview {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    font-family: inherit;
    line-height: 1.6;
    color: #2c3e50;
    min-height: 100px;
}

.message-preview .highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* Improved Message Builder Styles */
.toolbar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.toolbar-hint {
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
}

.token-categories-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.token-category {
    flex: 1;
    min-width: 180px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.token-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.token-category-icon {
    font-size: 16px;
}

.token-category-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.token-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

.token-btn.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.token-btn.featured:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    border-color: #5a6fd6;
}

.token-selector.compact {
    gap: 4px;
}

.token-group-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.token-group-column {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.token-group-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5d6d7e;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* SMS Builder Specific Styles */
.sms-preview {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #e5f6e5;
    border-color: #c3e6cb;
    max-width: 320px;
    border-radius: 18px;
    padding: 12px 16px;
    position: relative;
    min-height: 60px;
}

.sms-preview::before {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #e5f6e5;
}

.sms-preview-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.sms-char-count {
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.sms-char-count.warning {
    color: #e67e22;
}

.sms-char-count.over {
    color: #e74c3c;
}

.sms-segment-info {
    margin-left: 8px;
    color: #95a5a6;
}

/* Message Break Button */
.message-break-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    color: white !important;
    border-color: #d35400 !important;
}

.message-break-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400) !important;
}

/* Message Break Block in Builder */
.message-break-block {
    background: linear-gradient(135deg, #fff8e6, #ffeaa7) !important;
    border-color: #f39c12 !important;
    border-style: dashed !important;
}

.message-break-chip {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    color: white !important;
    font-weight: 600;
}

/* SMS Split Messages Preview Container */
.sms-messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sms-message-bubble {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #e5f6e5;
    border: 1px solid #c3e6cb;
    max-width: 320px;
    border-radius: 18px;
    padding: 12px 16px;
    position: relative;
}

.sms-message-bubble.warning {
    background: #fff8e6;
    border-color: #f39c12;
}

.sms-message-bubble.over {
    background: #fdecea;
    border-color: #e74c3c;
}

.sms-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.sms-message-number {
    font-size: 11px;
    font-weight: 600;
    color: #27ae60;
    text-transform: uppercase;
}

.sms-message-bubble.warning .sms-message-number {
    color: #e67e22;
}

.sms-message-bubble.over .sms-message-number {
    color: #e74c3c;
}

.sms-message-stats {
    font-size: 10px;
    color: #7f8c8d;
}

.sms-message-content {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

/* Auto-split segment styling */
.sms-message-bubble.auto-split {
    border-style: dashed;
    background: #f0f9ff;
    border-color: #3498db;
}

.sms-message-bubble.auto-split .sms-message-number {
    color: #3498db;
}

/* Encoding badge */
.encoding-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.encoding-badge.gsm7 {
    background: #d5f5e3;
    color: #27ae60;
}

.encoding-badge.ucs2 {
    background: #fdecea;
    color: #e74c3c;
}

/* Manual break indicator */
.message-break-indicator {
    text-align: center;
    padding: 8px;
    color: #f39c12;
    font-size: 12px;
    font-weight: 600;
    border: 1px dashed #f39c12;
    border-radius: 4px;
    margin: 8px 0;
    background: #fff8e6;
}

/* Unicode warning */
.sms-char-count.unicode {
    color: #9b59b6;
}

.sms-char-count.unicode::after {
    content: ' (Unicode)';
    font-size: 10px;
}

#smsBuilderSection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

#smsBuilderSection h2 {
    color: #27ae60;
    margin-bottom: 8px;
}

.mapping-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mapping-card {
    flex: 1;
    min-width: 260px;
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.mapping-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.mapping-table th,
.mapping-table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    font-size: 14px;
    text-align: left;
}

.mapping-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d0d5dc;
    border-radius: 4px;
}

.mapping-table .empty-message {
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
}

.user-table .user-primary strong {
    display: block;
    font-size: 15px;
    color: #2c3e50;
}

.user-table .user-meta {
    font-size: 12px;
    color: #7f8c8d;
}

.compact-control {
    width: 100%;
}

.status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-text {
    margin-left: 6px;
    font-size: 13px;
    color: #2c3e50;
}

.user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.form-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-column {
    flex: 1;
    min-width: 250px;
}

.role-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.role-checkbox-inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 13px;
    background: transparent;
    border: none;
    padding: 2px 0;
    border-radius: 0;
    white-space: normal;
    line-height: 1.3;
    color: #2c3e50;
    font-weight: 500;
    width: 100%;
}

.role-checkbox-inline input {
    flex-shrink: 0;
    margin: 0;
}

.user-role-cell {
    text-align: left;
}

.user-role-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 2px 0;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 14px;
    background: #fef2e6;
    color: #c0392b;
    font-size: 12px;
    border: 1px solid #f8d7b4;
    line-height: 1.2;
    font-weight: 600;
}

.call-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-top: 8px;
}
.user-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-table td {
    vertical-align: top;
    padding-top: 12px;
    padding-bottom: 12px;
}

.user-table td.align-middle,
.user-table td.user-actions-cell {
    vertical-align: middle;
}

.user-status-cell,
.user-timestamp-cell {
    text-align: center;
}

.user-status-content {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.user-status-cell .status-toggle {
    justify-content: center;
}

.user-status-cell .status-text {
    margin-left: 0;
}

.user-timestamp-cell .user-timestamp-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

/* Authentication Pages */
body.auth-body {
    background: radial-gradient(circle at top, #fdfefe 0%, #eef2f6 45%, #d9e1ea 100%);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.auth-wrapper {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 35px 55px rgba(44, 62, 80, 0.25);
    overflow: hidden;
}

.auth-brand {
    background: linear-gradient(155deg, #1f2c3d, #2c3e50 60%, #34495e);
    color: #ecf0f1;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

.auth-eyebrow {
    font-size: 12px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #8fb3d9;
    font-weight: 600;
}

.auth-brand h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
}

.auth-brand p {
    margin: 0;
    font-size: 15px;
    color: #d6e5f7;
}

.auth-tagline {
    font-size: 16px;
    color: #ffffff;
    opacity: 0.95;
}

.auth-highlights {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-highlights li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #dbe9f8;
}

.auth-highlights li::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #5dade2;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(93, 173, 226, 0.25);
    flex-shrink: 0;
}

.auth-card {
    background: #ffffff;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-card-header h2 {
    font-size: 28px;
    margin-bottom: 6px;
    color: #2c3e50;
}

.auth-card-header p {
    color: #5f6c7b;
    font-size: 14px;
    margin: 0;
}

.auth-description {
    color: #5f6c7b;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.auth-input {
    border: 1px solid #d9e3ef;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fbfcfe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    text-align: center;
}

.auth-alert {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    border-left: 4px solid transparent;
    background: #f5f7fb;
    color: #2c3e50;
}

.auth-alert.is-danger {
    border-color: #e74c3c;
    background: #fdecea;
    color: #a03528;
}

.auth-alert.is-success {
    border-color: #2ecc71;
    background: #eaf9f0;
    color: #1e8449;
}

.auth-alert.is-info {
    border-color: #3498db;
    background: #e8f3fd;
    color: #1b5b85;
}

.auth-security {
    background: #f4f6fb;
    border: 1px solid #dce4f1;
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.5;
}

.auth-security strong {
    display: block;
    margin-bottom: 6px;
    color: #1f2c3d;
}

.auth-footer {
    font-size: 13px;
    color: #607087;
    text-align: center;
}

.auth-footer strong {
    color: #2c3e50;
}

.auth-info-banner {
    background: #fff8e9;
    border: 1px solid #f0d499;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: #7a4a00;
}

.auth-link {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-callout {
    background: #f4f8ff;
    border: 1px solid #cfddf3;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 13px;
    color: #3c536f;
}

.auth-callout ul {
    margin: 10px 0 0 18px;
    color: #3c536f;
}

.auth-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 20px;
}

.auth-qr img {
    width: 100%;
    max-width: 240px;
    border: 8px solid #eef2f6;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(31, 45, 61, 0.18);
}

.backup-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.backup-code-list code {
    display: block;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #dfe8f5;
    font-weight: 600;
    color: #2c3e50;
}

@media (max-width: 900px) {
    .auth-brand,
    .auth-card {
        padding: 36px 28px;
    }
}

@media (max-width: 600px) {
    body.auth-body {
        padding: 24px 14px;
    }

    .auth-highlights {
        flex-direction: column;
        gap: 10px;
    }
}

/* Diagnostics Layout */
body.diagnostics-body {
    padding: 20px;
    background: #f0f3f8;
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #91a0bb;
    margin-bottom: 6px;
}

.subhead {
    color: #d7e1f1;
    font-size: 14px;
}

.diagnostics-container {
    padding-bottom: 30px;
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    padding: 24px 30px 30px;
}

.diagnostics-panel {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.diagnostic-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.diagnostic-filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.diagnostic-test-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 6px;
}

.diagnostic-test-item {
    display: block;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 0;
    background: #fbfcfe;
    cursor: pointer;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.diagnostic-test-item:hover {
    border-color: #c4d7f8;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.08);
}

.diagnostic-test-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 16px;
    align-items: flex-start;
}

.diagnostic-test-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 4px;
}

.diagnostic-test-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diagnostic-test-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.diagnostic-test-title {
    font-weight: 600;
    color: #1f2a37;
}

.diagnostic-test-description {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.4;
}

.diagnostic-test-meta {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.diagnostic-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #314158;
    background: #eaf0fb;
}

.diagnostic-chip + .diagnostic-chip {
    margin-left: 6px;
}

.diagnostic-chip.severity-critical {
    background: #fdecea;
    color: #a03528;
}

.diagnostic-chip.severity-important {
    background: #fff4e5;
    color: #7a3d08;
}

.diagnostic-chip.severity-info {
    background: #e8f4fd;
    color: #1b5b85;
}

.diagnostic-chip.optional {
    background: #f4f1ff;
    color: #5c3dbf;
}

.diagnostic-chip.category {
    text-transform: none;
}

.diagnostic-chip.result {
    text-transform: capitalize;
}

.diagnostic-result-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.diagnostic-result-card {
    border: 1px solid #dfe4ef;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.diagnostic-result-card.status-passed {
    border-color: #d4f3dd;
}

.diagnostic-result-card.status-warning {
    border-color: #ffe7c1;
}

.diagnostic-result-card.status-failed {
    border-color: #f8c8c8;
}

.diagnostic-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.diagnostic-result-summary {
    margin-top: 10px;
    color: #1f2a37;
    font-weight: 500;
}

.diagnostic-result-details {
    margin-top: 6px;
    color: #4b5563;
    font-size: 14px;
}

.diagnostic-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 12px;
    margin-top: 10px;
    font-size: 13px;
}

.diagnostic-metrics dt {
    font-weight: 600;
    color: #2c3e50;
}

.diagnostic-metrics dd {
    margin: 0;
    color: #4b5563;
}

.diagnostic-logs {
    margin-top: 10px;
    font-size: 13px;
}

.diagnostic-logs summary {
    cursor: pointer;
    color: #1b5b85;
}

.diagnostic-logs ul {
    margin-top: 8px;
    padding-left: 20px;
    color: #4b5563;
}

.diagnostic-result-footer {
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diagnostic-empty {
    padding: 24px;
    text-align: center;
    color: #6c7a91;
    background: #f7f9fc;
    border: 1px dashed #cbd5f0;
    border-radius: 12px;
}

.diagnostic-job-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #dfe5f2;
    border-radius: 10px;
    background: #f9fbff;
}

.diagnostic-job-meta .meta-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #7a859c;
    letter-spacing: 0.5px;
}

.diagnostic-job-meta .meta-value {
    font-weight: 600;
    color: #1f2a37;
    margin-top: 4px;
    word-break: break-all;
}

.job-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}

.btn-light {
    background: #ecf1f9;
    color: #1f2a37;
    border: 1px solid #d0d9ea;
}

.status-bar.status-error {
    background: #fdecea;
    color: #a03528;
}

.status-bar.status-success {
    background: #e7f6ef;
    color: #247147;
}

.status-bar.status-info {
    background: #e8f3fd;
    color: #1b5b85;
}

.status-bar.status-muted {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

.diagnostic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

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

@media (max-width: 600px) {
    .diagnostic-actions,
    .diagnostic-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .diagnostic-test-wrapper {
        grid-template-columns: 1fr;
    }

    .diagnostic-test-wrapper input[type="checkbox"] {
        margin-top: 0;
    }
}

.custom-sample-builder {
    margin-top: 16px;
    border: 1px solid #dbe3f1;
    border-radius: 12px;
    padding: 16px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.builder-header h3 {
    margin-bottom: 4px;
    font-size: 16px;
}

.builder-header p {
    color: #4b5563;
    font-size: 13px;
    margin: 0;
}

.sample-editor {
    width: 100%;
    font-family: 'Source Code Pro', 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #cfd7ea;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    resize: vertical;
}

.form-error {
    color: #a03528;
    font-size: 13px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    padding: 6px 10px;
    border-radius: 6px;
}

.custom-sample-options {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #4b5563;
}

.custom-sample-options label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-sample-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sample-run-status {
    margin-top: 20px;
    border: 1px solid #dfe5f2;
    border-radius: 12px;
    padding: 16px;
    background: #fdfdff;
}

.sample-run-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.sample-run-logs {
    max-height: 200px;
    overflow-y: auto;
    background: #0f172a;
    color: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Source Code Pro', 'Courier New', monospace;
    font-size: 12px;
}

.sample-log-entry {
    margin-bottom: 4px;
    line-height: 1.4;
}

.sample-log-entry.level-error {
    color: #f8b4b4;
}

.sample-grid-wrapper {
    border: 1px solid #dfe5f2;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
}

.sample-grid-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sample-grid-scroll {
    overflow-x: auto;
}

.sample-grid-table {
    width: 100%;
    border-collapse: collapse;
}

.sample-grid-table th,
.sample-grid-table td {
    border: 1px solid #e3e9f4;
    padding: 6px;
    text-align: left;
}

.sample-grid-table th {
    background: #f1f4fb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4b5563;
}

.sample-grid-table td .form-control {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
}

.sample-grid-table .empty-message {
    text-align: center;
    color: #6b7280;
    padding: 12px;
}
