/* ==========================================================================
   HUB BRASILAB V2
   Design System v1
   ========================================================================== */

:root {
    /* Brasilab */
    --brand-navy: #17365f;
    --brand-navy-dark: #102a4c;
    --brand-navy-deep: #0c223e;

    --brand-blue: #2563b5;
    --brand-blue-hover: #1e56a0;
    --brand-blue-light: #eaf2fd;
    --brand-blue-soft: #f3f7fd;

    /* Compatibility */
    --color-primary: var(--brand-navy);
    --color-primary-hover: var(--brand-navy-dark);
    --color-primary-soft: #244a78;

    --color-accent: var(--brand-blue);
    --color-accent-hover: var(--brand-blue-hover);
    --color-accent-soft: var(--brand-blue-light);

    /* Backgrounds */
    --color-background: #f6f8fb;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;
    --color-surface-muted: #f1f5f9;

    /* Text */
    --color-text: #0f2747;
    --color-text-secondary: #334e68;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    /* Borders */
    --color-border: #dce4ee;
    --color-border-strong: #c7d2e0;

    /* Feedback */
    --color-success: #15803d;
    --color-success-bg: #dcfce7;

    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;

    --color-warning: #b7791f;
    --color-warning-bg: #fffbeb;

    /* Layout */
    --sidebar-width: 255px;
    --header-height: 58px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 14px;

    --radius: var(--radius-lg);

    /* Shadows */
    --shadow-xs:
        0 1px 2px rgba(15, 39, 71, 0.04);

    --shadow-sm:
        0 1px 2px rgba(15, 39, 71, 0.04),
        0 2px 5px rgba(15, 39, 71, 0.035);

    --shadow-md:
        0 8px 24px rgba(15, 39, 71, 0.08);

    --shadow-lg:
        0 20px 50px rgba(15, 39, 71, 0.12);

    /* Motion */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}


/* ==========================================================================
   Reset
   ========================================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    background: var(--color-background);
}

body {
    background: var(--color-background);
    color: var(--color-text);

    font-family:
        Inter,
        "Segoe UI",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;

    font-size: 14px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    color: inherit;
}


/* ==========================================================================
   Aplicação
   ========================================================================== */

.app {
    display: flex;

    width: 100%;
    min-height: 100vh;

    background: var(--color-background);
}


/* ==========================================================================
   Sidebar
   ========================================================================== */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    height: 100vh;

    padding: 0;

    background:
        linear-gradient(
            180deg,
            #173a67 0%,
            #17365f 50%,
            #15345d 100%
        );

    color: #ffffff;

    border-right: 1px solid rgba(255, 255, 255, 0.06);

    overflow-x: hidden;
    overflow-y: auto;
}


/* ==========================================================================
   Marca
   ========================================================================== */

.app-brand {
    display: flex;
    align-items: center;

    min-height: 74px;

    margin: 0;
    padding: 0 16px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.app-brand strong {
    position: relative;

    display: flex;
    align-items: center;

    color: #ffffff;

    font-size: 19px;
    font-weight: 750;

    line-height: 1;
    letter-spacing: -0.025em;

    text-transform: uppercase;
}

.app-brand strong::after {
    content: "HUB";

    display: inline-flex;

    margin-left: 11px;

    color: #a9c9ef;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.18em;
}


/* ==========================================================================
   Navegação
   ========================================================================== */

.app-navigation {
    display: flex;
    flex: 1;
    flex-direction: column;

    gap: 27px;

    padding: 20px 8px 30px;
}

.app-navigation-section {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.app-navigation-label {
    padding: 0 8px 5px;

    color: #8fb0d5;

    font-size: 10px;
    font-weight: 700;

    line-height: 1.4;
    letter-spacing: 0.04em;

    text-transform: none;
}

.app-navigation-items {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.app-navigation-group {
    display: flex;
    flex-direction: column;
}


/* ==========================================================================
   Links da navegação
   ========================================================================== */

.app-navigation a {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 40px;

    padding: 9px 12px;

    color: #e2ecf8;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 500;

    line-height: 1.3;

    text-decoration: none;

    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
}

.app-navigation a:hover {
    background: rgba(255, 255, 255, 0.075);
    color: #ffffff;
}

.app-navigation a.is-active {
    background: rgba(73, 128, 194, 0.38);

    color: #ffffff;

    border-color: rgba(255, 255, 255, 0.035);

    font-weight: 650;
}


/* ==========================================================================
   Indicador ativo
   ========================================================================== */

.app-navigation-items > .app-navigation-group > a.is-active::before,
.app-navigation-items > a.is-active::before {
    content: "";

    position: absolute;

    top: 9px;
    bottom: 9px;
    left: -8px;

    width: 3px;

    background: #6fb2ff;

    border-radius: 0 4px 4px 0;
}


/* ==========================================================================
   Submenu
   ========================================================================== */

.app-navigation-children {
    display: flex;
    flex-direction: column;

    gap: 2px;

    margin: 4px 0 3px 14px;
    padding: 3px 0 3px 9px;

    border-left: 1px solid rgba(185, 210, 239, 0.28);
}

.app-navigation-children a {
    min-height: 36px;

    padding: 7px 10px;

    color: #bed1e7;

    font-size: 13px;
    font-weight: 500;

    border-radius: 6px;
}

.app-navigation-children a:hover {
    background: rgba(255, 255, 255, 0.065);

    color: #ffffff;
}

.app-navigation-children a.is-active {
    background: rgba(70, 126, 194, 0.30);

    color: #ffffff;

    border-color: transparent;

    font-weight: 650;
}


/* ==========================================================================
   Área principal
   ========================================================================== */

.app-main {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    background: var(--color-background);
}


/* ==========================================================================
   Header
   ========================================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    height: var(--header-height);

    padding: 0 32px;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid var(--color-border);

    backdrop-filter: blur(10px);
}

.app-header-title {
    display: flex;
    align-items: center;

    color: var(--color-text-secondary);

    font-size: 13px;
    font-weight: 600;

    letter-spacing: -0.01em;
}

.app-header-title::before {
    content: "";

    display: block;

    width: 1px;
    height: 18px;

    margin-right: 16px;

    background: var(--color-border);
}


/* ==========================================================================
   Conta
   ========================================================================== */

.app-header-account {
    display: flex;
    align-items: center;

    gap: 12px;
}

.app-header-user {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    min-width: 100px;

    padding-left: 42px;
    padding-right: 14px;

    line-height: 1.2;
}

.app-header-user::before {
    content: "";

    position: absolute;

    left: 0;
    top: 50%;

    width: 32px;
    height: 32px;

    background:
        linear-gradient(
            135deg,
            #2f78c4,
            #1f5fa7
        );

    border-radius: 50%;

    transform: translateY(-50%);
}

.app-header-user::after {
    content: "";

    position: absolute;

    top: 1px;
    right: 0;
    bottom: 1px;

    width: 1px;

    background: var(--color-border);
}

.app-header-user strong {
    max-width: 220px;

    overflow: hidden;

    color: var(--color-text);

    font-size: 13px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header-user span {
    margin-top: 3px;

    color: var(--color-text-muted);

    font-size: 11px;
    font-weight: 500;
}


/* ==========================================================================
   Logout
   ========================================================================== */

.app-logout-form {
    margin: 0;
}

.app-logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 6px 13px;

    background: #ffffff;
    color: var(--color-text-secondary);

    border: 1px solid var(--color-border);
    border-radius: 7px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.app-logout-button:hover {
    background: #f8fafc;

    color: var(--brand-blue);

    border-color: #b9c9dc;
}


/* ==========================================================================
   Conteúdo
   ========================================================================== */

.app-content {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;

    padding: 34px 32px 60px;
}


/* ==========================================================================
   Cabeçalho das páginas
   ========================================================================== */

.app-content > section > header {
    margin-bottom: 28px;
}

.app-content > section > header h1 {
    margin: 0 0 5px;

    color: #0c2749;

    font-size: 28px;
    font-weight: 700;

    line-height: 1.2;

    letter-spacing: -0.035em;
}

.app-content > section > header p {
    max-width: 760px;

    margin: 0;

    color: var(--color-text-muted);

    font-size: 14px;
    line-height: 1.55;
}


/* ==========================================================================
   Cards genéricos
   ========================================================================== */

.app-content > section > div {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));

    gap: 16px;
}

.app-content article {
    min-height: 140px;

    padding: 22px;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 12px;

    box-shadow: var(--shadow-sm);

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.app-content article:hover {
    transform: translateY(-1px);

    border-color: #cbd7e5;

    box-shadow: var(--shadow-md);
}

.app-content article h2 {
    margin: 0 0 9px;

    color: var(--color-text);

    font-size: 16px;
    font-weight: 650;

    line-height: 1.3;
}

.app-content article p {
    margin: 0;

    color: var(--color-text-muted);

    font-size: 13px;
    line-height: 1.55;
}


/* ==========================================================================
   Tabelas
   ========================================================================== */

.table-card {
    display: block !important;

    width: 100%;

    overflow: hidden;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 12px;

    box-shadow: var(--shadow-sm);
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 66px;

    padding: 15px 24px;

    background: #ffffff;

    border-bottom: 1px solid var(--color-border);
}

.table-card-header > div {
    display: flex;
    align-items: center;

    gap: 10px;
}

.table-card-header strong {
    color: var(--color-text);

    font-size: 14px;
    font-weight: 650;
}

.table-card-header span {
    color: var(--color-text-muted);

    font-size: 12px;
}

.table-responsive {
    width: 100%;

    overflow-x: auto;
}

.data-table {
    width: 100%;

    border-collapse: collapse;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 14px 24px;

    border-bottom: 1px solid var(--color-border);

    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #f7f9fc;

    color: #60738a;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.025em;

    text-transform: uppercase;
}

.data-table td {
    color: var(--color-text-secondary);

    font-size: 13px;
}

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

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.table-empty {
    padding: 42px !important;

    color: var(--color-text-muted);

    text-align: center !important;
}

.text-muted {
    color: var(--color-text-muted);
}

.table-link {
    color: #173f70;

    font-weight: 650;

    text-decoration: none;
}

.table-link:hover {
    color: var(--brand-blue);

    text-decoration: none;
}


/* ==========================================================================
   Status
   ========================================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 3px 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 650;
}

.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background: #eef2f6;
    color: #526579;
}

.status-blocked {
    background: #fee2e2;
    color: #b42318;
}


/* ==========================================================================
   Formulários
   ========================================================================== */

.form-card {
    display: block !important;

    width: 100%;
    max-width: none;

    padding: 28px 32px;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 12px;

    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 21px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #243b55;

    font-size: 12px;
    font-weight: 650;
}


/* ==========================================================================
   Campos
   ========================================================================== */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 44px;

    padding: 9px 13px;

    background: #ffffff;
    color: var(--color-text);

    border: 1px solid #cbd7e5;
    border-radius: 7px;

    outline: none;

    font: inherit;
    font-size: 13px;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background-color var(--transition-fast);
}

.form-group textarea {
    min-height: 120px;

    resize: vertical;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #a9bbcf;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3478c5;

    box-shadow:
        0 0 0 3px rgba(37, 99, 181, 0.11);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: #f1f5f9;

    color: var(--color-text-muted);

    border-color: var(--color-border);

    cursor: not-allowed;
}


/* ==========================================================================
   Select
   ========================================================================== */

.form-group select {
    appearance: none;

    padding-right: 42px;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #64748b 50%
        ),
        linear-gradient(
            135deg,
            #64748b 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 17px) 19px,
        calc(100% - 12px) 19px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;

    cursor: pointer;
}


/* ==========================================================================
   Textos auxiliares
   ========================================================================== */

.form-group small,
.form-help,
.text-muted {
    color: var(--color-text-muted);

    font-size: 11.5px;
    line-height: 1.5;
}

.form-group small {
    display: block;

    margin-top: 6px;
}


/* ==========================================================================
   Ações de formulário
   ========================================================================== */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    margin-top: 28px;
    padding-top: 22px;

    border-top: 1px solid var(--color-border);
}


/* ==========================================================================
   Botões
   ========================================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 8px 16px;

    border: 1px solid transparent;
    border-radius: 7px;

    font: inherit;
    font-size: 12.5px;
    font-weight: 650;

    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    background: var(--brand-blue);
    color: #ffffff;

    border-color: var(--brand-blue);
}

.button-primary:hover {
    background: var(--brand-blue-hover);

    border-color: var(--brand-blue-hover);

    box-shadow:
        0 3px 8px rgba(37, 99, 181, 0.18);
}

.button-secondary {
    background: #ffffff;
    color: var(--color-text-secondary);

    border-color: var(--color-border-strong);
}

.button-secondary:hover {
    background: #f8fafc;

    color: var(--color-text);

    border-color: #aab9ca;
}


/* ==========================================================================
   Alertas
   ========================================================================== */

.form-alert {
    margin-bottom: 22px;

    padding: 12px 14px;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 12.5px;
    line-height: 1.5;
}

.form-alert-error {
    background: var(--color-danger-bg);

    color: #b42318;

    border-color: #fecaca;
}

.success-message {
    margin-bottom: 22px;

    padding: 13px 15px;

    background: var(--color-success-bg);

    color: #166534;

    border: 1px solid #bbf7d0;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 600;
}


/* ==========================================================================
   Usuário criado
   ========================================================================== */

.created-user-data {
    margin: 0;
}

.created-user-data > div {
    padding: 14px 0;

    border-bottom: 1px solid var(--color-border);
}

.created-user-data > div:last-child {
    border-bottom: 0;
}

.created-user-data dt {
    margin-bottom: 4px;

    color: var(--color-text-muted);

    font-size: 10.5px;
    font-weight: 700;

    letter-spacing: 0.035em;

    text-transform: uppercase;
}

.created-user-data dd {
    margin: 0;

    color: var(--color-text);

    font-size: 14px;
}

.created-user-data code {
    color: #163f70;

    font-size: 15px;
    font-weight: 700;
}

.password-warning {
    margin-top: 20px;

    padding: 13px 15px;

    background: var(--color-warning-bg);

    color: #854d0e;

    border: 1px solid #fde68a;
    border-radius: 7px;

    font-size: 12.5px;
}


/* ==========================================================================
   Scrollbar
   ========================================================================== */

.app-sidebar::-webkit-scrollbar {
    width: 5px;
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);

    border-radius: 999px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.26);
}


/* ==========================================================================
   AUTENTICAÇÃO
   ========================================================================== */

.auth-page {
    width: 100%;
    min-height: 100vh;

    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);

    background: #f8fafc;
}


/* ==========================================================================
   AUTENTICAÇÃO - PAINEL INSTITUCIONAL
   ========================================================================== */

.auth-hero {
    position: relative;

    min-height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 56px 72px 40px;

    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            #315fa8 0%,
            #256fba 52%,
            #1788c8 100%
        );

    overflow: hidden;
}

.auth-hero::before {
    content: "";

    position: absolute;

    width: 480px;
    height: 480px;

    top: -260px;
    right: -220px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);
}

.auth-hero::after {
    content: "";

    position: absolute;

    width: 360px;
    height: 360px;

    bottom: -220px;
    left: -160px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.04);
}


/* ==========================================================================
   AUTENTICAÇÃO - MARCA
   ========================================================================== */

.auth-hero-brand {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;

    gap: 12px;
}

.auth-logo-mark {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: #ffffff;

    color: #2469b1;

    font-size: 27px;
    font-weight: 800;
    line-height: 1;
}

.auth-logo-text {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.02em;
}


/* ==========================================================================
   AUTENTICAÇÃO - CONTEÚDO INSTITUCIONAL
   ========================================================================== */

.auth-hero-content {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 560px;

    margin: auto;

    text-align: center;
}

.auth-hero-content h1 {
    margin: 0 0 22px;

    color: #ffffff;

    font-size: clamp(34px, 3vw, 48px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.auth-hero-content p {
    max-width: 520px;

    margin: 0 auto;

    color: rgba(255, 255, 255, 0.88);

    font-size: 17px;
    line-height: 1.75;
}

.auth-hero-footer {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    color: rgba(255, 255, 255, 0.82);

    font-size: 13px;
}

.auth-security-icon {
    width: 21px;
    height: 21px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;

    font-size: 11px;
}


/* ==========================================================================
   AUTENTICAÇÃO - PAINEL DIREITO
   ========================================================================== */

.auth-panel {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px 72px;

    background: #f8fafc;
}

.auth-panel-content {
    width: 100%;
    max-width: 430px;
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h2 {
    margin: 0 0 8px;

    color: #0b1f3a;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.auth-header p {
    margin: 0;

    color: #64748b;

    font-size: 14px;
    line-height: 1.6;
}


/* ==========================================================================
   AUTENTICAÇÃO - CARD
   ========================================================================== */

.auth-card {
    width: 100%;

    padding: 30px;

    border: 1px solid #dce4ee;
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 10px 30px rgba(15, 23, 42, 0.06);
}


/* ==========================================================================
   AUTENTICAÇÃO - FORMULÁRIO
   ========================================================================== */

.auth-form {
    display: flex;
    flex-direction: column;

    gap: 20px;
}

.auth-field {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.auth-field label {
    color: #0f172a;

    font-size: 14px;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    height: 46px;

    padding: 0 14px;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    outline: none;

    background: #ffffff;

    color: #0f172a;

    font: inherit;
    font-size: 14px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.auth-field input::placeholder {
    color: #94a3b8;
}

.auth-field input:hover {
    border-color: #94a3b8;
}

.auth-field input:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ==========================================================================
   AUTENTICAÇÃO - BOTÃO
   ========================================================================== */

.auth-submit {
    width: 100%;
    min-height: 46px;

    margin-top: 4px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 0;
    border-radius: 9px;

    background: #2868ad;

    color: #ffffff;

    font: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08);

    transition:
        background-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.auth-submit:hover {
    background: #205b9c;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.18);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit-icon {
    font-size: 16px;
}


/* ==========================================================================
   AUTENTICAÇÃO - ALERTA
   ========================================================================== */

.auth-alert {
    margin-bottom: 20px;

    padding: 12px 14px;

    border: 1px solid #fecaca;
    border-radius: 9px;

    background: #fef2f2;

    color: #b91c1c;

    font-size: 13px;
    line-height: 1.5;
}


/* ==========================================================================
   AUTENTICAÇÃO - SUPORTE
   ========================================================================== */

.auth-card-support {
    margin-top: 24px;
    padding-top: 20px;

    display: flex;
    flex-direction: column;

    gap: 3px;

    border-top: 1px solid #e2e8f0;

    text-align: center;
}

.auth-card-support span {
    color: #334155;

    font-size: 13px;
    font-weight: 600;
}

.auth-card-support small {
    color: #64748b;

    font-size: 12px;
    line-height: 1.5;
}

.auth-panel-footer {
    max-width: 390px;

    margin: 26px auto 0;

    color: #64748b;

    font-size: 12px;
    line-height: 1.6;

    text-align: center;
}


/* ==========================================================================
   AUTENTICAÇÃO - RESPONSIVIDADE
   ========================================================================== */

@media (max-width: 980px) {

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: auto;

        padding: 32px 28px;
    }

    .auth-hero-content {
        margin: 70px auto;
    }

    .auth-hero-content h1 {
        font-size: 34px;
    }

    .auth-hero-footer {
        margin-top: 20px;
    }

    .auth-panel {
        min-height: auto;

        padding: 64px 24px;
    }

}

@media (max-width: 640px) {

    .auth-hero {
        padding: 26px 20px 30px;
    }

    .auth-logo-mark {
        width: 40px;
        height: 40px;

        border-radius: 11px;

        font-size: 23px;
    }

    .auth-logo-text {
        font-size: 21px;
    }

    .auth-hero-content {
        margin: 48px auto;
    }

    .auth-hero-content h1 {
        font-size: 30px;
    }

    .auth-hero-content p {
        font-size: 15px;
    }

    .auth-panel {
        padding: 44px 18px;
    }

    .auth-header h2 {
        font-size: 26px;
    }

    .auth-card {
        padding: 24px 20px;
    }

}

/* =========================================================
   BRASILAB — LOGOTIPO
   ========================================================= */

.app-brand {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 0 16px;
}

.app-brand-logo {
    display: block;
    width: auto;
    max-width: 170px;
    height: auto;
    max-height: 42px;
    object-fit: contain;
}

/* =========================================================
   LOGIN — LOGOTIPO OFICIAL BRASILAB
   ========================================================= */

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 32px;
}

.auth-brand-logo {
    display: block;
    width: min(100%, 290px);
    height: auto;
    max-height: 110px;
    object-fit: contain;
}


/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 225px;
    }

    .app-content {
        padding:
            30px
            28px
            50px;
    }

}


@media (max-width: 800px) {

    .app {
        display: block;
    }

    .app-sidebar {
        position: relative;

        width: 100%;
        height: auto;

        background: var(--brand-navy);
    }

    .app-brand {
        min-height: 64px;
    }

    .app-navigation {
        flex-direction: row;
        flex-wrap: wrap;

        gap: 15px;

        padding: 14px;
    }

    .app-navigation-section {
        min-width: 180px;
        flex: 1;
    }

    .app-main {
        width: 100%;

        margin-left: 0;
    }

    .app-header {
        position: relative;

        padding: 0 20px;
    }

    .app-content {
        padding:
            26px
            20px
            40px;
    }

    .form-card {
        max-width: 100%;

        padding: 24px;
    }

}


@media (max-width: 560px) {

    .app-header {
        height: auto;
        min-height: var(--header-height);

        padding:
            10px
            16px;
    }

    .app-header-title {
        display: none;
    }

    .app-header-account {
        width: 100%;

        justify-content: flex-end;
    }

    .app-header-user {
        padding-left: 0;
    }

    .app-header-user::before {
        display: none;
    }

    .app-content {
        padding:
            22px
            16px
            36px;
    }

    .app-content > section > header h1 {
        font-size: 24px;
    }

    .form-card {
        padding: 20px 18px;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .button {
        width: 100%;
    }

    .table-card-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;
    }

}
/* ==========================================================================
   PÁGINAS DE MÓDULOS
   ========================================================================== */

.page-header {
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    width: 100%;

    margin-bottom: 24px;
}

.page-header > div {
    display: block;
}

.page-header h1 {
    margin: 0 0 6px;

    color: var(--color-text);

    font-size: 28px;
    font-weight: 700;

    line-height: 1.2;
    letter-spacing: -0.035em;
}

.page-header p {
    margin: 0;

    color: var(--color-text-muted);

    font-size: 14px;
    line-height: 1.5;
}


/* ==========================================================================
   CARDS DE MÓDULOS
   ========================================================================== */

.card {
    display: block !important;

    width: 100%;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    min-height: 64px;

    padding: 16px 22px;

    border-bottom: 1px solid var(--color-border);
}

.card-header strong {
    color: var(--color-text);

    font-size: 14px;
    font-weight: 650;
}

.card-header span {
    color: var(--color-text-muted);

    font-size: 12px;
}


/* ==========================================================================
   ESTADO VAZIO
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 220px;

    padding: 40px 24px;

    text-align: center;
}

.empty-state strong {
    margin-bottom: 5px;

    color: var(--color-text);

    font-size: 14px;
    font-weight: 650;
}

.empty-state p {
    margin: 0;

    color: var(--color-text-muted);

    font-size: 13px;
}


/* ==========================================================================
   FORMULÁRIO PADRÃO
   ========================================================================== */

.standard-form {
    width: 100%;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px 24px;
}

.form-field {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    display: block;

    margin-bottom: 7px;

    color: #243b55;

    font-size: 12px;
    font-weight: 650;
}


/* ==========================================================================
   CAMPOS DO FORMULÁRIO
   ========================================================================== */

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;

    padding: 9px 13px;

    background: #ffffff;
    color: var(--color-text);

    border: 1px solid #cbd7e5;
    border-radius: 7px;

    outline: none;

    font: inherit;
    font-size: 13px;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background-color var(--transition-fast);
}

.form-field input,
.form-field select {
    min-height: 44px;
}

.form-field textarea {
    min-height: 120px;

    resize: vertical;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #a9bbcf;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #3478c5;

    box-shadow:
        0 0 0 3px rgba(37, 99, 181, 0.11);
}

.form-field select {
    appearance: none;

    padding-right: 42px;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #64748b 50%
        ),
        linear-gradient(
            135deg,
            #64748b 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 17px) 19px,
        calc(100% - 12px) 19px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;

    cursor: pointer;
}

.form-field small {
    display: block;

    margin-top: 6px;

    color: var(--color-text-muted);

    font-size: 11.5px;
    line-height: 1.5;
}


/* ==========================================================================
   CARD DE FORMULÁRIO
   ========================================================================== */

.card.form-card {
    max-width: none;

    padding: 28px 30px;
}


/* ==========================================================================
   ALERTA DE ERRO
   ========================================================================== */

.form-card .form-alert {
    margin-bottom: 24px;

    padding: 12px 14px;

    background: var(--color-danger-bg);
    color: #b42318;

    border: 1px solid #fecaca;
    border-radius: 7px;

    font-size: 12.5px;
}


/* ==========================================================================
   LEADS - STATUS
   ========================================================================== */

.lead-status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    font-size: 12px;
    font-weight: 600;
}

.lead-status::before {
    content: "";

    display: block;

    width: 7px;
    height: 7px;

    background: var(--brand-blue);

    border-radius: 50%;
}

/* ==========================================================================
   LEADS - DETALHES
========================================================================== */

.lead-detail-back {
    margin-bottom: 18px;
}

.lead-detail-back a {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.lead-detail-back a:hover {
    color: var(--brand-blue);
}

.lead-detail-header {
    margin-bottom: 24px;
}

.lead-detail-code {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 8px;

    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 700;
}

.lead-detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lead-detail-actions .button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.lead-detail-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 3fr)
        minmax(340px, 2fr);

    gap: 20px;
    width: 100%;
    align-items: start;
}

.lead-detail-main,
.lead-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.lead-detail-card {
    overflow: hidden;
}

.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-detail-field {
    min-width: 0;
    padding: 20px 22px;

    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.lead-detail-field:nth-child(2n) {
    border-right: 0;
}

.lead-detail-field:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.lead-detail-field span,
.lead-detail-summary-list span {
    display: block;

    margin-bottom: 6px;

    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.lead-detail-field strong {
    display: block;

    overflow-wrap: anywhere;

    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}

.lead-detail-text {
    padding: 22px;

    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.lead-detail-summary {
    padding: 22px;
}

.lead-detail-summary strong {
    display: block;

    color: var(--color-text);
    font-size: 14px;
}

.lead-detail-summary p {
    margin: 7px 0 0;

    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.lead-detail-summary-list {
    padding: 4px 22px;
}

.lead-detail-summary-list > div {
    padding: 16px 0;

    border-bottom: 1px solid var(--color-border);
}

.lead-detail-summary-list > div:last-child {
    border-bottom: 0;
}

.lead-detail-summary-list strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}


/* ==========================================================================
   LEADS - DETALHES RESPONSIVO
========================================================================== */

@media (max-width: 980px) {

    .lead-detail-layout {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 720px) {

    .lead-detail-grid {
        grid-template-columns: 1fr;
    }

    .lead-detail-field,
    .lead-detail-field:nth-child(2n),
    .lead-detail-field:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .lead-detail-field:last-child {
        border-bottom: 0;
    }

}

/* ==========================================================================
   RESPONSIVIDADE DOS MÓDULOS
   ========================================================================== */

@media (max-width: 800px) {

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-full {
        grid-column: auto;
    }

    .card.form-card {
        max-width: 100%;

        padding: 24px;
    }

}


@media (max-width: 560px) {

    .page-header h1 {
        font-size: 24px;
    }

    .page-header .button {
        width: 100%;
    }

    .page-header > div:last-child {
        width: 100%;
    }

    .card.form-card {
        padding: 20px 18px;
    }

}


/* =========================================================
   LEADS - ARQUIVOS
   ========================================================= */

.lead-files-card {
    overflow: hidden;
}

.lead-files-content {
    padding: 20px;
}

.lead-file-upload {
    min-height: 245px;
    padding: 28px 20px;

    border: 1px dashed #b8c7da;
    border-radius: 10px;

    background: #fbfcfe;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.lead-file-upload:hover {
    border-color: #6f91b8;
    background: #f8fafc;
}

.lead-file-upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #64748b;
    font-size: 34px;
    line-height: 1;
}

.lead-file-upload strong {
    display: block;

    color: #0b2545;
    font-size: 14px;
    font-weight: 700;
}

.lead-file-upload-or {
    display: block;
    margin: 7px 0 11px;

    color: #718096;
    font-size: 13px;
}

.lead-file-upload .button {
    margin-bottom: 15px;
}

.lead-file-upload small {
    display: block;

    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}

.lead-files-empty {
    margin-top: 18px;
    padding-top: 17px;

    border-top: 1px solid #dbe3ed;

    color: #64748b;
    font-size: 13px;
}

/* Futuramente usada pela listagem dos anexos */

.lead-files-list {
    margin-top: 18px;

    border-top: 1px solid #dbe3ed;
}

.lead-file-item {
    width: 100%;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    border-bottom: 1px solid #edf1f5;
}

.lead-file-item:last-child {
    border-bottom: 0;
}



.lead-file-item + .lead-file-item {
    border-top: 1px solid #e2e8f0;
}

.lead-file-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lead-file-name {
    overflow: hidden;

    color: #0b2545;
    font-size: 13px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-file-meta {
    color: #718096;
    font-size: 11px;
}

/* ==========================================================================
   CRM - Leads - Arquivos / Modal
   ========================================================================== */

.lead-file-item-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.lead-file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
}

.lead-file-action {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.lead-file-action:hover {
    background: #eef4fb;
    color: #174a7c;
}


.lead-file-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.lead-file-info strong {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-file-info small {
    display: block;
    color: #64748b;
}


.lead-file-modal[hidden] {
    display: none;
}

.lead-file-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lead-file-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.lead-file-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 95vw);
    height: min(800px, 90vh);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lead-file-modal-header {
    min-height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid #dbe3ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.lead-file-modal-header strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-file-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.lead-file-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.lead-file-modal-content {
    flex: 1;
    min-height: 0;
    padding: 20px;
    background: #f8fafc;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lead-file-preview-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lead-file-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 600px;
    border: 0;
    background: #ffffff;
}

@media (max-width: 768px) {
    .lead-file-modal {
        padding: 12px;
    }

    .lead-file-modal-dialog {
        width: 100%;
        height: 92vh;
    }

    .lead-file-modal-content {
        padding: 10px;
    }

    .lead-file-preview-frame {
        min-height: 500px;
    }
}

.lead-file-upload.is-dragging {
    border-color: #2563eb;
    background: #eff6ff;
}

.lead-file-upload.is-dragging strong {
    color: #1d4ed8;
}

.lead-file-upload.is-uploading {
    opacity: 0.65;
    pointer-events: none;
    cursor: wait;
}

.lead-file-upload.is-uploading::after {
    content: "Enviando arquivos...";
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.lead-file-delete-form {
    margin: 0;
    padding: 0;
    display: inline-flex;
}

.lead-file-delete {
    color: #94a3b8;
}

.lead-file-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.lead-followups-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lead-followups-content {
    padding: 0;
}

.lead-followups-empty {
    padding: 24px;
    color: #64748b;
    text-align: center;
}

.lead-followup-item {
    padding: 18px 22px;
}

.lead-followup-item + .lead-followup-item {
    border-top: 1px solid #e2e8f0;
}

.lead-followup-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 5px;
}

.lead-followup-meta span {
    color: #64748b;
    font-size: 13px;
}

.lead-followup-user {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 10px;
}

.lead-followup-notes {
    line-height: 1.55;
}

.lead-followup-next {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
}

.lead-followup-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
}

.lead-followup-form {
    padding: 22px;
}

.lead-followup-form .form-group {
    margin-bottom: 18px;
}

.lead-followup-form label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.lead-followup-form input,
.lead-followup-form select,
.lead-followup-form textarea {
    width: 100%;
}

.lead-followup-form textarea {
    resize: vertical;
}

.lead-followup-form small {
    display: block;
    margin-top: 6px;
    color: #64748b;
}

.lead-followup-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.lead-followup-channel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-followup-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.lead-followup-status.is-pending {
    color: #92400e;
    background: #fef3c7;
}

.lead-followup-status.is-overdue {
    color: #991b1b;
    background: #fee2e2;
}

.lead-followup-status.is-completed {
    color: #166534;
    background: #dcfce7;
}

.lead-followup-next.is-pending {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
}

.lead-followup-next.is-overdue {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}

.lead-followup-next.is-completed {
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
}

.lead-followup-context {
    margin: 20px 22px 0;
    padding: 14px 16px;
    border-radius: 8px;
}

.lead-followup-context.is-pending {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.lead-followup-context.is-overdue {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.lead-followup-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.lead-followup-context-date {
    color: #475569;
    font-size: 13px;
    margin-bottom: 8px;
}

.lead-followup-context-notes {
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   CRM - Jornada do Lead
   ========================================================================== */

.lead-journey-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lead-journey-code {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.lead-journey-content {
    padding: 20px 22px 22px;
}

.lead-journey-timeline {
    position: relative;
}

.lead-journey-item {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
}

.lead-journey-item:last-child {
    padding-bottom: 0;
}

.lead-journey-item::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: -2px;
    left: 5px;
    width: 2px;
    background: #e2e8f0;
}

.lead-journey-item:last-child::before {
    display: none;
}

.lead-journey-marker {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #2f6fbd;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.lead-journey-item-content {
    flex: 1;
    min-width: 0;
}

.lead-journey-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 5px;
}

.lead-journey-item-header strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.lead-journey-item-header span {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}

.lead-journey-description {
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
}

.lead-journey-empty {
    padding: 8px 0;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 640px) {
    .lead-journey-item-header {
        flex-direction: column;
        gap: 3px;
    }

    .lead-journey-item-header span {
        white-space: normal;
    }
}

.lead-journey-changes {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lead-journey-change {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.lead-journey-change strong {
    color: #334155;
    font-weight: 600;
}

.lead-journey-change-from {
    color: #64748b;
}

.lead-journey-change-arrow {
    color: #94a3b8;
}

.lead-journey-change-to {
    color: #0f172a;
    font-weight: 500;
}

.lead-journey-actor {
    margin-top: 3px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #728aac;
}

/* ==========================================================================
   Lead - modal de alteração de status
   ========================================================================== */

.lead-status-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(480px, 95vw);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.lead-status-modal-content {
    padding: 24px;
}

.lead-status-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.lead-status-current span {
    font-size: 13px;
    color: #64748b;
}

.lead-status-current strong {
    font-size: 14px;
    color: #0f172a;
}

.lead-status-modal-content .form-group {
    margin-bottom: 0;
}

.lead-status-modal-content label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.lead-status-modal-content select {
    width: 100%;
}

.lead-status-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/*
==========================================================================
   LEADS — ABAS DE LISTAGEM
==========================================================================
*/

.lead-tabs {
    display: flex;
    align-items: center;
    gap: 28px;

    margin-bottom: 20px;

    border-bottom: 1px solid var(--color-border);
}

.lead-tab {
    position: relative;

    display: inline-flex;
    align-items: center;

    padding: 0 2px 12px;

    color: var(--color-text-muted);

    font-size: 13px;
    font-weight: 600;
    text-decoration: none;

    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.lead-tab:hover {
    color: var(--color-text);
}

.lead-tab-active {
    color: var(--color-primary);
}

.lead-tab-active::after {
    content: '';

    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;

    height: 2px;

    background: var(--color-primary);

    border-radius: 2px 2px 0 0;
}

@media (max-width: 640px) {

    .lead-tabs {
        gap: 18px;

        overflow-x: auto;
    }

    .lead-tab {
        flex-shrink: 0;
    }
}
/* =========================================================
   LEADS - LISTAGEM
   ========================================================= */

.lead-list-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.lead-list-row:hover {
    background-color: #f5f8fc;
}

.lead-list-row:focus {
    outline: 2px solid #2f6fbb;
    outline-offset: -2px;
}

.lead-list-action-column {
    text-align: center;
    white-space: nowrap;
}

.lead-list-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   LEAD - COPIAR DADOS
   ========================================================= */

.lead-copy-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 6px;

    background: transparent;
    color: #5f7691;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.lead-copy-button:hover {
    background: #eef5fc;
    border-color: #cbd9e8;
    color: #1f66b1;
}

.lead-copy-button.is-copied {
    color: #198754;
}

/* =========================================================
   BUTTON - SUCCESS
   ========================================================= */

.button.button-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 18px;

    border: 1px solid #198754;
    border-radius: 7px;

    background-color: #198754;
    color: #ffffff;

    font-weight: 600;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.button.button-success:hover {
    background-color: #157347;
    border-color: #146c43;
    color: #ffffff;
}

.button.button-success:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.18);
}


/* =========================================================
   CONVERSÃO DE LEAD - CONFIRMAÇÃO
   ========================================================= */

.budget-convert-simple {
    max-width: 1120px;
    margin: 0 auto;
}

.budget-convert-simple .budget-convert-header {
    margin-bottom: 26px;
}


/* Card principal
   --------------------------------------------------------- */

.budget-convert-confirm-card {
    max-width: 760px;
    margin: 0 auto;
    overflow: hidden;
}

.budget-convert-confirm-content {
    padding: 42px 48px 38px;
    text-align: center;
}


/* Ícone
   --------------------------------------------------------- */

.budget-convert-confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 62px;
    margin: 0 auto 18px;

    border-radius: 50%;

    background: #e8f6ee;
    color: #198754;

    font-size: 30px;
    font-weight: 700;
}


/* Título
   --------------------------------------------------------- */

.budget-convert-confirm-content h2 {
    margin: 0;

    color: #0b2d52;

    font-size: 24px;
    font-weight: 700;
}

.budget-convert-confirm-description {
    margin: 8px 0 30px;

    color: #64748b;
    font-size: 14px;
}


/* Resumo
   --------------------------------------------------------- */

.budget-convert-confirm-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    margin: 0 auto 28px;

    border: 1px solid #dbe4ee;
    border-radius: 8px;

    text-align: left;
    overflow: hidden;
}

.budget-convert-confirm-item {
    padding: 17px 20px;

    border-bottom: 1px solid #e5ebf2;
}

.budget-convert-confirm-item:nth-child(2n) {
    border-left: 1px solid #e5ebf2;
}

.budget-convert-confirm-company {
    grid-column: 1 / -1;
}

.budget-convert-confirm-item:last-child {
    border-bottom: 0;
}

.budget-convert-confirm-item span {
    display: block;
    margin-bottom: 5px;

    color: #64748b;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.budget-convert-confirm-item strong {
    display: block;

    color: #102a43;

    font-size: 15px;
    font-weight: 600;
}


/* Aviso
   --------------------------------------------------------- */

.budget-convert-confirm-notice {
    max-width: 620px;
    margin: 0 auto 30px;
    padding: 16px 20px;

    border-radius: 8px;
    background: #f5f8fc;

    color: #52677e;

    font-size: 13px;
    line-height: 1.65;
}


/* Ações
   --------------------------------------------------------- */

.budget-convert-confirm-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.budget-convert-cancel-button,
.budget-convert-confirm-button {
    min-height: 46px;
    padding: 0 24px;
}

.budget-convert-confirm-button {
    min-width: 230px;

    font-size: 14px;
    font-weight: 700;
}


/* Responsivo
   --------------------------------------------------------- */

@media (max-width: 720px) {

    .budget-convert-confirm-content {
        padding: 30px 20px;
    }

    .budget-convert-confirm-summary {
        grid-template-columns: 1fr;
    }

    .budget-convert-confirm-company {
        grid-column: auto;
    }

    .budget-convert-confirm-item:nth-child(2n) {
        border-left: 0;
    }

    .budget-convert-confirm-item:last-child {
        border-bottom: 0;
    }

    .budget-convert-confirm-actions {
        flex-direction: column-reverse;
    }

    .budget-convert-cancel-button,
    .budget-convert-confirm-button {
        width: 100%;
    }
}