/**
 * Admin Core v2.0 - Styles
 * Estilos modulares extraídos do inline
 */

/* ── KPI accent borders ─────────────────────────────────────────────────────── */
.kpi-green  { border-left: 4px solid #059669 !important; }
.kpi-yellow { border-left: 4px solid #f59e0b !important; }
.kpi-red    { border-left: 4px solid #ef4444 !important; }
.kpi-blue   { border-left: 4px solid #1d6abf !important; }
.kpi-indigo { border-left: 4px solid #6366f1 !important; }
.kpi-teal   { border-left: 4px solid #5EAB9B !important; }

/* ── Cotação item (usado em dashboard) ─────────────────────────────────────── */
.rate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-bg-light);
    border-radius: 10px;
}
.rate-item .rate-value {
    font-weight: 800;
    font-size: 1.4rem;
    color: #059669;
}
.rate-item .rate-label {
    color: #999;
    font-size: 0.9rem;
}

/* ── Modal Unificado (W3Modal) ─────────────────────────────────────────────── */
#w3-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
#w3-modal.open {
    display: flex;
}
#w3-modal-box {
    background: #fff;
    border-radius: 22px;
    padding: 32px 28px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
    animation: fadeInUp .2s ease;
    max-height: 90vh;
    overflow-y: auto;
}
#w3-modal-icon   { font-size: 2.5rem; text-align: center; margin-bottom: 10px; }
#w3-modal-title  { font-size: 1.4rem; font-weight: 800; color: #1e293b; margin: 0 0 10px; text-align: center; }
#w3-modal-body   { color: #555; font-size: 1rem; margin: 0 0 22px; line-height: 1.5; }
#w3-modal-btns   { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Layout & General */
.admin-view {
    animation: fadeIn 0.3s ease;
}

/* Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-box {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.kpi-box:hover {
    transform: translateY(-5px);
}

.kpi-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tables */
.admin-table-container {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.admin-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    border-bottom: 2px solid #edf2f7;
}

.admin-table tr:hover {
    background: #f8fafc !important;
}

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

.btn-primary { background: #1d6abf; color: #fff; }
.btn-primary:hover { background: #155091; }

.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }

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

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* Approval Cards */
.approval-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.approval-card.removing {
    transform: translateX(100px);
    opacity: 0;
}

/* Toasts */
#toast-container {
    pointer-events: none;
}

/* ── Nav Sub-items (Submenu de Configurações) ── */
.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.55rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    text-align: left;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    margin: 2px 0;
}

.nav-sub-item:hover {
    background: #f0f7ff;
    color: #1a56db;
}

.nav-sub-item.active {
    background: #eff6ff;
    color: #1a56db;
    font-weight: 600;
    border: 1px solid #bfdbfe;
}

.nav-sub-item .material-symbols-outlined {
    font-size: 2.2rem;
    flex-shrink: 0;
    color: #888;
}

.nav-sub-item:hover .material-symbols-outlined,
.nav-sub-item.active .material-symbols-outlined {
    color: #1a56db;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Real-time Indicator */
#sse-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    transition: background 0.3s;
}

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