/* ============================================
   CaioCriações - Design System v2
   Recoleta + DM Sans + Paleta Violeta/Dourado
   ============================================ */

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

@font-face {
    font-family: 'Recoleta';
    src: url('../fonts/Recoleta-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Recoleta';
    src: url('../fonts/Recoleta-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* === Paleta Brand === */
    --color-violet:        #5503A6;
    --color-violet-dark:   #210140;
    --color-violet-hover:  #3D0080;
    --color-violet-active: #2A0060;
    --color-magenta:       #812189;
    --color-yellow:        #FDB700;
    --color-yellow-dark:   #E5A500;
    --color-red:           #E8000F;
    
    /* === Neutros === */
    --color-white:         #FFFFFF;
    --color-off-white:     #F7F4FC;  /* tinted bg */
    --color-gray-100:      #EDE8F5;
    --color-gray-200:      #C9BFE0;
    --color-gray-400:      #8B7FA8;
    --color-gray-600:      #4A4260;
    --color-near-black:    #313131;
    --color-black:         #0D0010;
    
    /* === Semântico === */
    --color-success:       #1E9E5E;
    --color-success-bg:    #ECFDF5;
    --color-success-text:  #065F46;
    --color-error:         #E8000F;
    --color-error-bg:      #FEF2F2;
    --color-error-text:    #991B1B;
    --color-warning:       #FDB700;
    --color-warning-bg:    #FFFBEB;
    --color-warning-text:  #92400E;
    --color-info:          #5503A6;
    --color-info-bg:       #F0EEFF;
    --color-info-text:     #3D0080;
    
    /* === Tipografia === */
    --font-display: 'Recoleta', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* === Espaço === */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    
    /* === Borda === */
    --radius-sm:    4px;
    --radius-md:    8px;
    --radius-lg:    16px;
    --radius-xl:    24px;
    --radius-pill:  999px;
    
    /* === Sombra === */
    --shadow-1: 0 1px 3px rgba(33,1,64,0.08), 0 1px 2px rgba(33,1,64,0.06);
    --shadow-2: 0 4px 12px rgba(33,1,64,0.10), 0 2px 4px rgba(33,1,64,0.06);
    --shadow-3: 0 8px 24px rgba(33,1,64,0.14), 0 4px 8px rgba(33,1,64,0.08);
    --shadow-4: 0 16px 48px rgba(33,1,64,0.18), 0 8px 16px rgba(33,1,64,0.10);
    
    /* === Layout === */
    --sidebar-width: 256px;
    --header-height: 72px;
    
    /* === Transição === */
    --t-fast:   150ms;
    --t-normal: 250ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: var(--font-body);
    background: var(--color-off-white);
    color: var(--color-near-black);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-violet-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; }

a { color: var(--color-violet); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-violet-hover); }

/* ============ LAYOUT ============ */

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

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-violet-dark);
    color: var(--color-white);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-white);
    letter-spacing: -0.02em;
}

.sidebar-brand .brand-tag {
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-yellow);
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

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

.sidebar-section {
    padding: 18px 24px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--t-fast);
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--color-white);
}

.sidebar-nav a.active {
    background: rgba(253,183,0,0.12);
    color: var(--color-yellow);
    border-left-color: var(--color-yellow);
}

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

.sidebar-footer {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-yellow);
    color: var(--color-violet-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* === MAIN === */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-100);
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-violet-dark);
}

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

.content { padding: 32px 36px; max-width: 1400px; }

/* ============ COMPONENTES ============ */

/* Page Header */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

.page-header .page-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-violet);
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-violet-dark);
    letter-spacing: -0.03em;
}

.page-header .page-subtitle {
    color: var(--color-gray-600);
    margin-top: 6px;
    font-size: 0.95rem;
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--color-gray-100);
    transition: box-shadow var(--t-normal);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-gray-100);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-violet-dark);
}

/* Stats / KPI Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--color-gray-100);
    transition: all var(--t-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-3);
}

.stat-card.accent {
    background: linear-gradient(135deg, var(--color-violet-dark) 0%, var(--color-violet) 100%);
    color: var(--color-white);
    border: none;
}

.stat-card.accent .stat-label,
.stat-card.accent .stat-value,
.stat-card.accent .stat-meta {
    color: var(--color-white);
}

.stat-card.accent .stat-label { color: var(--color-yellow); }

.stat-card.yellow {
    background: var(--color-yellow);
    border: none;
}

.stat-card.yellow .stat-label,
.stat-card.yellow .stat-value,
.stat-card.yellow .stat-meta { color: var(--color-violet-dark); }

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-gray-400);
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-violet-dark);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-meta {
    font-size: 0.82rem;
    color: var(--color-gray-400);
    margin-top: 8px;
}

.stat-meta.positive { color: var(--color-success); }
.stat-meta.negative { color: var(--color-error); }

/* Botões — Pill Style */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--color-violet);
    color: var(--color-white);
}
.btn-primary:hover { background: var(--color-violet-hover); color: var(--color-white); }
.btn-primary:active { background: var(--color-violet-active); transform: scale(0.98); }

.btn-yellow {
    background: var(--color-yellow);
    color: var(--color-violet-dark);
    font-weight: 700;
}
.btn-yellow:hover { background: var(--color-yellow-dark); color: var(--color-violet-dark); }

.btn-secondary {
    background: transparent;
    color: var(--color-violet);
    border: 2px solid var(--color-violet);
    padding: 9px 20px;
}
.btn-secondary:hover { background: var(--color-violet); color: var(--color-white); }

.btn-ghost {
    background: transparent;
    color: var(--color-gray-600);
    border: 1px solid var(--color-gray-200);
}
.btn-ghost:hover {
    background: var(--color-off-white);
    color: var(--color-violet-dark);
    border-color: var(--color-violet);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}
.btn-danger:hover { background: #B30000; color: var(--color-white); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-green  { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-blue   { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-yellow { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-red    { background: var(--color-error-bg); color: var(--color-error-text); }
.badge-purple { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-gray   { background: var(--color-gray-100); color: var(--color-gray-600); }
.badge-violet { background: var(--color-violet); color: var(--color-white); }
.badge-dark   { background: var(--color-violet-dark); color: var(--color-yellow); }

/* Tabelas */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-gray-100);
    background: var(--color-white);
    box-shadow: var(--shadow-1);
}

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

table thead th {
    background: var(--color-off-white);
    padding: 14px 18px;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gray-600);
    font-weight: 700;
    border-bottom: 1px solid var(--color-gray-100);
}

table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-gray-100);
    font-size: 0.9rem;
    color: var(--color-near-black);
}

table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--color-off-white); }

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

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-violet-dark);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-violet-dark);
    transition: all var(--t-fast);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-gray-400); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-violet);
    box-shadow: 0 0 0 3px rgba(85,3,166,0.12);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

/* Alertas */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}
.alert-danger,
.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}
.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}
.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info-text);
}

/* Progress Bar */
.progress {
    height: 6px;
    background: var(--color-gray-100);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-violet), var(--color-magenta));
    border-radius: var(--radius-pill);
    transition: width 0.6s ease;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-gray-100);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid var(--color-gray-200);
    z-index: 1;
}

.timeline-item.concluido::before {
    background: var(--color-yellow);
    border-color: var(--color-yellow);
}

.timeline-item.em_andamento::before {
    background: var(--color-violet);
    border-color: var(--color-violet);
    box-shadow: 0 0 0 4px rgba(85,3,166,0.15);
}

.timeline-item.aguardando_cliente::before {
    background: var(--color-magenta);
    border-color: var(--color-magenta);
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-violet-dark);
    margin-bottom: 4px;
}

.timeline-meta {
    font-size: 0.82rem;
    color: var(--color-gray-400);
    margin-bottom: 8px;
}

.timeline-content {
    color: var(--color-gray-600);
    font-size: 0.9rem;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-violet-dark);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(85,3,166,0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(253,183,0,0.15) 0%, transparent 50%);
    padding: 24px;
}

.login-box {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-4);
    text-align: center;
}

.login-brand { margin-bottom: 32px; }

.login-brand h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.25rem;
    color: var(--color-violet-dark);
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.login-brand .tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-violet);
    font-weight: 700;
}

.login-form .form-input {
    padding: 14px 16px;
    font-size: 0.95rem;
}

.login-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    justify-content: center;
}

/* Project Card */
.project-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: all var(--t-normal);
    box-shadow: var(--shadow-1);
    border: 1px solid var(--color-gray-100);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-3);
}

.project-card-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.project-card .project-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-violet);
    font-weight: 700;
    margin-bottom: 8px;
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-card .project-desc {
    color: var(--color-gray-600);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.project-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.project-progress-info .label { color: var(--color-gray-400); }

.project-progress-info .value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-violet-dark);
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--color-gray-400);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--color-gray-200);
    margin-bottom: 16px;
}

.empty-state h3 {
    color: var(--color-gray-600);
    margin-bottom: 8px;
}

/* ============ CRM KANBAN ============ */
.kanban {
    display: grid;
    grid-template-columns: repeat(6, minmax(240px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-col {
    background: var(--color-off-white);
    border-radius: var(--radius-lg);
    padding: 14px;
    min-height: 400px;
    border: 1px solid var(--color-gray-100);
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-gray-100);
}

.kanban-col-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--color-violet-dark);
}

.kanban-col-count {
    background: var(--color-violet);
    color: var(--color-white);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.lead-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: all var(--t-fast);
    border-left: 3px solid var(--color-violet);
    text-decoration: none;
    display: block;
}

.lead-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
    border-left-color: var(--color-yellow);
}

.lead-card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-violet-dark);
    margin-bottom: 4px;
}

.lead-card-meta {
    font-size: 0.78rem;
    color: var(--color-gray-400);
    margin-bottom: 8px;
}

.lead-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.lead-tag {
    background: var(--color-info-bg);
    color: var(--color-info-text);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
}

.lead-card-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-violet);
    margin-top: 6px;
}

/* ============ UTILITIES ============ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-muted { color: var(--color-gray-400); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ============ BOTÃO HAMBURGUER (só aparece no mobile) ============ */
.btn-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-violet-dark);
    flex-shrink: 0;
}
.btn-menu svg { width: 20px; height: 20px; }

/* ============ OVERLAY (fecha sidebar ao clicar fora) ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(33, 1, 64, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ============ RESPONSIVO — TABLET (≤ 1024px) ============ */
@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }

    .content { padding: 24px 28px; }

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

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

/* ============ RESPONSIVO — MOBILE GRANDE (≤ 768px) ============ */
@media (max-width: 768px) {

    /* Sidebar vira drawer deslizante */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--t-normal);
        z-index: 100;
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }

    /* Main ocupa tela toda */
    .main { margin-left: 0; }

    /* Topbar adaptada */
    .topbar {
        padding: 0 16px;
        gap: 12px;
    }

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

    /* Hamburguer aparece */
    .btn-menu { display: flex; }

    /* Conteúdo */
    .content { padding: 16px; }

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

    .page-header h1 { font-size: 1.75rem; }

    .page-header > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    /* Stats: 2 colunas no mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.4rem; }

    /* Grid colapsa */
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 14px; }

    /* Cards */
    .card { padding: 18px; }
    .card-header { flex-wrap: wrap; gap: 8px; }

    /* Formulários */
    .form-row, .form-row-3 { grid-template-columns: 1fr; }

    /* Tabelas: scroll horizontal */
    .table-wrap { border-radius: var(--radius-md); }
    table thead th { padding: 10px 12px; font-size: 0.68rem; }
    table tbody td { padding: 10px 12px; font-size: 0.85rem; }

    /* Kanban: scroll horizontal com colunas de tamanho fixo */
    .kanban {
        grid-template-columns: repeat(6, 260px);
        padding-bottom: 12px;
    }

    /* Timeline */
    .timeline { padding-left: 24px; }

    /* Botões menores */
    .btn { padding: 9px 16px; font-size: 0.82rem; }
    .btn-sm { padding: 6px 11px; font-size: 0.75rem; }

    /* Modal */
    .modal-wrap {
        padding: 12px !important;
        align-items: flex-end !important;
    }
    .modal-wrap > .card {
        max-width: 100% !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Login */
    .login-box { padding: 32px 24px; }
    .login-brand h1 { font-size: 1.875rem; }
}

/* ============ RESPONSIVO — MOBILE PEQUENO (≤ 480px) ============ */
@media (max-width: 480px) {

    .content { padding: 12px; }

    /* Stats: 1 coluna em telas muito pequenas */
    .stats-grid { grid-template-columns: 1fr; gap: 8px; }

    /* Topbar: esconde botões extras, mantém só hamburguer e título */
    .topbar-actions .btn:not(:last-child) { display: none; }

    .page-header h1 { font-size: 1.5rem; }

    .stat-value { font-size: 1.25rem; }
    .card { padding: 14px; }

    /* Tabela: oculta colunas menos importantes */
    .col-hide-sm { display: none; }

    /* Lead card menor */
    .lead-card { padding: 10px; }
    .lead-card-name { font-size: 0.88rem; }

    /* Kanban colunas um pouco menores */
    .kanban { grid-template-columns: repeat(6, 230px); gap: 10px; }
}
