/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;

    --background: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --text-soft: #334155;
    --muted: #64748b;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --success: #16a34a;
    --success-light: #f0fdf4;

    --danger: #dc2626;
    --danger-light: #fef2f2;

    --warning: #d97706;
    --warning-light: #fffbeb;

    --info: #0891b2;
    --info-light: #ecfeff;

    --purple: #7c3aed;
    --purple-light: #f5f3ff;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.05);

    --shadow:
        0 8px 24px rgba(15, 23, 42, 0.06);

    --shadow-lg:
        0 16px 40px rgba(15, 23, 42, 0.08);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --transition: 0.2s ease;
}

/* =========================================================
   BODY
========================================================= */

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        Helvetica,
        sans-serif;

    background:
        linear-gradient(
            180deg,
            #f8fafc 0%,
            #f3f6fb 100%
        );

    color: var(--text);

    min-height: 100vh;

    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* =========================================================
   LINKS
========================================================= */

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* =========================================================
   FORM ELEMENTS
========================================================= */

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

input,
select,
textarea {
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

/* =========================================================
   CONTAINER
========================================================= */

.container {
    width: min(
        1250px,
        calc(100% - 32px)
    );

    margin: 0 auto;
}

/* =========================================================
   CARDS
========================================================= */

.card {
    background: var(--surface);

    border: 1px solid rgba(
        226,
        232,
        240,
        0.9
    );

    border-radius: var(--radius-lg);

    padding: 22px;

    box-shadow: var(--shadow-sm);

    transition:
        box-shadow var(--transition),
        transform var(--transition),
        border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: #dbe3ee;
}

/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid transparent;

    border-radius: var(--radius-sm);

    padding: 10px 16px;

    min-height: 42px;

    font-size: 14px;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.08);
}

.btn:active {
    transform: translateY(0);
}

/* PRIMARY */

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* SUCCESS */

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
}

/* DANGER */

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* WARNING */

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #b45309;
}

/* SECONDARY */

.btn-secondary {
    background: #475569;
    color: #fff;
}

.btn-secondary:hover {
    background: #334155;
}

/* LIGHT */

.btn-light {
    background: #f8fafc;
    color: var(--text-soft);

    border-color: var(--border);
}

.btn-light:hover {
    background: #f1f5f9;
}

/* OUTLINE */

.btn-outline {
    background: transparent;
    color: var(--primary);

    border-color: #bfdbfe;
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: #93c5fd;
}

/* =========================================================
   FORMULÁRIOS
========================================================= */

label {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border:
        1px solid var(--border-dark);

    border-radius: var(--radius-sm);

    background: #fff;

    padding: 11px 13px;

    min-height: 44px;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
    border-color: #94a3b8;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: #60a5fa;

    box-shadow:
        0 0 0 4px
        rgba(37, 99, 235, 0.10);

    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

/* =========================================================
   TEXTOS
========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);

    line-height: 1.25;

    letter-spacing: -0.02em;
}

h1 {
    font-size: 30px;
    font-weight: 800;
}

h2 {
    font-size: 23px;
    font-weight: 800;
}

h3 {
    font-size: 18px;
    font-weight: 750;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-muted {
    color: var(--muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* =========================================================
   BADGES / STATUS
========================================================= */

.badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 28px;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: #15803d;
}

.badge-danger {
    background: var(--danger-light);
    color: #b91c1c;
}

.badge-warning {
    background: var(--warning-light);
    color: #a16207;
}

.badge-primary {
    background: var(--primary-light);
    color: #1d4ed8;
}

.badge-info {
    background: var(--info-light);
    color: #0e7490;
}

.badge-purple {
    background: var(--purple-light);
    color: #6d28d9;
}

/* =========================================================
   TABELAS
========================================================= */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;

    background: #fff;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;
}

thead th {
    background: #f8fafc;

    color: #475569;

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    padding: 13px 14px;

    border-bottom:
        1px solid var(--border);
}

tbody td {
    padding: 14px;

    border-bottom:
        1px solid #edf2f7;

    color: var(--text-soft);

    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr {
    transition:
        background var(--transition);
}

tbody tr:hover {
    background: #f8fbff;
}

/* =========================================================
   MENSAGENS
========================================================= */

.alert {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    border-radius: var(--radius);

    padding: 14px 16px;

    margin-bottom: 20px;

    font-size: 14px;

    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #155e75;
    border-color: #a5f3fc;
}

/* =========================================================
   RESUMOS / MÉTRICAS
========================================================= */

.summary-grid,
.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(210px, 1fr)
        );

    gap: 16px;
}

.summary-card,
.stat-card {
    background: #fff;

    border:
        1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 20px;

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.summary-card:hover,
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-card .summary-label,
.stat-card .stat-label {
    color: var(--muted);

    font-size: 12px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    margin-bottom: 8px;
}

.summary-card .summary-value,
.stat-card .stat-value {
    color: var(--text);

    font-size: 25px;

    font-weight: 800;

    letter-spacing: -0.02em;
}

.summary-card .summary-sub,
.stat-card .stat-sub {
    color: var(--muted);

    font-size: 12px;

    margin-top: 6px;
}

/* =========================================================
   DASHBOARD BLOCO DE DESTAQUE
========================================================= */

.dashboard-hero {
    background:
        linear-gradient(
            135deg,
            #1d4ed8,
            #2563eb
        );

    color: #fff;

    border-radius: var(--radius-lg);

    padding: 28px;

    box-shadow:
        0 12px 30px
        rgba(37, 99, 235, 0.20);

    margin-bottom: 22px;
}

.dashboard-hero h1,
.dashboard-hero h2,
.dashboard-hero h3,
.dashboard-hero p {
    color: #fff;
}

.dashboard-hero p {
    opacity: 0.85;
}

/* =========================================================
   SEÇÕES
========================================================= */

.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;

    flex-wrap: wrap;
}

.section-title {
    margin: 0;
}

.section-subtitle {
    color: var(--muted);

    font-size: 13px;

    margin-top: 4px;
}

/* =========================================================
   PROGRESSO
========================================================= */

.progress {
    width: 100%;

    height: 9px;

    background: #e2e8f0;

    border-radius: 999px;

    overflow: hidden;
}

.progress-bar {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #3b82f6
        );

    border-radius: inherit;

    transition: width 0.4s ease;
}

.progress-success {
    background:
        linear-gradient(
            90deg,
            #16a34a,
            #22c55e
        );
}

/* =========================================================
   GRID DE AÇÕES
========================================================= */

.action-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );

    gap: 14px;
}

.action-card {
    display: flex;

    flex-direction: column;

    gap: 8px;

    background: #fff;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    padding: 18px;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.action-card:hover {
    transform: translateY(-2px);

    border-color: #bfdbfe;

    box-shadow: var(--shadow);
}

.action-card-title {
    font-weight: 800;
}

.action-card-description {
    color: var(--muted);

    font-size: 13px;
}

/* =========================================================
   NAVEGAÇÃO
========================================================= */

.navbar,
.topbar {
    background: rgba(
        255,
        255,
        255,
        0.92
    );

    border-bottom:
        1px solid var(--border);

    backdrop-filter: blur(12px);

    position: sticky;

    top: 0;

    z-index: 100;
}

.navbar-inner,
.topbar-inner {
    width: min(
        1250px,
        calc(100% - 32px)
    );

    margin: 0 auto;

    min-height: 68px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}

.logo,
.brand {
    font-weight: 800;

    font-size: 18px;

    color: var(--text);
}

.nav-links {
    display: flex;

    align-items: center;

    gap: 4px;

    flex-wrap: wrap;
}

.nav-links a {
    padding: 9px 11px;

    border-radius: 8px;

    color: var(--text-soft);

    font-size: 13px;

    font-weight: 650;

    transition:
        background var(--transition),
        color var(--transition);
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* =========================================================
   MODAIS / OVERLAYS
========================================================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    background:
        rgba(15, 23, 42, 0.45);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    z-index: 500;
}

.modal {
    width: min(
        600px,
        100%
    );

    background: #fff;

    border-radius: var(--radius-lg);

    padding: 24px;

    box-shadow: var(--shadow-lg);
}

/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #eef2f7;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================
   UTILITÁRIOS
========================================================= */

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 20px;
}

.mb-6 {
    margin-bottom: 24px;
}

/* =========================================================
   RESPONSIVIDADE
========================================================= */

@media (max-width: 900px) {

    .container {
        width: min(
            100% - 24px,
            1250px
        );
    }

    .navbar-inner,
    .topbar-inner {
        width: calc(100% - 24px);

        min-height: 62px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 21px;
    }

    .card,
    .summary-card,
    .stat-card {
        padding: 18px;
    }

}

@media (max-width: 700px) {

    body {
        font-size: 14px;
    }

    .container {
        width: calc(100% - 20px);
    }

    .navbar-inner,
    .topbar-inner {
        width: calc(100% - 20px);

        flex-direction: column;

        align-items: stretch;

        padding: 12px 0;
    }

    .nav-links {
        overflow-x: auto;

        flex-wrap: nowrap;

        padding-bottom: 3px;
    }

    .nav-links a {
        flex-shrink: 0;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .btn {
        width: 100%;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 700px;
    }

}

@media (max-width: 480px) {

    .container {
        width: calc(100% - 16px);
    }

    .card,
    .summary-card,
    .stat-card {
        padding: 16px;
        border-radius: 12px;
    }

    .summary-card .summary-value,
    .stat-card .stat-value {
        font-size: 22px;
    }

}

/* =========================================================
   AJUSTE PADRÃO DOS INPUTS NO TEMA ESCURO
   ========================================================= */

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background-color: #0d1625 !important;
    color: #e5edf7 !important;
    border-color: #253247 !important;
    caret-color: #60a5fa !important;
}

body.theme-dark input::placeholder,
body.theme-dark select::placeholder,
body.theme-dark textarea::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
    background-color: #0d1625 !important;
    color: #f8fafc !important;
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}

/* Campos de data */
body.theme-dark input[type="date"] {
    color: #e5edf7 !important;
    color-scheme: dark;
}

/* Select */
body.theme-dark select option {
    background: #111a29 !important;
    color: #e5edf7 !important;
}

/* Autocomplete do navegador */
body.theme-dark input:-webkit-autofill,
body.theme-dark input:-webkit-autofill:hover,
body.theme-dark input:-webkit-autofill:focus,
body.theme-dark textarea:-webkit-autofill,
body.theme-dark select:-webkit-autofill {
    -webkit-text-fill-color: #e5edf7 !important;
    -webkit-box-shadow: 0 0 0 1000px #0d1625 inset !important;
    box-shadow: 0 0 0 1000px #0d1625 inset !important;
    caret-color: #60a5fa !important;
}