/* ═══════════════════════════════════════════════════════
   RC CONCERTINA — DASHBOARD CSS — Identidade Visual RC
   ═══════════════════════════════════════════════════════ */

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

:root {
  /* ── RC Concertina Brand Colors ── */
  --rc-yellow:       #F4A900;
  --rc-yellow-light: #FFF3D6;
  --rc-yellow-dark:  #C98A00;
  --rc-yellow-glow:  rgba(244,169,0,0.18);
  --rc-black:        #1B1B1B;
  --rc-dark:         #111111;
  --rc-dark-2:       #181818;
  --rc-dark-3:       #222222;
  --rc-dark-4:       #2C2C2C;
  --rc-surface:      #1E1E1E;
  --rc-surface-2:    #282828;
  --rc-border:       rgba(244,169,0,0.12);
  --rc-border-dim:   rgba(255,255,255,0.06);

  /* ── Text ── */
  --text:        #F0F0F0;
  --text-muted:  #888888;
  --text-dim:    #555555;

  /* ── Status Colors ── */
  --green:   #22C55E;
  --red:     #EF4444;
  --blue:    #3B82F6;
  --orange:  #F97316;
  --purple:  #A855F7;

  /* ── Layout ── */
  --sidebar-w:  248px;
  --topbar-h:   62px;
  --radius:     10px;
  --radius-sm:  7px;
  --radius-xs:  4px;
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.35);
  --transition: 0.16s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  background: var(--rc-dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rc-dark-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--rc-yellow); }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--rc-dark-2);
  border-right: 1px solid var(--rc-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--rc-border);
  overflow: hidden;
  min-width: 0;
}
.logo-img {
  height: 28px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(1.1);
}
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 11px; font-weight: 700; color: var(--rc-yellow); letter-spacing: 0.3px; line-height: 1.2; }
.logo-sub { font-size: 10px; color: var(--text-muted); font-weight: 400; margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--rc-dark-3); color: var(--text); }
.nav-item.active {
  background: var(--rc-yellow-glow);
  color: var(--rc-yellow);
  border-color: rgba(244,169,0,0.25);
  font-weight: 600;
}

/* Yellow accent bar on active */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 32px;
  background: var(--rc-yellow);
  border-radius: 0 2px 2px 0;
  margin-left: -8px;
}
.nav-item { position: relative; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--rc-border);
}
.storage-info { display: flex; flex-direction: column; gap: 5px; }
.storage-label { font-size: 10px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.storage-bar { height: 3px; background: var(--rc-dark-4); border-radius: 99px; overflow: hidden; }
.storage-fill { height: 100%; background: var(--rc-yellow); border-radius: 99px; width: 0%; transition: width 0.5s ease; }
.storage-size { font-size: 11px; color: var(--text-dim); }

/* ─── MAIN ─── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--rc-dark-2);
  border-bottom: 1px solid var(--rc-border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-brand img {
  height: 20px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  opacity: 0.45;
  filter: brightness(10);
  flex-shrink: 0;
}

/* ─── VIEWS ─── */
.view-container { flex: 1; padding: 26px 26px 48px; }
.view { display: none; animation: fadeIn 0.18s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header p { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ─── STATS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--rc-surface);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--rc-border-dim);
  transition: transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card:hover::after { opacity: 1; }

.accent-yellow { border-top: 2px solid var(--rc-yellow); }
.accent-yellow:hover { border-color: var(--rc-yellow); box-shadow: 0 4px 20px rgba(244,169,0,0.12); }
.accent-green { border-top: 2px solid var(--green); }
.accent-green:hover { box-shadow: 0 4px 20px rgba(34,197,94,0.12); }
.accent-blue { border-top: 2px solid var(--blue); }
.accent-blue:hover { box-shadow: 0 4px 20px rgba(59,130,246,0.12); }
.accent-purple { border-top: 2px solid var(--purple); }
.accent-purple:hover { box-shadow: 0 4px 20px rgba(168,85,247,0.12); }

.stat-icon { font-size: 26px; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.accent-yellow .stat-value { color: var(--rc-yellow); }
.accent-blue .stat-value { color: var(--blue); }
.accent-green .stat-value { color: var(--green); }
.accent-purple .stat-value { color: var(--purple); }

/* ─── DASH GRID ─── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 14px;
}

/* ─── CARD ─── */
.card {
  background: var(--rc-surface);
  border-radius: var(--radius);
  border: 1px solid var(--rc-border-dim);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rc-border-dim);
}
.card-header h2 { font-size: 13.5px; font-weight: 600; color: var(--text); }
.btn-link {
  background: transparent;
  border: none;
  color: var(--rc-yellow);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  transition: opacity var(--transition);
}
.btn-link:hover { opacity: 0.8; text-decoration: underline; }

/* ─── RECENT LIST ─── */
.recent-list { padding: 6px 0; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rc-border-dim);
  transition: background var(--transition);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--rc-surface-2); }
.recent-num { font-size: 11px; color: var(--rc-yellow); font-weight: 700; width: 36px; }
.recent-info { flex: 1; }
.recent-client { font-size: 12.5px; font-weight: 600; color: var(--text); }
.recent-date { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.recent-value { font-size: 13px; font-weight: 700; color: var(--green); white-space: nowrap; }

/* ─── STATUS CHART ─── */
.status-chart { padding: 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.status-row { display: flex; align-items: center; justify-content: space-between; }
.status-count { font-size: 18px; font-weight: 800; color: var(--text); }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge::before { content: '●'; font-size: 7px; }
.badge-pending  { background: rgba(249,115,22,0.12); color: var(--orange); border: 1px solid rgba(249,115,22,0.2); }
.badge-approved { background: rgba(34,197,94,0.12);  color: var(--green);  border: 1px solid rgba(34,197,94,0.2); }
.badge-rejected { background: rgba(239,68,68,0.12);  color: var(--red);    border: 1px solid rgba(239,68,68,0.2); }

/* ─── TABLE TOOLBAR ─── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rc-border-dim);
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 180px;
  background: var(--rc-dark-3);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--rc-yellow); }
.search-input::placeholder { color: var(--text-dim); }
.filter-select {
  background: var(--rc-dark-3);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--rc-yellow); }
.filter-group { display: flex; gap: 8px; }
.count-badge {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--rc-dark-3);
  border-radius: 99px;
  border: 1px solid var(--rc-border-dim);
}

/* ─── DATA TABLE ─── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 9px 15px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--rc-border-dim);
  white-space: nowrap;
  background: var(--rc-dark-3);
}
.data-table td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--rc-border-dim);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--rc-surface-2); }

.td-name { font-weight: 600; color: var(--text); }
.td-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.td-value { font-weight: 700; color: var(--green); font-size: 13.5px; }
.td-num { font-weight: 700; color: var(--rc-yellow); font-size: 12px; }

.action-btns { display: flex; gap: 5px; }
.btn-icon {
  width: 29px; height: 29px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rc-border-dim);
  background: var(--rc-dark-3);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--rc-surface-2); color: var(--text); }
.btn-icon.btn-view:hover   { color: var(--blue);      border-color: rgba(59,130,246,0.4); }
.btn-icon.btn-edit:hover   { color: var(--rc-yellow); border-color: rgba(244,169,0,0.4);  }
.btn-icon.btn-delete:hover { color: var(--red);       border-color: rgba(239,68,68,0.4);  }
.btn-icon.btn-status:hover { color: var(--green);     border-color: rgba(34,197,94,0.4);  }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-small { text-align: center; padding: 22px; color: var(--text-dim); font-size: 12.5px; }
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.3; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.empty-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--rc-yellow);
  color: #000;
  box-shadow: 0 2px 12px rgba(244,169,0,0.25);
}
.btn-primary:hover { background: var(--rc-yellow-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(244,169,0,0.35); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--rc-border-dim);
}
.btn-ghost:hover { background: var(--rc-dark-3); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: overlayIn 0.18s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--rc-dark-2);
  border: 1px solid var(--rc-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
  box-shadow: var(--shadow);
}
.modal-wide { max-width: 800px; }
.modal-sm   { max-width: 380px; }
@keyframes modalIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rc-border-dim);
  flex-shrink: 0;
}
/* Yellow accent line on modal top */
.modal { border-top: 2px solid var(--rc-yellow); }

.modal-header h2 { font-size: 15px; font-weight: 700; }
.modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 16px;
  cursor: pointer; width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  display: grid; place-items: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--rc-dark-3); color: var(--text); }

.modal-body { overflow-y: auto; padding: 20px; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--rc-border-dim);
  margin-top: 18px;
}

/* ─── FORM ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.2px; }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--rc-dark-3);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  padding: 9px 11px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--rc-yellow);
  box-shadow: 0 0 0 3px rgba(244,169,0,0.08);
}
.form-group textarea { resize: vertical; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); font-size: 13px; }

/* ─── BUDGET ITEMS ─── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--rc-yellow);
  margin: 18px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rc-border);
}
.items-header {
  display: grid;
  grid-template-columns: 1fr 60px 70px 100px 90px 30px;
  gap: 8px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.budget-item-row {
  display: grid;
  grid-template-columns: 1fr 60px 70px 100px 90px 30px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  background: var(--rc-dark-3);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-sm);
  padding: 7px;
  transition: border-color var(--transition);
}
.budget-item-row:hover { border-color: var(--rc-border); }
.budget-item-row input,
.budget-item-row select {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  padding: 5px 7px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
.budget-item-row input:focus,
.budget-item-row select:focus { border-color: var(--rc-yellow); }
.item-total { font-size: 13px; font-weight: 700; color: var(--green); text-align: right; padding-right: 4px; }
.btn-remove-item {
  background: transparent; border: none;
  color: var(--red); cursor: pointer;
  font-size: 14px; width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  opacity: 0.5;
}
.btn-remove-item:hover { background: rgba(239,68,68,0.12); opacity: 1; }

.btn-add-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(244,169,0,0.25);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
  margin-top: 6px;
}
.btn-add-item:hover { border-color: var(--rc-yellow); color: var(--rc-yellow); background: var(--rc-yellow-glow); }

/* ─── BUDGET TOTALS ─── */
.budget-totals {
  background: var(--rc-dark-3);
  border: 1px solid var(--rc-border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.total-row:not(.total-final) { color: var(--text-muted); }
.total-final {
  font-size: 15px; font-weight: 800;
  color: var(--green);
  padding-top: 9px;
  border-top: 1px solid var(--rc-border);
}
.discount-input {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  padding: 4px 8px; width: 100px;
  text-align: right; outline: none;
}
.discount-input:focus { border-color: var(--rc-yellow); }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--rc-dark-2);
  border: 1px solid var(--rc-border-dim);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 999;
  opacity: 0; transform: translateY(8px);
  transition: all 0.22s ease;
  pointer-events: none; max-width: 300px;
}
.toast.show { opacity: 1; transform: none; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--rc-yellow); }

/* ══════════════════════════════════════════════════════
   PRINT / PDF STYLES
   ══════════════════════════════════════════════════════ */
/* Print modal — remove dark border around document */
#modal-print .modal {
  background: #1B1B1B;
  border-top: none;
}
#modal-print .modal-body {
  padding: 0;
  background: #1B1B1B;
}
#print-content {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
}
.print-doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  color: #1a1a1a;
  font-family: 'Poppins', 'Inter', sans-serif;
}

/* Header stripe */
.print-top-stripe {
  background: #1B1B1B;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.print-logo { height: 32px; width: auto; object-fit: contain; filter: brightness(10); }
.print-orcamento-label {
  background: #F4A900;
  color: #000;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 99px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-block;
}

/* Yellow divider */
.print-yellow-bar {
  height: 3px;
  background: linear-gradient(90deg, #F4A900 0%, #C98A00 100%);
}

.print-body { padding: 22px 28px; }

/* Meta row */
.print-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #eee;
}
.print-num { font-size: 22px; font-weight: 800; color: #1a1a1a; }
.print-num-label { font-size: 10px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 2px; }
.print-dates { text-align: right; }
.print-date-item { font-size: 12px; color: #555; margin-bottom: 3px; }
.print-date-item strong { color: #1a1a1a; }
.print-validity { display: inline-block; margin-top: 4px; background: #FFF3D6; color: #C98A00; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 99px; border: 1px solid #F4A900; }

/* Section title */
.print-section {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F4A900;
  margin-bottom: 8px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.print-section::after { content: ''; flex: 1; height: 1px; background: #eee; }

/* Client box */
.print-client-box {
  background: #F9F9F9;
  border-radius: 6px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  border: 1px solid #eee;
}
.print-field label { font-size: 9.5px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 2px; }
.print-field span { font-size: 13px; font-weight: 500; color: #1a1a1a; }

/* Items table */
.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
}
.print-table th {
  background: #333;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.print-table th:first-child { border-radius: 4px 0 0 4px; }
.print-table th:last-child  { border-radius: 0 4px 4px 0; }
.print-table tbody tr { transition: background 0.1s; }
.print-table tbody tr:nth-child(even) { background: #FAFAFA; }
.print-table td { padding: 10px 12px; border-bottom: 1px solid #F0F0F0; font-size: 12.5px; }
.print-table tfoot td {
  border-top: 2px solid #1B1B1B;
  font-weight: 700;
  padding-top: 12px;
}

/* Totals */
.print-totals-wrapper { display: flex; justify-content: flex-end; margin-top: 12px; }
.print-totals {
  width: 260px;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}
.print-total-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid #eee;
  color: #444;
}
.print-total-row:last-child { border-bottom: none; }
.print-total-final {
  background: #1B1B1B;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 14px;
}
.print-total-final span:last-child { color: #F4A900; }

/* Notes */
.print-notes-box {
  background: #FFFBF0;
  border: 1px solid #F4A900;
  border-left: 4px solid #F4A900;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: #444;
  margin-top: 6px;
}
.print-notes-box strong { color: #C98A00; display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 4px; }

/* Signatures */
.print-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 20px;
}
.print-sig-line {
  border-top: 1.5px solid #ccc;
  padding-top: 8px;
  text-align: center;
  font-size: 11px;
  color: #888;
}
.print-sig-line strong { display: block; color: #1a1a1a; font-size: 12px; margin-bottom: 4px; }

/* Footer */
.print-footer-stripe {
  background: #1B1B1B;
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  page-break-before: avoid;
  break-before: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
}
.print-footer-left { font-size: 11px; color: #999; }
.print-footer-right { font-size: 11px; color: #999; text-align: right; }
.print-footer-right a { color: #F4A900; text-decoration: none; }

/* ─── PRINT MEDIA ─── */
@page {
  margin: 10mm 10mm;
  size: A4;
}

@media print {
  /* Hide everything except the print modal */
  body > *:not(#modal-print) { display: none !important; }

  /* Reset ALL backgrounds — the black frame source */
  body,
  #modal-print,
  #modal-print .modal-overlay,
  #modal-print .modal,
  #modal-print .modal-body,
  #modal-print .modal-header,
  #print-content {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    width: 100% !important;
    overflow: visible !important;
    position: static !important;
  }

  /* Make the print doc fill the page */
  .print-doc {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  /* Hide UI elements */
  .no-print { display: none !important; }

  /* Preserve background colors in print */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Prevent footer from creating extra black page */
  .print-footer-stripe {
    page-break-before: avoid !important;
    break-before: avoid !important;
  }
  .print-doc {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}

/* ─── MOBILE BOTTOM NAV BAR ─── */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(24, 24, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--rc-border);
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  height: 100%;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-icon {
  font-size: 18px;
  transition: transform 0.15s ease;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--rc-yellow);
}
.mobile-nav-item.active .mobile-nav-icon {
  transform: scale(1.15);
}

/* Touch active highlight removal */
button, a {
  -webkit-tap-highlight-color: transparent;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 920px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  /* Navigation adjustments */
  .sidebar { display: none !important; }
  .main { margin-left: 0; }
  .menu-toggle { display: none !important; }
  
  .mobile-nav-bar {
    display: flex;
  }

  /* Padding adjustments to avoid overlap with bottom navigation and notches */
  .view-container { 
    padding: 16px 16px calc(80px + env(safe-area-inset-bottom)) !important;
  }
  
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .items-header { display: none; }
  .budget-item-row { grid-template-columns: 1fr 1.5fr; }
  
  /* Print adjustments */
  .print-client-box { grid-template-columns: 1fr; }
  .print-signatures { grid-template-columns: 1fr; gap: 20px; }

  /* ──────────────────────────────────────────────────────────
     AUTO-CONVERT TABLES TO RICH MOBILE CARDS
     ────────────────────────────────────────────────────────── */
  .data-table, 
  .data-table thead, 
  .data-table tbody, 
  .data-table th, 
  .data-table td, 
  .data-table tr {
    display: block;
  }
  
  .data-table thead {
    display: none;
  }
  
  .data-table tr {
    background: var(--rc-surface);
    border: 1px solid var(--rc-border-dim);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
    border-bottom: 1px dashed rgba(255,255,255,0.03);
  }
  .data-table td:last-child {
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--rc-border-dim);
  }

  /* Client Table Card Labels */
  #clients-table td:nth-child(1) {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--rc-border-dim);
    padding-bottom: 10px;
    margin-bottom: 4px;
    justify-content: flex-start;
  }
  #clients-table td:nth-child(2)::before { content: "Telefone:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #clients-table td:nth-child(3)::before { content: "E-mail:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #clients-table td:nth-child(4)::before { content: "Cidade:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #clients-table td:nth-child(5)::before { content: "Orçamentos:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }

  /* Budgets Table Card Labels */
  #budgets-table td:nth-child(1) {
    font-size: 14px;
    font-weight: 700;
    color: var(--rc-yellow);
    border-bottom: 1px solid var(--rc-border-dim);
    padding-bottom: 10px;
    margin-bottom: 4px;
    justify-content: flex-start;
  }
  #budgets-table td:nth-child(2)::before { content: "Cliente:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #budgets-table td:nth-child(3)::before { content: "Data:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #budgets-table td:nth-child(4)::before { content: "Total:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #budgets-table td:nth-child(5)::before { content: "Status:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }

  /* Products Table Card Labels */
  #products-table td:nth-child(1) {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--rc-border-dim);
    padding-bottom: 10px;
    margin-bottom: 4px;
    justify-content: flex-start;
  }
  #products-table td:nth-child(2)::before { content: "Unidade:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }
  #products-table td:nth-child(3)::before { content: "Preço Unitário:"; font-weight: 600; color: var(--text-muted); font-size: 11px; }

  /* Centering/stretching action buttons in mobile cards */
  .action-btns {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }
  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 6px;
  }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .budget-item-row { grid-template-columns: 1fr; }
  .print-meta-row { flex-direction: column; gap: 10px; }
  .print-dates { text-align: left; }
}
