/* ============================================================
   SIGSPA-SINDPESCA — COMPONENTS
   Botões, badges, cards, modais e estados (Mobile First).
   ============================================================ */

/* ---------- Botões (padrão de componentes) ---------- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 18px;
    line-height: 1.4;
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:focus,
.btn.focus {
    box-shadow: var(--shadow-focus);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 12px;
}

.btn-primary {
    background: var(--brand-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #5457ec, #7c4dff);
    border: none;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.38);
}

.btn-success {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-outline-secondary {
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-400);
}

/* Botões em cadeia de ações (evita dupla linha em telas pequenas) */
.btn-group-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-group-responsive .btn {
    white-space: nowrap;
}

/* ---------- Badges ---------- */
.badge {
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: 0.35em 0.65em;
    font-size: 11px;
}

.badge-pill {
    padding: 0.4em 0.75em;
}

/* ---------- Cards genéricos ---------- */
.card {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.card-header {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--surface-border);
    border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0 !important;
    font-weight: 700;
}

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

/* ---------- Modais ---------- */
.modal-content {
    border: none;
    border-radius: var(--modal-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--surface-border);
    padding: 16px 20px;
    border-radius: var(--modal-radius) var(--modal-radius) 0 0;
    align-items: center;
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-footer {
    border-top: 1px solid var(--surface-border);
    padding: 14px 20px;
    border-radius: 0 0 var(--modal-radius) var(--modal-radius);
}

/* Modais fullscreen: header/footer fixos, rolagem interna */
.modal-fullscreen-custom .modal-header {
    flex-shrink: 0;
    border-radius: 0;
}

.modal-fullscreen-custom .modal-footer {
    flex-shrink: 0;
    border-radius: 0;
}

.modal-fullscreen-custom .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Dropdown padrão ---------- */
.dropdown-menu {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.dropdown-menu .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13.5px;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background: var(--gray-100);
}

.dropdown-menu .dropdown-divider {
    border-color: var(--surface-border);
    margin: 6px 4px;
}

/* ---------- Alertas ---------- */
.alert {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.alert-success {
    background: #eff6ff;
    color: #1d4ed8;
}

.alert-warning {
    background: #fffbeb;
    color: #b45309;
}

.alert-info {
    background: #ecfeff;
    color: #0e7490;
}

/* ---------- Status pill ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.success { background: #dbeafe; color: #1d4ed8; }
.status-pill.danger { background: #fee2e2; color: #b91c1c; }
.status-pill.warning { background: #fef3c7; color: #b45309; }
.status-pill.info { background: #e0f2fe; color: #0369a1; }
.status-pill.neutral { background: #f3f4f6; color: #4b5563; }

/* ---------- Avatar ---------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* ---------- Dark mode ---------- */
[data-theme="dark"] .modal-content {
    background: var(--surface-alt);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--surface-border);
}

[data-theme="dark"] .card {
    background: var(--surface-alt);
    border-color: var(--surface-border);
}

[data-theme="dark"] .card-header {
    background: var(--gray-100);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--surface-alt);
    border-color: var(--surface-border);
}

[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: var(--gray-600);
}

[data-theme="dark"] .dropdown-menu .dropdown-item:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

[data-theme="dark"] .alert-danger { background: #3b1a1a; color: #fca5a5; }
[data-theme="dark"] .alert-success { background: #172554; color: #93c5fd; }
[data-theme="dark"] .alert-warning { background: #362b14; color: #fcd34d; }
[data-theme="dark"] .alert-info { background: #12303b; color: #67e8f9; }

[data-theme="dark"] .status-pill.success { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
[data-theme="dark"] .status-pill.danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
[data-theme="dark"] .status-pill.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .status-pill.info { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
[data-theme="dark"] .status-pill.neutral { background: var(--gray-200); color: var(--gray-500); }
