/* ============================================================
   Prohidra ERP — Design System v2
   Mobile-first · Linear/Supabase/Vercel inspired
   ============================================================ */

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

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --blue:         #1a3a6b;
  --blue2:        #1e4480;
  --blue-light:   #dbeafe;
  --blue-text:    #1e3a8a;
  --gold:         #a87d34;
  --bg:           #f7f7f6;
  --surface:      #ffffff;
  --surface-2:    #f3f3f2;
  --surface-3:    #ececea;
  --text:         #1a1a18;
  --text-2:       #52524e;
  --text-3:       #8c8c87;
  --border:       rgba(0,0,0,.09);
  --border-2:     rgba(0,0,0,.14);
  --danger:       #c0392b;
  --danger-bg:    #fef2f2;
  --danger-text:  #991b1b;
  --success:      #15803d;
  --success-bg:   #f0fdf4;
  --warning-bg:   #fefce8;
  --warning-text: #854d0e;
  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    10px;
  --radius-xl:    12px;
  --font: 'Geist', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,.07);
}

/* ── Reset ──────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font);font-size:14px;line-height:1.5;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:var(--blue2);text-decoration:none}
a:hover{text-decoration:underline}
button,input,select,textarea{font-family:var(--font)}

/* ── Layout ─────────────────────────────────────────────── */
.layout{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
.content{min-width:0;padding:20px 24px;display:flex;flex-direction:column;gap:16px}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar{background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;overflow-x:hidden}
.brand-box{padding:14px 12px 12px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px;flex-shrink:0}
.brand-logo{max-width:140px;max-height:44px;width:auto;height:auto;object-fit:contain;display:block}
.nav{padding:8px;flex:1;display:flex;flex-direction:column;gap:0}
.nav-group{display:flex;flex-direction:column;padding-top:16px}
.nav-group:first-child{padding-top:4px}
.nav-group-label{font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--text-3);padding:0 10px 4px}
.nav a{display:flex;align-items:center;gap:8px;color:var(--text-2);padding:7px 10px;border-radius:var(--radius-md);font-size:13px;font-weight:400;transition:background .12s,color .12s;min-height:34px;line-height:1.3}
.nav a:hover{background:var(--surface-2);color:var(--text);text-decoration:none}
.nav a.active{background:var(--surface-2);color:var(--text);font-weight:500}
.nav a svg{width:15px;height:15px;flex-shrink:0;opacity:.65}
.nav a.active svg{opacity:1}
.nav .nav-subitem{margin-left:8px;padding-left:26px;font-size:12.5px;color:var(--text-3);min-height:30px}
.nav .nav-subitem.active{color:var(--text);font-weight:500}
.sidebar-footer{padding:8px;border-top:1px solid var(--border);flex-shrink:0;display:flex;flex-direction:column;gap:2px}
.sidebar-user{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--radius-md)}
.sidebar-avatar{width:26px;height:26px;border-radius:50%;background:var(--blue);color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;letter-spacing:.02em}
.sidebar-user-name{font-size:12px;font-weight:500;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.nav-unread-dot{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:#dc2626;color:#fff;font-size:9px;font-weight:700;line-height:1;flex-shrink:0;animation:navDotPulse 2s ease-in-out infinite}
@keyframes navDotPulse{0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.45)}50%{box-shadow:0 0 0 4px rgba(220,38,38,0)}}
.sidebar-logout{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:var(--radius-md);font-size:13px;font-weight:400;color:var(--text-3);text-decoration:none;transition:background .12s,color .12s}
.sidebar-logout:hover{background:var(--surface-2);color:var(--text);text-decoration:none}
.sidebar-logout svg{width:15px;height:15px;flex-shrink:0;display:block}
.mobile-nav-backdrop{display:none}
.mobile-nav-toggle{display:none}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar{display:flex;align-items:center;gap:12px;padding:0 24px;height:48px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10}
.search-form{flex:1;max-width:480px}
.search-form input{width:100%;height:34px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-2);font-size:13px;color:var(--text);transition:border-color .15s,background .15s}
.search-form input:focus{outline:none;border-color:var(--border-2);background:var(--surface);box-shadow:0 0 0 3px rgba(26,58,107,.08)}
.search-form input::placeholder{color:var(--text-3)}

/* ── Alert ──────────────────────────────────────────────── */
.alert{padding:10px 14px;border-radius:var(--radius-md);border:1px solid transparent;font-size:13px;font-weight:500}
.alert-success{background:var(--success-bg);border-color:#bbf7d0;color:var(--success)}
.alert-error{background:var(--danger-bg);border-color:#fecaca;color:var(--danger-text)}

/* ── Card ────────────────────────────────────────────────── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:20px;box-shadow:var(--shadow-sm)}

/* ── Page head ───────────────────────────────────────────── */
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.page-head h1{font-size:17px;font-weight:600;letter-spacing:-.02em;margin:0}
.page-head h2{font-size:15px;font-weight:600;letter-spacing:-.02em;margin:0}
.page-head h3{font-size:14px;font-weight:600;margin:0}
.muted{color:var(--text-3);font-size:13px}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;border-radius:var(--radius-md);padding:8px 14px;font-size:13px;font-weight:500;cursor:pointer;line-height:1;white-space:nowrap;transition:background .12s,box-shadow .12s;text-decoration:none;min-height:34px}
.btn svg{width:14px;height:14px;flex-shrink:0}
.btn-primary{background:var(--blue);color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.btn-primary:hover{background:var(--blue2);text-decoration:none;color:#fff}
.btn-secondary{background:var(--surface);color:var(--text);border:1px solid var(--border-2);box-shadow:var(--shadow-sm)}
.btn-secondary:hover{background:var(--surface-2);text-decoration:none;color:var(--text)}
.btn-danger{background:var(--danger-bg);color:var(--danger-text);border:1px solid #fecaca}
.btn-danger:hover{background:#fee2e2;text-decoration:none}
.btn-sm{padding:6px 10px;font-size:12px;min-height:30px}

/* ── Icon buttons ────────────────────────────────────────── */
.icon-btn{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text-3);text-decoration:none;transition:color .12s;flex-shrink:0}
.icon-btn svg{width:13px;height:13px;display:block}
.icon-btn:hover{background:transparent;color:var(--text);text-decoration:none}
.icon-btn-danger{background:transparent;color:var(--text-3)}
.icon-btn-danger:hover{background:transparent;color:var(--danger-text)}
.action-group{display:flex;align-items:center;gap:4px;flex-wrap:nowrap}
.inline-form{display:inline-flex;margin:0}
.status-select{min-width:140px}

/* ── Status badges ───────────────────────────────────────── */
.status-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:500;white-space:nowrap}
.status-Pendente{background:var(--warning-bg);color:var(--warning-text)}
.status-Enviado{background:var(--blue-light);color:var(--blue-text)}
.status-Cancelado{background:var(--surface-2);color:var(--text-3)}
.status-Suspenso{background:#f3e8ff;color:#6b21a8}
.status-Em\ execução{background:var(--success-bg);color:var(--success)}
.status-Concluído{background:#ecfeff;color:#164e63}
.status-Ativo{background:var(--success-bg);color:var(--success)}
.status-Inativo{background:var(--surface-2);color:var(--text-3)}

/* ── Compact list ────────────────────────────────────────── */
.compact-list{display:flex;flex-direction:column;gap:0;border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;background:var(--surface);margin-top:4px}
.clist-item{background:var(--surface);border-bottom:1px solid var(--border);padding:0 14px;display:flex;align-items:center;min-height:48px;gap:0;transition:background .12s}
.clist-item:last-child{border-bottom:none}
.clist-item:hover{background:var(--surface-2)}
.clist-row1{display:flex;align-items:center;gap:10px;min-width:0;flex:1;overflow:hidden}
.clist-row2{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-left:auto;padding-left:16px}
.clist-row3{display:none}
.clist-id{font-size:12px;font-weight:600;color:var(--blue2);white-space:nowrap;flex-shrink:0;min-width:72px}
.clist-id:hover{text-decoration:underline}
.clist-name{font-size:13px;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
a.clist-name:hover{text-decoration:underline;color:var(--text)}
.clist-date{font-size:11px;color:var(--text-3);white-space:nowrap;flex-shrink:0}
.clist-meta{display:flex;align-items:center;gap:12px;flex-shrink:0}
.clist-values{display:flex;align-items:center;gap:12px;flex-shrink:0}
.clist-total{font-size:13px;font-weight:500;color:var(--text);white-space:nowrap}
.clist-sub{font-size:11px;color:var(--text-3);white-space:nowrap}
.clist-divider{width:1px;height:12px;background:var(--border);flex-shrink:0}
.clist-thumb{width:28px;height:28px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--border);flex-shrink:0}
.clist-status{display:inline-flex;align-items:center;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:500;white-space:nowrap}
.s-ativo{background:var(--success-bg);color:var(--success)}
.s-inativo{background:var(--surface-2);color:var(--text-3)}
.s-prospect{background:var(--warning-bg);color:var(--warning-text)}
.s-recorrente{background:var(--blue-light);color:var(--blue-text)}
.clist-status-select{font-size:11px;padding:3px 20px 3px 7px;border-radius:999px;border:1px solid var(--border);background:var(--surface);font-weight:500;color:var(--text);appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);background-position:calc(100% - 10px) calc(50% - 1px),calc(100% - 6px) calc(50% - 1px);background-size:4px 4px,4px 4px;background-repeat:no-repeat;cursor:pointer}
.clist-item .action-group{opacity:1}
.action-group{gap:0}

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.table-search-input,.select-search-input{height:34px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-2);font-size:13px;color:var(--text);transition:border-color .15s,background .15s;min-width:180px}
.table-search-input:focus,.select-search-input:focus{outline:none;border-color:var(--border-2);background:var(--surface);box-shadow:0 0 0 3px rgba(26,58,107,.08)}
.table-search-input::placeholder{color:var(--text-3)}
.table-filter-select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);background-position:calc(100% - 14px) calc(50% - 1px),calc(100% - 10px) calc(50% - 1px);background-size:4px 4px,4px 4px;background-repeat:no-repeat;padding-right:32px}

/* ── Searchable select ───────────────────────────────────── */
.searchable-select{position:relative}
.searchable-select select{display:none}
.searchable-select-toggle{width:100%;min-height:38px;padding:8px 36px 8px 12px;border:1px solid var(--border-2);border-radius:var(--radius-md);background:var(--surface);font-size:13px;color:var(--text);cursor:pointer;position:relative;text-align:left}
.searchable-select-toggle::after{content:"";position:absolute;right:14px;top:50%;width:7px;height:7px;border-right:1.5px solid var(--text-3);border-bottom:1.5px solid var(--text-3);transform:translateY(-65%) rotate(45deg)}
.searchable-select-panel{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:20;background:var(--surface);border:1px solid var(--border-2);border-radius:var(--radius-lg);box-shadow:0 8px 24px rgba(0,0,0,.1);padding:8px;display:none}
.searchable-select.is-open .searchable-select-panel{display:block}
.searchable-select-input{width:100%;height:34px;padding:0 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2);font-size:13px}
.searchable-select-list{display:flex;flex-direction:column;gap:2px;max-height:220px;overflow:auto;margin-top:6px}
.searchable-select-option{padding:8px 10px;border:0;border-radius:var(--radius-sm);background:transparent;text-align:left;font-size:13px;color:var(--text);cursor:pointer}
.searchable-select-option:hover,.searchable-select-option.is-active{background:var(--surface-2)}
.searchable-select-empty{padding:10px;color:var(--text-3);font-size:13px}

/* ── Table ───────────────────────────────────────────────── */
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:10px 12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}
th{font-size:11px;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;background:var(--surface)}
td{font-size:13px}
tbody tr:hover td{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:0}
.thumb{width:40px;height:40px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface-2)}
.sort-btn{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:0;font:inherit;font-size:11px;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em;cursor:pointer}
.sort-btn::after{content:"";width:8px;height:8px;border-right:1.5px solid var(--text-3);border-bottom:1.5px solid var(--text-3);transform:rotate(45deg) translateY(-2px);opacity:.5}
.sort-btn.is-asc::after{opacity:1;transform:rotate(-135deg) translateX(-1px)}
.sort-btn.is-desc::after{opacity:1;transform:rotate(45deg) translateY(-2px)}

/* ── Forms ───────────────────────────────────────────────── */
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field label{font-size:12px;font-weight:500;color:var(--text-2)}
.field input,.field textarea,.field select{width:100%;min-height:38px;padding:8px 12px;border:1px solid var(--border-2);border-radius:var(--radius-md);background:var(--surface);font-size:13px;color:var(--text);transition:border-color .15s,box-shadow .15s}
.field input:focus,.field textarea:focus,.field select:focus{outline:none;border-color:var(--blue2);box-shadow:0 0 0 3px rgba(26,58,107,.1)}
.field select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);background-position:calc(100% - 16px) calc(50% - 1px),calc(100% - 12px) calc(50% - 1px);background-size:4px 4px,4px 4px;background-repeat:no-repeat;padding-right:36px}
.field textarea{min-height:100px;resize:vertical;line-height:1.5}
.field.full{grid-column:1/-1}

/* ── KPIs / Grids ────────────────────────────────────────── */
.kpis,.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stat{font-size:28px;font-weight:600;letter-spacing:-.03em;margin-top:6px;color:var(--text)}

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-user-badge{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-2);font-size:12px;font-weight:500}
.dashboard-user-badge svg{width:14px;height:14px}
.dashboard-hero-card{background:var(--surface)}
.dashboard-hero-head{align-items:flex-start;gap:14px}
.dashboard-hero-head h1{font-size:22px;font-weight:600;letter-spacing:-.03em;line-height:1.15;margin-bottom:4px}
.dashboard-hero-head .muted{font-size:13px}
.dashboard-kicker,.dashboard-section-label{display:inline-block;padding:3px 8px;border-radius:999px;background:var(--surface-2);color:var(--text-3);font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;margin-bottom:6px}
.dashboard-section-card{padding:16px 20px}
.dashboard-section-head{margin-bottom:12px}
.dashboard-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.dashboard-shortcut-card{display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:80px;padding:14px;border-radius:var(--radius-lg);border:1px solid var(--border);text-decoration:none;color:var(--text);background:var(--surface);transition:border-color .14s,box-shadow .14s,transform .14s}
.dashboard-shortcut-card:hover{border-color:var(--border-2);box-shadow:var(--shadow-md);transform:translateY(-1px);text-decoration:none;color:var(--text)}
.dashboard-shortcut-title{font-size:13px;font-weight:600;letter-spacing:-.01em;line-height:1.2}
.dashboard-shortcut-note{font-size:11px;line-height:1.3;color:var(--text-3)}
.tone-blue{background:#eff6ff;border-color:#bfdbfe}.tone-blue .dashboard-shortcut-note{color:#3b82f6}
.tone-teal{background:#f0fdfa;border-color:#99f6e4}.tone-teal .dashboard-shortcut-note{color:#14b8a6}
.tone-gold{background:#fffbeb;border-color:#fde68a}.tone-gold .dashboard-shortcut-note{color:#d97706}
.tone-slate{background:#f8fafc;border-color:#cbd5e1}.tone-slate .dashboard-shortcut-note{color:#64748b}
.tone-purple{background:#faf5ff;border-color:#e9d5ff}.tone-purple .dashboard-shortcut-note{color:#a855f7}
.tone-green{background:#f0fdf4;border-color:#bbf7d0}.tone-green .dashboard-shortcut-note{color:#22c55e}
.tone-navy{background:var(--blue);border-color:var(--blue)}.tone-navy .dashboard-shortcut-title{color:#fff}.tone-navy .dashboard-shortcut-note{color:rgba(255,255,255,.7)}
.tone-orange{background:#fff7ed;border-color:#fed7aa}.tone-orange .dashboard-shortcut-note{color:#f97316}
.tone-danger{background:#fff1f2;border-color:#fecdd3}.tone-danger .dashboard-shortcut-note{color:#e11d48}
.dashboard-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.dashboard-stat-card{padding:16px}
.dashboard-stat-label{font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3);display:block;margin-bottom:8px}
.dashboard-stat-value{font-size:28px;font-weight:600;letter-spacing:-.04em;color:var(--text);line-height:1}
.dashboard-funnel-card{background:var(--surface)}
.dashboard-funnel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dashboard-funnel-pill{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-radius:var(--radius-lg);text-decoration:none;border:1px solid var(--border);background:var(--surface);color:var(--text);transition:border-color .14s,box-shadow .14s}
.dashboard-funnel-pill:hover{border-color:var(--border-2);box-shadow:var(--shadow-sm);text-decoration:none;color:var(--text)}
.dashboard-funnel-pill span{font-size:12px;font-weight:500;color:var(--text-2)}
.dashboard-funnel-pill strong{font-size:20px;font-weight:600;letter-spacing:-.03em}
.dashboard-funnel-pill.is-pending strong{color:var(--warning-text)}
.dashboard-funnel-pill.is-sent strong{color:var(--blue-text)}
.dashboard-funnel-pill.is-suspended strong{color:#7c3aed}
.dashboard-funnel-pill.is-running strong{color:var(--success)}
.dashboard-funnel-pill.is-completed strong{color:#0891b2}
.dashboard-funnel-pill.is-canceled strong{color:var(--text-3)}

/* ── Budget items ────────────────────────────────────────── */
#budget-items{counter-reset:item-num}
.item-card{counter-increment:item-num;position:relative;border:1px solid var(--border);border-left:3px solid var(--primary);border-radius:var(--radius-xl);padding:12px;background:var(--surface);margin-bottom:8px;box-shadow:var(--shadow-sm)}
.budget-item-grid{display:grid;gap:8px;grid-template-columns:90px 1fr 60px 130px 110px 36px;align-items:end;width:100%}
.quote-item-grid{display:grid;gap:12px;grid-template-columns:minmax(0,1.2fr) minmax(0,2fr) 152px 100px;align-items:end}
.quote-item-name{grid-column:1/2}.quote-item-description{grid-column:2/3}
.quote-item-qty{grid-column:3/4}.quote-item-actions{grid-column:4/5}
.quote-item-description textarea{min-height:100px;resize:vertical}
.item-type-field{grid-column:1/2;grid-row:1}.item-choice-field{grid-column:2/3;grid-row:1}
.item-thumb-field{grid-column:2/3;grid-row:1;display:flex;align-items:flex-end;justify-content:flex-end;pointer-events:none;min-height:0}
.item-thumb-field label{display:none}
.item-thumb-preview{width:36px;height:36px;border-radius:var(--radius-sm);box-shadow:var(--shadow-md);margin-left:6px}
.item-qty-field{grid-column:3/4;grid-row:1}.item-unit-field{grid-column:4/5;grid-row:1}.item-subtotal-field{grid-column:5/6;grid-row:1}
.item-actions{grid-column:6/7;grid-row:1;align-self:end}
.item-actions .btn{width:36px;height:36px;padding:0;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center;min-height:0;border-radius:var(--radius-sm)}
.field-desc{grid-column:1/7;grid-row:2}
.field-desc label{display:none}
.field-desc .item-desc{display:none;min-height:64px;resize:vertical;line-height:1.5;margin-top:4px}
.field-desc.desc-open .item-desc{display:block}
.desc-toggle{background:none;border:none;cursor:pointer;font-size:11px;color:var(--text-3);padding:4px 0 2px;display:flex;align-items:center;gap:4px;line-height:1}
.desc-toggle:hover{color:var(--primary)}
.budget-item-description-text{white-space:pre-line;line-height:1.45}
.item-choice-field .searchable-select{padding-right:44px}
.item-choice-field .searchable-select-panel{right:auto;width:min(100%,520px)}
.is-hidden{display:none!important}

/* ── Total box ───────────────────────────────────────────── */
.total-box{display:flex;flex-direction:column;gap:6px;align-items:flex-end;margin-top:16px}
.total-line{width:min(100%,340px);display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--border);padding:8px 0;font-size:13px}
.total-line strong{font-size:16px;font-weight:600}
.total-line-soft span:last-child{font-weight:400;color:var(--text-2)}
.discount-inline{display:flex;align-items:center;gap:8px;min-width:180px;justify-content:flex-end}
.discount-inline span{font-weight:500;color:var(--text);font-size:13px}
.discount-inline input{width:120px;min-height:36px;padding:8px 12px;border:1px solid var(--border-2);border-radius:var(--radius-md);background:var(--surface);font-size:13px;color:var(--text);text-align:right}

/* ── Money / status ──────────────────────────────────────── */
.money-inline{white-space:nowrap;font-weight:500}
.status-money-pending{color:var(--warning-text);font-weight:500}
.status-money-sent{color:var(--blue-text);font-weight:500}
.status-money-canceled{color:var(--text-3);font-weight:500}
.status-money-suspended{color:#7c3aed;font-weight:500}
.status-money-running{color:var(--success);font-weight:500}
.status-money-completed{color:#0891b2;font-weight:500}
.budget-profit-inline{font-size:12px;font-weight:400}
.profits-profit-inline{color:var(--success)}
.product-margin-pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:var(--success-bg);color:var(--success);font-size:11px;font-weight:500}
.product-profit-summary{margin-top:10px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-2);display:flex;flex-direction:column;gap:6px}
.product-profit-line{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:13px;color:var(--text-2)}
.product-profit-line strong{font-size:14px;color:var(--success);font-weight:600}

/* ── Service progress ────────────────────────────────────── */
.service-progress-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;margin-top:12px}
.service-progress-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:16px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:10px}
.service-progress-card h3{margin:0;font-size:16px;font-weight:600;letter-spacing:-.02em;color:var(--text)}
.service-progress-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.service-progress-status{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;font-size:10px;font-weight:600;letter-spacing:.05em;text-transform:uppercase}
.service-progress-status.is-planning{background:var(--blue-light);color:var(--blue-text)}
.service-progress-status.is-running{background:var(--success-bg);color:var(--success)}
.service-progress-status.is-client{background:var(--warning-bg);color:var(--warning-text)}
.service-progress-status.is-supplier{background:#f0f9ff;color:#0369a1}
.service-progress-status.is-paused{background:var(--danger-bg);color:var(--danger-text)}
.service-progress-status.is-completed{background:#ecfeff;color:#164e63}
.service-progress-date{font-size:11px;color:var(--text-3)}
.service-progress-client{font-size:13px;font-weight:500;color:var(--text-2)}
.service-progress-stage{font-size:13px;line-height:1.5;color:var(--text-2);min-height:40px;white-space:pre-line}
.service-progress-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:11px;color:var(--text-3);border-top:1px solid var(--border);padding-top:10px}
.service-progress-view-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.service-progress-view-card{padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.service-progress-view-label{display:block;font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--text-3);margin-bottom:4px}
.service-progress-view-value{display:block;font-size:20px;font-weight:600;letter-spacing:-.03em;color:var(--text)}
.service-progress-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.service-progress-detail-block{padding:14px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2)}
.service-progress-detail-text{font-size:13px;line-height:1.55;color:var(--text-2);white-space:pre-line}
.service-progress-upload-form{margin-bottom:14px}

/* ── Profit ──────────────────────────────────────────────── */
.profit-report-card{background:var(--surface)}
.profit-head{align-items:flex-start;margin-bottom:16px}
.profit-title-block h1{font-size:28px;letter-spacing:-.03em}
.profit-kicker{display:inline-block;padding:3px 9px;border-radius:999px;background:var(--surface-2);color:var(--text-3);font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;margin-bottom:8px}
.profit-hero{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,.9fr);gap:14px;align-items:stretch;margin-bottom:14px}
.profit-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.profit-chip{padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2)}
.profit-chip span{display:block;color:var(--text-3);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.profit-chip strong{font-size:16px;font-weight:600}
.profit-hero-total{display:flex;flex-direction:column;justify-content:center;padding:20px 22px;border-radius:var(--radius-xl);background:var(--blue);color:#fff}
.profit-hero-total span{font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;opacity:.75}
.profit-hero-total strong{font-size:28px;font-weight:600;line-height:1.05;margin-top:8px}
.profit-type-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:var(--blue-light);color:var(--blue-text);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}
.profit-money-positive{color:var(--success);font-weight:500}
.profit-money-danger{color:var(--danger-text);font-weight:500}
.profit-money-warning{color:var(--warning-text);font-weight:500}
.profit-panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.9fr);gap:14px;margin-top:16px}
.profit-note{padding:16px 18px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.profit-note h3{margin:0 0 10px;font-size:14px}
.profit-note p{margin:0 0 6px;color:var(--text-2);line-height:1.6;font-size:13px}
.profit-totals{margin-left:auto;width:min(100%,400px);display:flex;flex-direction:column;gap:6px}
.profit-total-line{display:flex;justify-content:space-between;gap:18px;padding:10px 0;border-bottom:1px solid var(--border);font-size:13px}
.profit-total-line strong{font-size:16px;font-weight:600}
.profit-total-highlight{padding:14px 16px;border:1px solid #bbf7d0;border-radius:var(--radius-lg);background:var(--blue);color:#fff}
.profit-total-highlight strong{font-size:20px;font-weight:600}
.profit-total-highlight-value{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.profit-total-highlight-value small{font-size:12px;opacity:.8}
.budget-profit-card .page-head{margin-bottom:6px}
.budget-profit-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.budget-profit-metric{display:flex;flex-direction:column;gap:3px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}
.budget-profit-metric span{font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.budget-profit-metric strong{font-size:15px;font-weight:600;line-height:1.2}
.budget-profit-highlight{grid-column:span 2;padding:14px 16px;background:var(--blue);border-color:var(--blue);color:#fff}
.budget-profit-highlight span{color:rgba(255,255,255,.8)}
.budget-profit-highlight strong{font-size:20px}

/* ── Link pills ──────────────────────────────────────────── */
.link-pills{display:flex;gap:8px;flex-wrap:wrap}
.link-pill{padding:6px 12px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);text-decoration:none;color:var(--text-2);font-size:12px;font-weight:500;transition:background .12s,border-color .12s}
.link-pill:hover{background:var(--surface-3);border-color:var(--border-2);color:var(--text);text-decoration:none}

/* ── Auth ────────────────────────────────────────────────── */
.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg)}
.auth-card{width:min(100%,400px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);padding:32px;box-shadow:var(--shadow-md)}
.auth-card h1{font-size:20px;font-weight:600;letter-spacing:-.02em;margin:12px 0 4px}
.auth-brand{display:flex;justify-content:center;margin-bottom:4px}
.auth-brand img{max-width:160px;max-height:60px;object-fit:contain}
.auth-alert{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:50}

/* ── PDF ─────────────────────────────────────────────────── */
.pdf-page{background:#fff}.pdf-content{max-width:1080px;margin:0 auto}.pdf-card{overflow:hidden}.pdf-table-wrap{overflow:visible}
.pdf-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;border-bottom:2px solid #e5e7eb;padding-bottom:14px;margin-bottom:16px}
.pdf-logo{max-width:200px;max-height:64px;width:100%;height:auto;object-fit:contain}
.pdf-qr{width:96px;height:auto;object-fit:contain}
.pdf-company-info{margin-top:6px;font-size:11px;line-height:1.35;color:#374151}
.pdf-header-title{flex:1;text-align:center;font-size:22px;font-weight:700;line-height:1.1;color:var(--blue);letter-spacing:-.02em;padding-top:8px}
.pdf-meta-grid{gap:4px 16px}.pdf-meta-grid>div{line-height:1.2;font-size:12px}
.pdf-item-cell{display:flex;align-items:center;gap:8px;min-width:0}
.pdf-item-thumb{width:38px;min-width:38px;height:38px;max-width:38px;max-height:38px;object-fit:cover;border-radius:6px;border:1px solid #e5e7eb;display:block;flex:0 0 38px}
.pdf-desc-small{font-size:10px;line-height:1.2;color:#6b7280}
.pdf-col-right{text-align:right}.pdf-money-small{font-size:11px}

/* ── Shipping label ──────────────────────────────────────── */
.shipment-label-sheet{max-width:860px;margin:0 auto}
.shipment-label{border:2px solid var(--border-2);border-radius:var(--radius-xl);padding:26px 28px;background:#fff}
.shipment-block{padding:4px 0}
.shipment-title{font-size:20px;font-weight:700;color:var(--text-2);margin-bottom:10px}
.shipment-recipient-name{font-size:32px;font-weight:700;line-height:1.1;color:var(--text);margin-bottom:14px}
.shipment-recipient-address{font-size:22px;line-height:1.45;color:var(--text);font-weight:500}
.shipment-gap{height:48px}
.shipment-sender{border-top:1px dashed var(--border-2);padding-top:18px}
.shipment-sender-head{display:flex;align-items:flex-start;gap:16px}
.shipment-sender-logo{display:block;width:110px;max-width:100%;height:auto;object-fit:contain;margin:4px 0 8px}
.shipment-sender-title{font-size:14px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.07em;margin-bottom:3px}
.shipment-sender-text{font-size:14px;line-height:1.5;color:var(--text-2)}
.shipment-hand-box{margin-top:22px;min-height:100px;border:2px dashed var(--border-2);border-radius:var(--radius-lg);background:var(--surface-2)}

/* ── Supplier price cards ────────────────────────────────── */
/* ── Supplier Prices — Upload ────────────────────────────── */
.spl-upload-form{display:flex;flex-direction:column;gap:10px;margin-bottom:4px}
.spl-upload-area{display:flex;flex-direction:row;align-items:center;gap:12px;padding:14px 18px;border:1.5px dashed var(--border-2);border-radius:var(--radius-lg);background:var(--surface-2);cursor:pointer;transition:border-color .14s,background .14s;user-select:none}
.spl-upload-area:hover,.spl-drag-over{border-color:var(--blue2);background:var(--blue-light)}
.spl-has-file{border-color:var(--blue2);border-style:solid;background:var(--blue-light)}
.spl-file-input{display:none}
.spl-upload-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;border-radius:var(--radius-md);background:var(--surface);color:var(--text-2);border:1px solid var(--border-2)}
.spl-upload-icon svg{width:18px;height:18px;display:block}
.spl-upload-label{font-size:13px;color:var(--text-2);line-height:1.4}
.spl-upload-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.spl-selected-name{font-size:12px;color:var(--text-2);font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.spl-delete-form{display:inline-flex}
.spl-preview-box{display:flex;align-items:center;gap:12px;padding:10px 14px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-lg)}
.spl-preview-box img{width:48px;height:auto;max-height:64px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--border);background:#fff;display:block;flex-shrink:0}
.spl-preview-label{font-size:12px;color:var(--success);font-weight:500}

/* Supplier Prices — mobile-first: lista horizontal */
.supplier-price-grid{display:flex;flex-direction:column;gap:8px}
.supplier-price-card{display:flex;flex-direction:row;align-items:stretch;width:100%;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);overflow:hidden;box-shadow:var(--shadow-sm);transition:border-color .14s,box-shadow .14s;text-decoration:none;color:inherit}
.supplier-price-card:hover{border-color:var(--border-2);box-shadow:var(--shadow-md);text-decoration:none;color:inherit}
.supplier-price-thumb-wrap{position:relative;flex:0 0 72px;width:72px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;padding:8px;overflow:hidden}
.supplier-price-thumb{width:56px;height:auto;max-height:80px;object-fit:cover;border-radius:var(--radius-sm);border:1px solid var(--border);background:#fff;display:block}
.supplier-price-placeholder{width:56px;height:72px;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:600;color:var(--text-3);background:rgba(255,255,255,.7);border-radius:var(--radius-sm);border:2px dashed var(--border-2);font-size:10px;padding:6px;line-height:1.2}
.supplier-price-date{position:absolute;top:5px;left:50%;transform:translateX(-50%);display:inline-flex;align-items:center;gap:3px;font-size:9px;font-weight:600;color:var(--text-2);background:#fff;border:1px solid var(--border);border-radius:4px;padding:2px 5px;white-space:nowrap;line-height:1;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.supplier-price-date svg{flex-shrink:0}
.supplier-price-body{flex:1;padding:12px 14px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.supplier-price-name{font-size:13px;font-weight:600;line-height:1.3;color:var(--text);flex:1;min-width:0;white-space:normal}
.supplier-price-meta{font-size:12px;line-height:1.4;color:var(--text-3)}
.supplier-price-footer{display:none}
.supplier-price-actions{display:inline-flex;align-items:center;gap:4px;flex-shrink:0}
.supplier-price-link{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:7px 11px;border-radius:var(--radius-md);background:var(--surface-2);color:var(--text-2);font-weight:500;font-size:12px;text-decoration:none;transition:background .12s;white-space:nowrap;flex-shrink:0}
.supplier-price-link:hover{background:var(--surface-3);color:var(--text);text-decoration:none}
/* Desktop: grid de cards verticais */
@media(min-width:901px){
  .supplier-price-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,220px));gap:14px;justify-content:flex-start}
  .supplier-price-card{flex-direction:column;max-width:220px}
  .supplier-price-thumb-wrap{width:auto;flex:none;aspect-ratio:210/297;padding:10px}
  .supplier-price-thumb{width:100%;height:100%;max-height:none}
  .supplier-price-placeholder{width:100%;height:100%;font-size:12px;padding:14px}
  .supplier-price-date{top:14px;left:50%;transform:translateX(-50%)}
  .supplier-price-body{flex-direction:column;align-items:stretch;gap:8px;padding:12px 14px}
  .supplier-price-name{text-align:center;font-size:13px}
  .supplier-price-actions{justify-content:stretch;gap:6px}
  .supplier-price-link{flex:1;justify-content:center}
}

/* ── Product image grid ──────────────────────────────────── */
.product-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,240px));gap:14px;justify-content:flex-start;align-items:start}
.product-image-card{display:flex;flex-direction:column;width:100%;max-width:240px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);overflow:hidden;box-shadow:var(--shadow-sm)}
.product-image-thumb-wrap{aspect-ratio:1/1;background:var(--surface-2);padding:12px;display:flex;align-items:center;justify-content:center}
.product-image-thumb{width:auto;height:auto;max-width:90%;max-height:90%;object-fit:contain;border-radius:var(--radius-md);border:1px solid var(--border);background:#fff;display:block;margin:auto}
.product-image-body{padding:14px;display:flex;flex-direction:column;gap:8px;flex:1}
.product-image-name{font-size:14px;font-weight:600;line-height:1.25;color:var(--text);min-height:38px}
.product-image-meta{font-size:12px;line-height:1.45;color:var(--text-3);display:flex;flex-direction:column;gap:2px;min-height:36px}
.product-image-body .btn-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:auto}
.product-image-body .btn{width:100%;padding:8px 6px;text-align:center}

/* ── Portal ──────────────────────────────────────────────── */
.portal-upload-form{margin-bottom:16px}
.portal-item-list,.portal-note-list{display:flex;flex-direction:column;gap:10px}
.portal-note-list{margin-top:14px}
.portal-item-card,.portal-note-card{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.portal-item-content{min-width:0;flex:1}
.portal-item-content strong{display:block;font-size:15px;margin-bottom:3px;font-weight:600}
.portal-item-content p{margin:0 0 6px;color:var(--text-2);line-height:1.5;font-size:13px}
.portal-original-name{display:block;margin-top:4px;font-size:10px;line-height:1.3;color:var(--text-3)}
.portal-note-card{display:block}
.portal-note-meta{font-size:11px;font-weight:600;color:var(--text-3);margin-bottom:6px}
.client-portal-card{width:min(100%,720px)}
.client-portal-header{padding:12px 14px;margin-bottom:12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2)}
.client-portal-header strong{display:block;font-size:18px;font-weight:600;margin-bottom:3px}
.client-portal-header p{margin:8px 0 0;color:var(--text-2);line-height:1.55;font-size:13px}
.client-portal-public-card{width:min(100%,880px)}
.client-portal-public-logo{display:block;width:120px;max-width:100%;height:auto;object-fit:contain;margin-bottom:8px}
.client-portal-public-intro{margin:4px 0 18px}
.client-portal-public-intro h2{margin:0;font-size:26px;font-weight:600;line-height:1.1;letter-spacing:-.02em;color:var(--text)}
.client-portal-public-client{margin-top:6px;font-size:16px;font-weight:500;color:var(--text-2)}
.client-portal-public-message{margin-top:14px;font-size:14px;line-height:1.65;color:var(--text-2);max-width:860px}
.client-portal-public-files{padding:16px;border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface-2);margin-top:10px}
.portal-item-card-public{align-items:center;padding:16px 18px;border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-sm)}
.portal-item-filehead{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.portal-item-filehead strong{margin:0;font-size:16px;font-weight:600;line-height:1.2}
.portal-file-badge{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;padding:0 8px;border-radius:var(--radius-md);background:var(--blue-light);color:var(--blue-text);font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.portal-item-public-meta{display:block;margin-top:1px;font-size:11px;color:var(--text-3)}
.portal-item-public-actions{align-items:center;justify-content:flex-end}
.client-portal-public-created{margin-top:12px;font-size:11px;line-height:1.4;color:var(--text-3)}

/* ── Sidebar collapse ────────────────────────────────────── */
.layout.sidebar-collapsed .sidebar{width:0!important;padding:0!important;overflow:hidden!important}
.layout.sidebar-collapsed{grid-template-columns:0 1fr!important}
.sidebar{transition:width .2s ease,padding .2s ease}

/* ── Tablet (max 1100px) ─────────────────────────────────── */
@media(max-width:1100px){
  .layout{grid-template-columns:220px 1fr}
  .kpis,.grid-3,.grid-2,.form-grid,.profit-summary,.profit-hero,.profit-panels,.service-progress-view-grid,.service-progress-detail-grid{grid-template-columns:1fr}
  .dashboard-hero-head h1{font-size:20px}
  .dashboard-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .dashboard-funnel-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .budget-profit-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .budget-profit-highlight{grid-column:span 3}
  .budget-item-grid{grid-template-columns:90px 1fr 60px 130px 110px 36px}
  .item-type-field{grid-column:1/2;grid-row:1}.item-choice-field{grid-column:2/3;grid-row:1}
  .item-thumb-field{grid-column:2/3;grid-row:1;justify-content:flex-end}
  .item-qty-field{grid-column:3/4;grid-row:1}.item-unit-field{grid-column:4/5;grid-row:1}.item-subtotal-field{grid-column:5/6;grid-row:1}
  .item-actions{display:flex}
  .field-desc{grid-column:1/7;grid-row:2}
  .profit-totals{margin-left:0}
  .quote-item-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 130px 90px}
  .quote-item-name{grid-column:1/3}.quote-item-description{grid-column:1/3}
  .quote-item-qty{grid-column:1/2}.quote-item-actions{grid-column:2/3}
  .compact-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ── Mobile (max 900px) ──────────────────────────────────── */
@media(max-width:900px){
  /* Previne zoom automático do iOS em qualquer campo de texto */
  input,select,textarea,button{font-size:16px!important}
  body.mobile-nav-open{overflow:hidden}
  .layout{display:block;width:100vw;max-width:100vw;overflow-x:hidden}
  .sidebar{position:fixed;top:0;left:0;bottom:0;width:min(85vw,300px);z-index:50;overflow-y:auto;transform:translateX(calc(-100% - 20px));transition:transform .22s ease,box-shadow .22s ease}
  .mobile-nav-open .sidebar{transform:translateX(0);box-shadow:0 20px 40px rgba(0,0,0,.18)}
  .mobile-nav-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);backdrop-filter:blur(2px);z-index:40}
  .mobile-nav-open .mobile-nav-backdrop{display:block}
  .topbar{display:flex;align-items:center;gap:10px;padding:0 16px;height:52px}
  .mobile-nav-toggle{display:inline-flex;width:40px;height:40px;align-items:center;justify-content:center;flex-direction:column;gap:5px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);padding:0;flex:0 0 40px;cursor:pointer}
  .mobile-nav-toggle span{display:block;width:18px;height:2px;border-radius:999px;background:var(--text)}
  .search-form{flex:1;max-width:none}
  .nav-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .nav-group-label{grid-column:1/-1}
  .nav a{min-height:44px;font-size:13px}
  .nav .nav-subitem{margin-left:0;padding-left:10px}
  .content{padding:14px 16px;gap:12px}
  .card{padding:16px;border-radius:var(--radius-lg)}
  .page-head h1{font-size:17px}
  .page-head{margin-bottom:10px}
  .kpis,.grid-3{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .grid-2{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .field input,.field textarea,.field select,.searchable-select-toggle{min-height:46px;font-size:16px}
  .btn{min-height:44px;padding:10px 16px;font-size:14px}
  .btn-sm{min-height:36px;padding:8px 12px;font-size:13px}
  .icon-btn{width:34px;height:34px;border-radius:var(--radius-sm)}
  .icon-btn svg{width:15px;height:15px}
  .dashboard-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-shortcut-card{min-height:72px;padding:12px}
  .dashboard-shortcut-title{font-size:12px}
  .dashboard-shortcut-note{font-size:10px}
  .dashboard-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-stat-card{padding:14px}
  .dashboard-stat-value{font-size:24px}
  .dashboard-funnel-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-funnel-pill{padding:10px 12px}
  .dashboard-funnel-pill strong{font-size:18px}
  .compact-list{border-radius:var(--radius-md)}
  .clist-item{display:flex;flex-direction:column;min-height:auto;padding:10px 14px;gap:4px;align-items:stretch}
  .clist-row1{flex-wrap:wrap;gap:4px;overflow:visible}
  .clist-row2{flex-wrap:wrap;gap:6px;margin-left:0;padding-left:0;justify-content:flex-start}
  .clist-row3{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:2px}
  .clist-name{font-size:14px;font-weight:600;white-space:normal;width:100%;overflow:visible;text-overflow:unset}
  .clist-sub{font-size:11px}
  .clist-total{font-size:13px}
  .clist-values{gap:8px}
  .mobile-card-table thead{display:none}
  .mobile-card-table,.mobile-card-table tbody{display:block;width:100%}
  .mobile-card-table tbody tr{display:block;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:12px 14px;margin-bottom:8px;box-shadow:var(--shadow-sm)}
  .mobile-card-table tbody td{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:6px 0;border-bottom:1px solid var(--border);font-size:13px;white-space:normal;min-width:0}
  .mobile-card-table tbody td:last-child{border-bottom:0;padding-bottom:0}
  .mobile-card-table tbody td::before{content:attr(data-label);display:block;min-width:76px;flex:0 0 76px;font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--text-3)}
  .mobile-card-table tbody td[data-label="Ações"]{display:block}
  .mobile-card-table tbody td[data-label="Ações"]::before{margin-bottom:8px}
  .mobile-card-table .action-group{gap:8px}
  .mobile-card-table .status-select{min-width:0;width:100%}
  .budget-item-grid{grid-template-columns:1fr 1fr}
  .quote-item-grid{grid-template-columns:1fr}
  .item-type-field{grid-column:1/2;grid-row:1}.item-actions{grid-column:2/3;grid-row:1;justify-self:end;align-self:end}
  .item-choice-field{grid-column:1/3;grid-row:2}
  .item-qty-field{grid-column:1/2;grid-row:3}.item-unit-field{grid-column:2/3;grid-row:3}
  .item-subtotal-field{grid-column:1/3;grid-row:4}
  .field-desc{grid-column:1/3;grid-row:5}
  .item-actions .btn{width:36px}
  .item-thumb-field{position:absolute;top:12px;right:12px;justify-content:flex-end}
  .item-choice-field .searchable-select{padding-right:40px}
  .quote-item-name,.quote-item-description,.quote-item-qty,.quote-item-actions{grid-column:1/2}
  .quote-item-name{grid-row:1}.quote-item-description{grid-row:2}.quote-item-qty{grid-row:3}.quote-item-actions{grid-row:4}
  .quote-item-actions .btn{width:100%}
  .total-box,.profit-totals{align-items:stretch;width:100%}
  .total-line{width:100%}
  .table-wrap td img,.table-wrap .pdf-item-thumb{width:32px!important;min-width:32px!important;height:32px!important}
  .service-progress-grid{grid-template-columns:1fr;gap:10px}
  .service-progress-view-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .service-progress-detail-grid{grid-template-columns:1fr}
  .service-progress-view-value{font-size:18px}
  .service-progress-card{padding:14px}
  .product-image-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .product-image-card{max-width:none;width:100%}
  .product-image-body .btn-row{grid-template-columns:1fr}
  .profit-panels,.profit-hero,.profit-summary{grid-template-columns:1fr}
  .profit-totals{margin-left:0}
  .profit-title-block h1{font-size:24px}
  .budget-profit-grid{grid-template-columns:1fr}
  .budget-profit-highlight{grid-column:span 1}
  .shipment-label{padding:18px}
  .shipment-recipient-name{font-size:24px}
  .shipment-recipient-address{font-size:18px}
  .shipment-sender-head{flex-direction:column}
  .shipment-gap{height:24px}
  .client-portal-public-card{padding:16px}
  .portal-item-card-public{flex-direction:column;align-items:stretch;padding:14px}
  .portal-item-public-actions{display:grid;grid-template-columns:1fr;gap:8px}
  .portal-item-card-public .btn{width:100%}
}

/* ── Mobile tab bar & menu overlay ──────────────────────── */
.mobile-tab-bar { display:none }
.mmo-overlay    { display:none }

@media(max-width:900px){
  /* Esconde o hamburger — substituído pela tab bar */
  .mobile-nav-toggle { display:none }
  /* Tab bar inferior */
  .mobile-tab-bar {
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:60;
    background:var(--surface); border-top:1px solid var(--border);
    height:62px; padding-bottom:env(safe-area-inset-bottom);
  }
  .mtb-item {
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:3px; font-size:10px; font-weight:500; color:var(--text-3); text-decoration:none;
    border:none; background:none; cursor:pointer; padding:0; transition:color .15s;
  }
  .mtb-item svg { width:22px; height:22px; flex-shrink:0 }
  .mtb-item.mtb-active { color:var(--blue) }
  .mtb-item:active { opacity:.7 }
  /* Empurra conteúdo acima da tab bar */
  .content { padding-bottom: calc(62px + env(safe-area-inset-bottom) + 14px) }
  /* Overlay do menu completo */
  .mmo-overlay {
    display:none; position:fixed; inset:0; background:rgba(0,0,0,.5);
    backdrop-filter:blur(4px); z-index:70; align-items:flex-end;
  }
  .mmo-overlay.open { display:flex }
  .mmo-sheet {
    width:100%; max-height:92vh; background:var(--surface);
    border-radius:20px 20px 0 0; display:flex; flex-direction:column;
    box-shadow:0 -8px 40px rgba(0,0,0,.2);
    animation:mmo-slide-up .25s ease;
  }
  @keyframes mmo-slide-up { from{transform:translateY(100%)} to{transform:translateY(0)} }
  .mmo-sheet-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 18px 12px; border-bottom:1px solid var(--border); flex-shrink:0;
  }
  .mmo-sheet-user { display:flex; align-items:center; gap:10px }
  .mmo-sheet-avatar {
    width:34px; height:34px; border-radius:50%; background:var(--blue);
    color:#fff; font-size:12px; font-weight:700;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .mmo-sheet-name { font-size:14px; font-weight:600; color:var(--text) }
  .mmo-close-btn {
    width:32px; height:32px; border-radius:50%; border:1px solid var(--border);
    background:var(--surface-2); display:flex; align-items:center; justify-content:center;
    cursor:pointer; color:var(--text-2);
  }
  .mmo-body { overflow-y:auto; flex:1; padding:12px 14px 8px }
  .mmo-group { margin-bottom:14px }
  .mmo-group-label {
    font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
    color:var(--text-3); padding:0 2px 6px;
  }
  .mmo-grid {
    display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
  }
  .mmo-item {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:6px; padding:12px 6px; border-radius:12px; border:1px solid var(--border);
    background:var(--surface-2); text-decoration:none; color:var(--text-2);
    font-size:11px; font-weight:500; text-align:center; transition:background .12s,color .12s;
    min-height:70px;
  }
  .mmo-item svg { width:22px; height:22px; flex-shrink:0 }
  .mmo-item span { line-height:1.2 }
  .mmo-item.mmo-active { background:rgba(37,99,235,.1); border-color:rgba(37,99,235,.3); color:var(--blue) }
  .mmo-item:active { opacity:.7 }
  .mmo-footer {
    padding:10px 14px calc(env(safe-area-inset-bottom) + 10px);
    border-top:1px solid var(--border); flex-shrink:0;
  }
  .mmo-logout {
    display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:10px;
    background:var(--surface-2); text-decoration:none; color:var(--text-3);
    font-size:14px; font-weight:500; transition:background .12s;
  }
  .mmo-logout svg { width:18px; height:18px; flex-shrink:0 }
  .mmo-logout:hover { background:var(--surface-2); color:var(--text) }
  /* Oculta a sidebar deslizante no mobile */
  .sidebar { display:none }
  .mobile-nav-backdrop { display:none!important }
}

/* ── Print ───────────────────────────────────────────────── */
@media print{
  @page{size:A4 portrait;margin:10mm}
  .sidebar,.topbar,.btn-row,.no-print{display:none!important}
  .layout{display:block}
  .content,.pdf-content{padding:0!important;margin:0!important;max-width:none}
  .card,.pdf-card{box-shadow:none;border:0;padding:0;break-inside:avoid-page}
  .grid-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .table-wrap,.pdf-table-wrap{overflow:visible}
  .pdf-header,.total-box,table,tr,td,th{page-break-inside:avoid}
  .pdf-item-thumb{width:30px;height:30px}
  .pdf-desc-small{font-size:9px}
  table{font-size:11px}
  body{background:#fff;color:#000}
}

/* ── Dashboard v2 — limpo, denso, sem cards dentro de cards ─ */
.dash-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dash-greeting {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.dash-meta {
  font-size: 12px;
  color: var(--text-3);
}

/* KPIs — linha única sem card */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-kpi {
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dash-kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text);
  line-height: 1;
}

/* Rótulo de seção */
.dash-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}

/* Funil — linha de números */
.dash-funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-funnel-item {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  transition: background .12s;
}
.dash-funnel-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.dash-funnel-num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}
.dash-funnel-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}
.dash-funnel-num.is-pending   { color: var(--warning-text); }
.dash-funnel-num.is-sent      { color: var(--blue-text); }
.dash-funnel-num.is-running   { color: var(--success); }
.dash-funnel-num.is-suspended { color: #7c3aed; }
.dash-funnel-num.is-completed { color: #0891b2; }
.dash-funnel-num.is-canceled  { color: var(--text-3); }

/* Atalhos — grid de ícone + texto, sem cores */
.dash-shortcuts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-shortcut {
  background: var(--surface);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: var(--text-2);
  transition: background .12s, color .12s;
}
.dash-shortcut:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.dash-shortcut svg {
  width: 16px;
  height: 16px;
  opacity: .6;
  flex-shrink: 0;
}
.dash-shortcut:hover svg { opacity: 1; }
.dash-shortcut span {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

/* Responsive dashboard */
@media (max-width: 1100px) {
  .dash-shortcuts { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .dash-funnel    { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .dash-header    { flex-direction: column; gap: 2px; padding-bottom: 12px; }
  .dash-kpis      { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-funnel    { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .dash-shortcuts { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .dash-kpi-value { font-size: 20px; }
  .dash-funnel-num { font-size: 18px; }
}
@media (max-width: 480px) {
  .dash-funnel    { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-shortcuts { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ── List page layout — sem card externo ─────────────────── */
.list-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.list-page-head h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--text);
}
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.list-count {
  font-size: 12px;
  color: var(--text-3);
  margin-left: 2px;
}

/* Empty state */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-state svg {
  width: 32px; height: 32px;
  opacity: .3;
  margin: 0 auto 10px;
  display: block;
}
.empty-state p { margin: 0 0 12px; }

/* ── Form sections ───────────────────────────────────────── */
.form-section {
  margin-bottom: 24px;
}
.form-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.field-required {
  color: var(--danger-text);
  font-size: 11px;
}
.form-actions {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Budget form sections */
.budget-section {
  margin-bottom: 28px;
}
.budget-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px}
.modal-box{background:var(--surface);border-radius:14px;box-shadow:0 8px 40px rgba(0,0,0,.18);width:100%;max-width:560px;max-height:90vh;overflow-y:auto;display:flex;flex-direction:column}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 0;gap:12px}
.modal-title{font-size:18px;font-weight:700;color:var(--text-1);margin:0}
.modal-close-btn{background:none;border:none;font-size:22px;line-height:1;color:var(--text-3);cursor:pointer;padding:4px 8px;border-radius:6px}
.modal-close-btn:hover{background:var(--hover);color:var(--text-1)}
.modal-body{padding:20px 24px}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border)}
