/* app.css - Plataforma Web Dashboard */

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    min-height: 100vh;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    text-align: center;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #334155;
    color: #fff;
}

.sidebar .user-info {
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid #334155;
    font-size: 0.85rem;
}

/* Main content */
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Shared action buttons (used by SkyDataTable, SecaoGrafico, SkyEmailButton) */
.plat-table-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.plat-table-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.plat-table-btn-export,
.plat-table-btn-email {
    padding: 6px 10px;
    font-size: 1rem;
    color: #fff;
    border: none;
    font-weight: 500;
}
.plat-table-btn-export i,
.plat-table-btn-email i {
    font-size: 1.1rem;
}
.plat-table-btn-export {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}
.plat-table-btn-export:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.plat-table-btn-email {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.plat-table-btn-email:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.top-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-body {
    flex: 1;
    padding: 12px 20px;
    background: #f1f5f9;
    overflow-y: auto;
}

/* Cards KPI */
.card {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Modern chart cards (shared across dashboards) */
.plat-chart-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.15s;
}
.plat-chart-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.plat-chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}
.plat-chart-header .plat-chart-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
}
.plat-chart-body {
    padding: 16px;
}

/* Dashboard KPI row */
.plat-kpi-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}
.plat-kpi-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.15s;
}
.plat-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.plat-kpi-card .plat-kpi-label,
.plat-kpi-card .kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
    margin-bottom: 4px;
}
.plat-kpi-card .plat-kpi-sub,
.plat-kpi-card .kpi-sublabel {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 2px;
}
.plat-kpi-card .plat-kpi-value,
.plat-kpi-card .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Compact KPI row (horizontal icon + value) */
.plat-kpi {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 6px 10px;
    transition: all .15s;
    border-left: 3px solid #cbd5e1;
}
.plat-kpi:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
    transform: translateY(-1px);
}
.plat-kpi-icon {
    font-size: 0.95rem;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #64748b;
}
.plat-kpi-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.plat-kpi .plat-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
}
.plat-kpi .plat-kpi-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #94a3b8;
}
.plat-kpi-success { border-left-color: #22c55e; }
.plat-kpi-success .plat-kpi-icon { background: #f0fdf4; color: #16a34a; }
.plat-kpi-success .plat-kpi-value { color: #16a34a; }
.plat-kpi-danger { border-left-color: #ef4444; }
.plat-kpi-danger .plat-kpi-icon { background: #fef2f2; color: #dc2626; }
.plat-kpi-danger .plat-kpi-value { color: #dc2626; }
.plat-kpi-neutral { border-left-color: #64748b; }
.plat-kpi-neutral .plat-kpi-icon { background: #f1f5f9; color: #475569; }

/* KPI group (card with title + inline items) */
.plat-kpi-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    height: 100%;
}
.plat-kpi-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    display: block;
    margin-bottom: 4px;
}
.plat-kpi-group-items {
    display: flex;
    gap: 6px;
}
.plat-kpi-group-items .plat-kpi {
    flex: 1;
    min-width: 0;
}

/* Row highlight for pending items */
.plat-row-pendente {
    background-color: #fee2e2 !important;
    border-left: 3px solid #dc2626;
    color: #991b1b;
}
.plat-row-pendente:hover {
    background-color: #fecaca !important;
}

/* Status toggle buttons (inline in grid header) */
.plat-status-toggle {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-left: 8px;
}
.plat-status-btn {
    border: none;
    background: #fff;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.plat-status-btn:not(:last-child) {
    border-right: 1px solid #e2e8f0;
}
.plat-status-btn:hover {
    background: #f1f5f9;
}
.plat-status-btn.active {
    background: #3b82f6;
    color: #fff;
}
.plat-status-btn-pendente {
    color: #dc2626;
}
.plat-status-btn-pendente.active {
    background: #dc2626;
    color: #fff;
}
.plat-status-btn-finalizado {
    color: #16a34a;
}
.plat-status-btn-finalizado.active {
    background: #16a34a;
    color: #fff;
}

/* Toggle button group */
.plat-toggle-group {
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.plat-toggle-group button,
.plat-toggle-group .plat-toggle-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: #fff;
    color: #64748b;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.plat-toggle-group button:hover,
.plat-toggle-group .plat-toggle-btn:hover {
    background: #f1f5f9;
}
.plat-toggle-group button.active,
.plat-toggle-group .plat-toggle-btn.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
}

/* Tables */
.table-sm th, .table-sm td {
    padding: 6px 8px;
    font-size: 0.85rem;
}

/* Form cards */
.plat-form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    border: none;
    border-top: 2px solid #94a3b8;
    border-right: 2px solid #94a3b8;
    margin-bottom: 16px;
    overflow: hidden;
}
.plat-form-card .plat-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}
.plat-form-card .plat-form-header i {
    color: #3b82f6;
    margin-right: 8px;
}
.plat-form-card .plat-form-body {
    padding: 20px;
}
.plat-form-card .plat-form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.plat-form-card .plat-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.plat-form-card .plat-form-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.plat-form-card .plat-form-section-title i {
    color: #94a3b8;
    font-size: 0.75rem;
}
.plat-form-card .plat-form-actions {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}
/* PlatDataTable layout */
.plat-table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    border: none;
    margin-bottom: 16px;
    overflow: hidden;
}
.plat-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    gap: 12px;
}
.plat-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.plat-table-icon {
    color: #3b82f6;
    font-size: 1rem;
}
.plat-table-title-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}
.plat-table-badge {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.plat-table-center {
    flex: 1;
    display: flex;
    justify-content: center;
}
.plat-table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.plat-table-body {
    overflow-x: auto;
}
.plat-table-loading,
.plat-table-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: #94a3b8;
    font-size: 0.85rem;
}
.plat-table-empty i {
    font-size: 1.2rem;
}
.plat-table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
}

.plat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.plat-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
}
.plat-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.plat-table tbody tr:hover {
    background: #f8fafc;
}

/* ===== CHECKLIST / FORMULÁRIO APLICAÇÃO ===== */

/* Info bar (formulário + atividade) */
.checklist-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: #1e40af;
}
.checklist-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.checklist-info-item i {
    opacity: 0.7;
}

/* Readonly values */
.checklist-readonly-value {
    font-size: 0.85rem;
    color: #475569;
    padding: 5px 0;
    font-weight: 500;
}

/* Collapsible sections */
.checklist-collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.15s;
}
.checklist-collapsible-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.checklist-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
    color: #94a3b8;
}
.checklist-collapsible-toggle[aria-expanded="true"] .checklist-chevron {
    transform: rotate(180deg);
}

/* Progress bar - sticky */
.checklist-progress-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    padding: 12px 0 8px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}
.checklist-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.checklist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.checklist-progress-fill.complete {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}
.checklist-progress-badge {
    font-size: 0.72rem;
    padding: 3px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

/* Question cards */
.checklist-question {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.checklist-question:hover {
    border-color: #cbd5e1;
}
.checklist-question-answered {
    background: #f0fdf4;
    border-color: #86efac;
}
.checklist-question-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.checklist-question-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.checklist-question-number.answered {
    background: #22c55e;
    color: #fff;
}
.checklist-question-text {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    line-height: 1.4;
    padding-top: 3px;
}
.checklist-mandatory {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Answer options */
.checklist-answers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 38px;
}
.checklist-answer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.84rem;
    color: #334155;
}
.checklist-answer-option:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}
.checklist-answer-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.checklist-answer-option input[type="radio"] {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.checklist-answer-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    flex-shrink: 0;
}
.checklist-answer-option.selected .checklist-answer-letter {
    background: #2563eb;
    color: #fff;
}
.checklist-answer-text {
    flex: 1;
}

/* Anotação dentro da pergunta */
.checklist-anotacao {
    margin-top: 10px;
    padding-left: 38px;
}

/* Question actions container */
.checklist-question-actions {
    margin-top: 12px;
    padding-left: 38px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.checklist-question-actions .checklist-anotacao {
    padding-left: 0;
    margin-top: 0;
}

/* Anexo per question */
.checklist-anexo-section {
    display: flex;
    flex-direction: column;
}
.checklist-anexo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}
.checklist-anexo-toggle:hover {
    color: #2563eb;
}
.checklist-anexo-toggle.has-files {
    color: #d97706;
}
.checklist-anexo-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #d97706;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 4px;
}
.checklist-anexo-panel {
    margin-top: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.checklist-anexo-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.checklist-anexo-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #334155;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b, #334155);
}

.login-card {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.login-card h3 {
    text-align: center;
    margin-bottom: 24px;
    color: #1e293b;
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .brand span,
    .sidebar .nav-link span,
    .sidebar .user-info span {
        display: none;
    }
    .page-body {
        padding: 12px;
    }
}
