/* ═══════ HUNNY ═══════ */
:root {
  --honey: #D4A03C; --honey-dark: #B87333; --honey-light: #F5E6C8; --honey-bg: #FFF8EE;
  --brown: #5C3D1A; --brown-light: #8B7355; --brown-muted: #BFA880;
  --border: #E8D5B7; --bg: linear-gradient(160deg, #FFF8EE 0%, #FFF1DB 40%, #FFE8C8 100%);
  --card: #FFFFFF; --red: #E74C3C; --green: #27AE60; --blue: #2980B9;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(180,120,40,0.08); --shadow-lg: 0 8px 30px rgba(180,120,40,0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', sans-serif; background: var(--bg); color: var(--brown); min-height: 100vh; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,160,60,0.3); border-radius: 10px; }

/* Header */
.header { background: linear-gradient(135deg, var(--honey), var(--honey-dark)); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 20px rgba(180,120,40,0.25); flex-wrap: wrap; gap: 12px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 36px; }
.logo-text { font-size: 26px; font-weight: 800; color: #FFF; letter-spacing: -1px; }
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.8); letter-spacing: 3px; text-transform: uppercase; }
.tab-bar { display: flex; gap: 4px; background: rgba(255,255,255,0.15); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 10px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; background: transparent; color: rgba(255,255,255,0.85); transition: all 0.2s; }
.tab.active { background: #FFF; color: var(--honey-dark); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.tab:hover:not(.active) { background: rgba(255,255,255,0.1); }

/* Main */
.main { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Editing Banner */
.editing-banner { background: linear-gradient(135deg, #2980B9, #3498DB); color: #FFF; padding: 12px 20px; border-radius: var(--radius); margin-bottom: 18px; box-shadow: 0 3px 12px rgba(41,128,185,0.3); }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); border: 1px solid rgba(212,160,60,0.1); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--brown); }
.card-title.small { font-size: 13px; color: var(--brown-light); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-summary { background: linear-gradient(170deg, #FFFBF3, #FFF5E6); border: 2px solid rgba(212,160,60,0.2); }
.card-analysis { padding: 16px; }

/* Forms */
.input { width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 14px; font-family: inherit; background: #FFFBF3; color: var(--brown); outline: none; transition: all 0.2s; }
.input:focus { border-color: var(--honey); box-shadow: 0 0 0 3px rgba(212,160,60,0.15); }
.input-sm { padding: 8px 12px; font-size: 13px; text-align: center; }
.input-color { height: 44px; padding: 4px; cursor: pointer; }
.textarea { min-height: 80px; resize: vertical; }
.textarea-sm { min-height: 60px; resize: vertical; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--brown-light); margin-bottom: 5px; letter-spacing: 0.3px; }
.form-group { margin-bottom: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-label input { accent-color: var(--honey); }

/* Buttons */
.btn { padding: 10px 22px; border-radius: var(--radius-sm); border: none; cursor: pointer; font-size: 14px; font-weight: 700; font-family: inherit; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--honey), var(--honey-dark)); color: #FFF; box-shadow: 0 2px 8px rgba(180,120,40,0.3); }
.btn-sm { padding: 6px 14px; font-size: 12px; background: linear-gradient(135deg, var(--honey), var(--honey-dark)); color: #FFF; border-radius: 8px; }
.btn-ghost { background: rgba(212,160,60,0.08); color: var(--honey-dark); border: 1.5px solid rgba(212,160,60,0.25); }
.btn-danger { background: var(--red); color: #FFF; }
.btn-danger-ghost { background: transparent; color: var(--red); border: 1.5px solid rgba(231,76,60,0.25); padding: 6px 12px; font-size: 12px; }
.btn-blue { background: var(--blue); color: #FFF; }
.btn-secondary { background: #6C757D; color: #FFF; }

/* Layout */
.row { display: flex; align-items: center; }
.gap-xs { gap: 6px; } .gap-sm { gap: 10px; } .flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.mb-xs { margin-bottom: 4px; } .mb-sm { margin-bottom: 10px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.mt-xs { margin-top: 4px; } .mt-md { margin-top: 16px; }
.bold { font-weight: 700; }
.text-red { color: var(--red); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }
.badge { background: linear-gradient(135deg, var(--honey), var(--honey-dark)); color: #FFF; border-radius: 20px; padding: 3px 12px; font-size: 11px; font-weight: 700; }
.badge-blue { background: var(--blue); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 16px 0; }
.border-top { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.empty-state { text-align: center; padding: 30px; color: var(--brown-muted); font-size: 14px; }
.hidden { display: none !important; }
.sticky { position: sticky; top: 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 800; color: var(--brown); }

/* Budget Layout */
.budget-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.budget-main { min-width: 0; } .budget-sidebar { min-width: 0; }

/* Items List */
.items-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.item-row { display: flex; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 6px; background: #FEFCF8; border: 1px solid #F0E6D4; transition: all 0.2s; cursor: pointer; }
.item-row:hover { background: rgba(212,160,60,0.05); }
.item-row.selected { background: rgba(212,160,60,0.08); border-color: rgba(212,160,60,0.3); }
.item-icon { font-size: 18px; margin-right: 10px; }
.item-info { flex: 1; }
.item-name { font-size: 14px; font-weight: 600; }
.item-meta { font-size: 11px; color: var(--brown-light); }
.item-price { font-size: 14px; font-weight: 700; color: var(--honey-dark); margin-right: 10px; }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer; font-size: 16px; font-weight: 700; background: linear-gradient(135deg, var(--honey), var(--honey-dark)); color: #FFF; transition: all 0.15s; }
.qty-btn:hover { opacity: 0.85; }
.qty-value { font-weight: 700; min-width: 24px; text-align: center; }

/* Labor */
.labor-row { display: flex; gap: 10px; align-items: end; margin-bottom: 10px; flex-wrap: wrap; padding: 12px; border-radius: var(--radius-sm); background: #FEFCF8; border: 1px solid #F0E6D4; }
.labor-row .form-group { margin-bottom: 0; }

/* Summary */
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.discount { color: var(--green); }
.summary-row.hint { font-size: 12px; color: var(--brown-light); }
.summary-total { display: flex; justify-content: space-between; padding: 14px 0; font-size: 22px; font-weight: 800; color: var(--honey-dark); border-top: 2px solid var(--honey); }
.hint { font-size: 12px; color: var(--brown-light); }
.value { font-size: 14px; font-weight: 600; color: var(--brown); }
.client-info { margin-top: 14px; padding: 14px; background: #FFFBF3; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Catalog Grid */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* Divisions Grid */
.divisions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.division-card { border-left: 4px solid var(--honey); }

/* History */
.history-card { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.history-avatar { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg, var(--honey), var(--honey-dark)); display: flex; align-items: center; justify-content: center; color: #FFF; font-size: 20px; font-weight: 800; flex-shrink: 0; }
.history-info { flex: 1; }
.history-name { font-size: 16px; font-weight: 700; }
.history-number { font-size: 13px; font-weight: 700; color: var(--honey-dark); font-family: monospace; }
.history-meta { font-size: 12px; color: var(--brown-light); margin-top: 2px; }
.history-date { font-size: 11px; color: var(--brown-muted); }
.history-total { font-size: 20px; font-weight: 800; color: var(--honey-dark); text-align: right; }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.status-badge:hover { opacity: 0.8; }
.status-rascunho { background: #F0E6D4; color: var(--brown-light); }
.status-enviado { background: #D4EFFF; color: var(--blue); }
.status-aprovado { background: #D5F5E3; color: var(--green); }
.status-rejeitado { background: #FADBD8; color: var(--red); }
.status-concluído { background: #D4A03C22; color: var(--honey-dark); }
.status-cancelado { background: #E0E0E0; color: #777; }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--honey-dark); text-align: center; }
.stat-label { font-size: 13px; color: var(--brown-light); font-weight: 600; text-align: center; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(60,40,10,0.45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-content { background: #FFF; border-radius: 20px; padding: 30px; width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-content h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; color: var(--brown); }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 780px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 14px; position: sticky; bottom: 0; background: #FFF; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* Notification */
.notification { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 9999; color: #FFF; box-shadow: 0 4px 20px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; }
.notification.success { background: linear-gradient(135deg, var(--honey), var(--honey-dark)); }
.notification.error { background: var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* Preview */
.preview-header { text-align: center; margin-bottom: 24px; }
.preview-logo { font-size: 32px; font-weight: 800; color: var(--honey-dark); }
.preview-sub { font-size: 11px; letter-spacing: 3px; color: var(--brown-light); text-transform: uppercase; }
.preview-divider { height: 2px; background: linear-gradient(90deg, transparent, var(--honey), transparent); margin: 16px 0; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 20px; }
.preview-table th { padding: 8px 10px; text-align: left; font-weight: 700; background: #FFF5E6; border-bottom: 2px solid var(--honey); }
.preview-table td { padding: 6px 10px; border-bottom: 1px solid #F0E6D4; }
.preview-table .group-header { font-weight: 700; color: var(--honey-dark); background: rgba(212,160,60,0.05); font-size: 12px; }
.preview-table .text-right { text-align: right; }
.preview-table .text-center { text-align: center; }

/* Calendar */
.cal-legend { display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--brown-light);font-weight:600 }
.cal-dot { width:12px;height:12px;border-radius:50%;display:inline-block }
.calendar-grid { background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 2px 12px rgba(0,0,0,0.06) }
.cal-header-row { display:grid;grid-template-columns:repeat(7,1fr);background:var(--brown);color:#fff }
.cal-day-name { padding:10px 4px;text-align:center;font-weight:700;font-size:13px }
.cal-day-name.sat { color:#FFD700 }
.cal-day-name.sun { color:#FF9999 }
.cal-body { }
.cal-row { display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid #f0e8d8 }
.cal-row:last-child { border-bottom:none }
.cal-cell { min-height:110px;padding:6px 8px;border-right:1px solid #f0e8d8;position:relative;transition:background 0.15s }
.cal-cell:last-child { border-right:none }
.cal-cell.empty { background:#faf6ef }
.cal-cell:hover:not(.empty) { background:#FFF8E7 }
.cal-cell.today { background:#FFF3CD;box-shadow:inset 0 0 0 2px var(--honey) }
.cal-cell.sat-free { background:#E8F8F0 }
.cal-cell.sat-busy { background:#FDEDEC }
.cal-cell.sun { background:#FDF2F2 }
.cal-day-num { font-size:14px;font-weight:700;color:var(--brown);margin-bottom:4px }
.cal-cell.today .cal-day-num { color:var(--honey);font-size:16px }
.cal-cell.sun .cal-day-num { color:#E74C3C }
.cal-badge { font-size:10px;font-weight:700;padding:2px 8px;border-radius:10px;text-align:center;margin-bottom:4px }
.cal-badge.free { background:#27AE60;color:#fff }
.cal-event { display:flex;align-items:flex-start;gap:4px;padding:3px 6px;border-radius:6px;margin-bottom:3px;font-size:11px;cursor:default }
.cal-ev-icon { font-size:12px;flex-shrink:0;margin-top:1px }
.cal-ev-info { overflow:hidden }
.cal-ev-title { font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis }
.cal-ev-client { font-size:10px;opacity:0.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis }

/* Financeiro */
.fin-subtabs { border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.fin-tab { background: transparent; color: var(--brown-light); border: 1px solid transparent; }
.fin-tab.active { background: var(--honey); color: #FFF; border-color: var(--honey); }
.fin-tab:hover:not(.active) { background: var(--honey-bg); color: var(--brown); }

/* Responsive */
@media (max-width: 960px) { .budget-layout { grid-template-columns: 1fr; } .sticky { position: static; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .header { padding: 12px 16px; } .main { padding: 16px 12px; } .grid-2,.grid-3 { grid-template-columns: 1fr; } .catalog-grid { grid-template-columns: 1fr; } }
@media print { .header,.tab-bar,.modal-actions,.budget-sidebar button,.btn,.editing-banner { display: none !important; } .modal { position: static; background: none; } .modal-content { box-shadow: none; max-width: 100%; padding: 0; } body { background: white; } }
