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

:root {
    /* Inovasoft Precision - paleta */
    --primary: #006e2f;
    --primary-soft: #22c55e;
    --primary-strong: #005321;
    --secondary: #0058be;
    --secondary-soft: #2170e4;
    --surface: #f8f9ff;
    --surface-card: #ffffff;
    --surface-muted: #eff4ff;
    --surface-container: #e5eeff;
    --text: #0b1c30;
    --muted: #3d4a3d;
    --muted-soft: #6d7b6c;
    --line: #e2e8f0;
    --outline: #cbd5e1;
    --danger: #ba1a1a;
    --danger-strong: #cf1717;
    --warning: #d68a00;
    --success: #006e2f;
    --info: #0058be;
    --brand-gradient: linear-gradient(135deg, #006e2f 0%, #0058be 100%);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
    --radius: .5rem;
    --radius-lg: 1rem;
    --sidebar-width: 260px;
    --dashboard-sales: #0058be;
    --dashboard-revenue: #006e2f;
}


* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--surface);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .headline {
    font-family: 'Plus Jakarta Sans', Inter, Arial, sans-serif;
    letter-spacing: -0.01em;
}


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

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

img {
    max-width: 100%;
}

.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 24px 16px;
    color: #fff;
    background: linear-gradient(180deg, #00003c 0%, #008a68 100%);
    box-shadow: 10px 0 26px rgba(0, 0, 0, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin: 0 8px 42px;
    flex: 0 0 auto;
}

.brand img,
.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 3px solid #fff;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
}

.brand img {
    object-fit: contain;
    padding: 3px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
}

.brand strong {
    display: block;
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.1;
}

.brand small {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
}

.brand-mark.large {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    font-size: 20px;
}

.nav {
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    margin: 0 -4px;
    padding: 0 4px;
    -webkit-overflow-scrolling: touch;
}

/* Barra de rolagem discreta na sidebar */
.nav::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .25);
    border-radius: 3px;
}

.nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    margin: 0 -8px;
    padding: 12px 18px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 800;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.nav-link:active {
    transform: scale(.98);
}

.nav-link.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .10);
}

.nav-link.active .material-symbols-outlined {
    font-variation-settings: "FILL" 1, "wght" 200, "GRAD" 0, "opsz" 24;
}

.sidebar-footer {
    display: grid;
    gap: 16px;
    margin-top: 16px;
    padding: 0 4px;
    flex: 0 0 auto;
}

.company-block {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    overflow-wrap: anywhere;
}

.company-block div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-block .material-symbols-outlined {
    color: rgba(255, 255, 255, .72);
    font-size: 19px;
}

.company-block strong {
    color: #fff;
    font-size: 13px;
}

.company-block small {
    color: rgba(255, 255, 255, .52);
    font-size: 11px;
}

.main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    background: var(--surface);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 96px;
    padding: 20px 32px 14px;
    background: rgba(249, 249, 252, .96);
    backdrop-filter: blur(10px);
}

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

.topbar h1,
.auth-card h1,
.panel h2,
.summary-panel h2,
.asaas-summary h2 {
    margin: 0;
    line-height: 1.16;
}

.topbar h1 {
    color: var(--primary);
    font-size: 24px;
    font-weight: 800;
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    max-width: 260px;
    padding: 8px 16px 8px 10px;
    border: 1px solid var(--outline);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    cursor: default;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.menu-toggle {
    display: none;
}

.content-wrap {
    padding: 28px 32px 36px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 34px;
}

.metric-card,
.panel,
.auth-card {
    border: 1px solid rgba(198, 197, 213, .42);
    border-radius: 12px;
    background: var(--surface-card);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 148px;
    padding: 28px 24px 22px;
    border-top: 4px solid var(--primary);
    transition: transform .18s ease, box-shadow .18s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
}

.metric-card span {
    display: block;
    min-height: 42px;
    color: #333546;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.metric-card strong {
    display: block;
    margin-top: 18px;
    color: var(--primary);
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.metric-card.success {
    border-top-color: var(--secondary);
}

.metric-card.success strong,
.metric-card.money strong {
    color: var(--secondary);
}

.metric-card.danger {
    border-top-color: var(--danger);
}

.metric-card.danger strong {
    color: var(--danger);
}

.metric-card.neutral {
    border-top-color: var(--muted);
}

.metric-card.neutral strong {
    color: #111;
}

.metric-card.money strong {
    font-size: 28px;
    line-height: 1.35;
}

.split-grid,
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 34px;
}

.panel {
    padding: 22px;
}

.dashboard-panel {
    min-height: 392px;
    padding: 0;
    overflow: hidden;
}

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

.dashboard-panel .panel-head {
    min-height: 84px;
    margin: 0;
    padding: 24px 34px;
    border-bottom: 1px solid rgba(198, 197, 213, .28);
    background: rgba(255, 255, 255, .72);
}

.panel h2 {
    color: var(--primary);
    font-size: 24px;
    font-weight: 800;
}

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.filters.wide label {
    min-width: 150px;
}

label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

label span {
    color: #4d5263;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    outline: none;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.input-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 138, 104, .14);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.btn .material-symbols-outlined {
    font-size: 20px;
}

.btn-small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.btn-secondary {
    color: #fff;
    background: var(--primary);
}

.btn-light {
    color: var(--secondary);
    border-color: rgba(0, 138, 104, .22);
    background: #fff;
}

.btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
}

.btn-danger,
.btn-logout {
    color: #fff;
    background: var(--danger-strong);
}

.btn-whatsapp {
    color: #fff;
    background: #13a65a;
}

.btn-banner {
    color: var(--primary);
    background: #fff;
    min-width: 160px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

/* Quando o menu "Mais" (details) esta aberto, nao recortar o dropdown */
.table-wrap:has(.row-more[open]) {
    overflow: visible;
}
.panel:has(.row-more[open]) {
    overflow: visible;
}
/* O menu abre para a ESQUERDA e por cima, garantindo que nao saia da tela */
.row-more[open] .row-more-menu {
    z-index: 60;
}
.row-more.drop-up .row-more-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}

.dashboard-panel .table-wrap {
    padding: 12px 22px 26px;
}

table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(198, 197, 213, .35);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

td strong {
    display: block;
}

td small {
    display: block;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.actions-col {
    width: 260px;
}

.row-actions,
.quick-actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-actions {
    margin-bottom: 16px;
}

.form-panel {
    max-width: 980px;
}

.wide-panel {
    max-width: 1180px;
}

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

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

.form-stack {
    display: grid;
    gap: 14px;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.settings-actions {
    grid-column: 1 / -1;
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin-top: 18px;
}

.switch-line {
    display: inline-flex;
    grid-column: span 2;
    align-items: center;
    gap: 9px;
}

.switch-line input {
    width: 18px;
    min-height: 18px;
}

.switch-line.compact {
    grid-column: auto;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 8px;
    color: #435066;
    background: #eef2f7;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-green {
    color: #07633c;
    background: #dcf8eb;
}

.badge-blue {
    color: #0b4d97;
    background: #e0efff;
}

.badge-yellow {
    color: #805207;
    background: #fff3d8;
}

.badge-red {
    color: #9b1f1f;
    background: #ffe2e2;
}

.badge-teal {
    color: #08756e;
    background: #def7f3;
}

.badge-gray {
    color: #4f5967;
    background: #edf0f4;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.alert-success {
    color: #075b3b;
    background: #dff8eb;
}

.alert-error {
    color: #8f1d1d;
    background: #ffe2e2;
}

.empty,
.muted {
    color: var(--muted);
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(198, 197, 213, .42);
    border-radius: 8px;
    background: var(--surface-muted);
}

.file-info span {
    color: #4d5263;
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 306px;
    padding: 34px;
    text-align: center;
}

.empty-state .material-symbols-outlined {
    display: inline-grid;
    place-items: center;
    width: 80px;
    height: 80px;
    margin-bottom: 18px;
    border-radius: 999px;
    color: #9ba0aa;
    background: #e6e6e9;
    font-size: 42px;
}

.empty-state strong {
    color: #303242;
    font-size: 16px;
    font-weight: 500;
}

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

.dashboard-extra {
    margin-top: 34px;
}

.contract-reader {
    max-height: 420px;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: #242736;
    line-height: 1.65;
    white-space: normal;
}

.contract-reader.small {
    max-height: 220px;
}

.accept-card {
    width: min(900px, 100%);
}

.variable-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.variable-box strong {
    display: block;
    margin-bottom: 6px;
}

.variable-box p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.template-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.message-template-form {
    max-width: 1280px;
}

.message-editor-panel textarea {
    min-height: 460px;
    font-family: Consolas, "Liberation Mono", monospace;
    line-height: 1.55;
}

.variable-panel {
    max-height: 720px;
    overflow: auto;
}

.variable-groups {
    display: grid;
    gap: 16px;
}

.variable-category {
    padding: 14px;
    border: 1px solid rgba(198, 197, 213, .45);
    border-radius: 8px;
    background: var(--surface-muted);
}

.variable-category h3 {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.variable-token-grid,
.template-variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-token,
.mini-token {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid rgba(0, 138, 104, .18);
    border-radius: 8px;
    color: var(--secondary);
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.variable-token {
    cursor: pointer;
}

.variable-token:hover {
    border-color: rgba(0, 138, 104, .45);
    box-shadow: 0 6px 16px rgba(0, 138, 104, .10);
}

.message-validation {
    min-height: 38px;
    margin-top: 12px;
}

.mini-token.success {
    color: #075b3b;
    background: #dff8eb;
    border-color: rgba(7, 91, 59, .18);
}

.mini-token.danger {
    color: #8f1d1d;
    background: #ffe2e2;
    border-color: rgba(143, 29, 29, .18);
}

.preview-panel {
    margin-top: 24px;
}

.preview-panel pre {
    min-height: 180px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #242736;
    font: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.timeline-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.timeline-item small {
    display: block;
    color: var(--muted);
}

.timeline-item p {
    margin: 8px 0 0;
}

.security-banner {
    position: relative;
    min-height: 280px;
    margin-top: 34px;
    padding: 44px 48px;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(0, 0, 60, .98), rgba(0, 80, 96, .88) 52%, rgba(0, 138, 104, .92)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 16px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 16px);
    box-shadow: 0 16px 36px rgba(0, 0, 60, .18);
}

.security-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 35%, rgba(255, 255, 255, .12), transparent 24%),
        radial-gradient(circle at 55% 70%, rgba(255, 255, 255, .07), transparent 28%);
    opacity: .85;
}

.security-banner > div {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.banner-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .20);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.security-banner h2 {
    margin: 0;
    font-size: 34px;
    line-height: 1.18;
    font-weight: 800;
}

.security-banner p {
    margin: 22px 0 28px;
    font-size: 18px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .88);
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.segmented a {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
}

.segmented a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.summary-panel,
.asaas-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 18px;
    max-width: 980px;
    margin-bottom: 16px;
}

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

.summary-grid span {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.summary-grid strong {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 22px;
    background: linear-gradient(180deg, #00003c 0%, #008a68 100%);
}

.auth-wrap {
    width: min(430px, 100%);
}

.auth-card {
    padding: 28px;
}

.auth-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.auth-brand p,
.auth-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.client-page {
    min-height: 100vh;
    background: var(--surface);
}

.client-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

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

.client-topbar h1 {
    margin: 0;
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
}

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

.client-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

.client-nav a {
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid rgba(0, 138, 104, .18);
    border-radius: 8px;
    color: var(--secondary);
    background: #fff;
    font-weight: 800;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.client-banner {
    min-height: 220px;
}

@media (max-width: 1280px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .split-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .sidebar {
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform .2s ease;
        padding: 16px 14px;
    }

    .sidebar .brand {
        margin-bottom: 20px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        min-height: 84px;
        padding: 16px 18px 12px;
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 23px;
    }

    .content-wrap {
        padding: 20px 18px 28px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        color: var(--primary);
        font-weight: 800;
    }

    .user-chip {
        display: none;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters,
    .filters.wide {
        display: grid;
        grid-template-columns: 1fr;
    }

    .filters.wide label {
        min-width: 0;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .dashboard-panel .panel-head {
        padding: 20px;
    }

    .summary-panel,
    .asaas-summary,
    .summary-grid,
    .checklist-grid,
    .template-editor-grid {
        grid-template-columns: 1fr;
    }

    .variable-panel {
        max-height: none;
    }
}

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

    .input-action {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 120px;
    }

    .span-2,
    .switch-line {
        grid-column: span 1;
    }

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

    .row-actions,
    .quick-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .row-actions .btn,
    .row-actions form,
    .row-actions button,
    .quick-actions .btn,
    .quick-actions form,
    .quick-actions button,
    .form-actions .btn,
    .form-actions button {
        width: 100%;
    }

    .security-banner {
        min-height: 240px;
        padding: 30px 24px;
        border-radius: 16px;
    }

    .security-banner h2 {
        font-size: 28px;
    }

    .security-banner p {
        font-size: 16px;
    }

    .client-topbar,
    .file-info {
        align-items: stretch;
        flex-direction: column;
    }

    .client-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Dashboard: seletor de periodo, cards e graficos ===== */
.dashboard-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dashboard-toolbar-info h2 {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 20px;
}

.dashboard-toolbar-info p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.period-switch {
    display: inline-flex;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
}

.period-btn {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all .15s ease;
}

.period-btn:hover {
    color: var(--primary);
}

.period-btn.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 60, .25);
}

.period-metric-grid {
    margin-bottom: 24px;
}

.metric-card small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.dashboard-charts {
    margin-bottom: 24px;
}

.chart-box {
    position: relative;
    height: 280px;
    padding: 8px 4px 0;
}

.chart-box-doughnut {
    height: 280px;
}

.chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.chart-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.chart-legend .dot-sales {
    background: var(--dashboard-sales);
}

.chart-legend .dot-revenue {
    background: var(--dashboard-revenue);
}

@media (max-width: 720px) {
    .dashboard-toolbar {
        align-items: stretch;
    }
    .period-switch {
        width: 100%;
        justify-content: space-between;
    }
    .chart-box,
    .chart-box-doughnut {
        height: 240px;
    }
}

/* ===== Funil de vendas (Kanban) ===== */
.funnel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.funnel-header h2 {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 20px;
}

.funnel-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.btn-danger-soft {
    background: #fdecec;
    color: var(--danger);
}

.btn-danger-soft:hover {
    background: #fbdcdc;
}

.funnel-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
}

.funnel-column {
    flex: 0 0 270px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 14px;
    border-top: 4px solid var(--primary-soft);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.funnel-column.stage-warm { border-top-color: var(--warning); }
.funnel-column.stage-won { border-top-color: var(--secondary); }
.funnel-column.stage-lost { border-top-color: var(--danger); }

.funnel-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
}

.funnel-column-head strong {
    font-size: 13px;
    color: var(--text);
}

.funnel-count {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.funnel-sum {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary-soft);
}

.funnel-cards {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
}

.funnel-cards.is-over {
    background: rgba(32, 44, 97, .06);
    border-radius: 10px;
}

.deal-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    cursor: grab;
    transition: box-shadow .15s ease, transform .05s ease;
}

.deal-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
}

.deal-card.is-dragging {
    opacity: .5;
    transform: rotate(1deg);
}

.deal-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.deal-card-top strong {
    font-size: 14px;
    color: var(--text);
    line-height: 1.25;
}

.deal-edit {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    line-height: 0;
}

.deal-edit:hover { background: var(--surface-muted); color: var(--primary); }
.deal-edit .material-symbols-outlined { font-size: 18px; }

.deal-product {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--primary-soft);
    font-weight: 600;
}

.deal-meta {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deal-meta li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.deal-meta .material-symbols-outlined {
    font-size: 15px;
    color: var(--outline);
}

.deal-card-foot {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    display: flex;
    justify-content: flex-end;
}

.deal-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--secondary);
}

/* Modal */
.deal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.deal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 19, 38, .45);
}

.deal-modal-box {
    position: relative;
    background: var(--surface-card);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.deal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.deal-modal-head h3 { margin: 0; color: var(--primary); font-size: 17px; }

.deal-modal-x {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    line-height: 0;
    padding: 4px;
    border-radius: 8px;
}

.deal-modal-x:hover { background: var(--surface-muted); }

.deal-modal form { padding: 18px 20px; }

.deal-modal .field-2 { grid-column: 1 / -1; }

.deal-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.deal-modal-foot-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

body.modal-open { overflow: hidden; }

@media (max-width: 720px) {
    .funnel-column { flex-basis: 82vw; }
    .deal-modal-foot { flex-direction: column-reverse; align-items: stretch; }
    .deal-modal-foot-right { margin-left: 0; }
}

/* ===== Financeiro - Fase 1 (cadastros) ===== */
.nav-group-label {
    margin: 14px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

/* Submenu colapsavel na sidebar */
.nav-submenu-toggle {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-weight: 800;
}

.nav-caret {
    margin-left: auto;
    font-size: 20px;
    transition: transform .2s ease;
}

.nav-submenu.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-submenu-items {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    padding-left: 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}

.nav-submenu.is-open .nav-submenu-items {
    max-height: 560px;
}

.nav-sublink {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
}

.nav-sublink .material-symbols-outlined {
    font-size: 19px;
}

.field-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.field-checkbox input { width: auto; }

.muted-cell {
    color: var(--muted);
    text-align: center;
    padding: 18px 0;
}

.fin-setup-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.fin-tab {
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.fin-tab:hover { color: var(--primary); }

.fin-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
}

.fin-inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 0 16px;
}

.fin-inline-form input,
.fin-inline-form select {
    padding: 9px 12px;
    border: 1px solid var(--outline);
    border-radius: 9px;
    font: inherit;
}

.fin-inline-form input[type="text"] { min-width: 240px; flex: 1; }

.fin-row-form {
    display: contents;
}

.fin-row-form input[type="text"],
.fin-row-form select {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    width: 100%;
    max-width: 280px;
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.switch-inline input { width: auto; }

@media (max-width: 720px) {
    .fin-inline-form input[type="text"] { min-width: 0; width: 100%; }
}

/* ===== Ordem de Servico ===== */
.os-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.os-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.os-status-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.os-status-form select { padding: 8px 12px; border: 1px solid var(--outline); border-radius: 9px; font: inherit; }
.os-actions-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.os-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.os-detail-grid span { font-size: 12px; color: var(--muted); }
.os-detail-grid strong { font-size: 14px; color: var(--text); }

.os-text-block { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.os-text-block h4 { margin: 14px 0 4px; font-size: 13px; color: var(--primary); }
.os-text-block p { margin: 0; font-size: 14px; color: var(--text); }

.os-items-table input,
.os-items-table select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.os-totals {
    display: flex;
    gap: 24px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.os-totals > div { display: flex; flex-direction: column; align-items: flex-end; }
.os-totals span { font-size: 12px; color: var(--muted); }
.os-totals strong { font-size: 15px; color: var(--text); }
.os-total-final strong { font-size: 19px; color: var(--secondary); }

.os-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.os-timeline li { display: flex; gap: 12px; align-items: flex-start; }
.os-timeline-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--secondary); margin-top: 5px; flex: 0 0 10px;
}
.os-timeline strong { display: block; font-size: 14px; color: var(--text); }
.os-timeline small { color: var(--muted); font-size: 12px; }

.os-comment-form { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.os-comment-form textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 9px; font: inherit; }

.os-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.os-comments li { background: var(--surface-muted); border-radius: 10px; padding: 12px 14px; }
.os-comment-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.os-comment-head strong { font-size: 13px; color: var(--primary); }
.os-comment-head small { color: var(--muted); font-size: 12px; }
.os-comments p { margin: 0; font-size: 14px; }

@media (max-width: 720px) {
    .os-actions-bar { flex-direction: column; align-items: stretch; }
    .os-totals { justify-content: space-between; }
}

/* ===== NFS-e ===== */
.os-nfse-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.nfse-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-muted);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
}
.nfse-note .material-symbols-outlined { color: var(--primary-soft); font-size: 20px; }
.nfse-note p { margin: 0; font-size: 13px; color: var(--muted); }

/* ===== Cliente: detalhe e form ===== */
.os-detail-wide { grid-column: 1 / -1; }
.client-resp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.client-resp-card { background: var(--surface-muted); border-radius: 10px; padding: 14px 16px; }
.client-resp-card h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.client-resp-card p { margin: 0; font-weight: 600; }
.client-resp-card small { color: var(--muted); }
.client-section-title { margin: 22px 0 10px; font-size: 13px; color: var(--primary); }
.client-form-section { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.client-form-section h3 { margin: 0; font-size: 14px; color: var(--primary); }
.link-danger { background: none; border: 0; color: var(--danger, #dc2626); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; margin-left: 6px; }
@media (max-width: 720px) { .client-resp { grid-template-columns: 1fr; } }

/* ===== Catalogo ===== */
.catalog-picker { padding: 7px 10px; border: 1px solid var(--outline); border-radius: 9px; font: inherit; max-width: 240px; }

/* ===== Agenda e tarefas ===== */
.task-check {
    background: none; border: 2px solid var(--secondary); color: var(--secondary);
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px;
    line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.task-check:hover { background: var(--secondary); color: #fff; }
.task-check-done { border-color: #0a7a4f; color: #0a7a4f; cursor: default; }
.task-done td { opacity: .6; }
.task-done strong { text-decoration: line-through; }
.task-overdue { color: #ba1a1a; font-weight: 600; }

/* ===== Notificacoes (sino) ===== */
.notif-bell { position: relative; margin-right: 12px; }
.notif-bell-btn {
    position: relative; background: none; border: 0; cursor: pointer; padding: 6px;
    border-radius: 8px; color: var(--text); display: inline-flex;
}
.notif-bell-btn:hover { background: var(--surface-muted); }
.notif-badge {
    position: absolute; top: 0; right: 0; background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-dropdown {
    position: absolute; top: 44px; right: 0; width: 340px; max-width: 90vw;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14); z-index: 50; overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-head strong { font-size: 14px; }
.notif-readall { background: none; border: 0; color: var(--secondary); cursor: pointer; font-size: 12px; }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.notif-item a { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.notif-item a:hover { background: var(--surface-muted); }
.notif-item.is-unread a { background: #f0f7ff; }
.notif-item .material-symbols-outlined { color: var(--primary-soft, #4655a8); font-size: 20px; }
.notif-item-text { display: flex; flex-direction: column; gap: 1px; }
.notif-item-text strong { font-size: 13px; }
.notif-item-text small { font-size: 12px; color: var(--muted); }
.notif-item-text em { font-size: 11px; color: var(--muted); font-style: normal; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-footer { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--secondary); text-decoration: none; border-top: 1px solid var(--line); }
.notif-footer:hover { background: var(--surface-muted); }

/* Tags/categorias de cliente (segmentacao) */
.client-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.client-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    white-space: nowrap;
}
.cat-color-dot { display:inline-block; width:14px; height:14px; border-radius:50%; vertical-align:middle; }

/* ============================================================= */
/* Inovasoft Precision - refinamentos visuais (sobrescreve acima) */
/* ============================================================= */

/* Botoes: peso e cantos do padrao Precision + transicoes */
.btn {
    font-weight: 600;
    border-radius: var(--radius);
    transition: transform .04s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn-primary:hover { box-shadow: var(--shadow-md); }

.btn-secondary {
    color: #fff;
    background: var(--secondary);
}
.btn-light {
    color: var(--secondary);
    border-color: var(--outline);
    background: #fff;
}
.btn-light:hover { background: var(--surface-muted); filter: none; }

/* Cards / paineis: sombra suave "low-gravity" e cantos 16px */
.panel,
.metric-card,
.dashboard-panel,
.funnel-header {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

/* Inputs: borda outline -> foco azul com anel */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
input[type="tel"], select, textarea {
    border-radius: var(--radius);
    border: 1px solid var(--outline);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 88, 190, .15);
}

/* Tabelas: sem zebra, divisoria horizontal, hover de linha */
table thead th {
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted-soft);
}
table tbody tr { transition: background .12s ease; }
table tbody tr:hover { background: #f1f5f9; }

/* Badges: baixa saturacao no fundo, texto saturado (estilo chip) */
.badge { font-weight: 600; border-radius: var(--radius); }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Navegacao: mantida como no layout atual (sidebar escuro) nesta fatia */

/* Links no conteudo no tom secundario (azul), sem afetar menu/botoes */
.main a:not(.btn):not(.nav-link),
.content-wrap a:not(.btn):not(.nav-link) { color: var(--secondary); }

/* ============================================================= */
/* Precision - SIDEBAR BRANCO (igual aos prints)                  */
/* ============================================================= */
.sidebar {
    color: var(--text);
    background: #ffffff;
    border-right: 1px solid var(--line);
    box-shadow: none;
}
.brand strong { color: var(--secondary); }
.brand small { color: var(--muted-soft); }
.brand img, .brand-mark {
    border-color: var(--secondary);
    background: var(--surface-muted);
}
.brand-mark { color: var(--secondary); }

.nav-link {
    color: #44506a;
    font-weight: 600;
    border-radius: var(--radius);
}
.nav-link .material-symbols-outlined { color: #6b7689; }
.nav-link:hover {
    color: var(--secondary);
    background: var(--surface-muted);
}
/* item ATIVO: fundo azul solido, texto branco (como nos prints) */
.nav-link.active {
    color: #fff;
    background: var(--secondary);
    box-shadow: 0 6px 16px rgba(0, 88, 190, .25);
}
.nav-link.active .material-symbols-outlined { color: #fff; }

/* barra de rolagem discreta no tema claro */
.nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); }

/* blocos do rodape da sidebar no tema claro */
.company-block {
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--line);
}
.company-block strong { color: var(--text); }
.company-block small { color: var(--muted-soft); }
.company-block .material-symbols-outlined { color: var(--secondary); }
.sidebar-footer .nav-link { color: #44506a; }

/* botao "Novo lead" / acao no rodape: verde solido como nos prints */
.sidebar .btn-secondary,
.sidebar .btn-primary {
    background: var(--primary);
    color: #fff;
}

/* links no conteudo no tom secundario (azul), sem afetar menu/botoes */
.main a:not(.btn):not(.nav-link),
.content-wrap a:not(.btn):not(.nav-link) { color: var(--secondary); }

/* ============================================================= */
/* Precision - TELA DE LOGIN (1:1 com o print)                    */
/* ============================================================= */
body.auth-page {
    background: linear-gradient(135deg, #0a3d2e 0%, #0b1c30 55%, #0a1422 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0;
}
.login-card {
    background: #f8f9fb;
    border-radius: 20px;
    padding: 44px 44px 32px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo { max-height: 96px; max-width: 140px; object-fit: contain; }
.login-mark {
    width: 96px; height: 96px; border-radius: 50%;
    display: inline-grid; place-items: center;
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 30px;
    color: #fff; background: var(--brand-gradient);
    border: 3px solid #2bb673;
}
.login-title {
    text-align: center; margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700;
    font-size: 34px; letter-spacing: .04em; color: #16233a;
}
.login-sub {
    text-align: center; margin: 4px 0 28px;
    color: var(--secondary); font-weight: 600; font-size: 13px; letter-spacing: .22em;
}
.login-form { display: grid; gap: 18px; }
.login-field { display: grid; gap: 8px; }
.login-label {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 14px; font-weight: 600; color: #1f2a3d;
}
.login-label .material-symbols-outlined { font-size: 18px; color: #1f2a3d; }
.login-label-row { display: flex; align-items: center; justify-content: space-between; }
.login-forgot { font-size: 13px; color: var(--secondary); font-weight: 500; }
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
    width: 100%; min-height: 52px; padding: 12px 16px;
    border: 1px solid #e2e8f0; border-radius: 12px;
    background: #eef2fb; font-size: 15px; color: #16233a;
}
.login-card input::placeholder { color: #9aa6b8; }
.login-password { position: relative; }
.login-password input { padding-right: 48px; }
.login-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer; color: #5b6b82;
    display: inline-grid; place-items: center; padding: 8px;
}
.login-remember {
    display: flex; align-items: center; gap: 9px;
    font-size: 14px; color: #44506a; cursor: pointer;
}
.login-remember input { width: 17px; height: 17px; accent-color: var(--secondary); }
.login-submit {
    width: 100%; min-height: 56px; margin-top: 4px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 12px; cursor: pointer;
    color: #fff; font-size: 16px; font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(100deg, #0a2a1c 0%, #0f7a3d 55%, #18a04f 100%);
    transition: filter .15s ease, transform .04s ease;
}
.login-submit:hover { filter: brightness(1.06); }
.login-submit:active { transform: translateY(1px); }
.login-submit .material-symbols-outlined { font-size: 20px; }
.login-divider { height: 1px; background: #e2e8f0; margin: 22px 0 16px; }
.login-support { text-align: center; margin: 0; font-size: 14px; color: #44506a; }
.login-support a { color: var(--primary); font-weight: 700; }
.auth-footer {
    text-align: center; color: rgba(255,255,255,.5);
    font-size: 12px; letter-spacing: .08em; margin-top: 22px; text-transform: uppercase;
}

/* ============================================================= */
/* Precision - cabecalho de pagina + tabela de dados rica         */
/* ============================================================= */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-title {
    margin: 0; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 34px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.page-subtitle { margin: 4px 0 0; color: var(--muted-soft); font-size: 15px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* cartoes de metrica com icone */
.metric-card { position: relative; padding: 18px 20px; }
.metric-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: inline-grid; place-items: center; margin-bottom: 12px;
}
.metric-icon .material-symbols-outlined { font-size: 22px; }
.metric-label {
    display: block; font-size: 12px; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted-soft);
}
.metric-value {
    display: block; margin-top: 4px;
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 30px; font-weight: 700; color: var(--text);
}

.filters-panel { margin-bottom: 18px; }

/* celula de usuario com avatar de iniciais */
.cell-user { display: flex; align-items: center; gap: 12px; }
.avatar-initials {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--surface-container); color: var(--secondary);
    font-weight: 700; font-size: 14px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.cell-user-info { display: grid; gap: 1px; }
.cell-user-name { font-weight: 600; color: var(--text); }
.cell-user-info small { color: var(--muted-soft); font-size: 12px; }

/* status com bolinha */
.status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 6px; vertical-align: middle;
}
.status-dot.is-on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.status-dot.is-off { background: #cf1717; box-shadow: 0 0 0 3px rgba(207,23,23,.12); }

/* menu "Mais" por linha (sem reescrever JS global) */
.row-more { position: relative; display: inline-block; }
.row-more summary { list-style: none; }
.row-more summary::-webkit-details-marker { display: none; }
.row-more-menu {
    position: absolute; right: 0; z-index: 20; margin-top: 6px;
    min-width: 190px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-md); display: grid; gap: 2px;
}
.row-more-menu a, .row-more-danger {
    display: block; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 7px; font-size: 14px;
    color: var(--text); background: none; border: 0; cursor: pointer; text-decoration: none;
}
.row-more-menu a:hover { background: var(--surface-muted); }
.row-more-danger { color: var(--danger); }
.row-more-danger:hover { background: #fee2e2; }

/* ============================================================= */
/* Precision - Gestao de OS (5 cartoes, cartao destaque azul)     */
/* ============================================================= */
.os-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1100px) { .os-metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .os-metric-grid { grid-template-columns: 1fr; } }

/* cartao de receita em destaque (azul solido, como no print) */
.metric-card-accent {
    background: var(--brand-gradient);
    border: 0;
    color: #fff;
}
.metric-card-accent .metric-label { color: rgba(255,255,255,.85); }
.metric-card-accent .metric-value { color: #fff; }

/* cartao de alerta (expiradas) com leve fundo */
.metric-card-danger { background: #fef2f2; }

/* bolinha de status aguardando (amarela) */
.status-dot.is-wait { background: #d68a00; box-shadow: 0 0 0 3px rgba(214,138,0,.15); }

/* Precision - equipamentos */
.equip-metric-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 20px;
}
@media (max-width: 800px) { .equip-metric-grid { grid-template-columns: 1fr; } }
.equip-type-icon {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
    display: inline-grid; place-items: center;
    background: var(--surface-container); color: var(--secondary);
}
.equip-type-icon .material-symbols-outlined { font-size: 22px; }

/* Precision - portal do cliente */
.client-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.client-nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; border-radius: 10px; text-decoration: none;
    color: #44506a; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.client-nav-link .material-symbols-outlined { font-size: 18px; }
.client-nav-link:hover { background: var(--surface-muted); }
.client-nav-link.is-active { background: var(--secondary); color: #fff; }
.client-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .client-summary-grid { grid-template-columns: 1fr; } }

/* Chamados - galeria de midia */
.ticket-media { margin: 16px 0; }
.ticket-media-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.ticket-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ticket-media-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px; overflow: hidden; }
.ticket-media-item img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; }
.ticket-media-icon { width: 100%; height: 70px; display: grid; place-items: center; background: var(--surface-muted); border-radius: 6px; color: var(--secondary); }
.ticket-media-icon .material-symbols-outlined { font-size: 32px; }
.ticket-media-item small { font-size: 11px; text-align: center; }
