/* PugWorks Software Dashboard Styles */
/* Brand Standards Version 1.0 - November 2025 */
/* Brand Promise: "Simple. Secure. Always There." */

:root {
    /* PugWorks Brand Colors */
    --primary-color: #1E6BD6;        /* Deep Trust Blue - Main logo, buttons, headers */
    --secondary-color: #5CA9F2;      /* Sky Accent - Highlights, links */
    --accent-color: #23C0B7;         /* Soft Aqua - Alerts, secondary calls to action */
    --success-color: #23C0B7;        /* Using Soft Aqua for success states */
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #F5F7FA;             /* Cloud Gray - Backgrounds, sections */
    --card-bg: #ffffff;
    --text-primary: #2E3238;         /* Midnight Slate - Text, footers */
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(30,107,214,0.12), 0 1px 2px rgba(30,107,214,0.06);
    --shadow-lg: 0 10px 15px rgba(30,107,214,0.1), 0 4px 6px rgba(30,107,214,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin-left: 80px; /* Make room for vertical sidebar */
}

/* Vertical Sidebar Brand Identifier */
.vertical-brand-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #1557a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 4px 0 12px rgba(30, 107, 214, 0.15);
}

.vertical-brand-sidebar .brand-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: 4px;
    text-transform: uppercase;
    user-select: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

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

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-trigger:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.profile-trigger:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.2;
}

.profile-role {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.profile-chevron {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.2s;
}

.profile-dropdown.active .profile-chevron {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.profile-dropdown.active .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.profile-menu-header-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 4px;
}

.profile-menu-header-company {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-menu-header-company .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.profile-menu-header-role {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 8px;
}

.profile-menu-items {
    padding: 8px 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.profile-menu-item:hover {
    background: var(--bg-color);
}

.profile-menu-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.profile-menu-item.danger {
    color: var(--danger-color);
}

.profile-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--accent-color);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
}

.btn-success:hover {
    background: #1da89f;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

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

.stat-card.clickable {
    cursor: pointer;
    user-select: none;
}

.stat-card.clickable.active {
    border: 2px solid var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.total {
    background: #dbeafe;
    color: var(--primary-color);
}

.stat-icon.active {
    background: #d1fae5;
    color: var(--success-color);
}

.stat-icon.inactive {
    background: #fed7aa;
    color: var(--warning-color);
}

.stat-icon.backups {
    background: #e9d5ff;
    color: #9333ea;
}

.stat-icon.data {
    background: #fce7f3;
    color: #ec4899;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.filter-select,
.filter-input {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-input {
    min-width: 250px;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.agents-table thead {
    background: #f1f5f9;
}

.agents-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.agents-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.agents-table th.sortable:hover {
    background: #e2e8f0;
}

.agents-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.agents-table tbody tr:hover {
    background: #f8fafc;
}

.agents-table td {
    padding: 16px;
    font-size: 14px;
}

.agents-table td.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 48px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fed7aa;
    color: #92400e;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

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

.status-indicator.active {
    background: var(--success-color);
}

.status-indicator.inactive {
    background: var(--warning-color);
}

.status-indicator.error {
    background: var(--danger-color);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.detail-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    text-align: right;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.status-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.status-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* Loading animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filter-input {
        width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .agents-table {
        min-width: 800px;
    }

    .form-actions {
        flex-direction: column;
    }
}

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

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

/* License Management */
.modal-large {
    max-width: 900px;
}

.license-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.license-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.license-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.license-stat .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.license-stat span:last-child {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.licenses-table-container {
    overflow-x: auto;
}

.licenses-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.licenses-table thead {
    background: #f1f5f9;
}

.licenses-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.licenses-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.licenses-table tbody tr:hover {
    background: #f8fafc;
}

.licenses-table td {
    padding: 12px;
    font-size: 13px;
}

.licenses-table td code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

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

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

.btn-danger:hover {
    background: #dc2626;
}

.status-badge.available {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.revoked {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.expired {
    background: #fee2e2;
    color: #991b1b;
}

/* License display in agents table */
.license-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.agents-table td.warning {
    color: #f59e0b;
    font-weight: 600;
}

.agents-table td.expired {
    color: #ef4444;
    font-weight: 600;
}

/* Company Management Styles */

/* License Tier Badges */
.license-tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.license-tier-badge.trial {
    background: #fef3c7;
    color: #92400e;
}

.license-tier-badge.basic {
    background: #dbeafe;
    color: #1e40af;
}

.license-tier-badge.professional {
    background: #d1fae5;
    color: #065f46;
}

.license-tier-badge.enterprise {
    background: #e9d5ff;
    color: #6b21a8;
}

/* Status Badge Variants */
.status-badge.suspended {
    background: #fecaca;
    color: #991b1b;
}

.status-badge.trial {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.warning {
    background: #fed7aa;
    color: #92400e;
}

/* Action Buttons */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

.actions {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
}

/* Form Sections */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.required {
    color: var(--danger-color);
    font-weight: 700;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.detail-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* Modal Show/Hide */
.modal.show {
    display: flex;
}

/* Table Error State */
.agents-table td.error {
    text-align: center;
    color: var(--danger-color);
    padding: 48px;
}

/* Responsive Adjustments for Company Management */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        justify-content: center;
    }
}

/* ========================================
   Company Settings Styles
   ======================================== */

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.settings-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.settings-tab:hover {
    color: var(--primary-color);
    background: rgba(30, 107, 214, 0.05);
}

.settings-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Tab Content */
.settings-tab-content {
    display: none;
}

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

.settings-tab-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--text-primary);
}

.settings-tab-content h4 {
    margin: 16px 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.settings-tab-content h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    cursor: pointer;
}

/* Notification Events */
.notification-event {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
}

.notification-event:last-child {
    margin-bottom: 0;
}

/* Dynamic Items (Schedules, Windows, etc) */
.schedule-item,
.maintenance-window-item,
.throttle-schedule-item {
    position: relative;
}

/* Small Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    margin-top: 8px;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Code Styling */
code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #991b1b;
}

/* Enhanced Modal for Settings */
.modal-large .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Responsive adjustments for settings */
@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .settings-tab {
        border-bottom: 1px solid #e5e7eb;
        border-left: 3px solid transparent;
    }

    .settings-tab.active {
        border-left-color: var(--primary-color);
        border-bottom-color: #e5e7eb;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        flex-direction: column;
    }
}

/* ============================================
   Agent Management Styles
   ============================================ */

.agent-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.2s ease;
}

.agent-item:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
}

.agent-item.assigned-agent {
    border-left: 4px solid var(--success-color);
}

.agent-item.available-agent {
    border-left: 4px solid #e5e7eb;
}

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

.agent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.agent-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.agent-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.agent-badge {
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.agent-id {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.agent-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.agent-status.active {
    background: #dcfce7;
    color: #166534;
}

.agent-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.agent-company {
    background: #e0e7ff;
    color: #3730a3;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.agent-unassigned {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
}

#assignedAgentsList .agent-item,
#availableAgentsList .agent-item {
    animation: fadeIn 0.3s ease;
}

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

/* Company Agent List in Details Modal */
.detail-section.full-width {
    grid-column: 1 / -1;
}

.agents-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.company-agent-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--success-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.company-agent-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Profile Page Styles */
.error-message {
    padding: 16px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-left: 4px solid var(--danger-color);
    border-radius: 8px;
    color: var(--danger-color);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "⚠";
    font-size: 20px;
}

.success-message {
    padding: 16px;
    background-color: #efe;
    border: 1px solid #cfc;
    border-left: 4px solid var(--success-color);
    border-radius: 8px;
    color: var(--success-color);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: "✓";
    font-size: 20px;
    font-weight: bold;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-description {
    margin: 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.content-wrapper {
    padding: 20px 0;
}

/* Agent Tabs */
.agent-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.agent-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.agent-tab:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.05);
}

.agent-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.agent-tab-content {
    display: none;
}

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

/* Backup Paths Management */
.backup-paths-header {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.backup-paths-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.enforced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.enforced-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.enforced-toggle .help-text {
    color: var(--text-secondary);
    cursor: help;
    font-size: 16px;
}

.backup-paths-table {
    overflow-x: auto;
    margin: 20px 0;
}

.backup-paths-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.backup-paths-table thead {
    background-color: #f8f9fa;
}

.backup-paths-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.backup-paths-table td {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.backup-paths-table code {
    background-color: #f1f3f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
}

.backup-paths-table .actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.priority-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.company-badge {
    display: inline-block;
    padding: 3px 10px;
    background-color: #1976d2;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-enabled {
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
}

.status-disabled {
    color: #ef4444;
    font-size: 18px;
    font-weight: bold;
}

/* Backup Path Form */
.backup-path-form {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

.backup-path-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.backup-path-form .form-group {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.backup-path-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.backup-path-form .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.backup-path-form .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.backup-path-form small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.backup-path-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.backup-path-form .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.backup-path-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    border-left: 4px solid var(--primary-color);
}

.toast-notification.success {
    border-left-color: #10b981;
}

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

/* Icon Tooltips with 3-second delay */
.icon-btn, .btn-icon {
    position: relative;
    cursor: pointer;
}

.icon-btn[title]:hover::after,
.btn-icon[title]:hover::after,
button[title]:hover::after,
a[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 8px;
    animation: fadeInTooltip 0.2s ease-in 3s forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.icon-btn[title]:hover::before,
.btn-icon[title]:hover::before,
button[title]:hover::before,
a[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 3px;
    animation: fadeInTooltip 0.2s ease-in 3s forwards;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 8px 0;
}

.empty-state p:first-child {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Error Message */
.error-message {
    padding: 16px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    margin: 20px 0;
}

/* ============================================
   Company Reports Tab Navigation
   ============================================ */

.tab-buttons {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: var(--primary-color);
    background-color: rgba(30, 107, 214, 0.05);
    border-radius: 8px 8px 0 0;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-button .icon {
    font-size: 16px;
}

.tab-content {
    display: none;
}

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

/* Responsive Tab Navigation */
@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-button {
        border-bottom: 1px solid var(--border-color);
        border-left: 3px solid transparent;
        margin-bottom: 0;
        border-radius: 0;
    }

    .tab-button:hover {
        border-radius: 0;
    }

    .tab-button.active {
        border-left-color: var(--primary-color);
        border-bottom-color: var(--border-color);
    }
}

/* ============================================
   Health Legend Styles
   ============================================ */

.health-legend-item {
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.health-legend-item:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom tooltip styling for health legend */
.health-legend-item[title]:hover::after {
    animation-delay: 0.5s;
}

@media (max-width: 768px) {
    #healthLegendContainer {
        grid-template-columns: 1fr !important;
    }
}
