/* ============================================
   ART Gestão
   ============================================ */
:root {
    --accent: #FF6A21;
    --accent-dark: #e85a14;
    --accent-soft: #fff1e9;
    --navy: #060610;
    --navy-2: #12122a;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --text: #17172b;
    --text-2: #55566e;
    --muted: #8a8ba3;
    --line: #e7e8f0;
    --green: #16a34a; --green-soft: #e8f8ee;
    --blue: #2563eb; --blue-soft: #e8f0fe;
    --purple: #7c3aed; --purple-soft: #f1ebfe;
    --red: #dc2626; --red-soft: #fdecec;
    --gray-soft: #eef0f4;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 16, 40, .05), 0 4px 16px rgba(16, 16, 40, .04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }

/* ---------- Boot / Login ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy); }
.boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.94); } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(circle at 80% 10%, rgba(255,106,33,.25), transparent 45%), radial-gradient(circle at 10% 90%, rgba(59,130,246,.18), transparent 45%), var(--navy); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 36px 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.4); text-align: center; }
.login-card img { margin: 0 auto; }
.login-card h1 { font-size: 22px; }
.login-card label { text-align: left; }
.login-error { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 13px; text-align: left; word-break: break-all; }
.env-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 3px 10px; }
.login-card .env-tag { align-self: center; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--navy); color: #c9c9da; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 20px 14px; z-index: 50; transition: transform .25s; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-size: 17px; padding: 0 8px 22px; }
.brand b { color: var(--accent); }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; text-decoration: none; font-weight: 500; color: #b4b4c8; transition: background .15s, color .15s; }
.menu a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu a.active { background: rgba(255,106,33,.14); color: #fff; }
.menu a.active svg { color: var(--accent); }
.menu-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; }
.user-email { font-size: 12px; color: #8b8ba3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .link-btn { color: #fff; text-align: left; }

.main { flex: 1; margin-left: 236px; min-width: 0; }
.topbar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .env-tag { margin-left: auto; }
.main > .env-tag { margin: 10px 32px 0; }
.menu-toggle { background: none; border: 0; font-size: 22px; cursor: pointer; }
.view { padding: 28px 32px 60px; max-width: 1280px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- Cabeçalhos ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; }
.page-head p { color: var(--text-2); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 6px; }
.back-link:hover { color: var(--accent); }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-dark { background: var(--navy-2); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #cfd1de; background: #fafbfd; }
.btn-danger { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-wa { background: #25D366; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 500; font-size: 13px; padding: 0; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--gray-soft); color: var(--red); }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 a { font-size: 12.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-accent .kpi-value { color: var(--accent); }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 10px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; min-width: 4px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }

.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.funnel-step { background: var(--gray-soft); border-radius: 10px; padding: 12px; text-align: center; }
.funnel-step b { display: block; font-size: 22px; }
.funnel-step span { font-size: 11.5px; color: var(--text-2); }

/* ---------- Tabelas ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fafbfd; }
.sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- Filtros ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.tab.active { background: var(--navy-2); color: #fff; }
.tab .count { opacity: .6; margin-left: 4px; }
.search { flex: 1; min-width: 200px; max-width: 320px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-orange { background: var(--accent-soft); color: var(--accent-dark); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--gray-soft); color: var(--text-2); }

/* ---------- Formulários ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 400; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,33,.12); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 0 12px; }
.section-title:first-child { margin-top: 0; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 25, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 200; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; padding: 26px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-wide { max-width: 760px; }
.modal h3 { font-size: 18px; margin-bottom: 18px; padding-right: 30px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--gray-soft); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }

.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13.5px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { word-break: break-word; }
.message-box { background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 13.5px; margin-top: 14px; }
.notes { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.note { background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.note small { display: block; color: var(--muted); font-size: 11px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: var(--navy-2); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .3s, transform .3s; max-width: 340px; }
.toast-err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Vazio ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty-icon { font-size: 34px; color: #d0d2de; }
.empty h3 { font-size: 16px; color: var(--text); margin: 6px 0 4px; }
.empty p { margin-bottom: 16px; }

/* ---------- Editor de orçamento ---------- */
.editor { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.items-table td { padding: 8px 10px; vertical-align: top; }
.items-table th { padding: 10px; }
.items-table input, .items-table select { padding: 7px 9px; font-size: 13.5px; }
.items-table textarea { min-height: 38px; padding: 6px 9px; font-size: 12.5px; margin-top: 6px; color: var(--text-2); }
.items-table td:first-child { min-width: 260px; }
.items-table .col-qtd { width: 76px; }
.items-table .col-unid { width: 104px; }
.items-table .col-valor { width: 130px; }
.items-table .col-total { width: 120px; }
.add-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.add-row select { max-width: 320px; }
.summary { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.summary-line { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.summary-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding-top: 12px; border-top: 1px solid var(--line); }
.summary-total span:last-child { color: var(--accent); }
.discount-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }

.clauses { display: flex; flex-direction: column; gap: 12px; }
.clause { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfd; }
.clause-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.clause-head b { color: var(--muted); font-size: 12px; white-space: nowrap; }
.clause-head input { font-weight: 600; }
.clause textarea { min-height: 110px; font-size: 13px; }
.alert { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item:hover b { color: var(--accent); }

/* ---------- Documento (orçamento / contrato) ---------- */
.doc-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.doc-toolbar .spacer { flex: 1; }
.doc { background: #fff; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 18mm 18mm 20mm; box-shadow: 0 10px 40px rgba(16,16,40,.12); color: #1b1b2e; font-size: 10.5pt; line-height: 1.55; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid var(--accent); margin-bottom: 22px; }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand img { width: 58px; height: 58px; }
.doc-brand strong { font-size: 15pt; display: block; letter-spacing: -.01em; }
.doc-brand small { color: #666; font-size: 8.5pt; display: block; line-height: 1.45; }
.doc-num { text-align: right; flex-shrink: 0; }
.doc-num .doc-type { white-space: nowrap; }
.doc-num .doc-type { font-size: 9pt; font-weight: 700; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.doc-num strong { font-size: 15pt; display: block; }
.doc-num small { color: #666; font-size: 8.5pt; }
.doc h2 { font-size: 10pt; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 20px 0 8px; }
.doc-client { background: #f7f7fb; border-radius: 6px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 20px; font-size: 9.5pt; }
.doc-client b { color: #555; font-weight: 600; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.doc th { background: #1b1b2e; color: #fff; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border: 0; }
.doc td { padding: 9px 10px; border-bottom: 1px solid #e4e4ec; font-size: 9.5pt; vertical-align: top; }
.doc td small { display: block; color: #666; font-size: 8.5pt; margin-top: 2px; white-space: pre-wrap; }
.doc-totals { margin-left: auto; width: 280px; margin-top: 12px; font-size: 10pt; }
.doc-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-totals .grand { border-top: 2px solid #1b1b2e; margin-top: 4px; padding-top: 8px; font-size: 13pt; font-weight: 800; }
.doc-totals .grand span:last-child { color: var(--accent); }
.doc-conditions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: 9.5pt; }
.doc-conditions p { white-space: pre-wrap; }
.doc-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #e4e4ec; font-size: 8.5pt; color: #777; text-align: center; }
.doc-contract h1 { text-align: center; font-size: 13pt; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 18px; }
.doc-contract .parties p { margin-bottom: 8px; text-align: justify; }
.doc-contract .clause-doc { margin-top: 14px; page-break-inside: avoid; }
.doc-contract .clause-doc h3 { font-size: 10pt; text-transform: uppercase; margin-bottom: 4px; }
.doc-contract .clause-doc p { text-align: justify; white-space: pre-wrap; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 50px; margin-top: 50px; page-break-inside: avoid; }
.signature { border-top: 1px solid #1b1b2e; padding-top: 6px; text-align: center; font-size: 9pt; }
.signature small { display: block; color: #666; }
.place-date { text-align: right; margin-top: 30px; }

@media print {
    @page { size: A4; margin: 12mm 0 12mm; }
    body { background: #fff; }
    .sidebar, .topbar, .doc-toolbar, #toasts, .env-tag { display: none !important; }
    .main { margin: 0; }
    .view { padding: 0; max-width: none; }
    .doc { box-shadow: none; margin: 0; width: auto; max-width: none; min-height: auto; padding: 2mm 16mm 0; }
    .doc-foot { margin-top: 18px; }
    .doc th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .doc-client, .doc-head, .doc-totals { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsivo ---------- */
@media screen and (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .editor { grid-template-columns: 1fr; }
    .summary { position: static; }
}
@media screen and (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    body.menu-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
    .main { margin-left: 0; }
    .topbar { display: flex; }
    .view { padding: 20px 16px 50px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .funnel { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .doc { width: 100%; min-height: 0; padding: 20px; }
    .doc-client, .doc-conditions { grid-template-columns: 1fr; }
    .bar-row { grid-template-columns: 100px 1fr 32px; }
}
@media screen and (max-width: 520px) {
    .grid-4 { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; gap: 2px; }
    .detail-list dd { margin-bottom: 8px; }
}

/* ============================================
   Componentes próprios (substituem os nativos)
   ============================================ */
.native-hidden { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; padding: 0 !important; }

/* Select */
.cselect { position: relative; width: 100%; min-width: 0; }
.cselect-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 400; color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cselect-btn:hover:not(:disabled) { border-color: #cfd1de; }
.cselect-btn:focus-visible, .cselect.open .cselect-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,33,.12); }
.cselect-btn:disabled { background: var(--gray-soft); color: var(--muted); cursor: not-allowed; }
.cselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-label.placeholder { color: var(--muted); }
.cselect-btn svg, .cdate-btn svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.cselect.open .cselect-btn svg { transform: rotate(180deg); stroke: var(--accent); }
.items-table .cselect-btn { padding: 7px 9px; font-size: 13.5px; }
.add-row .cselect { max-width: 320px; }

.cpopover { position: fixed; z-index: 500; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(16,16,40,.16), 0 2px 6px rgba(16,16,40,.06); padding: 6px; animation: pop .12s ease-out; outline: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.cselect-menu { max-width: min(420px, calc(100vw - 16px)); }
.cselect-search { margin-bottom: 6px; padding: 8px 10px; font-size: 13.5px; }
.cselect-options { max-height: 280px; overflow-y: auto; }
.cselect-option { padding: 8px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cselect-option.active { background: var(--gray-soft); }
.cselect-option.selected { color: var(--accent-dark); font-weight: 600; }
.cselect-option.selected::after { content: '✓'; color: var(--accent); }
.cselect-option.muted-opt { color: var(--muted); }
.cselect-option.disabled { opacity: .45; cursor: not-allowed; }
.cselect-empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* Data */
.cdate { position: relative; display: flex; }
.cdate input[type="text"] { padding-right: 40px; }
.cdate-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.cdate-btn:hover { background: var(--gray-soft); }
.cdate.open .cdate-btn svg { stroke: var(--accent); }
.cdate-menu { width: 272px; padding: 12px; }
.cdate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cdate-head b { font-size: 14px; text-transform: capitalize; }
.cdate-head button { width: 30px; height: 30px; border: 0; background: none; border-radius: 7px; font-size: 18px; cursor: pointer; color: var(--text-2); }
.cdate-head button:hover { background: var(--gray-soft); }
.cdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cdate-week span { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cdate-grid button { height: 34px; border: 0; background: none; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text); }
.cdate-grid button:hover { background: var(--gray-soft); }
.cdate-grid button.today { color: var(--accent); font-weight: 700; }
.cdate-grid button.selected { background: var(--accent); color: #fff; font-weight: 600; }
.cdate-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cdate-foot button { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.cdate-foot button:hover { background: var(--accent-soft); }

/* Checkbox */
input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px !important; height: 18px; padding: 0; flex-shrink: 0; border: 1.5px solid #c9cbd8; border-radius: 5px; background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; transition: background .15s, border-color .15s; }
input[type="checkbox"]::after { content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { opacity: 1; }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,106,33,.18); }

/* Sem controles nativos em números e busca */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
