/* ============================================================
   Contabler Connect — CSS Base
   Fonte: Jost | Paleta: contabler.com.br
   ============================================================ */

/* ----------------------------------------------------------
   Fontes locais
   ---------------------------------------------------------- */
@font-face {
    font-family: 'Jost';
    src: url('../fonts/jost/jost-v20-latin-300.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Jost';
    src: url('../fonts/jost/jost-v20-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Jost';
    src: url('../fonts/jost/jost-v20-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Jost';
    src: url('../fonts/jost/jost-v20-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Jost';
    src: url('../fonts/jost/jost-v20-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* ----------------------------------------------------------
   Variáveis de design
   ---------------------------------------------------------- */
:root {
    /* Cores principais */
    --primary:          #1268df;
    --primary-hover:    #064295;
    --primary-light:    rgba(18, 104, 223, 0.12);
    --primary-dark:     #0a4db3;

    /* Backgrounds */
    --bg:               #f1f3f5;
    --bg-2:             #E9ECEF;
    --bg-card:          #ffffff;
    --bg-card-hover:    #F8F9FA;

    /* Bordas */
    --border:           rgba(0, 0, 0, 0.08);
    --border-strong:    rgba(0, 0, 0, 0.14);

    /* Texto */
    --text:             #1A1A2E;
    --text-muted:       #5A5F6B;
    --text-subtle:      #8B919C;
    --text-on-primary:  #ffffff;

    /* Semânticas */
    --success:          #22c55e;
    --success-light:    rgba(34, 197, 94, 0.12);
    --warning:          #f59e0b;
    --warning-light:    rgba(245, 158, 11, 0.12);
    --error:            #ef4444;
    --error-light:      rgba(239, 68, 68, 0.12);
    --info:             #3b82f6;
    --info-light:       rgba(59, 130, 246, 0.12);

    /* Raios */
    --radius-sm:        6px;
    --radius:           10px;
    --radius-lg:        16px;
    --radius-pill:      999px;

    /* Sombras */
    --shadow-sm:        0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-md:        0 8px 22px rgba(0, 0, 0, 0.08);
    --shadow-lg:        0 16px 40px rgba(15, 23, 42, 0.14);

    /* Tipografia */
    --font:             'Jost', sans-serif;
    --text-xs:          12px;
    --text-sm:          14px;
    --text-base:        16px;
    --text-lg:          20px;
    --text-xl:          24px;
    --text-2xl:         32px;

    /* Layout */
    --sidebar-w:        240px;
    --topbar-h:         60px;
    --container:        1200px;
    --gap:              24px;
}

/* ----------------------------------------------------------
   Reset
   ---------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover { color: var(--primary-hover); }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

button, input, select, textarea {
    font-family: var(--font);
    font-size: var(--text-sm);
}

/* ----------------------------------------------------------
   Layout principal (sidebar + conteúdo)
   ---------------------------------------------------------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--gap);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.app-content {
    flex: 1;
    padding: var(--gap);
}

/* ----------------------------------------------------------
   Sidebar
   ---------------------------------------------------------- */
.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-section-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 20px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-sm);
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-link span:first-of-type { flex: 1; }

.nav-badge {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}
.nav-badge-error { background: var(--error); color: #fff; }
.nav-badge-info  { background: var(--primary-light); color: var(--primary); }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ----------------------------------------------------------
   Topbar
   ---------------------------------------------------------- */
.topbar-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ----------------------------------------------------------
   Página / cabeçalho de seção
   ---------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Cards
   ---------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

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

/* Stat card (dashboard) */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-change {
    font-size: var(--text-xs);
    font-weight: 500;
    margin-top: 6px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ----------------------------------------------------------
   Botões
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--bg-2);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-2);
    color: var(--text);
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--text-xs);
    gap: 6px;
}
.btn-sm svg { width: 14px; height: 14px; }

.btn-lg {
    padding: 12px 24px;
    font-size: var(--text-base);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Formulários
   ---------------------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: var(--text-sm);
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-subtle);
}

.form-control:disabled {
    background: var(--bg-2);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A5F6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    margin-top: 4px;
}

.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: 4px;
}

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

.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Checkbox / radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ----------------------------------------------------------
   Tabela
   ---------------------------------------------------------- */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table thead th {
    background: var(--bg);
    padding: 10px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

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

.table tbody tr:hover td { background: var(--bg-card-hover); }

.table-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ----------------------------------------------------------
   Badges / Tags
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-success   { background: var(--success-light); color: #15803d; }
.badge-warning   { background: var(--warning-light); color: #b45309; }
.badge-error     { background: var(--error-light);   color: #dc2626; }
.badge-neutral   { background: var(--bg-2);          color: var(--text-muted); }
.badge-info      { background: var(--info-light);    color: var(--info); }

/* Status de lead */
.badge-novo          { background: var(--info-light);    color: var(--info); }
.badge-ativo         { background: var(--success-light); color: #15803d; }
.badge-quente        { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-frio          { background: var(--bg-2);          color: var(--text-muted); }
.badge-convertido    { background: var(--success-light); color: #15803d; }
.badge-descadastrado { background: var(--bg-2);          color: var(--text-subtle); }
.badge-arquivado     { background: var(--bg-2);          color: var(--text-subtle); }
.badge-sem-resposta  { background: var(--warning-light); color: #b45309; }
.badge-interessado   { background: var(--primary-light); color: var(--primary); }

/* ----------------------------------------------------------
   Avatar (iniciais)
   ---------------------------------------------------------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: var(--text-xs);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-sm); }

/* ----------------------------------------------------------
   Alertas / Flash messages
   ---------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}
.alert-error {
    background: var(--error-light);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}
.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.3);
}
.alert-info {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

/* ----------------------------------------------------------
   Busca e filtros
   ---------------------------------------------------------- */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-subtle);
    pointer-events: none;
}

.search-input-wrapper .form-control {
    padding-left: 34px;
}

/* ----------------------------------------------------------
   Tabs
   ---------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    text-decoration: none;
}

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

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ----------------------------------------------------------
   Modal
   ---------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
}

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ----------------------------------------------------------
   Paginação
   ---------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.page-btn:hover { background: var(--bg-2); color: var(--text); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ----------------------------------------------------------
   Estado vazio
   ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-subtle);
}

.empty-state h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ----------------------------------------------------------
   Histórico / Timeline
   ---------------------------------------------------------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 32px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

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

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
}
.timeline-dot svg { width: 14px; height: 14px; }

.timeline-content { flex: 1; padding-top: 4px; }

.timeline-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}

.timeline-time {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    margin-top: 2px;
}

/* ----------------------------------------------------------
   Utilitários
   ---------------------------------------------------------- */
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-warning { color: var(--warning); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }
.gap-24   { gap: 24px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.w-100  { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------
   Login (tela sem sidebar)
   ---------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.login-logo {
    margin: 0 auto 32px;
    display: block;
    height: 36px;
    width: auto;
}

.login-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 28px;
}

/* ----------------------------------------------------------
   Scrollbar personalizada (Webkit)
   ---------------------------------------------------------- */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-subtle); }

/* ----------------------------------------------------------
   Focus visível (acessibilidade)
   ---------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Remove outline apenas quando não for via teclado */
:focus:not(:focus-visible) { outline: none; }

/* ----------------------------------------------------------
   Responsividade básica (mobile)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: -240px;
        width: 240px;
        height: 100vh;
        z-index: 200;
        transition: left .25s ease;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.open { left: 0; }

    .app-main {
        margin-left: 0;
        padding: 16px;
    }

    /* Topbar com botão de menu */
    .topbar { position: sticky; top: 0; z-index: 100; }

    /* Grids viram 1 coluna */
    .card-grid,
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Tabela scroll horizontal */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Formulários full-width */
    .form-row { grid-template-columns: 1fr !important; }

    /* Page header empilhado */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .btn { font-size: 12px; padding: 6px 12px; }
    .page-title { font-size: var(--text-xl) !important; }
}
