/**
 * NextDesk - Layout Painel CSS
 * Estilos para o painel de supervisores/atendentes
 */

/* ============================================
   VARIÁVEIS DO LAYOUT
   ============================================ */
:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #0891b2;
    --primary-dark: #0e7490;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
}

.sidebar-logo .empresa-logo-img {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
    margin: 0 auto;
}

.sidebar-logo h4 {
    color: #fff;
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

.sidebar-logo .empresa-nome {
    font-size: 0.75rem;
    color: var(--sidebar-text);
    margin-top: 0.125rem;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu-title {
    padding: 0.75rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 0.125rem 0.75rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.sidebar-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.sidebar-nav-link i {
    font-size: 1.125rem;
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.main-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.main-header .header-search {
    flex: 1;
    max-width: 400px;
}

.main-header .header-search input {
    border-radius: 2rem;
    padding-left: 2.5rem;
    background: #f1f5f9;
    border: none;
}

.main-header .header-search input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.main-header .header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.main-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.main-header .header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.main-header .header-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.main-header .header-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
}

.main-header .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.main-header .user-info {
    text-align: right;
    line-height: 1.2;
}

.main-header .user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
}

.main-header .user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    padding: 1.5rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
}

.card-title {
    margin: 0;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-icon.primary { background: rgba(8,145,178,0.1); color: #0891b2; }
.stat-card .stat-icon.success { background: rgba(16,185,129,0.1); color: #10b981; }
.stat-card .stat-icon.warning { background: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-card .stat-icon.danger { background: rgba(239,68,68,0.1); color: #ef4444; }
.stat-card .stat-icon.info { background: rgba(99,102,241,0.1); color: #6366f1; }

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card .stat-change.up { color: #10b981; }
.stat-card .stat-change.down { color: #ef4444; }

/* ============================================
   TABLES
   ============================================ */
.table {
    margin: 0;
}

.table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

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

/* ============================================
   TICKETS
   ============================================ */
.ticket-id {
    font-weight: 600;
    color: var(--primary-color);
}

.ticket-priority {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    display: inline-block;
}

.ticket-priority.urgente { background: #ef4444; }
.ticket-priority.alta { background: #f59e0b; }
.ticket-priority.media { background: #0891b2; }
.ticket-priority.baixa { background: #10b981; }

.ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ticket-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.ticket-status.aberto { background: #dbeafe; color: #1d4ed8; }
.ticket-status.aberto::before { background: #1d4ed8; }
.ticket-status.em_andamento { background: #fef3c7; color: #b45309; }
.ticket-status.em_andamento::before { background: #b45309; }
.ticket-status.aguardando { background: #f3e8ff; color: #7c3aed; }
.ticket-status.aguardando::before { background: #7c3aed; }
.ticket-status.resolvido { background: #d1fae5; color: #047857; }
.ticket-status.resolvido::before { background: #047857; }
.ticket-status.fechado { background: #e2e8f0; color: #475569; }
.ticket-status.fechado::before { background: #475569; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-soft-primary {
    background: rgba(8,145,178,0.1);
    color: var(--primary-color);
    border: none;
}

.btn-soft-primary:hover {
    background: rgba(8,145,178,0.2);
    color: var(--primary-dark);
}

/* ============================================
   BADGES
   ============================================ */
.badge-success { background: rgba(16,185,129,0.1); color: #10b981; }
.badge-danger { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-warning { background: rgba(245,158,11,0.1); color: #f59e0b; }
.badge-info { background: rgba(99,102,241,0.1); color: #6366f1; }
.badge-primary { background: rgba(8,145,178,0.1); color: #0891b2; }

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.page-description {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

/* ============================================
   AVATAR GROUP
   ============================================ */
.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-group .avatar.more {
    background: #e2e8f0;
    color: #64748b;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
}

/* ============================================
   ONLINE STATUS
   ============================================ */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online { background: #10b981; }
.status-indicator.away { background: #f59e0b; }
.status-indicator.offline { background: #94a3b8; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-header .user-info {
        display: none;
    }
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notification-dropdown {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.notification-item {
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background-color: #f8fafc;
}

.notification-item:last-child {
    border-bottom: none !important;
}
