/**
 * FireSys — Componentes visuais (cards, tabelas, dashboard)
 */

/* ----- Cards ----- */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: var(--card-background);
    transition: box-shadow var(--transition-base);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: var(--card-padding-compact) var(--card-padding);
    font-weight: 600;
}

.card-body {
    padding: var(--card-padding);
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
}

/* KPI / stat cards */
.stat-card,
.dashboard-kpi-card {
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: var(--card-background);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover,
.dashboard-kpi-card:hover {
    box-shadow: var(--card-shadow-hover);
}

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

.stat-icon.bg-accent,
.stat-icon.bg-danger {
    background: var(--accent-red-subtle) !important;
    color: var(--accent-red) !important;
}

.stat-icon.bg-primary {
    background: var(--primary-subtle) !important;
    color: var(--brand-primary) !important;
}

.stat-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #059669;
}

.stat-change.negative {
    color: var(--accent-red);
}

/* Chart cards */
.chart-card {
    min-height: 320px;
    border-radius: var(--card-radius);
}

.chart-card .card-header {
    font-size: 0.9375rem;
}

.chart-card canvas {
    max-height: 260px;
}

/* ----- Tabelas ----- */

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    background: var(--table-header-bg);
    color: var(--table-header-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--table-border-color);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--table-row-hover);
}

.table-hover > tbody > tr:hover > * {
    background: var(--table-row-hover);
}

.text-critical {
    color: var(--accent-red) !important;
    font-weight: 600;
}

/* ----- Formulários ----- */

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--border-color);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
}

/* Botão primário — vermelho acento para ações principais */
.btn-accent,
.btn-primary.btn-accent-action {
    background: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
}

.btn-accent:hover,
.btn-primary.btn-accent-action:hover {
    background: var(--accent-red-hover) !important;
    border-color: var(--accent-red-hover) !important;
}

.btn-outline-accent {
    color: var(--accent-red);
    border-color: var(--accent-red);
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-accent:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

/* ----- Dashboard ----- */

.dashboard-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.dashboard-date-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-background);
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}

.section-heading {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.vencimento-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}

.vencimento-item:last-child {
    border-bottom: none;
}

.vencimento-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vencimento-dot.critical { background: var(--accent-red); }
.vencimento-dot.warning { background: #F59E0B; }
.vencimento-dot.info { background: var(--brand-primary); }
.vencimento-dot.ok { background: #10B981; }

/* Quick actions */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.quick-action-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--card-shadow-hover);
    color: var(--brand-primary);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

/* Notification dropdown */
.notification-dropdown {
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow-hover);
}

.notification-unread {
    background: var(--accent-red-subtle);
}

/* Page header inside content */
.page-header h1,
.page-header .h1 {
    font-size: 1.375rem;
    font-weight: 700;
}

/* Badge accent */
.badge.bg-accent,
.notification-badge {
    background: var(--accent-red) !important;
}
