/* ==========================================================
   dashboard.css — Layout do Painel Admin (Sidebar + Content)
   ========================================================== */

/* ===== Layout Principal ===== */
.sr-app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sr-sidebar {
    width: 260px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--sr-transition-slow);
}

.sr-sidebar-brand {
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-sidebar-logo {
    height: 34px;
    width: auto;
}

.sr-sidebar-cta {
    padding: 14px 14px 0;
}

.sr-sidebar-btn-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all var(--sr-transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sr-sidebar-btn-new:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
    color: #fff;
}

.sr-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sr-sidebar-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 20px 14px 8px;
    margin: 0;
}

.sr-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--sr-transition);
    margin-bottom: 2px;
}

.sr-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.sr-sidebar-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.15));
    color: #93c5fd;
}

.sr-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sr-sidebar-plan-widget {
    margin: 0 12px 10px;
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sr-sidebar-plan-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.sr-sidebar-plan-label {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    font-weight: 700;
}
.sr-sidebar-plan-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #c4b5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sr-sidebar-plan-link {
    color: #8b5cf6;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s;
}
.sr-sidebar-plan-link:hover { color: #c4b5fd; }

.sr-sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sr-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.sr-sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sr-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sr-sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-sidebar-user-email {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-btn-logout {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all var(--sr-transition);
    font-size: 0.9rem;
}

.sr-btn-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Main Content ===== */
.sr-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sr-topbar {
    height: 64px;
    border-bottom: 1px solid var(--sr-border);
    background: var(--sr-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sr-topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sr-text);
}

.sr-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--sr-text);
    cursor: pointer;
    padding: 6px;
}

.sr-content {
    flex: 1;
    padding: 28px;
}

/* ===== Dashboard Stats Grid ===== */
.sr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.sr-stat-card {
    background: var(--sr-surface);
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all var(--sr-transition);
}

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

.sr-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sr-stat-icon.blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}

.sr-stat-icon.green {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}

.sr-stat-icon.purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.sr-stat-icon.amber {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.sr-stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--sr-text);
    margin: 0;
    line-height: 1.2;
}

.sr-stat-info p {
    font-size: 0.82rem;
    color: var(--sr-text-muted);
    margin: 2px 0 0 0;
    font-weight: 500;
}

/* ===== Recent Quotes Table ===== */
.sr-table-wrapper {
    overflow-x: auto;
    border-radius: var(--sr-radius-lg);
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sr-table th {
    text-align: left;
    padding: 13px 18px;
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sr-text-muted);
    border-bottom: 1px solid var(--sr-border);
}

.sr-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--sr-border);
    color: var(--sr-text);
}

.sr-table tr:last-child td {
    border-bottom: none;
}

.sr-table tr:hover td {
    background: #f8fafc;
}

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

.sr-table-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--sr-transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sr-primary-light);
    color: var(--sr-primary);
}

.sr-table-btn:hover {
    background: var(--sr-primary);
    color: #fff;
}

.sr-table-btn.danger {
    background: var(--sr-danger-light);
    color: var(--sr-danger);
}

.sr-table-btn.danger:hover {
    background: var(--sr-danger);
    color: #fff;
}

/* ===== Empty State ===== */
.sr-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sr-text-muted);
}

.sr-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.sr-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sr-text-secondary);
    margin-bottom: 6px;
}

.sr-empty-state p {
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .sr-sidebar {
        transform: translateX(-100%);
    }

    .sr-sidebar.open {
        transform: translateX(0);
    }

    .sr-main {
        margin-left: 0;
    }

    .sr-btn-mobile-menu {
        display: block;
    }

    /* Overlay when sidebar is open on mobile */
    .sr-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        display: none;
    }

    .sr-sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .sr-content {
        padding: 16px;
    }

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

/* ===== Historico Button ===== */
.sr-btn-view-historico {
    background: var(--sr-surface);
    border: 1px solid var(--sr-border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--sr-text-secondary);
    font-size: 0.85rem;
    transition: all var(--sr-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sr-btn-view-historico i {
    color: var(--sr-primary);
}

.sr-btn-view-historico:hover {
    border-color: var(--sr-primary-light);
    background: var(--sr-primary-light);
    color: var(--sr-primary-hover);
    transform: translateY(-1px);
}

.text-primary { color: var(--sr-primary) !important; }
.text-success { color: var(--sr-success) !important; }
.text-info { color: var(--sr-info) !important; }

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}
.pulse-anim {
    animation: pulse 2s infinite;
}

/* ===== Dashboard Quote Cards ===== */
.sr-qcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding: 20px;
}

.sr-qcard {
    background: var(--sr-bg);
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all var(--sr-transition);
}

.sr-qcard:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.sr-qcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sr-qcard-online {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.sr-qcard-body {
    flex: 1;
}

.sr-qcard-client {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sr-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-qcard-dest {
    font-size: 0.82rem;
    color: var(--sr-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-qcard-dest i {
    color: var(--sr-primary);
    margin-right: 4px;
    font-size: 0.75rem;
}

.sr-qcard-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--sr-border);
}

.sr-qcard-meta {
    font-size: 0.78rem;
    color: var(--sr-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sr-qcard-btn {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sr-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: gap var(--sr-transition);
}

.sr-qcard-btn:hover {
    gap: 7px;
}

@media (max-width: 576px) {
    .sr-qcard-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

/* Interações Premium Timeline */
.sr-timeline {
    position: relative;
    padding-left: 20px;
}

.sr-timeline::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: linear-gradient(to bottom, var(--sr-primary-light), transparent);
    border-radius: 2px;
}

.sr-timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.sr-timeline-item:last-child {
    margin-bottom: 0;
}

.sr-timeline-icon {
    position: absolute;
    left: -26px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sr-surface);
    border: 2px solid var(--sr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    z-index: 2;
    color: var(--sr-text-muted);
    box-shadow: 0 0 0 4px #f8fafc;
}

.sr-timeline-item.intent-high .sr-timeline-icon {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fffbeb;
}

.sr-timeline-item.intent-success .sr-timeline-icon {
    border-color: #10b981;
    color: #10b981;
    background: #d1fae5;
}

.sr-timeline-content {
    background: var(--sr-surface);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--sr-border);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: all var(--sr-transition);
}

.sr-timeline-item.intent-high .sr-timeline-content {
    border-color: #fde68a;
    background: #fffbeb;
}

.sr-timeline-item.intent-success .sr-timeline-content {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.sr-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px;
}

.sr-timeline-header strong {
    font-size: 0.95rem;
    color: var(--sr-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sr-timeline-header span {
    font-size: 0.75rem;
    color: var(--sr-text-muted);
    font-weight: 500;
}

.sr-timeline-content p {
     margin: 0;
     font-size: 0.85rem;
     color: var(--sr-text-secondary);
     line-height: 1.5;
}

/* Mini logs para eventos de sessão */
.sr-session-logs {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--sr-border);
    font-size: 0.8rem;
    color: var(--sr-text-muted);
}

.sr-session-logs.intent-high {
    border-top-color: #fde68a;
    color: #b45309;
}

.sr-session-logs div {
    margin-bottom: 4px;
}
.sr-session-logs i { margin-right: 6px; opacity: 0.7; }
