/* ==========================================
   OFFICES / SECTORS PAGE
   ========================================== */
.offices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.office-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.office-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.office-card .card-header {
    border-bottom: 1px solid var(--border-color);
}

.office-icon-container {
    transition: transform 0.3s ease;
}

.office-card:hover .office-icon-container {
    transform: scale(1.08);
}

.office-stat-chip {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.office-stat-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.office-manage-btn {
    transition: all 0.25s ease !important;
}

.office-manage-btn:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.office-assign-panel {
    animation: slideDown 0.3s ease;
    border: 1px solid var(--primary);
    border-radius: var(--border-radius-xl);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .offices-grid {
        grid-template-columns: 1fr;
    }

    .office-assign-panel .card-body>div:last-child {
        grid-template-columns: 1fr !important;
    }
}


/* ==========================================
   AI MAINTENANCE PAGE - Premium
   ========================================== */
.ai-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.12) 0%,
            rgba(139, 92, 246, 0.08) 50%,
            rgba(168, 85, 247, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--border-radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.ai-status-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.ai-status-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.ai-status-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.ai-avatar {
    position: relative;
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.ai-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
}

.ai-pulse {
    position: absolute;
    inset: -6px;
    border-radius: var(--border-radius-full);
    border: 2px solid var(--primary);
    animation: aiPulse 2.5s ease-out infinite;
}

@keyframes aiPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.ai-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.ai-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ai-status-stats {
    display: flex;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.ai-stat {
    text-align: center;
}

.ai-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.ai-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* AI Maintenance Page - 3 Panel Layout */
.maintenance-grid {
    display: grid;
    grid-template-columns: 1fr 450px;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    height: calc(100vh - 280px);
    min-height: 700px;
}

.ai-results-card {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, var(--card-bg) 0%, rgba(var(--primary-rgb), 0.02) 100%);
}

.ai-results-card .card-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.ai-results-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.ai-execution-card {
    grid-column: 2;
    grid-row: 1;
    border-bottom: 2px solid var(--primary);
}

.ai-history-card {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

.ai-history-card .card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.console-style .card-body {
    background: #0d0d12;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.console-output {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 5px;
}

.console-output::-webkit-scrollbar {
    width: 6px;
}

.console-output::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.log-line {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    border-left: 3px solid transparent;
    padding: 2px 10px;
}

.log-line.info {
    color: #94a3b8;
    border-left-color: #475569;
}

.log-line.success {
    color: #4ade80;
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.log-line.warning {
    color: #fbbf24;
    border-left-color: #f59e0b;
}

.log-line.error {
    color: #f87171;
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.log-line.command {
    color: #60a5fa;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.log-line.status-marker {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    padding: 8px 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.history-item .history-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.history-item .history-summary {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 4px 0;
}

.ai-idle-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 1200px) {
    .maintenance-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }

    .ai-results-card,
    .ai-execution-card,
    .ai-history-card {
        grid-column: 1;
        grid-row: auto;
        height: 400px;
    }

    .ai-results-card {
        grid-row: auto;
    }
}

.ai-chat-container {
    height: 320px;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.ai-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-avatar {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.ai-message-content {
    flex: 1;
    background: var(--bg-secondary);
    padding: 1.125rem 1.25rem;
    border-radius: var(--border-radius);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.ai-message-content p {
    margin-bottom: 0.625rem;
    line-height: 1.6;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
}

.ai-message-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ai-message-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

.user-msg {
    flex-direction: row-reverse;
}

.user-msg .ai-message-avatar {
    background: var(--gradient-secondary);
}

.user-msg .ai-message-content {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: 4px;
}

.user-msg .ai-message-content li {
    color: rgba(255, 255, 255, 0.85);
}

.user-msg .ai-message-content li::before {
    color: rgba(255, 255, 255, 0.7);
}

.ai-chat-input {
    display: flex;
    gap: 0.875rem;
}

.ai-chat-input input {
    flex: 1;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.ai-chat-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.ai-chat-input .btn {
    padding: 1rem 1.5rem;
}

/* Maintenance Tasks - Premium */
.maintenance-task {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.875rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.maintenance-task::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--gradient-primary);
    transition: width var(--transition-fast);
}

.maintenance-task:hover {
    transform: translateX(6px);
    border-color: var(--border-hover);
}

.maintenance-task:hover::before {
    width: 3px;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.task-checkbox:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.task-checkbox.checked {
    background: var(--gradient-success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.task-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.task-title {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.task-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-priority {
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-xs);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.task-priority.high {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.1) 100%);
    color: var(--danger);
}

.task-priority.medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: var(--warning);
}

.task-priority.low {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.1) 100%);
    color: var(--success);
}

/* Heartbeat Log Enhancements */
.heartbeat-log-line {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: default;
    word-break: break-all;
}

.heartbeat-log-line:hover {
    background: rgba(99, 102, 241, 0.05) !important;
    transform: translateX(2px);
}

.heartbeat-pulse-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #ef4444;
    animation: heartbeatPulse 1.5s ease infinite;
}

@keyframes heartbeatPulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ==========================================
   REMOTE CONTROL PAGE - Premium
   ========================================== */
.remote-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    grid-template-rows: 1.5fr 1fr;
    grid-template-areas:
        "devices session"
        "heartbeat tools";
    gap: 1.25rem;
    height: calc(100vh - 180px);
    min-height: 650px;
}

@media (max-width: 1200px) {
    .remote-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "devices"
            "session"
            "tools"
            "heartbeat";
        height: auto;
        overflow: visible;
    }
}

/* .remote-sidebar-col removed */

.online-devices-card {
    grid-area: devices;
    min-height: 0;
    /* Important for scroll */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.heartbeat-console-card {
    grid-area: heartbeat;
}

.remote-session-card {
    grid-area: session;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.remote-tools-card {
    grid-area: tools;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.remote-tools-card .card-body {
    overflow-y: auto;
    flex: 1;
    padding: 1rem !important;
}

@media (max-width: 1200px) {
    .online-devices-card {
        height: 400px;
    }
}

.online-devices-card .card-body {
    overflow-y: auto;
    flex: 1;
    padding: 0.75rem;
}

/* Container for right column content */
.remote-content-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
}

.remote-session-card {
    flex: 0 0 auto;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.625rem;
    border: 1px solid transparent;
    position: relative;
}

.device-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.device-item.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.device-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.device-item.active .device-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.device-info {
    flex: 1;
    min-width: 0;
}

.device-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.device-user {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.device-item.active .device-user {
    color: rgba(255, 255, 255, 0.8);
}

.device-status {
    width: 10px;
    height: 10px;
    border-radius: var(--border-radius-full);
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: devicePulse 2s ease infinite;
}

@keyframes devicePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.remote-viewer {
    flex: 1;
    min-height: 400px;
    background: linear-gradient(135deg, #0a0a0f 0%, #12121a 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.remote-viewer:not(.active) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.remote-viewer.active {
    display: block;
}

.remote-session-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.session-controls .btn-sm {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

.session-controls .btn-sm.info:hover {
    background: var(--gradient-cyan);
    color: white;
}

.session-controls .btn-sm.warning:hover {
    background: var(--gradient-warning);
    color: white;
}

.session-controls .btn-sm.danger:hover {
    background: var(--gradient-danger);
    color: white;
}

.session-controls {
    display: flex;
    gap: 0.5rem;
}

.remote-viewer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.remote-placeholder {
    text-align: center;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.remote-placeholder i {
    font-size: 4.5rem;
    margin-bottom: 1.25rem;
    opacity: 0.25;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.remote-placeholder p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.tool-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tool-btn i {
    font-size: 1.1rem;
    color: var(--primary);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.tool-btn span {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: color var(--transition-fast);
}

.tool-btn:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 8px 25px rgba(99, 102, 241, 0.2);
}

.tool-btn:hover::before {
    opacity: 0.08;
}

.tool-btn:hover i {
    transform: scale(1.15);
}

.tool-btn.danger i {
    color: var(--danger);
}

.tool-btn.danger:hover {
    border-color: var(--danger);
    box-shadow: var(--shadow-lg), 0 8px 25px rgba(239, 68, 68, 0.2);
}

.tool-btn.danger:hover::before {
    background: var(--gradient-danger);
}

/* Heartbeat Console & Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    padding-bottom: 1rem;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.heartbeat-console {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.heartbeat-console::-webkit-scrollbar {
    width: 5px;
}

.heartbeat-console::-webkit-scrollbar-track {
    background: transparent;
}

.heartbeat-console::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}

.heartbeat-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: heartbeatPulse 1s ease infinite;
    display: inline-block;
}

@keyframes heartbeatPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

/* ==========================================
   TICKETS PAGE - Premium
   ========================================== */
.tickets-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.ticket-stat-card {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-card);
}

.ticket-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-hover);
}

.ticket-stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: all var(--transition-fast);
}

.ticket-stat-icon.open {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(34, 211, 238, 0.08) 100%);
    color: var(--info);
}

.ticket-stat-icon.progress {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.08) 100%);
    color: var(--accent);
}

.ticket-stat-icon.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.08) 100%);
    color: var(--warning);
}

.ticket-stat-icon.resolved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.08) 100%);
    color: var(--success);
}

.ticket-stat-card:hover .ticket-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.ticket-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    letter-spacing: -0.02em;
}

.ticket-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ticket-filters {
    display: flex;
    gap: 0.875rem;
}

/* Ticket Conversation & Observations */
.ticket-conversation {
    margin-top: 1.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.75rem;
}

.conversation-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.conversation-title i {
    color: var(--primary);
}

.observations-list {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    margin-bottom: 1.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.625rem;
}

.observation-item {
    background: var(--bg-tertiary);
    padding: 1.125rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    transition: all var(--transition-fast);
}

.observation-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.observation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
}

.observation-author {
    font-weight: 700;
    color: var(--primary);
}

.observation-date {
    color: var(--text-muted);
}

.observation-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ticket-response-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.ticket-response-form textarea {
    resize: none;
    min-height: 100px;
}

.empty-observations {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
}

/* ==========================================
   WHATSAPP PAGE - Premium
   ========================================== */
.whatsapp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .whatsapp-grid {
        grid-template-columns: 1fr;
    }
}

.whatsapp-connection {
    text-align: center;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2.25rem;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.08) 100%);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.75rem;
}

.connection-status .status-icon {
    position: relative;
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.35);
}

.status-pulse {
    position: absolute;
    inset: -6px;
    border-radius: var(--border-radius-full);
    border: 2px solid #25D366;
    animation: aiPulse 2.5s ease-out infinite;
}

.connection-status .status-info h4 {
    color: #25D366;
    font-size: 1.2rem;
    font-weight: 700;
}

.connection-status .status-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.connection-stats {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
}

.conn-stat {
    text-align: center;
}

.conn-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.conn-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Alert Rules - Premium */
.alert-rule {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 1.125rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.875rem;
    transition: all var(--transition-fast);
}

.alert-rule:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.rule-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.rule-icon.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.08) 100%);
    color: var(--danger);
}

.rule-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.08) 100%);
    color: var(--warning);
}

.rule-icon.info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(34, 211, 238, 0.08) 100%);
    color: var(--info);
}

.rule-content {
    flex: 1;
}

.rule-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.rule-description {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rule-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rule-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: var(--border-radius-full);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.rule-toggle.active {
    background: var(--gradient-success);
    border-color: var(--success);
}

.rule-toggle.active::after {
    left: 24px;
    background: white;
}

/* Contacts - Premium */
.contact-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    margin-bottom: 0.625rem;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.contact-phone {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Message History - Premium */
.message-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.message-item:hover {
    background: var(--bg-hover);
}

.message-item:last-child {
    border-bottom: none;
}

.message-type {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.message-type.sent {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15) 0%, rgba(18, 140, 126, 0.1) 100%);
    color: #25D366;
}

.message-type.received {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
    color: var(--info);
}

.message-content {
    flex: 1;
}

.message-text {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.message-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================
   SETTINGS PAGE - Premium
   ========================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.75rem;
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

@media (max-width: 1024px) {
    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.settings-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.settings-nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--gradient-primary);
    transition: width var(--transition-fast);
}

.settings-nav-btn i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.settings-nav-btn span {
    position: relative;
    z-index: 1;
}

.settings-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.settings-nav-btn.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.settings-nav-btn.active::before {
    width: 4px;
}

.settings-content {
    min-height: 400px;
}

.settings-form {
    max-width: 500px;
}

/* ==========================================
   REPORTS PAGE - Premium
   ========================================== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

.reports-grid .card {
    min-height: 300px;
}

.reports-grid .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.reports-grid canvas {
    max-width: 100%;
    max-height: 250px;
}

/* ==========================================
   USERS PAGE - Premium
   ========================================== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.user-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-hover);
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius);
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.user-card-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.user-card-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.user-card-dept {
    display: inline-block;
    padding: 0.35rem 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

/* ==========================================
   WHATSAPP BUTTON SPECIAL STYLE
   ========================================== */
.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    box-shadow: var(--shadow-md), 0 4px 15px rgba(37, 211, 102, 0.25) !important;
}

.whatsapp-btn:hover {
    box-shadow: var(--shadow-lg), 0 0 25px rgba(37, 211, 102, 0.35) !important;
}

/* ==========================================
   TERMINAL STYLES - Premium & Functional
   ========================================== */
.remote-viewer {
    background: #000 !important;
    border-radius: var(--border-radius-sm);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
    flex: 1;
    min-height: 200px;
    height: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid #111;
}

.remote-terminal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono) !important;
}

.terminal-header {
    background: #111;
    padding: 10px 15px;
    font-size: 0.7rem;
    color: #666;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
}

.terminal-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff5f56;
    border-radius: 50%;
    box-shadow: 15px 0 0 #ffbd2e, 30px 0 0 #27c93f;
    margin-right: 30px;
}

.terminal-output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    color: #0f0;
    /* Super Green */
    font-size: 0.85rem;
    line-height: 1.4;
    background: transparent;
}

.terminal-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
}

.terminal-footer {
    padding: 10px 15px;
    background: #080808;
    display: flex;
    align-items: center;
    border-top: 1px solid #222;
}

.terminal-prompt {
    color: #00bfff;
    /* Cyan blue */
    font-weight: bold;
    margin-right: 10px;
}

.terminal-input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-family: var(--font-mono) !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.terminal-input::placeholder {
    color: #333;
}

.text-success {
    color: #10b981 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-info {
    color: #06b6d4 !important;
}

.text-muted {
    color: #64748b !important;
}

/* ==========================================
   SKELETON LOADING - Premium
   ========================================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-full);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--border-radius-lg);
}

/* ==========================================
   EMPTY STATES - Premium
   ========================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.empty-state-icon i {
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

/* ==========================================
   ANIMATIONS - Additional
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Staggered animations */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* ==========================================
   PASSWORD MANAGER - Premium
   ========================================== */
.password-field input {
    font-family: var(--font-mono) !important;
    font-size: 1.1rem !important;
    letter-spacing: 2px;
    color: var(--primary) !important;
    transition: all 0.3s ease;
}

.password-field input[type="text"] {
    letter-spacing: 0;
    font-size: 0.9rem !important;
}

.password-field .action-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.password-field .action-btn:hover {
    opacity: 1;
    color: var(--primary);
}

.badge-dept {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--border-radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
}