/*
 * DASHBOARD MODERN LAYOUT
 * Layout específico e otimizado para a dashboard principal
 */

/* Container principal da dashboard */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header da Dashboard */
.dashboard-header {
    margin-bottom: 2.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    color: white;
    flex-wrap: wrap;
}

.header-text {
    flex: 0 0 auto;
    min-width: 200px;
    order: 1;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: white;
}

.dashboard-title svg {
    stroke: white;
}

.dashboard-subtitle {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    order: 3;
}

.header-actions .btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-actions .btn span {
    margin-left: 0.5rem;
}

/* Filtro de Empresa no Header */
.header-content .company-filter-card {
    flex: 1;
    min-width: 280px;
    max-width: 450px;
    order: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
}

.header-content .filter-header {
    background: white;
    border-bottom: none;
    padding: 12px 16px;
}

.header-content .filter-icon {
    width: 40px;
    height: 40px;
}

.header-content .filter-title {
    font-size: 14px;
    font-weight: 600;
}

.header-content .filter-subtitle {
    font-size: 11px;
    margin-top: 2px;
}

.header-content .filter-form {
    padding: 12px 16px;
}

.header-content .filter-controls {
    gap: 8px;
    flex-wrap: nowrap;
}

.header-content .select-wrapper {
    flex: 1;
    min-width: 180px;
}

.header-content .company-select {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px 14px;
    padding-right: 32px;
    font-size: 13px;
}

.header-content .btn-filter-apply {
    padding: 10px 14px;
    font-size: 12px;
    gap: 6px;
}

.header-content .btn-filter-apply svg {
    width: 16px;
    height: 16px;
}

.header-content .btn-filter-clear {
    padding: 10px 14px;
    font-size: 12px;
    gap: 6px;
}

.header-content .btn-filter-clear svg {
    width: 16px;
    height: 16px;
}

.header-content .filter-badge {
    display: none;
}

/* Stats Cards Grid */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

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

.stat-card-inner {
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
}

.stat-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.stat-icon-wrapper svg {
    position: relative;
    z-index: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Variações de cor dos stats */
.stat-primary .stat-icon-wrapper {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.stat-primary .stat-icon-wrapper svg {
    stroke: #6366f1;
}

.stat-warning .stat-icon-wrapper {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stat-warning .stat-icon-wrapper svg {
    stroke: #f59e0b;
}

.stat-success .stat-icon-wrapper {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.stat-success .stat-icon-wrapper svg {
    stroke: #10b981;
}

.stat-info .stat-icon-wrapper {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-info .stat-icon-wrapper svg {
    stroke: #3b82f6;
}

/* Charts Grid */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chart-title-group svg {
    stroke: var(--primary);
    flex-shrink: 0;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

.chart-body {
    height: 300px;
    position: relative;
}

/* Table Card */
.dashboard-table-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.table-header-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-header-text svg {
    stroke: var(--primary);
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.table-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

/* Modern Table */
.table-responsive {
    overflow-x: auto;
}

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

.modern-table thead {
    background: var(--gray-50);
}

.modern-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.modern-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modern-table tbody tr {
    transition: background 0.2s ease;
}

.table-row-hover:hover {
    background: var(--gray-50);
}

/* Client Info Cell */
.client-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.client-details {
    flex: 1;
    min-width: 0;
}

.client-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-email {
    font-size: 0.8125rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.contact-item svg {
    stroke: var(--gray-400);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

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

.status-default {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Date Info */
.date-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.time-info {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Action Button */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-action:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.btn-action svg {
    stroke: currentColor;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem !important;
    color: var(--gray-500);
}

.empty-state svg {
    opacity: 0.3;
    margin: 0 auto 1.5rem;
    stroke: var(--gray-400);
}

.empty-state p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 0.5rem 0;
}

.empty-state small {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Text Utilities */
.text-center {
    text-align: center !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 1rem;
    }

    .header-content .header-text {
        order: 1;
        flex: none;
        width: 100%;
    }

    .header-content .company-filter-card {
        order: 2;
        flex: none;
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }

    .header-content .filter-controls {
        flex-wrap: wrap;
    }

    .header-content .select-wrapper {
        min-width: 100%;
    }

    .header-content .btn-filter-apply,
    .header-content .btn-filter-clear {
        flex: 1;
    }

    .header-content .header-actions {
        order: 3;
        width: 100%;
        flex-direction: column;
    }

    .header-content .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }

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

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .table-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modern-table {
        font-size: 0.875rem;
    }

    .modern-table th,
    .modern-table td {
        padding: 0.75rem 1rem;
    }

    .client-name {
        font-size: 0.875rem;
    }

    .client-email {
        font-size: 0.75rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
