@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #ffffff;
    --bg-deep: #f7f7f7;
    --panel: #ffffff;
    --panel-2: #f7f7f7;
    --panel-3: #ffffff;
    --line: #e8e8e8;
    --text: #1a1a1a;
    --muted: #636363;
    --green: #024ad8;
    --green-strong: #0e3191;
    --danger: #b3262b;
    --shadow: 0 2px 8px rgba(26, 26, 26, 0.08);
    --shadow-floating: 0 8px 24px rgba(26, 26, 26, 0.12);
    --primary: #024ad8;
    --primary-bright: #296ef9;
    --primary-deep: #0e3191;
    --primary-soft: #c9e0fc;
    --canvas: #ffffff;
    --cloud: #f7f7f7;
    --fog: #e8e8e8;
    --steel: #c2c2c2;
    --ink: #1a1a1a;
    --ink-deep: #000000;
    --charcoal: #3d3d3d;
    --graphite: #636363;
    --on-ink: #ffffff;
    --bloom-rose: #f9d4d2;
    --font-head: 'Manrope', 'Inter', Arial, sans-serif;
    --font-body: 'Inter', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.4;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 650px at -10% 0%, rgba(61, 220, 132, 0.3), transparent 60%),
        radial-gradient(1200px 700px at 110% 100%, rgba(16, 170, 236, 0.2), transparent 55%),
        linear-gradient(160deg, #0a1713 0%, #050a08 75%);
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.login-hero {
    padding: 68px 56px;
    display: flex;
    align-items: center;
}

.login-hero-content {
    max-width: 620px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(61, 220, 132, 0.45);
    background: rgba(61, 220, 132, 0.14);
    color: #baf4d2;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-hero h1 {
    margin: 20px 0 14px;
    font-family: var(--font-head);
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.1;
}

.login-hero p {
    margin: 0;
    max-width: 56ch;
    color: var(--muted);
    line-height: 1.7;
    font-size: 17px;
}

.hero-points {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.hero-points li {
    position: relative;
    padding-left: 26px;
    color: #d7e8df;
}

.hero-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(61, 220, 132, 0.2);
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 30px;
}

.login-card {
    width: min(100%, 460px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.brand-box {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.brand-icon,
.sidebar-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #06351e;
    background: linear-gradient(135deg, #56f39d, #17be68);
}

.brand-box h2 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 24px;
}

.brand-box p {
    margin: 6px 0 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    color: #dbe8e2;
    font-size: 14px;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel-3);
    color: var(--text);
    border-radius: 14px;
    padding: 15px 16px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
    border-color: rgba(61, 220, 132, 0.82);
    box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.15);
}

.password-field {
    position: relative;
}

.password-field button {
    position: absolute;
    right: 8px;
    top: 8px;
    border: 1px solid rgba(61, 220, 132, 0.4);
    background: rgba(61, 220, 132, 0.08);
    color: #c8f5dc;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    margin-top: 10px;
    border: 0;
    border-radius: 14px;
    padding: 15px;
    background: linear-gradient(135deg, #63f6a7, #21cd72);
    color: #042814;
    font-weight: 800;
    cursor: pointer;
    font-size: 15px;
    transition: transform 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 12px 28px rgba(36, 211, 102, 0.32);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(36, 211, 102, 0.45);
}

.btn-primary:disabled,
.btn-danger:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.alert-error {
    background: rgba(248, 113, 113, 0.13);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(61, 220, 132, 0.14);
    color: #baf4d2;
    border: 1px solid rgba(61, 220, 132, 0.35);
    border-radius: 14px;
    padding: 12px;
    font-size: 14px;
}

.app-body {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(980px 420px at 80% -10%, rgba(61, 220, 132, 0.12), transparent),
        #07100d;
}

.sidebar {
    width: 260px;
    background: rgba(4, 10, 8, 0.86);
    border-right: 1px solid var(--line);
    padding: 24px;
    backdrop-filter: blur(8px);
}

.sidebar-logo {
    margin-bottom: 32px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar a {
    color: var(--muted);
    padding: 13px 14px;
    border-radius: 13px;
    transition: background 120ms ease, color 120ms ease;
}

.sidebar a.active,
.sidebar a:hover {
    background: var(--panel-2);
    color: var(--text);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #7ef0b1;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar h1 {
    margin: 0;
    font-family: var(--font-head);
    font-size: clamp(24px, 2.4vw, 34px);
}

.user-box {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 12px 14px;
    border-radius: 16px;
}

.user-box a {
    color: #87efb9;
    font-weight: 700;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.admin-cards-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card,
.panel-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.metric-card span {
    color: var(--muted);
    font-size: 14px;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-family: var(--font-head);
    font-size: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 21px;
}

.panel-header span {
    color: var(--muted);
    font-size: 14px;
}

.clients-toolbar {
    margin-bottom: 20px;
}

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

.clients-toolbar-header h2 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 22px;
}

.clients-toolbar-header span {
    color: var(--muted);
    font-size: 14px;
}

.btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    min-height: 46px;
    padding: 0 18px;
    white-space: nowrap;
}

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

.extract-leads-panel {
    display: grid;
    gap: 16px;
}

.extract-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
    padding: 16px;
    background: rgba(8, 18, 14, 0.9);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.extract-form.is-hidden {
    display: none;
}

.input-text {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel-3);
    color: var(--text);
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
}

.extract-form input[type="file"] {
    flex: 1;
    border: 1px dashed var(--line);
    background: rgba(10, 20, 16, 0.9);
    color: var(--muted);
    border-radius: 12px;
    padding: 12px;
}

.extract-summary {
    color: #bdf6d5;
    font-weight: 700;
}

.lote-active-box {
    border: 1px solid rgba(61, 220, 132, 0.3);
    background: rgba(61, 220, 132, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 4px;
    width: 100%;
}

.lote-active-box strong {
    color: #baf4d2;
}

.lote-active-box small {
    color: var(--muted);
}

.lote-active-box .inline-form {
    margin-top: 8px;
}

.merge-options {
    border: 1px solid var(--line);
    background: rgba(10, 20, 16, 0.9);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 8px;
    width: 100%;
}

.merge-options p {
    margin: 0;
    font-weight: 700;
}

.merge-options label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #d8e6e0;
}

.new-file-trigger {
    margin: 10px 0 4px;
}

.lotes-panel {
    margin-top: 20px;
}

.inline-form {
    margin: 0;
}

.preview-actions-card {
    margin-top: 4px;
}

.preview-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-danger {
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.22);
}

.import-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 7, 5, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.import-loading-overlay.active {
    display: flex;
}

.import-loading-card {
    width: min(100%, 480px);
    background: #0d1b16;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.import-loading-card h3 {
    margin: 0 0 10px;
    font-family: var(--font-head);
}

.import-loading-card p {
    margin: 0 0 10px;
    color: #d8e6e0;
}

.import-loading-card small {
    color: var(--muted);
}

.import-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 0 0 10px;
}

.import-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #56f39d, #16bf68);
    transition: width 280ms ease;
}

.empty-state {
    color: var(--muted);
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(10, 20, 16, 0.9);
    border-radius: 12px;
}

.services-col {
    min-width: 320px;
    line-height: 1.45;
}

.admin-panel {
    margin-bottom: 20px;
}

.admin-screens-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screen-link-card {
    border: 1px solid var(--line);
    background: rgba(18, 33, 27, 0.7);
    border-radius: 16px;
    padding: 15px;
    display: block;
    transition: transform 140ms ease, border-color 140ms ease;
}

.screen-link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(97, 236, 157, 0.6);
}

.screen-link-card h3 {
    margin: 0;
    font-size: 16px;
}

.screen-link-card p {
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.screen-link-card span {
    color: #8af3bc;
    font-size: 13px;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

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

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(61, 220, 132, 0.12);
    color: #87efb9;
    font-size: 13px;
}

.status-pill.status-active {
    background: rgba(61, 220, 132, 0.16);
    color: #8af3bc;
}

.status-pill.status-paused {
    background: rgba(250, 204, 21, 0.14);
    color: #fde68a;
}

.status-pill.status-draft {
    background: rgba(148, 163, 184, 0.15);
    color: #dbe5f3;
}

.status-pill.status-running {
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
}

.campanhas-header-card {
    margin-bottom: 16px;
}

.campanhas-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.campanhas-top h2 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 24px;
}

.campanhas-top p {
    margin: 6px 0 0;
    color: var(--muted);
}

.campanhas-filtros-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 220px 170px;
    gap: 12px;
}

.campanhas-select {
    appearance: none;
}

.disparos-create-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.disparos-create-form .btn-primary {
    margin-top: 0;
    min-height: 48px;
}

.disparos-kpis-grid {
    margin-bottom: 16px;
}

.disparos-filtros-form {
    margin-bottom: 14px;
}

.whatsapp-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.whatsapp-form-span-2 {
    grid-column: span 2;
}

.whatsapp-form-actions {
    display: flex;
    align-items: end;
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 10, 8, 0.78);
    backdrop-filter: blur(2px);
}

.app-modal-overlay[hidden] {
    display: none !important;
}

.app-modal-overlay.is-open {
    display: flex;
}

.app-modal {
    width: min(980px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: rgba(13, 23, 19, 0.98);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.app-modal-header h3 {
    margin: 0;
    font-family: var(--font-head);
}

.app-modal-close {
    border: 1px solid var(--line);
    background: rgba(12, 24, 19, 0.95);
    color: #d8ede2;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.iniciar-disparo-form {
    display: grid;
    gap: 12px;
}

.iniciar-disparo-form label {
    color: #d8e6e0;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-action {
    border: 1px solid var(--line);
    background: rgba(12, 24, 19, 0.95);
    color: #d8ede2;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-action:hover {
    border-color: rgba(97, 236, 157, 0.5);
}

.btn-action-danger {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.campanha-form {
    display: grid;
    gap: 16px;
    max-width: 1240px;
}

.campanha-card {
    display: grid;
    gap: 14px;
}

.campanha-grid {
    display: grid;
    gap: 12px;
}

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

.campanha-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.campanha-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.campanha-field {
    display: grid;
    gap: 8px;
}

.campanha-field label {
    font-size: 14px;
    font-weight: 700;
    color: #deeee6;
}

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

.textarea-input {
    min-height: 108px;
    resize: vertical;
    font-family: var(--font-body);
}

.textarea-lg {
    min-height: 140px;
}

.weekday-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weekday-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(10, 20, 16, 0.88);
    color: #d8e6e0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.rules-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
}

.variables-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variables-row span {
    border: 1px solid rgba(97, 236, 157, 0.28);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    color: #b8f6d5;
    background: rgba(61, 220, 132, 0.09);
}

.message-preview-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(11, 20, 16, 0.95);
    padding: 12px;
}

.message-preview-card strong {
    display: block;
    margin-bottom: 8px;
}

.message-preview-card p {
    margin: 0;
    line-height: 1.5;
    color: #dcebe4;
}

.flow-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 280px;
    gap: 12px;
}

.flow-left,
.flow-right {
    border: 1px solid var(--line);
    background: rgba(10, 20, 16, 0.9);
    border-radius: 12px;
    padding: 12px;
}

.flow-left h3,
.flow-right h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.flow-node-list {
    display: grid;
    gap: 8px;
}

.flow-add-btn {
    border: 1px dashed rgba(97, 236, 157, 0.35);
    background: rgba(12, 24, 19, 0.95);
    color: #d8ede2;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flow-add-btn:hover {
    border-color: rgba(97, 236, 157, 0.65);
}

.flow-node-icon {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.flow-node-icon svg {
    width: 18px;
    height: 18px;
}

.icon-start { background: rgba(99, 246, 167, 0.2); color: #b8f6d5; }
.icon-message { background: rgba(56, 189, 248, 0.2); color: #bae6fd; }
.icon-wait { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.icon-condition { background: rgba(167, 139, 250, 0.2); color: #ddd6fe; }
.icon-ai-classify { background: rgba(96, 165, 250, 0.22); color: #bfdbfe; }
.icon-ai-reply { background: rgba(34, 197, 94, 0.2); color: #bbf7d0; }
.icon-tag { background: rgba(244, 114, 182, 0.2); color: #fbcfe8; }
.icon-notify { background: rgba(251, 146, 60, 0.2); color: #fed7aa; }
.icon-end { background: rgba(248, 113, 113, 0.2); color: #fecaca; }

.flow-center {
    border: 1px solid var(--line);
    background: rgba(10, 20, 16, 0.88);
    border-radius: 12px;
    padding: 10px;
    overflow: auto;
}

.flow-canvas {
    position: relative;
    min-height: 380px;
    border: 1px dashed rgba(159, 196, 178, 0.24);
    border-radius: 10px;
    background:
        linear-gradient(transparent 31px, rgba(255, 255, 255, 0.04) 32px),
        linear-gradient(90deg, transparent 31px, rgba(255, 255, 255, 0.04) 32px);
    background-size: 32px 32px;
}

.flow-edges-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.flow-edge-path {
    fill: none;
    stroke: rgba(97, 236, 157, 0.68);
    stroke-width: 2.2;
}

.flow-edge-remove {
    fill: #f87171;
    stroke: #fff;
    stroke-width: 1;
    cursor: pointer;
    pointer-events: auto;
}

.flow-edges-list {
    position: sticky;
    left: 10px;
    top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 1;
    padding: 8px;
}

.flow-edges-list span {
    font-size: 11px;
    background: rgba(97, 236, 157, 0.12);
    color: #b8f6d5;
    border: 1px solid rgba(97, 236, 157, 0.2);
    border-radius: 999px;
    padding: 4px 8px;
}

.flow-node {
    position: absolute;
    min-width: 160px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(13, 25, 20, 0.96);
    padding: 10px 12px;
    display: grid;
    gap: 3px;
    text-align: left;
    cursor: grab;
    color: #e7f2ec;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    padding-right: 24px;
    padding-left: 24px;
}

.flow-node strong {
    font-size: 13px;
    display: block;
    padding-left: 11px;
}

.flow-node small {
    color: var(--muted);
    font-size: 11px;
    display: block;
    padding-left: 11px;
}

.flow-node.selected {
    border-color: rgba(97, 236, 157, 0.75);
    box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.18), 0 8px 18px rgba(0, 0, 0, 0.24);
}

.flow-node-mini-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    font-size: 9px;
    padding: 2px 5px;
    color: #b8f6d5;
    background: rgba(99, 246, 167, 0.16);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.flow-mini-svg {
    width: 13px;
    height: 13px;
}

.flow-handle {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #1a2f25;
    border: 1px solid rgba(97, 236, 157, 0.6);
    transform: translateY(-50%);
}

.flow-handle.source {
    right: -7px;
}

.flow-handle.target {
    left: -7px;
}

.flow-handle.target.active,
.flow-handle.source.selected {
    background: #63f6a7;
    box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.18);
}

.flow-node-config {
    display: grid;
    gap: 10px;
}

.flow-config-fields {
    display: grid;
    gap: 10px;
}

.flow-config-title {
    display: grid;
    gap: 4px;
}

.flow-config-title small {
    color: var(--muted);
}

.flow-field {
    display: grid;
    gap: 6px;
}

.flow-field span {
    font-size: 12px;
    font-weight: 700;
}

.flow-remove-btn {
    margin-top: 8px;
}

.flow-connect-hint {
    position: sticky;
    top: 8px;
    left: 8px;
    display: inline-block;
    z-index: 2;
    margin: 8px;
    border: 1px solid rgba(97, 236, 157, 0.4);
    background: rgba(10, 20, 16, 0.95);
    color: #b8f6d5;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
}

.flow-vars-box {
    display: grid;
    gap: 8px;
}

.flow-vars-box > span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.flow-var-chip {
    border: 1px solid rgba(97, 236, 157, 0.28);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    color: #b8f6d5;
    background: rgba(61, 220, 132, 0.09);
    cursor: pointer;
}

.flow-var-chip:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.flow-msg-composer {
    display: grid;
    gap: 8px;
}

.flow-msg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.flow-format-btn {
    border: 1px solid var(--line);
    background: rgba(12, 24, 19, 0.95);
    color: #d8ede2;
    border-radius: 8px;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.flow-format-btn:hover {
    border-color: rgba(97, 236, 157, 0.5);
}

.flow-format-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.flow-format-italic {
    font-style: italic;
}

.flow-format-underline {
    text-decoration: underline;
}

.flow-emoji-wrap {
    position: relative;
}

.flow-emoji-btn {
    font-size: 17px;
    line-height: 1;
    padding-top: 1px;
}

.flow-emoji-picker {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    z-index: 12;
    border: 1px solid var(--line);
    background: rgba(8, 17, 14, 0.98);
    border-radius: 10px;
    padding: 8px;
    width: 220px;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.flow-emoji-picker.is-open {
    display: grid;
}

.flow-emoji-item {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.flow-emoji-item:hover {
    border-color: rgba(97, 236, 157, 0.55);
}

.flow-message-textarea {
    min-height: 130px;
}

.flow-ai-hint {
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(30, 64, 175, 0.18);
    color: #dbeafe;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
}

.flow-field-title {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.flow-rules-list {
    display: grid;
    gap: 10px;
}

.flow-rule-row {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(8, 17, 14, 0.9);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.flow-remove-rule-btn {
    justify-self: start;
}

.flow-page .sidebar {
    display: none;
}

.flow-page .main-content {
    width: 100%;
    padding: 18px 18px 14px;
}

.flow-editor-form {
    max-width: none;
}

.flow-canvas-card {
    min-height: calc(100vh - 160px);
}

.flow-page .flow-layout {
    min-height: calc(100vh - 260px);
    grid-template-columns: 250px minmax(0, 1fr) 340px;
}

.flow-page .flow-center {
    min-height: calc(100vh - 310px);
}

.campaign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.campaign-flow-cta {
    border: 1px solid var(--line);
    background: rgba(10, 20, 16, 0.9);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 12px;
}

.campaign-flow-card {
    gap: 18px;
}

.campaign-flow-header {
    align-items: center;
}

.campaign-flow-header > div {
    display: grid;
    gap: 6px;
}

.flow-icon-action {
    width: 44px;
    height: 44px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.flow-icon-action svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flow-icon-action:hover {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}

.flow-icon-action.is-disabled {
    background: var(--cloud);
    border-color: var(--steel);
    color: var(--graphite);
    cursor: not-allowed;
}

.campaign-flow-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: var(--cloud);
    border-radius: 16px;
    padding: 16px;
}

.campaign-flow-summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.campaign-flow-summary-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.campaign-flow-summary strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-weight: 600;
}

.campaign-flow-summary p {
    margin: 0;
}

@media (max-width: 1180px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-screens-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campanha-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .disparos-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .whatsapp-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .whatsapp-form-span-2 {
        grid-column: span 2;
    }

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

    .flow-page .flow-layout {
        min-height: 0;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 42px 24px 8px;
    }

    .login-panel {
        padding: 24px 16px 34px;
    }

    .app-body {
        display: block;
    }

    .sidebar {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 20px;
        overflow-x: auto;
    }

    .sidebar-logo {
        margin: 0;
        min-width: 54px;
    }

    .sidebar nav {
        display: flex;
        gap: 8px;
    }
}

@media (max-width: 620px) {
    .main-content {
        padding: 16px;
    }

    .cards-grid,
    .admin-cards-grid,
    .admin-screens-grid {
        grid-template-columns: 1fr;
    }

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

    .clients-toolbar-header,
    .extract-form {
        flex-direction: column;
        align-items: stretch;
    }

    .campanhas-top {
        flex-direction: column;
    }

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

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

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

    .whatsapp-form-span-2 {
        grid-column: span 1;
    }

    .campanha-grid-2,
    .campanha-grid-3,
    .campanha-grid-4 {
        grid-template-columns: 1fr;
    }

    .btn-inline {
        width: 100%;
    }

    .login-card {
        padding: 26px;
    }
}

/* Corporate HP-inspired theme overrides */
body,
.app-body,
.login-body {
    color: var(--ink);
    background: var(--canvas);
}

.login-body {
    background:
        linear-gradient(135deg, rgba(2, 74, 216, 0.05) 0 18%, transparent 18% 100%),
        linear-gradient(315deg, rgba(2, 74, 216, 0.05) 0 14%, transparent 14% 100%),
        var(--canvas);
}

.login-layout {
    background: var(--canvas);
}

.login-hero {
    background: var(--cloud);
    position: relative;
    overflow: hidden;
}

.login-hero::before,
.login-hero::after {
    content: '';
    position: absolute;
    width: 84px;
    height: 320px;
    background: var(--primary);
    transform: skewX(-28deg);
    opacity: 0.95;
}

.login-hero::before {
    left: -48px;
    top: 88px;
}

.login-hero::after {
    right: -58px;
    bottom: 72px;
}

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

.hero-badge {
    border: 1px solid var(--primary);
    background: var(--canvas);
    color: var(--primary);
    border-radius: 8px;
    letter-spacing: 0.07em;
}

.login-hero h1,
.topbar h1,
.panel-header h2,
.clients-toolbar-header h2,
.campanhas-top h2,
.brand-box h2,
.import-loading-card h3,
.app-modal-header h3,
.metric-card strong {
    color: var(--ink);
    font-family: var(--font-head);
    font-weight: 500;
    letter-spacing: 0;
}

.login-hero p,
.brand-box p,
.panel-header span,
.clients-toolbar-header span,
.campanhas-top p,
.text-muted,
.metric-card span,
.screen-link-card p,
.import-loading-card small,
.flow-config-title small,
.flow-node small,
.flow-vars-box > span,
.flow-field-title {
    color: var(--graphite);
}

.hero-points li {
    color: var(--charcoal);
}

.hero-points li::before {
    border-radius: 2px;
    background: var(--primary);
    box-shadow: none;
}

.login-panel,
.main-content {
    background: var(--canvas);
}

.login-card,
.metric-card,
.panel-card,
.screen-link-card,
.app-modal,
.import-loading-card,
.flow-left,
.flow-right,
.flow-center,
.flow-node,
.flow-rule-row,
.message-preview-card,
.campaign-flow-cta,
.flow-emoji-picker {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: var(--ink);
    backdrop-filter: none;
}

.login-card {
    border-radius: 16px;
    padding: 32px;
}

.brand-icon,
.sidebar-logo {
    border-radius: 16px;
    background: var(--ink);
    color: var(--on-ink);
    box-shadow: none;
}

.login-form label,
.campanha-field label,
.iniciar-disparo-form label,
.merge-options label,
.flow-field span {
    color: var(--ink);
    font-weight: 600;
}

.login-form input,
.input-text,
.extract-form input[type="file"],
.textarea-input {
    min-height: 44px;
    border: 1px solid var(--steel);
    background: var(--canvas);
    color: var(--ink);
    border-radius: 4px;
    box-shadow: none;
}

.login-form input:focus,
.input-text:focus,
.textarea-input:focus {
    border-color: var(--ink);
    box-shadow: none;
}

.password-field button,
.btn-action,
.flow-format-btn,
.flow-add-btn {
    border: 1px solid var(--primary);
    background: var(--canvas);
    color: var(--primary);
    border-radius: 4px;
    box-shadow: none;
}

.btn-primary {
    min-height: 44px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 12px 24px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow: none;
}

.btn-primary:hover,
.screen-link-card:hover,
.btn-action:hover,
.flow-add-btn:hover,
.flow-format-btn:hover {
    transform: none;
    border-color: var(--primary-deep);
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-deep);
}

.btn-danger,
.btn-action-danger {
    border: 1px solid var(--danger);
    background: var(--canvas);
    color: var(--danger);
    border-radius: 4px;
}

.btn-danger:hover {
    background: var(--bloom-rose);
}

.app-body {
    display: flex;
    min-height: 100vh;
    background: var(--canvas);
}

.sidebar {
    background: var(--ink);
    border-right: 1px solid var(--ink);
    box-shadow: none;
    backdrop-filter: none;
}

.sidebar a {
    color: rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    font-weight: 500;
}

.sidebar a.active,
.sidebar a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.topbar {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.user-box {
    background: var(--cloud);
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
}

.user-box a,
.screen-link-card span,
a.btn-action,
.button-text-link {
    color: var(--primary);
}

.cards-grid {
    gap: 24px;
}

.metric-card,
.panel-card {
    border-radius: 16px;
    padding: 24px;
}

.metric-card strong {
    font-size: 32px;
    line-height: 1;
}

.panel-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.extract-form,
.merge-options,
.lote-active-box,
.empty-state,
.weekday-pill,
.flow-connect-hint,
.flow-edges-list span,
.variables-row span,
.flow-var-chip,
.flow-ai-hint {
    background: var(--cloud);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 8px;
}

.lote-active-box strong,
.extract-summary,
.variables-row span,
.flow-var-chip {
    color: var(--primary);
}

.alert-success {
    background: var(--primary-soft);
    color: var(--primary-deep);
    border: 1px solid var(--primary);
    border-radius: 8px;
}

.alert-error {
    background: var(--bloom-rose);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
}

.table-responsive {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: auto;
}

table {
    background: var(--canvas);
}

th {
    background: var(--cloud);
    color: var(--charcoal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

td {
    color: var(--ink);
}

th,
td {
    border-bottom: 1px solid var(--line);
}

tr:last-child td {
    border-bottom: 0;
}

.status-pill {
    border: 1px solid var(--steel);
    background: var(--cloud);
    color: var(--charcoal);
    border-radius: 8px;
    font-weight: 600;
}

.status-pill.status-active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-deep);
}

.status-pill.status-paused {
    background: #fff7d6;
    border-color: #d39b00;
    color: #7a5200;
}

.status-pill.status-draft {
    background: var(--cloud);
    color: var(--graphite);
}

.status-pill.status-running {
    background: var(--primary-soft);
    border-color: var(--primary-bright);
    color: var(--primary);
}

.app-modal-overlay,
.import-loading-overlay {
    background: rgba(26, 26, 26, 0.42);
}

.app-modal {
    box-shadow: var(--shadow-floating);
}

.app-modal-close {
    border: 1px solid var(--steel);
    background: var(--canvas);
    color: var(--ink);
    border-radius: 4px;
}

.import-progress-track {
    background: var(--fog);
}

.import-progress-bar {
    background: var(--primary);
}

.flow-canvas {
    background:
        linear-gradient(var(--cloud) 31px, var(--line) 32px),
        linear-gradient(90deg, var(--cloud) 31px, var(--line) 32px);
    background-size: 32px 32px;
    border: 1px dashed var(--steel);
}

.flow-edge-path {
    stroke: var(--primary);
}

.flow-edge-remove {
    fill: var(--danger);
}

.flow-node {
    box-shadow: var(--shadow);
}

.flow-node.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}

.flow-node-mini-icon,
.flow-node-icon {
    border-color: var(--line);
    background: var(--cloud);
    color: var(--primary);
    border-radius: 8px;
}

.flow-handle {
    background: var(--canvas);
    border: 1px solid var(--primary);
}

.flow-handle.target.active,
.flow-handle.source.selected {
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.flow-emoji-item {
    background: var(--cloud);
    border-radius: 4px;
}

.flow-emoji-item:hover {
    border-color: var(--primary);
}

.flow-page .main-content {
    background: var(--canvas);
}

@media (max-width: 980px) {
    .sidebar {
        background: var(--ink);
    }
}
