/* ============================================================
   PULSE NR-01 — Design System Global
   Fontes: Sora (headings) + DM Sans (body)
   Tema: Clean Modern com tons de azul profundo + coral
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    /* Primary palette */
    --primary: #1B4965;
    --primary-light: #2D6A8F;
    --primary-dark: #0F2D40;
    --primary-50: rgba(27,73,101,0.05);
    --primary-100: rgba(27,73,101,0.1);
    --primary-200: rgba(27,73,101,0.2);

    /* Accent */
    --accent: #FF6B4A;
    --accent-light: #FF8A70;
    --accent-dark: #E5522F;

    /* Semantic */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Semaforo */
    --semaforo-verde: #10B981;
    --semaforo-amarelo: #F59E0B;
    --semaforo-vermelho: #EF4444;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Typography */
    --font-heading: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-glow: 0 0 30px rgba(27,73,101,0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Layout */
    --max-width: 1200px;
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}
.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255,107,74,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}
.btn-white:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}

.btn-success { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-warning { background: var(--warning); color: var(--white); border-color: var(--warning); }
.btn-danger  { background: var(--danger);  color: var(--white); border-color: var(--danger); }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.9rem 2.2rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.3rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.3rem;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748B' d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger  { background: var(--danger-light);  color: #991B1B; }
.badge-info    { background: var(--info-light);    color: #1E40AF; }
.badge-neutral { background: var(--gray-100);      color: var(--gray-600); }

/* ── Tables ── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}

table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ── Alerts / Flash ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success { background: var(--success-light); border-color: var(--success); color: #065F46; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #92400E; }
.alert-error   { background: var(--danger-light);  border-color: var(--danger);  color: #991B1B; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #1E40AF; }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 0.85rem; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden { display: none !important; }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-up {
    animation: slideUp 0.6s ease forwards;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
