/* RemoteControl PRO — UI v2 (roxo · azul · branco) */
:root {
    --bg: #0b0e14;
    --bg-elev: #121722;
    --bg-card: #161b26;
    --border: #252d3d;
    --text: #f8fafc;
    --muted: #94a3b8;
    --purple: #8b5cf6;
    --purple-dim: #7c3aed;
    --blue: #3b82f6;
    --blue-dim: #2563eb;
    --white: #ffffff;
    --green: #22c55e;
    --amber: #f59e0b;
    --error: #f87171;
    --radius: 12px;
    --radius-sm: 8px;
    /* Sombras suaves (profundidade sem contorno) */
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.38), 0 2px 10px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.28),
        0 12px 40px rgba(139, 92, 246, 0.08);
    --shadow-chrome: 0 2px 14px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.18);
    --shadow-sidebar-edge: 8px 0 32px rgba(0, 0, 0, 0.42);
    --shadow-topbar: 0 6px 28px rgba(0, 0, 0, 0.28);
    --glow-purple: 0 0 24px rgba(139, 92, 246, 0.35);
    --glow-blue: 0 0 24px rgba(59, 130, 246, 0.35);
    --font: "Inter", system-ui, -apple-system, sans-serif;
    --sidebar-w: 272px;
    --space-section: 1.25rem;
    --space-card-pad: 1.25rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background:
        radial-gradient(ellipse 55% 48% at 0% 0%, rgba(139, 92, 246, 0.1), transparent 58%),
        radial-gradient(ellipse 50% 42% at 100% 0%, rgba(59, 130, 246, 0.09), transparent 55%),
        radial-gradient(ellipse 45% 40% at 0% 100%, rgba(139, 92, 246, 0.06), transparent 52%),
        radial-gradient(ellipse 42% 38% at 100% 100%, rgba(59, 130, 246, 0.07), transparent 50%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #080b11 0%, #0b0e14 45%, #0d1118 100%);
    border-right: none;
    box-shadow: var(--shadow-sidebar-edge);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 !important;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 20;
    transition: transform 0.22s ease;
    overflow: hidden;
    height: auto;
    min-height: 0;
    max-height: none;
}

/* Topo lateral: logomarca (compacto, separado do menu) */
.sidebar-header {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.65rem 0.75rem 0;
    margin: 0 0 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: visible;
    box-sizing: border-box;
    border-bottom: none;
    position: relative;
    z-index: 1;
}

.sidebar-header .sidebar-logo-img {
    max-width: 140px;
    width: auto;
    height: auto;
    max-height: 46px;
    margin: 0 auto;
    padding: 0;
    display: block;
    object-fit: contain;
    object-position: center center;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}

.sidebar-header .sidebar-brand-wordmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 140px;
    max-height: 46px;
    margin: 0 auto;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(59, 130, 246, 0.28) 100%);
    color: #f1f5f9;
    font-weight: 800;
    font-size: 0.72rem;
    line-height: 1.15;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

/* Login / legado */
.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
    color: var(--white);
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: var(--glow-purple);
}

img.app-global-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-nav,
.sidebar-menu,
.sidebar-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0;
    padding: 0 0.6rem 0.35rem !important;
    padding-top: 0 !important;
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.35) transparent;
    align-self: stretch;
}

.sidebar-menu ul,
.sidebar-nav ul {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    list-style: none;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.35);
    border-radius: 999px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.48rem 0.75rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
    border: none;
    min-height: 2.45rem;
    box-sizing: border-box;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.18s ease;
}

.nav-link .nav-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.92;
}

.nav-link .nav-ico .nav-lucide {
    width: 20px;
    height: 20px;
    display: block;
}

.nav-label {
    flex: 1;
    min-width: 0;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(139, 92, 246, 0.12);
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, 0.12),
        0 4px 22px rgba(139, 92, 246, 0.12),
        0 2px 12px rgba(0, 0, 0, 0.18);
    transform: translateX(1px);
}

.nav-link:hover .nav-ico {
    opacity: 1;
    color: #c4b5fd;
}

.nav-link.is-active {
    color: #f8fafc;
    font-weight: 600;
    background: linear-gradient(92deg, rgba(139, 92, 246, 0.42) 0%, rgba(59, 130, 246, 0.22) 52%, rgba(15, 23, 42, 0.15) 100%);
    box-shadow:
        inset 4px 0 0 #a78bfa,
        0 0 24px rgba(139, 92, 246, 0.28),
        0 4px 18px rgba(139, 92, 246, 0.18);
}

.nav-link.is-active .nav-ico {
    opacity: 1;
    color: var(--white);
}

.nav-link--hot:not(.is-active) {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.14);
}

.nav-link--hot:not(.is-active):hover {
    box-shadow:
        inset 0 0 0 1px rgba(251, 191, 36, 0.28),
        0 4px 22px rgba(139, 92, 246, 0.12);
}

/* ——— Topbar: menu do usuário ——— */
.topbar-user {
    position: relative;
    flex-shrink: 0;
    z-index: 2;
}

.topbar-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: min(220px, 42vw);
    padding: 0.28rem 0.45rem 0.28rem 0.35rem;
    margin: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(22, 27, 38, 0.88);
    box-shadow: var(--shadow-chrome);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.topbar-user-trigger:hover {
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: var(--shadow-chrome), 0 0 18px rgba(139, 92, 246, 0.12);
}

.topbar-user.is-open .topbar-user-trigger {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: var(--shadow-chrome), var(--glow-purple);
}

.topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white);
    font-weight: 700;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.topbar-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.06rem;
    min-width: 0;
    text-align: left;
}

.topbar-user-name {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.15;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-role {
    font-size: 0.68rem;
    line-height: 1.1;
    color: var(--muted);
    font-weight: 500;
}

.topbar-user-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.topbar-user.is-open .topbar-user-chevron {
    transform: rotate(180deg);
    color: var(--text);
}

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 11.5rem;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, rgba(11, 14, 20, 0.98) 100%);
    border: 1px solid rgba(139, 92, 246, 0.22);
    box-shadow: var(--shadow-card), 0 12px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
}

.topbar-user-dropdown--compact {
    min-width: 9.25rem;
    padding: 0.28rem;
    border-radius: 10px;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.topbar-user-dropdown[hidden] {
    display: none !important;
}

.topbar-user-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.52rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.topbar-user-dropdown--compact .topbar-user-item {
    padding: 0.42rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 7px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

a.topbar-user-item:hover,
button.topbar-user-item:hover {
    background: rgba(139, 92, 246, 0.12);
    color: var(--white);
}

.topbar-user-item--danger {
    color: var(--muted);
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    margin-top: 0.2rem;
    padding-top: 0.62rem;
    border-radius: 0 0 8px 8px;
}

.topbar-user-dropdown--compact .topbar-user-item--danger {
    margin-top: 0.12rem;
    padding-top: 0.48rem;
    border-radius: 0 0 7px 7px;
}

.topbar-user-item--danger:hover {
    color: #fecaca !important;
    background: rgba(127, 29, 29, 0.45) !important;
}

.topbar-user-logout-form {
    margin: 0;
    padding: 0;
}

/* ——— Main layout ——— */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(ellipse 78% 52% at 50% -18%, rgba(139, 92, 246, 0.13), transparent 52%),
        radial-gradient(ellipse 58% 42% at 100% 0%, rgba(59, 130, 246, 0.11), transparent 48%),
        radial-gradient(ellipse 48% 40% at 0% 85%, rgba(139, 92, 246, 0.06), transparent 55%),
        radial-gradient(ellipse 44% 36% at 100% 92%, rgba(59, 130, 246, 0.07), transparent 52%),
        var(--bg);
}

.main-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    flex-wrap: nowrap;
    min-height: 3.25rem;
    padding: 0.5rem 1.15rem;
    background: rgba(11, 14, 20, 0.78);
    border-bottom: none;
    box-shadow: var(--shadow-topbar);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 15;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-greet {
    min-width: 0;
}

.topbar-title {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-title .wave {
    display: inline-block;
}

.topbar-sub {
    margin: 0.08rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.3;
}

.topbar-expiry {
    margin: 0.35rem 0 0;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    padding: 0.38rem 0.72rem;
    border-radius: var(--radius-sm);
    background: rgba(22, 27, 38, 0.58);
    box-shadow: var(--shadow-chrome);
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 100%;
}

.topbar-expiry-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.66rem;
    color: var(--muted);
}

.topbar-expiry-value {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.topbar-expiry--soon .topbar-expiry-value {
    color: var(--amber);
}

.topbar-expiry--past .topbar-expiry-value {
    color: var(--error);
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(100%, 420px);
}

.topbar-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 140px;
    min-width: 0;
    max-width: 200px;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: none;
    background: rgba(22, 27, 38, 0.88);
    box-shadow: var(--shadow-chrome);
}

.topbar-search-ico {
    display: flex;
    color: var(--muted);
}

.topbar-search {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

.topbar-search::placeholder {
    color: var(--muted);
}

:where(
    a,
    button,
    input,
    select,
    textarea,
    [role="button"],
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.9);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.topbar-notify {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(22, 27, 38, 0.88);
    box-shadow: var(--shadow-chrome);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, box-shadow 0.15s;
}

.topbar-notify:hover {
    color: var(--text);
    box-shadow: var(--shadow-chrome), var(--glow-purple);
}

.topbar-notify-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(22, 27, 38, 0.88);
    box-shadow: var(--shadow-chrome);
    color: var(--text);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.main-content {
    padding: 1.65rem 1.6rem 1.75rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.35rem 1.6rem 1.5rem;
    margin-top: 0.5rem;
    border-top: none;
    color: var(--muted);
    font-size: 0.78rem;
}

.app-footer-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-footer-ver {
    opacity: 0.85;
}

.app-footer-pro {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white);
}

/* ——— Page ——— */
.page-head {
    margin-bottom: 1.5rem;
}

/* Automação WhatsApp — cabeçalho compacto após remoção do card de estado Evolution */
.automacao-wa-page-head {
    margin-bottom: 1rem;
}

.automacao-wa-vars-hint {
    margin-bottom: 1rem;
}

.automacao-wa-vars-text {
    margin: 0;
    line-height: 1.5;
}

.automacao-wa-form-card {
    padding: 1.25rem 1.35rem;
}

.automacao-wa-scenarios {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.automacao-wa-scenario {
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    background: linear-gradient(145deg, rgba(15, 12, 28, 0.55), rgba(8, 10, 22, 0.35));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.automacao-wa-scenario-title {
    margin: 0 0 0.5rem;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--white);
}

.automacao-wa-scenario-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.automacao-wa-field--time {
    flex: 0 0 auto;
    min-width: 140px;
    margin: 0;
}

.automacao-wa-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.automacao-wa-time-input {
    width: 100%;
    max-width: 9.5rem;
}

.automacao-wa-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    flex: 1 1 280px;
}

.automacao-wa-check {
    margin: 0;
}

.automacao-wa-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

.automacao-wa-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--purple);
}

/* Dias após vencimento — chips compactos (uma linha no desktop) */
.automacao-wa-dias-retorno {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.automacao-wa-dias-retorno-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
}

.automacao-wa-dias-retorno-title {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
    padding-right: 0.15rem;
}

.automacao-wa-dias-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
}

.automacao-wa-dia-chip {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.automacao-wa-dia-chip-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.automacao-wa-dia-chip-face {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    color: rgba(226, 232, 240, 0.88);
    background: rgba(15, 18, 32, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.automacao-wa-dia-chip-mark {
    display: inline-block;
    width: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 0.75rem;
    font-weight: 700;
    transition: width 0.12s ease, opacity 0.12s ease, margin 0.12s ease;
}

.automacao-wa-dia-chip-input:checked + .automacao-wa-dia-chip-face,
.automacao-wa-dia-chip:has(.automacao-wa-dia-chip-input:checked) .automacao-wa-dia-chip-face {
    color: #fff;
    background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
    border-color: rgba(196, 181, 253, 0.75);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, var(--glow-purple);
}

.automacao-wa-dia-chip-input:checked + .automacao-wa-dia-chip-face .automacao-wa-dia-chip-mark,
.automacao-wa-dia-chip:has(.automacao-wa-dia-chip-input:checked) .automacao-wa-dia-chip-mark {
    width: 0.85em;
    opacity: 1;
    margin-right: 0.05rem;
}

.automacao-wa-dia-chip:hover .automacao-wa-dia-chip-face {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(30, 27, 55, 0.9);
}

.automacao-wa-dia-chip-input:checked:hover + .automacao-wa-dia-chip-face,
.automacao-wa-dia-chip:has(.automacao-wa-dia-chip-input:checked):hover .automacao-wa-dia-chip-face {
    background: linear-gradient(135deg, #9d6ff7 0%, #4f8fe8 100%);
}

.automacao-wa-dia-chip:focus-within .automacao-wa-dia-chip-face {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 2px;
}

.automacao-wa-dia-chip--custom {
    flex: 0 0 auto;
    cursor: default;
}

.automacao-wa-dia-chip-face--custom {
    gap: 0.35rem;
    padding: 0.28rem 0.55rem 0.28rem 0.65rem;
    cursor: text;
}

.automacao-wa-dia-chip--custom.is-filled .automacao-wa-dia-chip-face--custom,
.automacao-wa-dia-chip--custom:focus-within .automacao-wa-dia-chip-face--custom {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(22, 20, 42, 0.95);
}

.automacao-wa-dia-chip-custom-label,
.automacao-wa-dia-chip-custom-suffix {
    font-size: 0.82rem;
    color: rgba(203, 213, 225, 0.85);
    white-space: nowrap;
}

.automacao-wa-dia-chip-custom-input {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 3.25rem;
    margin: 0;
    padding: 0.15rem 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    color: var(--white);
    background: rgba(8, 10, 18, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 6px;
}

.automacao-wa-dia-chip-custom-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.automacao-wa-dias-retorno-hint {
    margin: 0.35rem 0 0;
    line-height: 1.35;
    font-size: 0.75rem;
    opacity: 0.85;
}

@media (max-width: 900px) {
    .automacao-wa-dias-retorno-row {
        gap: 0.45rem 0.4rem;
    }

    .automacao-wa-dias-retorno-title {
        flex: 1 1 100%;
        margin-bottom: 0.1rem;
    }
}

@media (max-width: 640px) {
    .automacao-wa-dias-chips {
        gap: 0.3rem;
    }

    .automacao-wa-dia-chip-face {
        padding: 0.3rem 0.55rem;
        font-size: 0.8rem;
    }

    .automacao-wa-dia-chip--custom {
        flex: 1 1 100%;
    }

    .automacao-wa-dia-chip-face--custom {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===== PWA: UI de instalação/atualização ===== */
#pwa-install-btn {
    position: fixed;
    z-index: 9999;
    right: 1rem;
    bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(109, 40, 217, 0.45);
    background: linear-gradient(145deg, rgba(109, 40, 217, 0.92), rgba(59, 130, 246, 0.72));
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 36px rgba(109, 40, 217, 0.28);
    cursor: pointer;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
}

.pwa-ios-banner {
    position: fixed;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    width: min(92vw, 520px);
    background: linear-gradient(145deg, rgba(22, 27, 38, 0.96), rgba(18, 23, 34, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow-card-hover);
}

.pwa-ios-banner-inner {
    padding: 1rem 1rem 0.85rem;
}

.pwa-ios-banner-title {
    font-weight: 900;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.pwa-ios-banner-steps {
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.92rem;
}

.pwa-ios-banner-close {
    margin-top: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    cursor: pointer;
    font-weight: 700;
}

.pwa-update-banner {
    position: fixed;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    width: min(92vw, 520px);
    background: linear-gradient(145deg, rgba(22, 27, 38, 0.96), rgba(18, 23, 34, 0.92));
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 16px;
    box-shadow: var(--shadow-card-hover);
}

.pwa-update-inner {
    padding: 1rem 1rem 0.85rem;
}

.pwa-update-title {
    font-weight: 900;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.pwa-update-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pwa-update-refresh,
.pwa-update-close {
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    cursor: pointer;
    font-weight: 800;
}

.pwa-update-refresh {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

.automacao-wa-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
    .automacao-wa-scenario-body {
        flex-direction: column;
        align-items: stretch;
    }

    .automacao-wa-checks {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .automacao-wa-check-label {
        white-space: normal;
    }

    .automacao-wa-time-input {
        max-width: 100%;
    }
}

.page-title-lg {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.muted {
    color: var(--muted);
    margin: 0;
}

.muted.small {
    font-size: 0.82rem;
}

/* ——— Dashboard metrics ——— */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.35rem;
}

.metric-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-card-pad) 1.25rem;
    box-shadow: var(--shadow-card);
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.12), transparent 55%);
    pointer-events: none;
}

.metric-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.metric-icon--purple {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: none;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.15);
}

.metric-icon--blue {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: none;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.14);
}

.metric-icon--green {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: none;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.12);
}

.metric-icon--amber {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border: none;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.12);
}

.metric-trend {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--white), #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.metric-card--purple .metric-value {
    background: linear-gradient(135deg, #e9d5ff, var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
}

.metric-card--blue .metric-value {
    background: linear-gradient(135deg, #dbeafe, var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
}

.metric-card--green .metric-value {
    background: linear-gradient(135deg, #dcfce7, var(--green));
    -webkit-background-clip: text;
    background-clip: text;
}

.metric-card--amber .metric-value {
    background: linear-gradient(135deg, #fef3c7, var(--amber));
    -webkit-background-clip: text;
    background-clip: text;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.sparkline {
    height: 36px;
    margin-top: 0.65rem;
    border-radius: 8px;
    opacity: 0.85;
}

.sparkline--purple {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(59, 130, 246, 0.14));
    box-shadow: inset 0 -8px 16px rgba(139, 92, 246, 0.12);
}

.sparkline--blue {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.1));
    box-shadow: inset 0 -8px 16px rgba(59, 130, 246, 0.12);
}

.sparkline--green {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(59, 130, 246, 0.08));
    box-shadow: inset 0 -8px 16px rgba(34, 197, 94, 0.1);
}

.sparkline--amber {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.24), rgba(139, 92, 246, 0.1));
    box-shadow: inset 0 -8px 16px rgba(245, 158, 11, 0.1);
}

/* ——— Dashboard panels ——— */
.dash-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 1.15rem;
    margin-bottom: 1.35rem;
}

.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.35rem;
}

.panel {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-card-pad) 1.25rem;
    box-shadow: var(--shadow-card);
}

.panel h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.panel-title-only {
    margin: 0 0 0.85rem;
    font-size: 1rem;
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}

.panel-head h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.panel-legend {
    font-size: 0.72rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-p {
    background: var(--purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.55);
}

.dot-b {
    background: var(--blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.55);
}

.chart-svg-wrap {
    width: 100%;
}

.chart-svg {
    width: 100%;
    height: auto;
    min-height: 160px;
    display: block;
}

.chart-x-labels {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0.25rem 0;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: capitalize;
}

.server-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.server-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.5rem;
    margin: 0 -0.35rem;
    border-radius: var(--radius-sm);
    border-bottom: none;
    font-size: 0.88rem;
}

.server-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.server-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.server-dot--ok {
    background: var(--green);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.server-dot--warn {
    background: var(--amber);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.server-name {
    flex: 1;
    min-width: 0;
}

.server-pct {
    color: var(--muted);
    font-size: 0.78rem;
}

.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.top-item {
    display: grid;
    grid-template-columns: 1fr minmax(80px, auto) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.5rem 0.35rem;
    margin: 0 -0.2rem;
    border-radius: var(--radius-sm);
    border-bottom: none;
    font-size: 0.86rem;
}

.top-item:hover {
    background: rgba(255, 255, 255, 0.035);
}

.top-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar-wrap {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.top-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--purple), var(--blue));
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.top-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: 0.82rem;
}

.donut-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0.5rem auto 1rem;
}

.donut {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--bg-card) 58%, transparent 59%),
        conic-gradient(
            var(--purple) 0deg 216deg,
            var(--blue) 216deg 306deg,
            var(--green) 306deg 342deg,
            var(--amber) 342deg 360deg
        );
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 8px 32px rgba(139, 92, 246, 0.15);
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-center strong {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0;
}

.lg {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.lg-p {
    background: var(--purple);
}

.lg-b {
    background: var(--blue);
}

.lg-g {
    background: var(--green);
}

.lg-a {
    background: var(--amber);
}

.donut-note {
    margin: 0.75rem 0 0;
}

.panel-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.shortcut {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow-chrome);
    text-decoration: none;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    transition: transform 0.12s, box-shadow 0.15s;
}

.shortcut:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card), var(--glow-purple);
}

.shortcut-ico {
    display: flex;
    color: inherit;
    opacity: 0.95;
}

.sc-purple {
    background: rgba(139, 92, 246, 0.14);
    color: #ddd6fe;
}

.sc-blue {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

.sc-green {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.sc-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.dash-actions {
    margin-bottom: 0.5rem;
}

/* ——— Cards & buttons (global) ——— */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-card-pad);
    box-shadow: var(--shadow-card);
}

.card h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-head-row h3 {
    margin: 0;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.15s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white);
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: rgba(22, 27, 38, 0.92);
    color: var(--text);
    box-shadow: var(--shadow-chrome);
}

.btn-secondary:hover {
    color: #e2e8f0;
    box-shadow: var(--shadow-chrome), 0 0 20px rgba(139, 92, 246, 0.12);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    box-shadow: none;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-chrome);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.btn-success {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 5px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: var(--green);
    color: #fff;
}

.btn-warning {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: var(--amber);
    color: #0f172a;
    margin-right: 5px;
}

.btn-danger {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: #ef4444;
    color: #fff;
}

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.22);
    color: #c4b5fd;
    border: none;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.12);
}

.alert {
    padding: 0.95rem 1.05rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: none;
    box-shadow: 0 4px 18px rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: none;
    box-shadow: 0 4px 18px rgba(34, 197, 94, 0.1);
    color: #bbf7d0;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-span {
    grid-column: 1 / -1;
}

.field span {
    font-size: 0.8rem;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(18, 23, 34, 0.92);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), var(--shadow-chrome);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(139, 92, 246, 0.22),
        0 4px 16px rgba(139, 92, 246, 0.12);
}

.field textarea {
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
}

.field-whatsapp-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.field-whatsapp-ico {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #25d366;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.field-whatsapp-field .field-whatsapp-input-wrap input[type="tel"] {
    padding-left: 2.35rem;
    width: 100%;
}

/* ——— Login (fullscreen bg + glassmorphism) ——— */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #050811;
    background-image: url("../img/login-bg.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1.01);
}

@media (prefers-reduced-motion: reduce) {
    .login-bg {
        transform: none;
    }
}

.login-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 100% 90% at 50% 45%, rgba(5, 8, 17, 0.22) 0%, rgba(5, 8, 17, 0.52) 55%, rgba(5, 8, 17, 0.82) 100%),
        linear-gradient(to top, rgba(5, 8, 17, 0.48) 0%, transparent 40%);
}

.login-page {
    --login-page-pad: clamp(1rem, 4vw, 2rem);
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: max(var(--login-page-pad), env(safe-area-inset-top, 0px));
    padding-right: max(var(--login-page-pad), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--login-page-pad), env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--login-page-pad), env(safe-area-inset-left, 0px));
}

.login-glass {
    width: 100%;
    max-width: 400px;
    padding: clamp(1.35rem, 3.5vw, 2rem);
    border-radius: 16px;
    border: none;
    /* Sem backdrop-filter: painel mais opaco para legibilidade (WCAG / browsers antigos). */
    background: rgba(15, 23, 42, 0.86);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.28),
        0 0 40px rgba(139, 92, 246, 0.08);
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
    .login-glass {
        background: rgba(15, 23, 42, 0.4);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
        backdrop-filter: blur(18px) saturate(160%);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .login-glass {
        background: rgba(15, 23, 42, 0.94);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 0.85rem;
}

.login-brand .sidebar-logo {
    margin: 0 auto 1rem;
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.login-form.form-stack {
    gap: 0.75rem;
}

.login-alert {
    margin-bottom: 0.85rem;
}

.login-page .login-alert.alert-error {
    background: rgba(127, 29, 29, 0.42);
    box-shadow: 0 4px 20px rgba(127, 29, 29, 0.25);
    color: #fee2e2;
}

.login-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 0;
}

.login-field {
    gap: 0.4rem;
}

.login-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f1f5f9;
}

.login-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: none;
    background: rgba(30, 41, 59, 0.92);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 12px rgba(0, 0, 0, 0.2);
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    transition: box-shadow 0.15s, background 0.15s;
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
    .login-input {
        background: rgba(255, 255, 255, 0.08);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .login-input {
        background: rgba(30, 41, 59, 0.96);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

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

.login-input:focus {
    outline: none;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(139, 92, 246, 0.25),
        0 6px 24px rgba(59, 130, 246, 0.15);
    background: rgba(255, 255, 255, 0.11);
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
    .login-input:focus {
        background: rgba(255, 255, 255, 0.12);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .login-input:focus {
        background: rgba(51, 65, 85, 0.98);
    }
}

.login-submit {
    margin-top: 0.15rem;
}

.login-version {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.95rem 0 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
}

.login-version-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white);
}

.login-brand-logo {
    display: block;
    margin: 0 auto 0.65rem;
    max-height: 52px;
    width: auto;
    object-fit: contain;
}

.login-brand-fallback-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 3.2vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.login-brand-fallback-sub {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.login-brand-fallback {
    margin: 0 auto 1rem;
}

@media (max-width: 480px) {
    .login-glass {
        padding: 1.35rem 1.15rem;
        border-radius: 14px;
    }
}

.field.field-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
}

.field-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.field-checkbox span {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}

.branding-preview-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.branding-preview-img {
    max-width: 220px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: none;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: var(--shadow-chrome);
}

.branding-preview-placeholder {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #e2e8f0;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px dashed rgba(148, 163, 184, 0.45);
    display: inline-block;
}

.profile-logo-form .btn-row {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-card--branding {
    grid-column: 1 / -1;
    max-width: 720px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.82rem 0.7rem;
    text-align: left;
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:hover td {
    background: rgba(139, 92, 246, 0.06);
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 0.65rem;
}

.id-cell {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.22rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.actions-cell {
    white-space: normal;
}

.actions-cell .btn-sm {
    margin-bottom: 0.35rem;
    margin-right: 0.35rem;
}

.table-wrap--resellers {
    margin-top: 0.75rem;
}

.data-table--resellers .data-table__actions {
    min-width: 0;
    width: 1%;
    vertical-align: middle;
}

.reseller-cell-name {
    font-weight: 600;
}

.reseller-cell-email {
    margin-top: 0.2rem;
}

.reseller-quota {
    font-variant-numeric: tabular-nums;
}

.reseller-client-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.plans-table-row-cell {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.plans-edit-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    margin: 0;
}

.plans-delete-form {
    display: inline-block;
    margin-left: 0.75rem;
    vertical-align: middle;
}

.plans-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.plans-edit-price {
    width: 7.5rem;
}

.plans-edit-hint {
    align-self: center;
}

.reseller-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reseller-badge--ok {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: none;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
}

.reseller-badge--blocked {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
    border: none;
    box-shadow: 0 2px 10px rgba(248, 113, 113, 0.1);
}

.reseller-badge--expired {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: none;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.1);
}

.reseller-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
}

.reseller-actions--icons {
    align-items: center;
    gap: 0.35rem 0.45rem;
    flex-wrap: nowrap;
}

@media (max-width: 900px) {
    .reseller-actions--icons {
        flex-wrap: wrap;
    }
}

.reseller-actions--legacy {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.reseller-actions-legacy-hint {
    flex: 1 1 100%;
    margin: 0 0 0.25rem 0;
}

@media (min-width: 901px) {
    .reseller-actions--legacy.reseller-actions--icons .reseller-actions-legacy-hint {
        flex: 1 1 auto;
        margin: 0;
        max-width: 14rem;
    }
}

/* Ícones de ação — Lucide, premium glow */
.reseller-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(165deg, rgba(22, 27, 38, 0.95), rgba(15, 18, 26, 0.98));
    color: #cbd5e1;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.22s ease,
        transform 0.18s ease,
        filter 0.2s ease;
}

.reseller-icon-btn .nav-lucide {
    flex-shrink: 0;
}

.reseller-icon-btn:hover:not(:disabled) {
    color: #f8fafc;
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow:
        0 0 18px rgba(139, 92, 246, 0.28),
        0 4px 16px rgba(59, 130, 246, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.reseller-icon-btn:active:not(:disabled) {
    transform: translateY(0);
}

.reseller-icon-btn:focus-visible {
    outline: none;
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

.reseller-icon-btn--renew:hover:not(:disabled) {
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
}

.reseller-icon-btn--edit:hover:not(:disabled) {
    border-color: rgba(139, 92, 246, 0.55);
    color: #c4b5fd;
}

.reseller-icon-btn--block:hover:not(:disabled) {
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.reseller-icon-btn--unblock:hover:not(:disabled) {
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.reseller-icon-btn--delete {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

.reseller-icon-btn--delete:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
    box-shadow:
        0 0 22px rgba(248, 113, 113, 0.28),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

.reseller-icon-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: none;
    transform: none;
    box-shadow: none;
}

/* Tooltip (data-tooltip) */
.reseller-icon-btn[data-tooltip]:not(:disabled)::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.96);
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s;
    background: linear-gradient(145deg, rgba(30, 27, 45, 0.98), rgba(15, 23, 42, 0.99));
    color: #e2e8f0;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 20px rgba(139, 92, 246, 0.15);
    z-index: 50;
}

.reseller-icon-btn[data-tooltip]:not(:disabled):hover::after,
.reseller-icon-btn[data-tooltip]:not(:disabled):focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

@media (hover: none) {
    .reseller-icon-btn[data-tooltip]:not(:disabled)::after {
        display: none;
    }
}

@media (max-width: 640px) {
    .reseller-icon-btn {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
        border-radius: 11px;
    }
}

.reseller-action-form--renew {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.reseller-action-form--inline {
    display: inline;
    margin: 0;
}

.reseller-export-link {
    display: inline-block;
    margin-top: 0.35rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}

.reseller-export-link:hover {
    color: var(--purple);
    text-decoration: underline;
}

.btn-reseller-excluir {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #b91c1c 100%);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.5);
    box-shadow:
        0 0 20px rgba(248, 113, 113, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.35);
    font-weight: 600;
}

.btn-reseller-excluir:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow:
        0 0 26px rgba(248, 113, 113, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.38);
}

.btn-reseller-excluir:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-reseller-excluir-confirm {
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.3);
}

.modal-delete-reseller-card {
    box-shadow: var(--shadow-card), var(--glow-purple), 0 0 0 1px rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.resellers-toast {
    position: fixed;
    bottom: 1.35rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 120;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(22, 101, 52, 0.95), rgba(15, 23, 42, 0.96));
    border: 1px solid rgba(52, 211, 153, 0.45);
    color: #ecfdf5;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-card), 0 0 28px rgba(52, 211, 153, 0.25);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: min(420px, calc(100% - 2rem));
    text-align: center;
}

.resellers-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.resellers-toast.resellers-toast--error {
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.96), rgba(15, 23, 42, 0.96));
    border-color: rgba(248, 113, 113, 0.55);
    color: #fecaca;
    box-shadow: var(--shadow-card), 0 0 28px rgba(248, 113, 113, 0.22);
}

.reseller-action-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.reseller-renew-select {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(18, 23, 34, 0.92);
    box-shadow: var(--shadow-chrome);
    color: var(--text);
    max-width: 7.5rem;
}

.client-form-card--quota-full {
    opacity: 0.92;
}

.client-form-card--quota-full .btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.client-quota-blocked .client-quota-upgrade {
    color: var(--muted);
    line-height: 1.45;
}

.reveal-target {
    display: inline-block;
    margin-left: 0.35rem;
    font-family: ui-monospace, monospace;
    color: #c4b5fd;
}

/* ——— Clientes / TV Box ——— */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.client-form-card {
    margin-bottom: 1.75rem;
}

.clients-list-section {
    margin-top: 0.5rem;
}

.clients-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.clients-section-head-main {
    flex: 1 1 220px;
    min-width: 0;
}

.clients-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.clients-section-meta {
    margin: 0.25rem 0 0;
    line-height: 1.35;
}

.clients-per-page-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(22, 27, 38, 0.72);
    box-shadow: var(--shadow-chrome);
}

.clients-per-page-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.clients-per-page-select {
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: none;
    background: rgba(18, 23, 34, 0.95);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    min-width: 4rem;
}

.clients-per-page-hint {
    font-size: 0.68rem;
}

.clients-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem 1rem;
    flex: 1 1 280px;
    min-width: 0;
}

.clients-per-page-form--toolbar {
    flex: 0 0 auto;
}

.clients-search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(22, 27, 38, 0.72);
    box-shadow: var(--shadow-chrome);
}

.clients-search-ico {
    display: flex;
    color: var(--muted);
    flex-shrink: 0;
}

.clients-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

.clients-search-input::placeholder {
    color: var(--muted);
}

.resellers-list-head {
    align-items: center;
    margin-bottom: 1rem;
}

.resellers-list-head h3 {
    margin: 0;
}

.resellers-toolbar-form {
    flex: 0 1 300px;
    min-width: 0;
    margin: 0;
}

@media (max-width: 640px) {
    .clients-toolbar-form {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search-field {
        max-width: none;
    }
}

.clients-count-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.2);
    border: none;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.card-empty {
    text-align: center;
    padding: 2rem 1.25rem;
}

.client-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
}

.client-cards--dense {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 0.65rem;
    align-items: stretch;
}

.client-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    transition: box-shadow 0.15s;
}

.client-card--compact {
    padding: 0.65rem 0.75rem 0.72rem;
    gap: 0.45rem;
    border-radius: 10px;
}

.client-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.client-card--compact:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42), 0 4px 14px rgba(0, 0, 0, 0.22),
        0 0 24px rgba(139, 92, 246, 0.1);
}

.client-card--compact .client-card-top {
    gap: 0.35rem;
}

.client-card--compact .client-status {
    font-size: 0.65rem;
    padding: 0.28rem 0.45rem;
}

.client-card--compact .client-status-select {
    font-size: 0.65rem;
    padding: 0.28rem 0.4rem;
    max-width: 132px;
}

.client-card--compact .client-name {
    font-size: 0.88rem;
    line-height: 1.2;
}

.client-card--compact .client-owner {
    font-size: 0.72rem !important;
}

.client-card--compact .client-id-row {
    padding: 0.42rem 0.52rem;
}

.client-card--compact .client-id-label {
    font-size: 0.6rem;
    margin-bottom: 0.22rem;
}

.client-card--compact .client-id-main {
    font-size: 1.02rem;
    letter-spacing: 0.03em;
}

.client-card--compact .client-pass-row {
    gap: 0.35rem 0.5rem;
}

.client-card--compact .client-pass-label {
    font-size: 0.62rem;
    width: auto;
    margin-right: 0.35rem;
}

.client-card--compact .client-pass-values {
    flex: 1 1 100px;
}

.client-card--compact .pass-mask {
    font-size: 0.82rem;
}

.client-card--compact .btn-sm {
    padding: 0.28rem 0.45rem;
    font-size: 0.72rem;
}

.client-card--compact .client-actions {
    padding-top: 0.45rem;
    margin-top: 0.15rem;
    gap: 0.35rem;
}

.client-card--compact .btn-connect {
    padding: 0.42rem 0.65rem;
    font-size: 0.8rem;
    min-width: 0;
}

.clients-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(22, 27, 38, 0.62);
    box-shadow: var(--shadow-chrome);
}

.clients-pagination--bottom {
    margin-bottom: 0;
    margin-top: 0.85rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: rgba(18, 23, 34, 0.88);
    box-shadow: var(--shadow-chrome);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    transition: box-shadow 0.15s, color 0.15s;
}

.pagination-btn:hover:not(.is-disabled) {
    color: #e2e8f0;
    box-shadow: var(--shadow-chrome), 0 0 18px rgba(139, 92, 246, 0.12);
}

.pagination-btn.is-disabled {
    opacity: 0.38;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination-status {
    font-size: 0.78rem;
    color: var(--muted);
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1 1 auto;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.45rem;
    border-radius: 8px;
    border: none;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--muted);
    font-family: inherit;
    background: transparent;
}

a.pagination-num:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-chrome);
}

.pagination-num.is-current {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(59, 130, 246, 0.14));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.2);
}

.pagination-ellipsis {
    padding: 0 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.client-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.client-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    border: none;
}

.client-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.client-status--online {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.14);
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.12);
}

.client-status--online .client-status-dot {
    background: var(--green);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

.client-status--offline {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.client-status--offline .client-status-dot {
    background: #64748b;
}

.client-status--unknown {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.1);
}

.client-status--unknown .client-status-dot {
    background: var(--amber);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.15);
    }
}

.client-status-form {
    margin: 0;
}

.client-status-select {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: none;
    background: rgba(18, 23, 34, 0.92);
    box-shadow: var(--shadow-chrome);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    max-width: 160px;
}

.client-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.client-owner {
    margin: 0;
}

.client-id-row {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 2px 12px rgba(139, 92, 246, 0.08);
}

.client-id-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.client-id-main {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--white);
    font-family: ui-monospace, "Cascadia Code", monospace;
    word-break: break-all;
}

.client-pass-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.client-pass-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    width: 100%;
}

.client-pass-values {
    flex: 1 1 140px;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 1.6rem;
}

.pass-mask {
    font-family: ui-monospace, monospace;
    letter-spacing: 0.15em;
    color: var(--muted);
    font-size: 0.95rem;
}

.client-pass-values .reveal-target.pass-plain,
.pass-plain.reveal-target {
    margin-left: 0;
    font-size: 0.92rem;
    word-break: break-all;
}

.client-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
    padding-top: 1rem;
    border-top: none;
}

.client-delete-form {
    display: inline;
    margin: 0;
}

.btn-connect {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.35);
    transition: transform 0.1s, box-shadow 0.15s;
}

.btn-connect:hover {
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.45);
}

.client-edit-card {
    max-width: 720px;
}

.client-automacoes-opt-out-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.client-automacoes-opt-out-hint {
    display: block;
    margin-top: 0.45rem;
    line-height: 1.45;
    padding-left: 1.65rem;
}

.client-automacoes-off-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.profile-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
    align-items: start;
}

.profile-card h3 {
    margin: 0 0 0.35rem;
}

.profile-card-desc {
    margin: 0 0 1rem;
    line-height: 1.45;
}

.profile-form {
    max-width: 440px;
}

@media (max-width: 1100px) {
    .dash-grid-3 {
        grid-template-columns: 1fr;
    }

    .dash-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .topbar {
        padding: 0.45rem 0.9rem;
        gap: 0.5rem;
    }

    .topbar-right {
        max-width: min(100%, 320px);
    }

    .topbar-search-wrap {
        max-width: 160px;
        flex-basis: 120px;
    }

    .topbar-greet .topbar-sub {
        display: none;
    }

    .topbar-expiry {
        margin-top: 0.2rem;
        padding: 0.28rem 0.55rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 12px 0 48px rgba(0, 0, 0, 0.55);
    }

    .main-wrap {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        min-height: 2.85rem;
    }

    .topbar-title {
        font-size: 0.95rem;
    }

    .topbar-search-wrap {
        display: none;
    }

    .topbar-right {
        max-width: none;
        flex: 0 0 auto;
    }

    .topbar-user-meta,
    .topbar-user-chevron {
        display: none;
    }

    .topbar-user-trigger {
        max-width: none;
        padding: 0.22rem;
    }
}

@media (max-width: 520px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

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

    .client-actions,
    .cobranca-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .client-actions .btn-warning,
    .client-actions .btn-danger {
        width: 100%;
        margin-right: 0;
        text-align: center;
    }

    .cobranca-actions .btn,
    .cobranca-actions form {
        width: 100%;
    }

    .cobranca-actions .btn {
        justify-content: center;
    }

    .btn-connect {
        width: 100%;
    }
}

/* ——— Cobrança ——— */
.nav-link--hot:not(.is-active) .nav-hot-mark {
    filter: grayscale(0.2);
}

.cobrancas-head .cobrancas-title {
    margin-bottom: 0;
}

.cobrancas-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cobrancas-btn-central {
    flex-shrink: 0;
    white-space: nowrap;
}

.filtros-cobranca {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filtro-cobranca-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--muted);
    background: linear-gradient(145deg, rgba(22, 27, 38, 0.95), rgba(18, 23, 34, 0.88));
    box-shadow: var(--shadow-chrome);
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.filtro-cobranca-btn:hover {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.45);
}

.filtro-cobranca-btn.is-active {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.65);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(59, 130, 246, 0.18));
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.cobrancas-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.cobrancas-search-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 220px;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.cobrancas-search-ico {
    display: flex;
    opacity: 0.75;
}

.cobrancas-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    outline: none;
}

.cobranca-card {
    background: linear-gradient(155deg, rgba(22, 27, 38, 0.98) 0%, rgba(18, 23, 34, 0.92) 55%, rgba(15, 19, 28, 0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.12);
}

.cobranca-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.billing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.billing-badge--past {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.billing-badge--today {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.billing-badge--ok {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.billing-badge--none {
    background: rgba(148, 163, 184, 0.15);
    color: var(--muted);
    border: 1px solid var(--border);
}

.cobranca-meta {
    margin: 0.65rem 0 1rem;
    font-size: 0.88rem;
}

.cobranca-meta-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(37, 45, 61, 0.65);
}

.cobranca-meta-row:last-child {
    border-bottom: none;
}

.cobranca-meta dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.cobranca-meta dd {
    margin: 0;
    font-weight: 600;
}

.cobranca-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.cobranca-actions--three {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(139, 92, 246, 0.18);
}

.cobranca-actions--three .cobranca-btn-cobrar,
.cobranca-actions--three .cobranca-btn-renovar,
.cobranca-actions--three .cobranca-btn-editar {
    min-width: 6.5rem;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* Cobrar — principal (WhatsApp / pagamento) */
.cobranca-btn-cobrar {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
    border: 1px solid rgba(34, 197, 94, 0.65);
    color: #f0fdf4;
    box-shadow: 0 4px 18px rgba(34, 197, 94, 0.28);
}

.cobranca-btn-cobrar:hover:not(:disabled) {
    filter: brightness(1.07);
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.38);
}

.cobranca-btn-cobrar--disabled,
.cobranca-btn-cobrar:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
    box-shadow: none;
}

/* Renovar */
.cobranca-btn-renovar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), rgba(139, 92, 246, 0.45));
    border: 1px solid rgba(96, 165, 250, 0.45);
    color: var(--text);
}

.cobranca-btn-renovar:hover {
    filter: brightness(1.06);
    box-shadow: var(--glow-blue);
}

/* Editar */
.cobranca-btn-editar {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid var(--border);
    color: var(--muted);
}

.cobranca-btn-editar:hover {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.16);
}

.cobranca-inline-form {
    display: inline;
}

.cobranca-cobrar-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(139, 92, 246, 0.2);
}

.btn-cobrar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.28));
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: var(--text);
}

.btn-cobrar:hover {
    box-shadow: var(--glow-blue);
}

.btn-wa {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.35), rgba(22, 163, 74, 0.28));
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #ecfdf5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-wa:hover {
    filter: brightness(1.08);
}

.btn-wa.is-disabled,
.btn-wa:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.dash-cobranca-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.dash-cob-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.92rem;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(22, 27, 38, 0.96), rgba(18, 23, 34, 0.9));
    box-shadow: var(--shadow-card);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dash-cob-alert:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.dash-cob-alert strong {
    font-size: 1.15rem;
    font-weight: 800;
}

.dash-cob-alert-ico {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.dash-cob-alert-text {
    font-weight: 600;
    line-height: 1.35;
}

.dash-cob-alert--past {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.dash-cob-alert--today {
    border-color: rgba(245, 158, 11, 0.5);
    color: #fde68a;
}

.dash-cob-alert--soon {
    border-color: rgba(249, 115, 22, 0.52);
    color: #fdba74;
}

.dash-cob-alert--pulse {
    animation: dashAlertPulse 2.6s ease-in-out infinite;
}

@keyframes dashAlertPulse {
    0%, 100% {
        box-shadow: var(--shadow-card), 0 0 0 0 rgba(139, 92, 246, 0);
    }
    50% {
        box-shadow: var(--shadow-card-hover), 0 0 22px rgba(139, 92, 246, 0.22);
    }
}

.dash-cob-alert--past.dash-cob-alert--pulse {
    animation-name: dashAlertPulseRed;
}

@keyframes dashAlertPulseRed {
    0%, 100% {
        box-shadow: var(--shadow-card), 0 0 0 0 rgba(248, 113, 113, 0);
    }
    50% {
        box-shadow: var(--shadow-card-hover), 0 0 20px rgba(248, 113, 113, 0.28);
    }
}

.dash-cob-alert--today.dash-cob-alert--pulse {
    animation-name: dashAlertPulseAmber;
}

@keyframes dashAlertPulseAmber {
    0%, 100% {
        box-shadow: var(--shadow-card), 0 0 0 0 rgba(245, 158, 11, 0);
    }
    50% {
        box-shadow: var(--shadow-card-hover), 0 0 20px rgba(245, 158, 11, 0.3);
    }
}

.dash-cob-alert--soon.dash-cob-alert--pulse {
    animation-name: dashAlertPulseOrange;
}

@keyframes dashAlertPulseOrange {
    0%, 100% {
        box-shadow: var(--shadow-card), 0 0 0 0 rgba(249, 115, 22, 0);
    }
    50% {
        box-shadow: var(--shadow-card-hover), 0 0 20px rgba(249, 115, 22, 0.32);
    }
}

.dash-lic-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 0 10px currentColor;
}

.dash-lic-dot--amber {
    background: #fbbf24;
    color: rgba(251, 191, 36, 0.8);
}

.dash-lic-dot--red {
    background: #f87171;
    color: rgba(248, 113, 113, 0.8);
}

.dash-lic-dot--orange {
    background: #fb923c;
    color: rgba(249, 115, 22, 0.8);
}

.client-billing-section-head {
    margin-top: 0.5rem;
}

.client-billing-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.cobrancas-migrate-hint code {
    font-size: 0.85em;
}

/* ——— Central de Disparos ——— */
.central-disparos-head {
    margin-bottom: 1.25rem;
}

.central-disparos-sub {
    margin: 0.35rem 0 0;
    max-width: 52rem;
}

.central-disparos-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.central-disparos-metric {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(139, 92, 246, 0.22);
    box-shadow: var(--shadow-card), 0 0 28px rgba(139, 92, 246, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.central-disparos-metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover), var(--glow-purple);
}

.central-disparos-metric-val {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.central-disparos-metric-lbl {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.central-disparos-metric--fail {
    border-color: rgba(248, 113, 113, 0.35);
}

.central-disparos-metric--pend {
    border-color: rgba(245, 158, 11, 0.4);
}

.central-disparos-metric--ok {
    border-color: rgba(52, 211, 153, 0.35);
}

.central-disparos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.central-disparos-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--muted);
    background: linear-gradient(145deg, rgba(22, 27, 38, 0.95), rgba(18, 23, 34, 0.88));
    box-shadow: var(--shadow-chrome);
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.central-disparos-tab:hover {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.45);
}

.central-disparos-tab.is-active {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.65);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(59, 130, 246, 0.18));
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.2);
}

.central-disparos-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
}

.central-disparos-toolbar-form {
    display: inline;
}

.central-disparos-empty {
    padding: 1.5rem;
}

.central-disparos-table-wrap {
    border: 1px solid rgba(139, 92, 246, 0.14);
    box-shadow: var(--shadow-card), 0 0 32px rgba(139, 92, 246, 0.08);
}

.central-disparos-status {
    font-weight: 600;
    white-space: nowrap;
}

/* ——— Evolution API — telemetria circuit breaker ——— */
.evo-circuit-panel .evo-circuit-table {
    font-size: 0.875rem;
}
.evo-circuit-tr--accent {
    outline: 1px solid rgba(139, 92, 246, 0.45);
    outline-offset: -1px;
    background: rgba(139, 92, 246, 0.08);
}
.evo-circuit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.evo-circuit-badge--ok {
    color: #86efac;
    background: rgba(22, 163, 74, 0.18);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}
.evo-circuit-badge--warn {
    color: #fde047;
    background: rgba(234, 179, 8, 0.2);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.22);
}
.evo-circuit-badge--open {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.22);
    box-shadow: 0 0 14px rgba(248, 113, 113, 0.35);
}

/* ——— Clientes SaaS (tabela profissional) ——— */
.saas-glass-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.94) 0%, rgba(18, 23, 34, 0.9) 55%, rgba(11, 14, 20, 0.92) 100%);
    border: 1px solid rgba(139, 92, 246, 0.14);
    border-radius: var(--radius);
    padding: var(--space-card-pad);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

.page-head.clients-saas-head {
    margin-bottom: 0.5rem;
}

.clients-saas-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.85rem;
}

.clients-saas-page-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.clients-saas-section {
    margin-top: 0.75rem;
}

.clients-saas-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .clients-saas-head-row {
        align-items: flex-start;
    }

    .clients-saas-top-actions {
        width: 100%;
    }
}

.btn-saas-glow {
    background: linear-gradient(135deg, var(--purple-dim) 0%, var(--blue-dim) 100%);
    border: none;
    box-shadow: var(--glow-purple), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.btn-saas-glow:hover {
    filter: brightness(1.06);
}

.resellers-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.resellers-page-head-text {
    flex: 1 1 220px;
    min-width: 0;
}

.resellers-page-head-text h2 {
    margin: 0 0 0.35rem;
}

.resellers-create-modal .modal-new-client-card {
    width: min(26rem, 100%);
}

.reseller-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.22);
    color: #ddd6fe;
    border: 1px solid rgba(167, 139, 250, 0.35);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    z-index: 60;
}

.modal-new-client {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 70;
}

.modal-new-client.is-open {
    display: flex;
}

.modal-new-client-card {
    width: min(980px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.modal-backdrop--delete {
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.modal-backdrop--delete.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-delete-client {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 85;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal-delete-client.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-delete-client-card {
    width: min(440px, 100%);
    padding: 1.35rem 1.4rem 1.25rem;
    transform: scale(0.94) translateY(10px);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease;
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(248, 113, 113, 0.12);
}

.modal-delete-client.is-open .modal-delete-client-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-delete-client-title {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-delete-client-msg {
    margin: 0 0 0.5rem;
    line-height: 1.45;
}

.modal-delete-client-hint {
    margin: 0 0 1.15rem;
}

.modal-delete-client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.modal-backdrop--view {
    z-index: 78;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.modal-backdrop--view.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-client-view {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 82;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal-client-view.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-client-view-card {
    width: min(520px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    padding: 1.25rem 1.35rem 1.2rem;
    transform: scale(0.94) translateY(10px);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease;
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(139, 92, 246, 0.14);
}

.modal-client-view.is-open .modal-client-view-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-client-view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.modal-client-view-head h3 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 600;
}

.modal-client-view-name {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.client-view-dl {
    margin: 0 0 1.1rem;
    display: grid;
    gap: 0.55rem;
}

.client-view-dl > div {
    display: grid;
    grid-template-columns: minmax(7.5rem, 38%) 1fr;
    gap: 0.5rem 0.75rem;
    align-items: start;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(37, 45, 61, 0.55);
}

.client-view-dl dt {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}

.client-view-dl dd {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
}

.modal-client-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.client-btn-view-data {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.68rem !important;
    padding: 0 0.5rem !important;
    min-width: auto !important;
    height: 30px;
}

.btn-delete-client {
    font-size: 0.82rem;
}

.clients-saas-meta {
    margin: 0 0 0.75rem;
}

.clients-saas-filters {
    margin-bottom: 1rem;
    padding: 1rem;
}

.clients-saas-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem 1rem;
    align-items: end;
}

.clients-saas-filter-field span {
    display: block;
    margin-bottom: 0.25rem;
}

.clients-saas-filter-field input,
.clients-saas-filter-field select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
}

.clients-saas-filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.saas-table-wrap {
    display: block;
    margin-bottom: 1rem;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
}

.saas-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.saas-clients-table {
    width: 100%;
    min-width: 1160px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.saas-clients-table thead {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(15, 23, 42, 0.3));
    border-bottom: 1px solid var(--border);
}

.saas-clients-table th,
.saas-clients-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(37, 45, 61, 0.65);
    vertical-align: middle;
    white-space: nowrap;
}

.saas-clients-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(15, 23, 42, 0.96));
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.saas-clients-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.06);
}

.saas-clients-table tbody tr {
    transition: background-color 0.14s ease;
}

.saas-th-actions {
    min-width: 270px;
}

.saas-cell-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.saas-cell-sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.remote-access-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.saas-cell-remote {
    margin-top: 0.2rem;
}

.saas-pass-mask {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.saas-actions-cluster {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
}

.saas-td-actions .btn {
    min-width: 88px;
    height: 32px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1;
}

/* ——— Tabela de clientes: ações em ícones compactos ——— */
.saas-th--center,
.saas-td--center {
    text-align: center;
}

.saas-clients-table.tabela-clientes {
    min-width: 920px;
    font-size: 0.84rem;
}

.saas-clients-table.tabela-clientes th,
.saas-clients-table.tabela-clientes td {
    padding: 0.52rem 0.5rem;
    vertical-align: middle;
}

.tabela-clientes .saas-th-actions {
    min-width: 11.5rem;
    width: 1%;
    white-space: nowrap;
}

.tabela-clientes .saas-td-actions {
    white-space: nowrap;
    width: 1%;
    vertical-align: middle;
    overflow: visible;
}

.tabela-clientes td:nth-child(4) {
    font-variant-numeric: tabular-nums;
}

.tabela-clientes .saas-cell-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    max-width: 11rem;
}

.tabela-clientes td:nth-child(2),
.tabela-clientes td:nth-child(3),
.tabela-clientes td:nth-child(6) {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabela-clientes td:nth-child(3) {
    max-width: 6.25rem;
}

.tabela-clientes td:nth-child(6) {
    max-width: 8rem;
}

.saas-actions-cluster--icons {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
}

.saas-actions-cluster--toolbar,
.actions-group {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: none;
    margin-inline: auto;
    flex-wrap: nowrap;
}

.tabela-clientes .saas-td-actions .actions-group,
.tabela-clientes .saas-td-actions .saas-actions-cluster--toolbar {
    justify-content: center;
}

.tabela-clientes .actions-group .client-act-btn,
.tabela-clientes .saas-actions-cluster--toolbar .client-act-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
    flex-shrink: 0;
}

.tabela-clientes .actions-group .client-act-btn--text,
.tabela-clientes .saas-actions-cluster--toolbar .client-act-btn--text {
    width: 32px;
    min-width: 32px;
    padding: 0;
    font-size: 0;
}

.actions-group .btn,
.tabela-clientes .actions-group .client-act-btn {
    min-width: auto;
    padding: 6px 10px;
    white-space: nowrap;
}

.tabela-clientes .actions-group .client-act-btn,
.tabela-clientes .actions-group .btn {
    padding: 0;
}

.tabela-clientes .saas-td-actions .btn {
    min-width: auto;
    width: auto;
    height: auto;
    padding: 0;
}

.saas-client-row--vencido {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.07), rgba(15, 23, 42, 0.02));
}

.saas-client-row--vencido:hover {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.11), rgba(139, 92, 246, 0.06));
}

.saas-client-row--vencido td {
    border-bottom-color: rgba(248, 113, 113, 0.14);
}

.client-act-btn--text {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: 30px;
    padding: 0 0.5rem;
    margin: 0;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(22, 27, 38, 0.78);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

.client-act-btn--icon {
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
}

.client-act-btn--view {
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.12);
}

.client-act-btn--view:hover {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.2);
    color: #ede9fe;
}

.tabela-clientes .saas-td-actions .saas-inline-form--icon {
    display: inline-flex;
    flex-shrink: 0;
}

.saas-inline-form--icon {
    display: inline-flex;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.client-act-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(22, 27, 38, 0.72);
    backdrop-filter: blur(10px);
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    line-height: 0;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease;
}

.client-act-btn .nav-lucide {
    width: 17px;
    height: 17px;
    display: block;
    pointer-events: none;
}

.client-act-btn:hover {
    transform: translateY(-1px);
}

.client-act-btn:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.85);
    outline-offset: 2px;
}

.client-act-btn--connect {
    color: #93c5fd;
}

.client-act-btn--connect:hover {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.18);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.38);
    color: #dbeafe;
}

.client-act-btn--cobrar {
    color: #86efac;
}

.client-act-btn--cobrar:hover {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.16);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.38);
    color: #dcfce7;
}

.client-act-btn--renew {
    color: #d8b4fe;
}

.client-act-btn--renew:hover {
    border-color: rgba(167, 139, 250, 0.55);
    background: rgba(139, 92, 246, 0.18);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.42);
    color: #f3e8ff;
}

.client-act-btn--edit {
    color: #fcd34d;
}

.client-act-btn--edit:hover {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.38);
    color: #fef3c7;
}

.client-act-btn--delete {
    color: #fca5a5;
}

.client-act-btn--delete:hover {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(220, 38, 38, 0.18);
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.42);
    color: #fecaca;
}

@media (max-width: 900px) {
    .saas-clients-table.tabela-clientes {
        min-width: 880px;
    }

    .tabela-clientes .saas-th-actions {
        min-width: 10.5rem;
    }

    .tabela-clientes .actions-group .client-act-btn,
    .tabela-clientes .saas-actions-cluster--toolbar .client-act-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        max-width: 30px;
    }

    .client-act-btn--icon {
        width: 30px;
        height: 30px;
    }

    .client-act-btn .nav-lucide {
        width: 16px;
        height: 16px;
    }

    .saas-actions-cluster--toolbar,
    .actions-group {
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .tabela-clientes .saas-td-actions {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .tabela-clientes .saas-td-actions .actions-group,
    .tabela-clientes .saas-td-actions .saas-actions-cluster--toolbar {
        justify-content: flex-start;
        max-width: min(100%, 14.5rem);
        margin-inline: auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    .tabela-clientes .actions-group .client-act-btn,
    .tabela-clientes .saas-actions-cluster--toolbar .client-act-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
    }
}

@media (max-width: 520px) {
    .modal-client-view {
        padding: 0.65rem;
        align-items: flex-end;
    }

    .modal-client-view-card {
        width: 100%;
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .client-view-dl > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .modal-client-view-actions {
        flex-direction: column;
    }

    .modal-client-view-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Gestão de cobranças — tabela compacta, ações só ícones */
.cobranca-tip-floating {
    display: block;
    position: fixed;
    z-index: 12000;
    max-width: 240px;
    min-width: 4.5rem;
    padding: 0.38rem 0.6rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.28;
    color: #f8fafc;
    text-align: center;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.38);
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.cobranca-tip-floating.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cobrancas-table-shell .cobrancas-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabela-cobranca {
    min-width: 0;
    width: 100%;
    font-size: 0.84rem;
}

.tabela-cobranca th,
.tabela-cobranca td {
    padding: 0.42rem 0.38rem;
    vertical-align: middle;
}

.tabela-cobranca th:nth-child(1),
.tabela-cobranca td:nth-child(1) {
    min-width: 0;
    max-width: 11rem;
}

.tabela-cobranca th:nth-child(2),
.tabela-cobranca td:nth-child(2) {
    min-width: 0;
    max-width: 7rem;
}

.tabela-cobranca th:nth-child(3),
.tabela-cobranca td:nth-child(3),
.tabela-cobranca th:nth-child(4),
.tabela-cobranca td:nth-child(4) {
    min-width: 0;
    white-space: nowrap;
}

.tabela-cobranca th:nth-child(5),
.tabela-cobranca td:nth-child(5),
.tabela-cobranca th:nth-child(6),
.tabela-cobranca td:nth-child(6) {
    min-width: 0;
    max-width: 6.5rem;
}

.tabela-cobranca .saas-cell-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabela-cobranca .saas-th-actions,
.tabela-cobranca .saas-td-actions {
    min-width: 0;
    width: 1%;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.tabela-cobranca .cobrancas-actions-row {
    gap: 0.28rem;
    justify-content: center;
}

.tabela-cobranca .client-act-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.tabela-cobranca .client-act-btn .nav-lucide {
    width: 16px;
    height: 16px;
}

@media (max-width: 520px) {
    .tabela-cobranca .client-act-btn {
        width: 30px;
        height: 30px;
    }

    .tabela-cobranca .client-act-btn .nav-lucide {
        width: 15px;
        height: 15px;
    }
}

.saas-inline-form {
    display: inline;
}

.saas-status-mini {
    margin-top: 0.45rem;
}

.saas-op-select {
    font-size: 0.72rem;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    max-width: 100%;
}

.saas-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.saas-badge--past {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
    box-shadow: 0 0 14px rgba(248, 113, 113, 0.42);
}

.saas-badge--warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.saas-badge--ok {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
}

.saas-badge--none {
    background: rgba(148, 163, 184, 0.12);
    color: var(--muted);
    border: 1px solid var(--border);
}

.saas-code-sample {
    font-size: 0.78rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.tutorial-preview-video {
    width: 200px;
    max-width: 100%;
    border-radius: 8px;
    background: #000;
}

.tutorial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: 1rem;
}

.tutorial-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tutorial-new-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.tutorial-main-video {
    border-radius: 10px;
    background: #000;
}

/* ——— Financeiro (SaaS) ——— */
.fin-page {
    max-width: 1200px;
    margin: 0 auto;
}

.fin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.fin-title {
    margin: 0 0 0.25rem;
}

.fin-sub {
    margin: 0;
}

.fin-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
}

.fin-migrate code {
    font-size: 0.85em;
}

.fin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fin-metrics--finance {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    gap: 0.85rem;
}

@media (max-width: 1100px) {
    .fin-metrics--finance {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .fin-metrics--finance {
        grid-template-columns: 1fr;
    }
}

.fin-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.05rem;
    min-height: 5.25rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.92) 0%, rgba(17, 24, 39, 0.88) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fin-card--minimal {
    justify-content: flex-start;
}

.fin-card--minimal .fin-card-body {
    justify-content: center;
    gap: 0.35rem;
}

.fin-card--minimal .fin-card-value {
    font-size: 1.12rem;
}

.fin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.fin-card-ico {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.fin-card-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.fin-card-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.fin-card-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.fin-card-hint {
    font-size: 0.65rem;
    color: #64748b;
}

.fin-card--green { border-color: rgba(34, 197, 94, 0.25); }
.fin-card--red { border-color: rgba(248, 113, 113, 0.28); }
.fin-card--purple { border-color: rgba(167, 139, 250, 0.35); }
.fin-card--amber { border-color: rgba(245, 158, 11, 0.35); }
.fin-card--blue { border-color: rgba(59, 130, 246, 0.35); }

.fin-chart-card,
.fin-toolbar,
.fin-table-card,
.fin-detail {
    margin-bottom: 1rem;
}

.fin-section-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

.fin-section-sub {
    margin: 0 0 0.75rem;
}

.fin-chart-svg-wrap {
    overflow-x: auto;
}

.fin-chart-svg {
    width: 100%;
    max-width: 720px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.fin-chart-legend {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.fin-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.fin-dot--e { background: #34d399; }
.fin-dot--s { background: #f87171; }
.fin-dot--l { background: #a78bfa; }
.fin-dot--c { background: #fbbf24; }

.fin-chart-labels {
    display: flex;
    justify-content: space-between;
    max-width: 720px;
    margin: 0.35rem auto 0;
    font-size: 0.68rem;
    color: #64748b;
    padding: 0 0.5rem;
}

.fin-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.fin-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.fin-filter-field select,
.fin-filter-field input[type="date"] {
    min-width: 10rem;
}

.fin-dl {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.35rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.88rem;
}

.fin-dl dt {
    color: #94a3b8;
    font-weight: 600;
}

.fin-dl dd {
    margin: 0;
}

.fin-table th,
.fin-table td {
    font-size: 0.82rem;
}

.fin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.fin-inline-form {
    display: inline;
}

.fin-pagination {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.fin-pagination a {
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    text-decoration: none;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.fin-pagination a.is-active {
    background: rgba(99, 102, 241, 0.35);
    border-color: rgba(129, 140, 248, 0.5);
    color: #fff;
}

.fin-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fin-badge--ok {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
}

.fin-badge--pend {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
}

.fin-modal-backdrop {
    z-index: 1180;
}

.fin-modal {
    z-index: 1190;
}

.fin-modal-card {
    width: min(26rem, 100%);
}

.fin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fin-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.fin-servidor-mes-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(251, 146, 60, 0.35);
    border-radius: 14px;
}

.fin-servidor-mes-ico {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.fin-servidor-mes-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.fin-servidor-mes-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fb923c;
}

.fin-servidor-mes-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
}

.fin-servidor-mes-hint {
    font-size: 0.72rem;
    color: #94a3b8;
}

.fin-card-hint--sub {
    display: block;
    margin-top: 0.2rem;
    color: #fb923c;
}

.fin-btn-servidor {
    white-space: nowrap;
}

.fin-ds-modal-card {
    max-height: min(92vh, 720px);
    overflow-y: auto;
}

.fin-ds-intro {
    margin: 0 0 1rem;
    line-height: 1.45;
}

.fin-ds-list-wrap {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.fin-ds-list-title {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.fin-ds-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.fin-ds-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.fin-ds-list-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.fin-ds-list-obs {
    display: block;
    max-width: 280px;
}

.fin-ds-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.fin-ds-historico {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .fin-head-actions {
        width: 100%;
    }
    .fin-head-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
    .fin-btn-servidor {
        font-size: 0.78rem;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }
    .fin-servidor-mes-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .fin-ds-list-item {
        flex-direction: column;
    }
    .fin-ds-list-actions {
        width: 100%;
    }
    .fin-ds-list-actions .btn {
        flex: 1;
    }
}

@media (max-width: 959px) {
    .clients-saas-filters-grid {
        grid-template-columns: 1fr;
    }
}

/* ——— Produtos & Vendas (estoque simplificado) ——— */
.pv-metrics {
    margin-bottom: 1rem;
}

.pv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.pv-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pv-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: min(100%, 220px);
    justify-content: flex-end;
}

.pv-search-input {
    min-width: min(100%, 200px);
    max-width: 280px;
    flex: 1;
}

.pv-table-wrap {
    margin-bottom: 1.5rem;
}

.pv-table {
    min-width: 520px;
}

.pv-prod-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.pv-prod-meta {
    margin-top: 0.12rem;
}

.pv-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pv-stock--ok {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.pv-stock--ok::before {
    content: '🟢';
    font-size: 0.65rem;
}

.pv-stock--low {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.pv-stock--low::before {
    content: '🟡';
    font-size: 0.65rem;
}

.pv-stock--out {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.pv-stock--out::before {
    content: '🔴';
    font-size: 0.65rem;
}

.pv-stock-qty {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.pv-td-actions {
    white-space: nowrap;
}

.pv-td-actions .btn {
    margin: 0 0.12rem;
}

.pv-inline-del {
    display: inline;
}

.pv-empty {
    text-align: center;
    padding: 1.5rem !important;
}

.modal-backdrop--pv {
    z-index: 76;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.modal-backdrop--pv.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-pv {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 82;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal-pv.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-pv-card {
    width: min(440px, 100%);
    max-height: min(90vh, 640px);
    overflow-y: auto;
    padding: 1.15rem 1.25rem 1.1rem;
    transform: scale(0.94) translateY(8px);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-pv.is-open .modal-pv-card {
    transform: scale(1) translateY(0);
}

.modal-pv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-pv-head h3 {
    margin: 0;
    font-size: 1.08rem;
}

.pv-form .field textarea {
    min-height: 4rem;
    resize: vertical;
}

.pv-report-section {
    margin-top: 1.25rem;
    scroll-margin-top: 5rem;
}

.pv-period-card {
    margin-bottom: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.pv-period-card-title {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.pv-period-card-sub {
    margin: 0;
}

.pv-period-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.pv-period-metric {
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.pv-period-metric-label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.pv-period-metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.pv-period-metric-value--profit {
    color: #86efac;
}

.pv-report-filters-wrap {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pv-report-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.65rem;
    min-width: min(100%, 640px);
}

.pv-report-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 auto;
    min-width: 7.5rem;
}

.pv-report-filter-label {
    font-size: 0.72rem;
    color: var(--muted);
}

.pv-report-filter-input {
    width: 100%;
    min-height: 2.15rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text);
    font-size: 0.85rem;
}

.pv-report-filter-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding-bottom: 0.05rem;
}

@media (max-width: 720px) {
    .pv-period-metrics {
        grid-template-columns: 1fr;
    }

    .pv-report-filters {
        flex-wrap: wrap;
        min-width: 100%;
    }

    .pv-report-filter-field {
        min-width: calc(50% - 0.35rem);
    }

    .pv-report-filter-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.pv-report-head {
    margin-bottom: 0.65rem;
}

.pv-report-title {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
}

.pv-report-table-wrap {
    margin-bottom: 0.5rem;
}

.pv-report-table {
    min-width: 720px;
}

.pv-report-scroll {
    max-height: min(420px, 55vh);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.pv-report-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pv-report-pager-info {
    min-width: 8rem;
    text-align: center;
}

.pv-sale-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.pv-sale-actions .client-act-btn {
    flex-shrink: 0;
}

.pv-ajax-msg {
    margin-top: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
}

.pv-ajax-msg.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.pv-form-error {
    margin: 0.35rem 0 0.5rem;
}

@media (max-width: 640px) {
    .pv-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pv-toolbar-actions {
        width: 100%;
    }

    .pv-toolbar-actions .btn {
        flex: 1;
    }

    .pv-search-form {
        justify-content: stretch;
    }

    .pv-search-input {
        max-width: none;
    }

    .modal-pv {
        align-items: flex-end;
        padding: 0.5rem;
    }

    .modal-pv-card {
        width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}
