:root {
    --primary: #2dd4bf;
    --secondary: #0b5674;
    --accent: #5eead4;
    --header-bg: #091627;
    --header-color: #f8fafc;
    --breadcrumbs-bg: #10243a;
    --breadcrumbs-fg: #cbd5e1;
    --body-bg: #07111f;
    --body-fg: #e5edf6;
    --body-quiet-color: #9fb0c3;
    --darkened-bg: #0c1b2d;
    --selected-bg: #17304a;
    --selected-row: #13263d;
    --hairline-color: #29435e;
    --border-color: #29435e;
    --link-fg: #67e8f9;
    --link-hover-color: #99f6e4;
}

html, body { background: var(--body-bg); }
#header {
    min-height: 72px;
    padding: 8px 24px;
    background: linear-gradient(100deg, #091627 0%, #10243a 68%, #0b3441 100%);
    border-top: 4px solid #6a3d43;
    border-bottom: 1px solid #29435e;
}
#branding { min-width: 190px; }
#user-tools { font-size: 11px; }
.af-admin-shortcuts {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    margin-right: 22px;
}
.af-admin-shortcuts a {
    padding: 8px 11px;
    color: #dce9f5 !important;
    background: #13263d;
    border: 1px solid #29435e;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.af-admin-shortcuts a:hover { color: #05201d !important; background: #2dd4bf; }
div.breadcrumbs { padding: 11px 30px; border-bottom: 1px solid #29435e; }
#content { padding: 28px 34px; }
#content h1 { margin-bottom: 24px; color: #f8fafc; font-size: 24px; font-weight: 750; }
#nav-sidebar {
    flex: 0 0 290px;
    background: #091627;
    border-right: 1px solid #29435e;
}
#nav-sidebar .module { margin-bottom: 10px; }
#nav-sidebar .module caption {
    padding: 11px 14px;
    color: #dffdfa;
    background: #0b5674;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
}
#nav-sidebar .module th,
#nav-sidebar .module td { padding: 9px 12px; border-bottom-color: #21364f; }
#nav-sidebar .current-model { background: #17304a; border-left: 3px solid #2dd4bf; }
.module, .inline-group {
    overflow: hidden;
    background: #0d1b2d;
    border: 1px solid #29435e;
    border-radius: 10px;
}
.module h2, .inline-group h2 {
    padding: 12px 15px;
    color: #eafffb;
    background: #0b5674;
    font-size: 12px;
    font-weight: 800;
}
.form-row { padding: 15px 12px; border-bottom-color: #21364f; }
.form-row > div { max-width: 1050px; }
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], textarea, select {
    min-height: 38px;
    color: #eef6ff;
    background: #101f34;
    border: 1px solid #355371;
    border-radius: 7px;
}
input:focus, textarea:focus, select:focus { border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45,212,191,.15); }
.submit-row {
    padding: 12px;
    background: #0d1b2d;
    border: 1px solid #29435e;
    border-radius: 10px;
}
.button, input[type=submit], input[type=button], .submit-row input {
    min-height: 36px;
    padding: 8px 13px;
    background: #0b7890;
    border-radius: 7px;
}
.button.default, input[type=submit].default { color: #03201c; background: #2dd4bf; font-weight: 800; }
#changelist-filter { background: #0d1b2d; border-left-color: #29435e; }
#changelist-filter h2 { background: #0b5674; }
#changelist .results { border: 1px solid #29435e; border-radius: 9px; overflow: auto; }
#changelist table thead th { padding: 11px 9px; background: #13263d; }
#changelist table tbody tr:hover { background: #17283f; }
.olMap { border: 1px solid #355371 !important; border-radius: 9px; overflow: hidden; }
.af-location-panel {
    padding: 14px;
    margin: 4px 0 14px;
    background: #10243a;
    border: 1px solid #2f5873;
    border-left: 4px solid #2dd4bf;
    border-radius: 9px;
}
.af-location-panel strong, .af-location-panel small, .af-location-panel output { display: block; }
.af-location-panel strong { margin-bottom: 9px; color: #eafffb; }
.af-location-panel small { margin-top: 8px; color: #9fb0c3; }
.af-location-row { display: flex; align-items: center; gap: 8px; }
.af-location-row .af-address-search { flex: 1; min-width: 260px; }
.af-location-feedback { margin-top: 8px; color: #99f6e4; font-size: 12px; }
.af-location-feedback.error { color: #fda4af; }
.dashboard #nav-sidebar, .dashboard #toggle-nav-sidebar { display: none !important; }
.dashboard #content { width: min(1280px, calc(100% - 64px)); }
.dashboard #content-main { float: none; width: 100%; }
.af-control-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.af-control-head h1 { margin: 3px 0 6px !important; font-size: 30px !important; }
.af-control-head p { margin: 0; color: #9fb0c3; }
.af-eyebrow { color: #5eead4 !important; font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.af-control-actions { display: flex; gap: 9px; }
.af-admin-search { display: flex; align-items: center; gap: 10px; max-width: 820px; margin: 0 auto 22px; padding: 5px 7px 5px 15px; background: #10243a; border: 1px solid #355371; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.af-admin-search span { color: #5eead4; font-size: 22px; }
.af-admin-search input { width: 100%; border: 0; background: transparent; box-shadow: none; font-size: 14px; }
.af-control-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 16px; }
.af-control-card { position: relative; padding: 20px; background: linear-gradient(145deg, #0d1b2d, #10243a); border: 1px solid #29435e; border-radius: 14px; }
.af-control-card h2 { margin: 0 0 7px; color: #f8fafc; font-size: 17px; }
.af-control-card > p { min-height: 38px; margin: 0 0 16px; color: #9fb0c3; }
.af-card-icon { position: absolute; top: 17px; right: 19px; color: #2dd4bf; font-size: 25px; }
.af-card-toggle { width: 100%; padding: 10px 12px; color: #dce9f5; background: #091627; border: 1px solid #29435e; border-radius: 8px; text-align: left; cursor: pointer; }
.af-card-toggle span { float: right; }
.af-control-card.open { border-color: #2b8f8b; }
.af-control-card nav { display: grid; gap: 6px; }
.af-control-card nav[hidden] { display: none !important; }
.af-control-card nav:not([hidden]) { margin-top: 8px; }
.af-control-card nav a { display: flex; justify-content: space-between; padding: 10px 12px; color: #dce9f5; background: #091627; border: 1px solid #21364f; border-radius: 8px; text-decoration: none; }
.af-control-card nav a:hover { color: #06211e; background: #2dd4bf; }
.af-advanced { margin-top: 18px; padding: 15px 18px; background: #0a1727; border: 1px solid #29435e; border-radius: 12px; }
.af-advanced summary { cursor: pointer; color: #cbd5e1; font-weight: 750; }
.af-advanced > p { color: #9fb0c3; }
.af-app-list .module { margin-bottom: 12px; }
.af-recent { position: relative; z-index: 40; }
.af-recent > summary { display: flex; align-items: center; gap: 8px; padding: 9px 13px; color: #dce9f5; background: #13263d; border: 1px solid #355371; border-radius: 9px; cursor: pointer; list-style: none; }
.af-recent > summary span { color: #5eead4; font-size: 20px; }
.af-recent-popover { position: absolute; top: 48px; right: 0; width: 310px; max-height: 70vh; overflow: auto; padding: 18px; background: #0d1b2d; border: 1px solid #29435e; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.af-recent h2 { margin: 0 0 12px; color: #f8fafc; }
.af-recent a { display: block; padding: 9px 0; color: #dce9f5; border-bottom: 1px solid #21364f; text-decoration: none; }
.af-recent small { display: block; margin-top: 3px; color: #8194aa; }
.deletelink, .deletelink-box a { background: #b42342 !important; border-radius: 7px !important; }
.af-platform-login {
    --login-accent: #e5484d;
    --login-accent-dark: #c93a3e;
    --login-accent-soft: rgba(229, 72, 77, .12);
    position: relative;
    display: grid; min-height: 100vh; place-items: center; margin: 0; padding: 24px; box-sizing: border-box;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: #03050a;
    overflow: hidden;
}
/* Mesmo fundo animado da tela de carregamento pós-login
   (templates/loading.html) — repetido aqui (não compartilhado por CSS)
   de propósito, pra cada tela poder evoluir sozinha depois; o objetivo é
   só a troca de página não "quebrar" visualmente. */
.af-platform-login::before {
    content: ""; position: fixed; inset: 0;
    background-image: radial-gradient(#16203a 1.5px, transparent 1.5px);
    background-size: 35px 35px;
    z-index: 0;
    animation: afLoginPulseDots 4s ease-in-out infinite alternate;
}
.af-platform-login::after {
    content: ""; position: fixed; top: -50%; left: -50%; width: 200vw; height: 200vh;
    background-image: radial-gradient(rgba(6, 182, 212, .25) 2px, transparent 2px);
    background-size: 80px 80px;
    z-index: 0;
    animation: afLoginStreamLights 20s linear infinite;
}
@keyframes afLoginPulseDots { 0% { opacity: .2; } 100% { opacity: .7; } }
@keyframes afLoginStreamLights { 0% { transform: translate(0, 0); } 100% { transform: translate(80px, 80px); } }
/* Um único fundo contínuo pro cartão inteiro -- de propósito, sem uma
   segunda cor/gradiente no painel dos planos, pra não formar a "linha"
   separando login e planos que o Adrian pediu pra tirar. */
.af-login-card { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.28fr; width: min(1140px, 100%); min-height: 560px; overflow: hidden; background: linear-gradient(155deg, #1b1d22, #0b0c0f 70%); border-radius: 24px; box-shadow: 0 40px 110px rgba(0,0,0,.5); }
.af-login-card-single { grid-template-columns: 1fr; width: min(460px, 100%); min-height: 0; }
.af-login-form-panel { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 56px 44px; color: #f1f5f9; text-align: center; }
.af-login-mark { width: 168px; margin-bottom: 24px; object-fit: contain; }
.af-login-form-panel h1 { margin: 0 0 6px; color: #f8fafc; font-family: inherit; font-size: 26px; font-weight: 800; }
.af-login-form-panel > p.af-login-lede { margin: 0 0 24px; color: #9aa5b1; font-size: 14px; }
.af-login-error { width: 100%; box-sizing: border-box; margin-bottom: 16px; padding: 11px 14px; color: #fca5a5; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); border-radius: 10px; font-size: 13px; }
.af-field-error { margin-top: 8px; padding: 9px 12px; color: #fca5a5; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); border-radius: 9px; font-size: 12px; line-height: 1.5; }
.af-login-form-panel form { display: grid; width: 100%; gap: 16px; text-align: left; }
.af-login-form-panel label { display: block; margin-bottom: 6px; color: #cbd5e1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.af-input-icon { position: relative; }
.af-input-icon svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; color: #7c8794; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: translateY(-50%); pointer-events: none; }
.af-input-icon input { width: 100%; box-sizing: border-box; padding: 13px 14px 13px 42px; color: #f1f5f9; background: #1a1c20; border: 1px solid #33363c; border-radius: 11px; font-size: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.af-input-icon input:focus { outline: none; border-color: var(--login-accent); background: #202226; box-shadow: 0 0 0 3px var(--login-accent-soft); }
.af-login-form-panel button { margin-top: 8px; padding: 14px; color: #fff; background: var(--login-accent); border: 0; border-radius: 11px; font-size: 14px; font-weight: 800; cursor: pointer; transition: background .15s ease; }
.af-login-form-panel button:hover { background: var(--login-accent-dark); }
.af-login-switch { margin: 18px 0 0; color: #8994a3; font-size: 12.5px; }
.af-login-switch a { color: #5eead4; font-weight: 700; text-decoration: none; }
.af-login-switch a:hover { text-decoration: underline; }

/* ---- Painel de planos (login + cadastro) ---- */
.af-plans-panel { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 14px; overflow: hidden; padding: 48px 44px; color: #f8fafc; }
.af-plans-panel::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 260px; height: 260px; background: var(--login-accent); border-radius: 50%; opacity: .08; pointer-events: none; }
.af-plans-eyebrow { color: #5eead4; font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.af-plans-panel h2 { max-width: 360px; margin: 6px 0 18px; color: #f8fafc; font-size: 24px; line-height: 1.15; }
.af-plan-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.af-plan-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 15px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; }
.af-plan-card.is-trial { background: linear-gradient(160deg, var(--login-accent-soft), rgba(94,234,212,.07)); border-color: rgba(229,72,77,.35); }
.af-plan-tag { align-self: flex-start; padding: 2px 8px; color: #5eead4; background: rgba(94,234,212,.12); border-radius: 999px; font-size: 9.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.af-plan-name { color: #f1f5f9; font-size: 13.5px; font-weight: 800; }
.af-plan-price { color: #f8fafc; font-size: 19px; font-weight: 850; }
.af-plan-price small { color: #9aa5b1; font-size: 11px; font-weight: 600; }
.af-plan-specs { margin: 0; padding: 0; list-style: none; color: #aeb8c4; font-size: 11.5px; line-height: 1.7; }
.af-plan-specs li { display: flex; align-items: center; gap: 6px; }
.af-plan-specs li::before { content: ""; width: 4px; height: 4px; flex-shrink: 0; background: #5eead4; border-radius: 50%; }
.af-plan-features { margin: 8px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px dashed rgba(255,255,255,.1); color: #8994a3; font-size: 10.5px; line-height: 1.6; }
.af-plan-features li { display: flex; align-items: center; gap: 6px; }
.af-plan-features li::before { content: "✓"; color: var(--login-accent); font-weight: 800; flex-shrink: 0; }
.af-plan-features-more { color: #6c7681 !important; font-style: italic; }
.af-plan-features-more::before { content: "" !important; }
.af-plan-features-toggle { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: #5eead4; font-size: 10.5px; font-weight: 700; cursor: pointer; text-align: left; }
.af-plan-features-toggle:hover { text-decoration: underline; }

/* Modal "ver todos os recursos" -- deixa o cliente conferir tudo que o
   plano inclui antes de decidir contratar, sem lotar o cartão pequeno. */
.af-features-overlay { display: none; position: fixed; inset: 0; z-index: 300; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 10, .6); backdrop-filter: blur(3px); }
.af-features-overlay.is-open { display: flex; }
.af-features-modal { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 380px; max-height: min(80vh, 560px); padding: 26px 24px 24px; background: #14161b; border: 1px solid #2a2d33; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.af-features-modal h3 { flex-shrink: 0; margin: 0 0 14px; color: #f8fafc; font-size: 17px; }
.af-features-modal-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,.06); color: #9aa5b1; font-size: 18px; line-height: 1; cursor: pointer; }
.af-features-modal-close:hover { background: rgba(255,255,255,.12); color: #f1f5f9; }
.af-features-modal-list { margin: 0; padding: 0 10px 0 0; list-style: none; display: grid; gap: 9px; align-content: start; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--login-accent) transparent; }
.af-features-modal-list li { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 13px; }
.af-features-modal-list li::before { content: "✓"; color: var(--login-accent); font-weight: 800; flex-shrink: 0; }
.af-features-modal-list::-webkit-scrollbar { width: 7px; }
.af-features-modal-list::-webkit-scrollbar-track { background: transparent; }
.af-features-modal-list::-webkit-scrollbar-thumb { background: var(--login-accent); border-radius: 999px; }
.af-features-modal-list::-webkit-scrollbar-thumb:hover { background: var(--login-accent-dark); }
.af-plans-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 14px 18px; color: #fff; background: var(--login-accent); border-radius: 11px; font-size: 14px; font-weight: 800; text-align: center; text-decoration: none; transition: background .15s ease; }
.af-plans-cta:hover { background: var(--login-accent-dark); }
.af-plans-note { margin: 8px 0 0; color: #7c8794; font-size: 11px; text-align: center; }

@media (max-width: 900px) {
    .af-login-card { grid-template-columns: 1fr; min-height: 0; }
    .af-plans-panel { padding: 30px 28px 34px; }
    .af-plans-panel h2 { font-size: 20px; }
    .af-plan-grid { grid-template-columns: 1fr 1fr; }
    .af-login-form-panel { padding: 34px 28px; }
}
@media (max-width: 520px) {
    .af-plan-grid { grid-template-columns: 1fr; }
    .af-plan-card.is-trial { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 1100px) {
    .af-admin-shortcuts { display: none; }
    #content { padding: 20px 18px; }
    .af-location-row { align-items: stretch; flex-direction: column; }
    .dashboard #content { width: auto; }
    .af-recent { top: 14px; right: 14px; }
    .af-recent > summary b { display: none; }
    .af-control-grid { grid-template-columns: 1fr; }
}
