/* ─── Variáveis ─────────────────────────────────────────────────── */
:root {
    --primary:       #0284c7;
    --primary-dark:  #0369a1;
    --primary-light: #e0f2fe;
    --sidebar:       #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-width: 240px;
    --bg:            #f1f5f9;
    --card-shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* ─── Base ──────────────────────────────────────────────────────── */
body {
    background-color: var(--bg);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.925rem;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width 0.25s;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #1e293b;
    text-decoration: none;
    display: block;
}

.sidebar-brand .brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: 0.88rem;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--sidebar-hover);
    color: #f1f5f9;
}

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

.sidebar-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #475569;
    padding: 0.65rem 1.25rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 1rem;
    border-top: 1px solid #1e293b;
}

.sidebar-footer .user-name {
    font-size: 0.85rem;
    color: #f1f5f9;
    font-weight: 500;
}

.sidebar-footer .user-nivel {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: capitalize;
}

.sidebar-footer .btn-logout {
    color: #64748b;
    font-size: 1.1rem;
    transition: color 0.18s;
}

.sidebar-footer .btn-logout:hover {
    color: #f87171;
}

/* ─── Conteúdo principal ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    min-height: 100vh;
}

/* ─── Página header ─────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.page-title-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.1rem;
}

/* ─── Stat cards (dashboard) ────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.stat-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon-yellow { background: #fef9c3; color: #a16207; }
.stat-icon-green  { background: #dcfce7; color: #16a34a; }
.stat-icon-red    { background: #fee2e2; color: #dc2626; }

/* ─── Cards genéricos ───────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.card-header-custom {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0 !important;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

/* ─── Tabelas ───────────────────────────────────────────────────── */
.table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

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

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

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

/* ─── Badges de status ──────────────────────────────────────────── */
.badge-status {
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ─── Formulários ───────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.3rem;
}

.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Radio group para tipo relatório */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio-group .form-check {
    margin: 0;
    padding: 0;
}

.radio-group .form-check-input { display: none; }

.radio-group .form-check-label {
    cursor: pointer;
    padding: 0.35rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #374151;
    background: #fff;
    transition: all 0.15s;
    user-select: none;
}

.radio-group .form-check-input:checked + .form-check-label {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}

.radio-group .form-check-label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.radio-group .form-check-input:checked + .form-check-label:hover {
    color: #fff;
}

/* ─── Detalhe do relatório ──────────────────────────────────────── */
.detail-row {
    display: flex;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
    gap: 1rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    width: 160px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.detail-value {
    color: #0f172a;
    font-size: 0.9rem;
    flex: 1;
}

.detail-value.empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.82rem;
}

.copy-btn {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.85rem;
    transition: color 0.15s;
    flex-shrink: 0;
}

.copy-btn:hover { color: var(--primary); }

/* ─── Flash messages ────────────────────────────────────────────── */
.flash-overlay {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    max-width: 380px;
    pointer-events: none;
}

.flash-message {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.3s;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    pointer-events: none;
}

.flash-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.flash-hide {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

/* ─── Contatos — cores de linha ─────────────────────────────────── */
tr.row-finalizado td { background-color: rgba(25, 135, 84, 0.12); }
tr.row-atencao    td { background-color: rgba(255, 193, 7,  0.18); }

/* ─── Login page ────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #0284c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.login-subtitle {
    font-size: 0.82rem;
    color: #64748b;
}

/* ─── Botões ────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm { font-size: 0.8rem; }

/* ─── Utilitários ───────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ─── Responsivo ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar       { width: 100%; min-height: auto; position: relative; }
    .main-content  { margin-left: 0; padding: 1rem; }
}
