/* =============================================
   SIGMAFORMA ARCHITECTURE & ENGINEERING STUDIO
   Clean White Architectural Light Theme (Fundo Branco)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --brand-navy: #1d2259;
  --brand-gold: #f3c50f;
  --brand-gold-soft: #fff8d7;
  --bg:          #f8fafc;
  --bg2:         #ffffff;
  --bg3:         #f1f5f9;
  --glass:       #ffffff;
  --glass-b:     #f8fafc;
  --border:      #cbd5e1;
  --border-white: #1d2259;

  --accent-white: #1d2259;
  --accent-gray:  #334155;
  --accent-dim:   rgba(29,34,89,0.06);

  --text:        #1d2259;
  --text-2:      #334155;
  --text-3:      #64748b;

  --emerald:     #16a34a;
  --rose:        #e11d48;
  --sky:         #0284c7;

  --r-sm:        10px;
  --r-md:        16px;
  --r-lg:        22px;
  --r-xl:        30px;

  --shadow:      0 10px 36px rgba(29,34,89,0.08);
  --shadow-dark: 0 14px 44px rgba(29,34,89,0.15);
  --trans:       all 0.22s cubic-bezier(.4,0,.2,1);

  --sidebar-w:   290px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 1rem;
}

/* ==========================================
   UNIVERSAL STANDARDIZED BLACK SCROLLBAR & SELECTION SYSTEM
   ========================================== */
* {
  scrollbar-width: thin !important;
  scrollbar-color: #1d2259 #f1f5f9 !important;
  accent-color: #1d2259 !important;
}

::selection {
  background-color: #1d2259 !important;
  color: #ffffff !important;
}

::-moz-selection {
  background-color: #1d2259 !important;
  color: #ffffff !important;
}

input::selection,
textarea::selection,
select::selection {
  background-color: #1d2259 !important;
  color: #ffffff !important;
}

input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  accent-color: #1d2259 !important;
  color-scheme: light;
}

body.dark-theme input[type="date"],
body.dark-theme input[type="datetime-local"],
body.dark-theme input[type="time"] {
  accent-color: #38bdf8 !important;
  color-scheme: dark;
}

::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
}

::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 10px !important;
}

::-webkit-scrollbar-thumb {
  background: #1d2259 !important;
  border-radius: 10px !important;
  border: 1.5px solid #f1f5f9 !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #1e293b !important;
}

::-webkit-scrollbar-corner {
  background: #f1f5f9 !important;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

body::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(29,34,89,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,34,89,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none; z-index: 0;
}

/* TOP HEADER WHITE BACKGROUND */
.app-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1.5px solid var(--border);
  padding: 0 3rem; height: 82px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.brand-logo { display: flex; align-items: center; gap: 18px; }

.logo-icon-img {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem; font-weight: 900; letter-spacing: 3.5px;
  color: #1d2259; text-transform: uppercase;
}

.brand-text span {
  font-size: 0.72rem; letter-spacing: 3.5px;
  color: var(--text-3); font-weight: 700; display: block; margin-top: -1px;
}

.header-center { display: flex; flex-direction: column; align-items: center; }
.header-center h2 { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 800; color: #1d2259; letter-spacing: 1px; }
.header-center p { font-size: 0.82rem; color: var(--text-2); letter-spacing: 0.8px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

.header-actions { display: flex; gap: 12px; align-items: center; }

/* BUTTONS WHITE THEME */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r-sm); font-weight: 700; cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important; text-decoration: none;
  font-family: 'Inter', sans-serif; letter-spacing: 0.4px;
}

.btn:hover, .btn-animated:hover {
  transform: translateY(-2.5px) scale(1.02) !important;
  box-shadow: 0 8px 22px rgba(29,34,89, 0.22) !important;
}

.btn:active, .btn-animated:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn-primary {
  background: #1d2259;
  color: #ffffff; box-shadow: 0 6px 20px rgba(29,34,89,0.25);
  border: 1px solid #1d2259;
}

.btn-primary:hover {
  background: #1e293b; color: #ffffff;
  transform: translateY(-2px); box-shadow: 0 10px 30px rgba(29,34,89,0.35);
}

.btn-secondary { background: #f1f5f9; border: 1.5px solid var(--border); color: #1d2259; }
.btn-secondary:hover { background: #e2e8f0; border-color: #1d2259; color: #1d2259; }

.btn-outline { background: #ffffff; border: 1.5px solid #cbd5e1; color: #1d2259; transition: all 0.2s ease !important; }
.btn-outline:hover, .btn-outline:focus, .btn-outline.active { border-color: #1d2259 !important; color: #ffffff !important; background: #1d2259 !important; }

.btn-sm { padding: 0.48rem 1rem; font-size: 0.88rem; }
.btn-md { padding: 0.65rem 1.25rem; font-size: 0.95rem; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.1rem; }
.btn-xl { padding: 1.2rem 2.5rem; font-size: 1.2rem; font-weight: 800; letter-spacing: 1px; width: 100%; justify-content: center; }

.btn-danger-sm {
  display: inline-flex; align-items: center; gap: 5px; padding: 0.35rem 0.75rem;
  border-radius: 8px; font-size: 0.84rem; font-weight: 700;
  background: #ffffff; border: 1.5px solid #cbd5e1;
  color: #1d2259; cursor: pointer; transition: var(--trans);
}
.btn-danger-sm:hover { background: #1d2259; color: #ffffff; border-color: #1d2259; }

/* MAIN LAYOUT */
.main-layout-sigma {
  position: relative; z-index: 1; flex: 1; display: grid;
  grid-template-columns: var(--sidebar-w) 1fr; gap: 0;
  max-width: 1600px; margin: 0 auto; width: 100%;
}

/* SIDEBAR LIGHT THEME */
.step-sidebar {
  background: #ffffff; border-right: 1.5px solid var(--border);
  padding: 2.2rem 1.5rem; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 82px; height: calc(100vh - 82px); overflow-y: auto;
}

.step-sidebar-title {
  font-size: 0.78rem; letter-spacing: 3.5px; text-transform: uppercase;
  color: #1d2259; font-weight: 800; margin-bottom: 1.25rem; padding-left: 4px;
}

.step-item {
  display: flex; align-items: center; gap: 14px; padding: 0.9rem 1.1rem;
  border-radius: var(--r-md); cursor: pointer; transition: var(--trans); border: 1.5px solid transparent;
}
.step-item:hover { background: #f8fafc; border-color: var(--border); }
.step-item.active { background: #f1f5f9; border-color: #1d2259; }

.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: #ffffff;
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800; color: var(--text-2); flex-shrink: 0; transition: var(--trans);
}
.step-item.active .step-num { background: #1d2259; border-color: #1d2259; color: #ffffff; box-shadow: 0 4px 16px rgba(29,34,89,0.2); }

.step-info { display: flex; flex-direction: column; }
.step-label { font-size: 1.02rem; font-weight: 700; color: var(--text-2); transition: var(--trans); }
.step-item.active .step-label { color: #1d2259; font-weight: 800; }
.step-sublabel { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; font-weight: 500; }

/* FORM SECTION */
.form-section-wide { padding: 2.5rem 3.5rem; display: flex; flex-direction: column; gap: 2.2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

.fcard { background: #ffffff; border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.fcard-header { padding: 1.35rem 2rem; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; gap: 14px; background: #f8fafc; }
.fcard-header-left { display: flex; align-items: center; gap: 14px; flex: 1; }

.step-badge {
  width: 32px; height: 32px; border-radius: 50%; background: #1d2259; color: #ffffff;
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 800; flex-shrink: 0;
}
.fcard-title { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 800; color: #1d2259; letter-spacing: 0.5px; }
.fcard-subtitle { font-size: 0.85rem; color: var(--text-3); margin-top: 2px; font-weight: 500; }
.fcard-body { padding: 2rem 2.25rem; }

/* FIELDS LIGHT THEME */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
.span-2 { grid-column: 1 / -1; }
.fgroup { display: flex; flex-direction: column; gap: 8px; }
.fgroup label { font-size: 0.88rem; font-weight: 800; color: #1d2259; letter-spacing: 0.8px; text-transform: uppercase; }

.finput {
  background: #ffffff; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  color: #1d2259; padding: 0.9rem 1.15rem; font-size: 1.05rem; font-weight: 600;
  font-family: 'Inter', sans-serif; transition: var(--trans); width: 100%;
}
.finput:focus { outline: none; border-color: #1d2259; background: #ffffff; box-shadow: 0 0 0 4px rgba(29,34,89,0.1); }
.finput::placeholder { color: #94a3b8; font-size: 0.95rem; font-weight: 400; }

.finput.input-error {
  border-color: #e11d48 !important;
  background: rgba(225,29,72,0.05) !important;
  box-shadow: 0 0 0 4px rgba(225,29,72,0.2) !important;
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

textarea.finput { resize: vertical; min-height: 90px; line-height: 1.5; }
select.finput {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 16px;
  padding-right: 3rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-weight: 800;
  color: #1d2259;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

select.finput:hover {
  border-color: #1d2259;
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(29,34,89, 0.08);
}

select.finput:focus {
  outline: none;
  border-color: #1d2259;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(29,34,89, 0.12);
}

select.finput option,
select option {
  font-weight: 800 !important;
  color: #1d2259 !important;
  background: #ffffff !important;
  padding: 12px 18px !important;
  text-align: center !important;
}

.input-row { 
  display: flex !important; 
  flex-direction: row !important; 
  flex-wrap: nowrap !important; 
  gap: 10px !important; 
  align-items: stretch !important; 
  width: 100% !important; 
}
.input-row .finput { 
  flex: 1 1 auto !important; 
  min-width: 0 !important; 
  width: auto !important; 
}
.input-row button,
.input-row .btn-confirm-interactive {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  height: 48px !important;
  min-height: 48px !important;
}

.input-suffix-wrap { position: relative; display: flex; align-items: center; }
.input-suffix-text { position: absolute; right: 1.25rem; font-weight: 800; font-size: 0.82rem; color: #1d2259; letter-spacing: 1.5px; }

/* STEPPER COMPACT INPUT (-) AND (+) */
.stepper-input-wrap {
  display: flex; align-items: center; gap: 6px;
  background: #ffffff; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 10px; transition: var(--trans);
}
.stepper-input-wrap:focus-within { border-color: #1d2259; box-shadow: 0 0 0 4px rgba(29,34,89,0.1); }

.stepper-btn {
  background: #f1f5f9; border: 1.5px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: #1d2259; font-weight: 800; cursor: pointer; transition: var(--trans);
  flex-shrink: 0;
}
.stepper-btn:hover { background: #1d2259; color: #ffffff; border-color: #1d2259; }

.stepper-input-wrap .finput {
  border: none !important; box-shadow: none !important;
  text-align: center; font-size: 1.15rem; font-weight: 800;
  padding: 0.5rem 0.2rem !important; width: 65px !important; flex: 0 0 65px;
}
.stepper-input-wrap .finput::-webkit-outer-spin-button,
.stepper-input-wrap .finput::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.stepper-input-wrap .finput[type=number] {
  -moz-appearance: textfield;
}

.stepper-suffix {
  font-size: 0.78rem; font-weight: 800; color: var(--text-3);
  letter-spacing: 1px; margin-left: auto; padding-right: 4px; white-space: nowrap;
}

.input-suffix {
  display: flex; align-items: center; background: #f8fafc; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 0 1.25rem; color: #1d2259; font-weight: 800; font-size: 1.2rem; flex-shrink: 0;
}

/* MASTER CHECKLIST LIGHT THEME */
.master-checklist {
  display: flex; flex-direction: column; gap: 1.1rem;
  max-height: 420px; overflow-y: auto;
  background: #ffffff; border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 1.5rem;
}

.chk-category { border-bottom: 1.5px solid var(--border); padding-bottom: 1rem; margin-bottom: 0.5rem; }
.chk-cat-header { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: #1d2259; cursor: pointer; margin-bottom: 0.6rem; }
.chk-cat-checkbox { width: 20px; height: 20px; accent-color: #1d2259; cursor: pointer; }

.chk-item-row { display: flex; align-items: center; gap: 12px; padding: 0.45rem 0.6rem; border-radius: 6px; transition: var(--trans); }
.chk-item-row:hover { background: #f1f5f9; }
.chk-checkbox { width: 18px; height: 18px; accent-color: #1d2259; cursor: pointer; }
.chk-item-text { font-size: 0.98rem; font-weight: 600; color: #1d2259; flex: 1; cursor: pointer; }

/* SCOPE CARDS LIGHT THEME */
.cat-card { background: #ffffff; border: 1.5px solid var(--border); border-radius: var(--r-md); margin-bottom: 1.25rem; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.03); scroll-margin-top: 90px; }
.cat-header { display: flex; align-items: center; gap: 10px; padding: 1rem 1.4rem; border-bottom: 1.5px solid var(--border); background: #f8fafc; }
.cat-icon { color: #1d2259; font-size: 0.95rem; }
.cat-title-input { flex: 1; font-weight: 800 !important; color: #1d2259 !important; background: transparent !important; border: none !important; padding: 0 !important; font-size: 1.1rem !important; box-shadow: none !important; }

#map-container {
  height: 520px !important;
  width: 100%;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: #f1f5f9;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  position: relative;
  z-index: 1;
}

/* LEAFLET CONTROLS HIDDEN */
.leaflet-control-zoom,
.leaflet-control-layers,
.leaflet-control-attribution,
.leaflet-bottom {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.items-list { padding: 1.1rem 1.4rem; display: flex; flex-direction: column; gap: 10px; }
.item-row { display: flex; align-items: center; gap: 12px; }
.item-dot { width: 6px; height: 6px; border-radius: 50%; background: #1d2259; flex-shrink: 0; }
.item-input { flex: 1; font-size: 0.98rem !important; font-weight: 600 !important; padding: 0.7rem 1rem !important; background: #f8fafc !important; }

/* PAYMENTS GRID WITH PERCENTAGES LIGHT THEME */
.pay-row-grid, .payment-row, .installment-row {
  display: grid;
  grid-template-columns: 1fr 110px 160px 48px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.pay-desc-col { flex: 1; width: 100%; height: 48px; }
.pay-percent-col { width: 100% !important; height: 48px; }
.pay-val-col { width: 100% !important; height: 48px; }
.pay-action-col { display: flex; justify-content: center; align-items: center; height: 48px; }

.split-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.split-btn { 
  background: #ffffff !important; 
  border: 1.5px solid #1d2259 !important; 
  border-radius: 20px !important; 
  padding: 0 1.25rem !important; 
  height: 48px !important;
  min-height: 48px !important;
  font-size: 0.88rem !important; 
  font-weight: 800 !important; 
  color: #1d2259 !important; 
  cursor: pointer !important; 
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important; 
  box-shadow: 0 2px 6px rgba(29,34,89, 0.04) !important;
}
.split-btn:hover, 
.split-btn.active { 
  background: #1d2259 !important; 
  border-color: #1d2259 !important; 
  color: #ffffff !important; 
  box-shadow: 0 4px 12px rgba(29,34,89, 0.18) !important;
}

/* GENERATE CARD LIGHT THEME */
.generate-card { background: #ffffff; border: 2px solid #1d2259 !important; border-radius: var(--r-lg); padding: 2.2rem; display: flex; flex-direction: column; gap: 1.75rem; box-shadow: var(--shadow-dark); }

/* GENERATE BUTTON INTERACTIVE WHITE TO BLACK PROCESSING */
#btn-generate.loading-active,
#btn-generate:disabled {
  background: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  box-shadow: 0 6px 20px rgba(29,34,89, 0.25) !important;
  opacity: 1 !important;
  cursor: wait !important;
}

#btn-generate.loading-active i,
#btn-generate:disabled i {
  color: #ffffff !important;
}
.pdf-toggle { display: flex; align-items: center; gap: 14px; font-size: 1.05rem; font-weight: 700; color: #1d2259; }

.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-sw { position: absolute; cursor: pointer; inset: 0; background: #e2e8f0; border-radius: 28px; transition: 0.3s; border: 1px solid var(--border); }
.slider-sw::before { content: ''; position: absolute; height: 22px; width: 22px; left: 2px; bottom: 2px; background: #ffffff; border-radius: 50%; transition: 0.3s; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
input:checked + .slider-sw { background: #16a34a; border-color: #16a34a; }
input:checked + .slider-sw::before { transform: translateX(22px); }

/* MODAL LIGHT THEME */
.modal-overlay { position: fixed; inset: 0; background: rgba(29,34,89,0.6); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal-wrap { background: #ffffff; border: 1.5px solid var(--border); border-radius: var(--r-xl); width: 90%; max-width: 960px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-dark); overflow: hidden; }
.modal-head { padding: 1.6rem 2.2rem; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: #f8fafc; }
.modal-head h3 { font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 12px; color: #1d2259; }
.modal-head h3 i { color: #1d2259; }

.close-btn {
  background: #ffffff !important;
  color: #1d2259 !important;
  border: 1.5px solid #cbd5e1 !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 8px rgba(29,34,89, 0.08);
  opacity: 1 !important;
}

.close-btn:hover {
  background: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  transform: rotate(90deg) scale(1.12) !important;
  box-shadow: 0 6px 20px rgba(29,34,89, 0.25) !important;
}

.close-btn:active {
  background: #1d2259 !important;
  transform: rotate(90deg) scale(0.95) !important;
}

.modal-body { padding: 2rem 2.2rem; overflow-y: auto; }
.search-wrap { position: relative; margin-bottom: 1.5rem; }
.search-wrap i { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: #1d2259; font-size: 1.15rem; }
.search-wrap input { padding-left: 3.2rem; }

.hist-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
.hist-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.8px; color: #64748b; font-weight: 800; padding: 0.5rem 0.6rem; text-align: center !important; vertical-align: middle !important; white-space: nowrap; }
.hist-table td { padding: 0.62rem 0.6rem; font-size: 0.88rem; font-weight: 600; background: #ffffff; border-top: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); vertical-align: middle !important; text-align: center !important; }
.hist-table tr td:first-child { border-left: 1.5px solid var(--border); border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.hist-table tr td:last-child { border-right: 1.5px solid var(--border); border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.ext-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 6px; font-size: 0.82rem; font-weight: 800; }
.ext-pdf { background: rgba(225,29,72,0.1); color: #e11d48; border: 1px solid rgba(225,29,72,0.25); }
.ext-docx { background: rgba(2,132,199,0.1); color: #0284c7; border: 1px solid rgba(2,132,199,0.25); }

/* TOAST ELEGANT WHITE THEME */
.toast-container { position: fixed; bottom: 3rem; right: 2.5rem; display: flex; flex-direction: column; gap: 12px; z-index: 9999999; }
.toast {
  background: #ffffff;
  color: #1d2259;
  border: 1.5px solid #1d2259;
  border-left: 5px solid #1d2259;
  padding: 1.1rem 1.6rem;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  min-width: 320px;
}
.toast.success { border-left-color: #1d2259; }
.toast.error { border-left-color: #000000; }

/* YEAR NAVIGATION TABS & ZIP EXPORT */
.year-nav-row { display: flex; align-items: center; gap: 10px; }
.year-tabs { display: flex; align-items: center; gap: 6px; }

.year-tab-btn {
  background: #ffffff; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.85rem;
  font-size: 0.9rem; font-weight: 800; color: var(--text-2);
  cursor: pointer; transition: var(--trans);
}

.year-tab-btn:hover { background: #f1f5f9; border-color: #1d2259; color: #1d2259; }
.year-tab-btn.active { background: #1d2259; border-color: #1d2259; color: #ffffff; box-shadow: 0 4px 12px rgba(29,34,89,0.2); }

/* UTILS */
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 1.5rem; }
.font-bold { font-weight: 800; }
.divider { height: 1.5px; background: var(--border); margin: 1.5rem 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-sm { font-size: 0.88rem; }
.text-muted { color: var(--text-3); }
.fcard, .generate-card { scroll-margin-top: 90px; }

/* CUSTOM DROPDOWN SELECT STYLING */
.custom-select-wrap {
    position: relative;
    width: 100%;
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow-y: auto;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(29,34,89, 0.16);
    z-index: 1050;
    display: none;
    padding: 8px 0;
}

.custom-dropdown-menu.active {
    display: block;
}

#card-step-5:has(#assunto-dropdown-menu.active) {
    position: relative;
    z-index: 2;
    overflow: visible;
}

.dropdown-cat-header {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 10px 18px 6px 18px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.dropdown-cat-header:first-child {
    border-top: none;
}

.dropdown-item-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1d2259;
    cursor: pointer;
    text-align: center;
    border-radius: 10px;
    margin: 3px 8px;
    transition: all 0.15s ease;
}

.dropdown-item-btn:hover {
    background: #f1f5f9;
    color: #1d2259;
}

.dropdown-item-btn.active-item {
    background: #1d2259;
    color: #ffffff;
}

body.dark-theme .custom-dropdown-menu {
    background: #1d2259;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-theme .dropdown-item-btn {
    color: #f8fafc;
}

body.dark-theme .dropdown-item-btn:hover {
    background: #1e293b;
    color: #38bdf8;
}

/* HIDE NUMBER INPUT SPINNER ARROWS */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* =============================================
   DARK MODE OVERRIDES & LIVE SUMMARY STYLES
   ============================================= */
body.dark-theme {
  --bg:          #1d2259;
  --bg2:         #1e293b;
  --bg3:         #334155;
  --glass:       #1e293b;
  --glass-b:     #1d2259;
  --border:      #334155;
  --border-white: #f8fafc;

  --accent-white: #f8fafc;
  --accent-gray:  #94a3b8;
  --accent-dim:   rgba(255,255,255,0.06);

  --text:        #f8fafc;
  --text-2:      #cbd5e1;
  --text-3:      #94a3b8;
}

body.dark-theme .app-header {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: #334155;
}

body.dark-theme .brand-text h1,
body.dark-theme .header-center h2 {
  color: #f8fafc;
}

body.dark-theme .fcard,
body.dark-theme .modal-wrap,
body.dark-theme .custom-dropdown-menu {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-theme .modal-head {
  background: #1d2259;
  border-bottom-color: #334155;
}

body.dark-theme .modal-head h3 {
  color: #f8fafc;
}

body.dark-theme .finput,
body.dark-theme select.finput,
body.dark-theme textarea.finput {
  background: #1d2259;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-theme .hist-table td {
  background: #1d2259;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-theme .hist-table th {
  color: #94a3b8;
}

body.dark-theme .step-sidebar {
  background: #1e293b;
  border-color: #334155;
}

body.dark-theme .step-item {
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .step-item.active {
  background: #1d2259;
  border-color: #38bdf8;
  color: #f8fafc;
}

body.dark-theme .btn-outline {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-theme .btn-outline:hover {
  background: #334155;
  color: #38bdf8;
}

/* LIVE SUMMARY CARD */
.live-summary-card {
  background: linear-gradient(135deg, #1d2259 0%, #1e293b 100%);
  border: 1.5px solid #334155;
  border-radius: var(--r-lg);
  padding: 1.25rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  box-shadow: var(--shadow);
  color: #ffffff;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sum-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sum-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.sum-val.highlight {
  color: #38bdf8;
  font-size: 1.35rem;
}

.btn-danger-icon {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1d2259;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
}

.btn-danger-icon:hover {
  background: #1d2259;
  color: #ffffff;
  border-color: #1d2259;
}

.theme-toggle-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 50%;
}

/* =============================================
   TOP NAVIGATION TABS
   ============================================= */
.main-nav-bar {
  background: #ffffff;
  border-bottom: 1.5px solid var(--border);
  padding: 0 3rem;
  position: sticky;
  top: 82px;
  z-index: 190;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.nav-tabs-container {
  display: flex;
  gap: 8px;
  max-width: 1600px;
  margin: 0 auto;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.95rem 1.6rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: var(--trans);
}

.nav-tab-btn:hover {
  color: var(--text);
  background: var(--bg3);
}

.nav-tab-btn.active {
  color: #1d2259;
  border-bottom-color: #1d2259;
  background: rgba(29,34,89,0.04);
}

.tab-badge {
  background: #e2e8f0;
  color: #1d2259;
  border: 1px solid #cbd5e1;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  margin-left: 4px;
}

.nav-tab-btn.active .tab-badge {
  background: #1d2259;
  color: #ffffff;
}

/* =============================================
   PORTAL VIEWS
   ============================================= */
.main-content-portal {
  flex: 1;
  width: 100%;
}

.portal-view {
  display: none;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.portal-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-view {
  width: 100%;
  display: flex;
  justify-content: center;
}

.view-container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto !important;
  padding: 2rem 2.5rem;
  box-sizing: border-box;
}

.table-responsive {
  width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
  margin: 0 auto;
  display: block;
  scrollbar-width: thin !important;
  scrollbar-color: #1d2259 #f1f5f9 !important;
  padding-bottom: 8px;
}

.table-responsive::-webkit-scrollbar {
  height: 8px !important;
  display: block !important;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 10px !important;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #1d2259 !important;
  border-radius: 10px !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #334155 !important;
}

#jobs-table-wrap, .accepted-table-wrap, #accepted-proposals-table-wrap {
  min-height: auto !important;
  padding-bottom: 14px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: thin !important;
  scrollbar-color: #1d2259 #f1f5f9 !important;
}

#jobs-table-wrap::-webkit-scrollbar,
.accepted-table-wrap::-webkit-scrollbar,
#accepted-proposals-table-wrap::-webkit-scrollbar {
  height: 8px !important;
  display: block !important;
}

#jobs-table-wrap::-webkit-scrollbar-track,
.accepted-table-wrap::-webkit-scrollbar-track,
#accepted-proposals-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 10px !important;
}

#jobs-table-wrap::-webkit-scrollbar-thumb,
.accepted-table-wrap::-webkit-scrollbar-thumb,
#accepted-proposals-table-wrap::-webkit-scrollbar-thumb {
  background: #1d2259 !important;
  border-radius: 10px !important;
}

/* Drag to scroll horizontally on tables */
.drag-scroll-container {
  cursor: grab;
}
.drag-scroll-container.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.drag-scroll-container input,
.drag-scroll-container textarea,
.drag-scroll-container select,
.drag-scroll-container button,
.drag-scroll-container a,
.drag-scroll-container .custom-select-container,
.drag-scroll-container .select-styled-trigger {
  cursor: auto;
  user-select: text;
  -webkit-user-select: text;
}
.drag-scroll-container button,
.drag-scroll-container a,
.drag-scroll-container .pay-status-btn,
.drag-scroll-container .status-badge,
.drag-scroll-container .custom-select-container,
.drag-scroll-container .select-styled-trigger {
  cursor: pointer !important;
}

.hist-table {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  border-collapse: separate;
  border-spacing: 0 5px;
}

.view-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1.2rem;
}

.view-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.view-header-controls .search-wrap {
  margin-bottom: 0 !important;
}

.view-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  min-height: 92px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: #1d2259 !important;
  color: #ffffff !important;
  border: 1.5px solid #1d2259 !important;
}

.bg-emerald-light, .bg-sky-light, .bg-green-light, .bg-rose-light {
  background: #1d2259 !important;
  color: #ffffff !important;
  border: 1.5px solid #1d2259 !important;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-3);
  margin-top: 5px;
  line-height: 1.25;
}

/* ACCEPTED PROPOSALS GRID & CARDS */
.accepted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.accepted-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: var(--trans);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.accepted-card:hover {
  transform: translateY(-4px);
  border-color: #1d2259;
  box-shadow: 0 12px 30px rgba(29,34,89,0.1);
}

.accepted-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--bg3);
}

.ref-badge {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: #0284c7;
  letter-spacing: 0.5px;
}

.accepted-client-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.accepted-assunto {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.accepted-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.accepted-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
}

.accepted-actions {
  display: flex;
  gap: 10px;
}

/* STATUS SELECT BADGES */
.status-select {
  padding: 0.45rem 2.2rem 0.45rem 1rem !important;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 800;
  border: 1.5px solid transparent;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: var(--trans);
}

.status-pendente { 
  background-color: #fef3c7 !important; 
  color: #b45309 !important; 
  border-color: #fcd34d !important; 
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23b45309'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important; 
}
.status-aceite { 
  background-color: #dcfce7 !important; 
  color: #15803d !important; 
  border-color: #86efac !important; 
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2315803d'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important; 
}
.status-terminado { 
  background-color: #e0f2fe !important; 
  color: #0369a1 !important; 
  border-color: #7dd3fc !important; 
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230369a1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important; 
}
.status-recusado { 
  background-color: #ffe4e6 !important; 
  color: #be123c !important; 
  border-color: #fda4af !important; 
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23be123c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important; 
}

/* HISTORY REVISION SELECT BADGE */
.history-rev-select {
  padding: 0.35rem 2rem 0.35rem 0.85rem !important;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  color: #1d2259;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.65rem center !important;
  background-size: 0.85rem !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: var(--trans);
}

.history-rev-select:hover,
.history-rev-select:focus {
  border-color: #1d2259;
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(29,34,89, 0.08);
}

body.dark-theme .history-rev-select {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f8fafc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

/* BILLING VIEW & SUMMARY BANNER */
.billing-summary-banner {
  background: linear-gradient(135deg, #1d2259 0%, #1e293b 100%);
  border-radius: var(--r-lg);
  padding: 1.4rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.billing-summary-banner .summary-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
}

.billing-summary-banner .summary-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 4px;
}

.billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .billing-grid { grid-template-columns: 1fr; }
}

/* PROGRESS BAR */
.progress-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: 14px;
}

.progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #1d2259;
  border-radius: 20px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* PAYMENTS TABLE */
.payments-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.payments-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-3);
  padding: 0 8px 6px 8px;
  text-transform: uppercase;
}

.payments-table td {
  background: #ffffff;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  padding: 0.65rem 8px;
  font-size: 0.92rem;
  vertical-align: middle;
}

.payments-table td:first-child {
  border-left: 1.5px solid var(--border);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  width: 26%;
}

.payments-table td:last-child {
  border-right: 1.5px solid var(--border);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.pay-phase-input {
  width: 100%;
  min-width: 120px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}

.pay-pct-input {
  width: 44px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.4rem 0.2rem;
}

.pay-notes-input {
  width: 100%;
  min-width: 260px;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}

.pay-status-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}

.pay-status-paid { background: #dcfce7 !important; color: #15803d !important; border: 1.5px solid #86efac !important; font-weight: 800 !important; }
.pay-status-pending { background: #fff7ed !important; color: #c2410c !important; border: 1.5px solid #ffedd5 !important; font-weight: 800 !important; }

.empty-card {
  background: #ffffff;
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 4rem 2rem;
  text-align: center;
}

/* VIEW HEADER & CONTROLS ALIGNMENT */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.view-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-header-controls .search-wrap {
  margin-bottom: 0 !important;
  width: 360px;
  min-width: 320px;
}

.view-header-controls .finput {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 42px;
  display: flex;
  align-items: center;
}

/* VIEW MODE TOGGLE (LIST VS GRID) */
.view-mode-toggle {
  display: flex;
  align-items: center;
  height: 42px;
  background: var(--bg3);
  padding: 3px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.view-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-btn.active {
  background: #ffffff;
  color: #1d2259;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.accepted-table th {
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
}

.accepted-table td {
  padding: 0.62rem 0.75rem;
  vertical-align: middle;
}

.cell-assunto {
  min-width: 170px;
  max-width: 240px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-2);
}

.cell-fulltext {
  min-width: 180px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
}

.tag-emerald { background: #dcfce7 !important; color: #15803d !important; border: 1.5px solid #86efac !important; font-weight: 800 !important; }
.tag-sky { background: #e0f2fe !important; color: #0369a1 !important; border: 1.5px solid #7dd3fc !important; font-weight: 800 !important; }
.tag-amber { background: #fef3c7 !important; color: #b45309 !important; border: 1.5px solid #fcd34d !important; font-weight: 800 !important; }
.tag-rose { background: #ffe4e6 !important; color: #be123c !important; border: 1.5px solid #fda4af !important; font-weight: 800 !important; }
.tag-muted { background: #f1f5f9 !important; color: #64748b !important; border: 1.5px solid #cbd5e1 !important; font-weight: 700 !important; }
#edit-client-modal {
  z-index: 1200 !important;
}

/* APP FOOTER */
.app-footer {
  background: #ffffff;
  border-top: 1.5px solid var(--border);
  padding: 1.2rem 2rem;
  text-align: center;
  margin-top: 2rem;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.app-footer p {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  margin: 0;
  letter-spacing: 0.3px;
}

/* PRINT STYLES FOR BILLING SUMMARY */
@media print {
  body * { visibility: hidden; }
  #view-billing, #view-billing * { visibility: visible; }
  #view-billing { position: absolute; left: 0; top: 0; width: 100%; }
  .app-header, .main-nav-bar, .header-actions, button { display: none !important; }
}

/* FLOATING TOOLTIP POPUP WINDOW ON HOVER */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #1d2259;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
  max-width: 280px;
  width: max-content;
  text-align: center;
  box-shadow: 0 10px 30px rgba(29,34,89, 0.4);
  border: 1px solid #334155;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99999;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  border-width: 6px;
  border-style: solid;
  border-color: #1d2259 transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99999;
}

[data-tooltip]:hover::after, [data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* HEADER ACTION BUTTONS HOVER TO SOLID BLACK */
.header-actions button:hover,
.header-actions .btn-animated:hover,
.header-actions .btn:hover {
  background: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  transform: translateY(-2.5px) !important;
  box-shadow: 0 8px 24px rgba(29,34,89, 0.35) !important;
}

.header-actions button:hover i,
.header-actions .btn-animated:hover i,
.header-actions .btn:hover i {
  color: #ffffff !important;
}

/* USER PILL HOVER EFFECT */
#header-user-info:hover {
  background: #000000 !important;
  border-color: #000000 !important;
  transform: translateY(-2.5px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ACTION BUTTONS: WHITE BY DEFAULT, SOLID BLACK ON HOVER ONLY */
.btn-action-hover {
  background: #ffffff !important;
  color: #1d2259 !important;
  border: 1.5px solid #cbd5e1 !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-action-hover:hover {
  background: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  transform: translateY(-2.5px) scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(29,34,89, 0.35) !important;
}

.btn-action-hover:hover i {
  color: #ffffff !important;
}

/* CUSTOM DROPDOWN POPOVER ITEM HOVER STYLES */
.custom-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1d2259;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-dropdown-item:hover {
  background: #1d2259 !important;
  color: #ffffff !important;
}

.custom-dropdown-item.active {
  background: #f1f5f9;
  font-weight: 900;
}

.custom-dropdown-item.active:hover {
  background: #1d2259 !important;
  color: #ffffff !important;
}

/* ELEGANT STYLED SELECT DROPDOWN */
select.select-styled {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 12px 12px !important;
  padding-right: 2.5rem !important;
  padding-left: 1.1rem !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  color: #1d2259 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(29,34,89, 0.04) !important;
}

select.select-styled:hover {
  background-color: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(29,34,89, 0.25) !important;
}

select.select-styled:focus {
  outline: none !important;
  border-color: #1d2259 !important;
  box-shadow: 0 0 0 3px rgba(29,34,89, 0.15) !important;
}

select.select-styled option {
  background-color: #ffffff !important;
  color: #1d2259 !important;
  font-weight: 700 !important;
  padding: 10px 14px !important;
}

/* INTERACTIVE CONFIRM POP-UP BUTTONS (WHITE BY DEFAULT, BLACK ON HOVER) */
.btn-confirm-interactive {
  flex: 1;
  height: 46px;
  border-radius: 12px !important;
  background-color: #ffffff !important;
  color: #1d2259 !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 800 !important;
  font-size: 0.92rem !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-confirm-interactive:hover {
  background-color: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  box-shadow: 0 6px 16px rgba(29,34,89, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* PDF VIEWER MODAL HEADER BUTTONS (WHITE DEFAULT, BLACK ON HOVER) */
.btn-pdf-header-action {
  height: 40px;
  padding: 0 1.1rem;
  border-radius: 10px !important;
  background-color: #ffffff !important;
  color: #1d2259 !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  text-decoration: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

.btn-pdf-header-action:hover {
  background-color: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 16px rgba(29,34,89, 0.2) !important;
}

.btn-pdf-header-close {
  width: 38px;
  height: 38px;
  border-radius: 50% !important;
  background-color: #ffffff !important;
  color: #1d2259 !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.1rem !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

.btn-pdf-header-close:hover {
  background-color: #1d2259 !important;
  color: #ffffff !important;
  border-color: #1d2259 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 6px 16px rgba(29,34,89, 0.2) !important;
}

/* Keyboard access and narrow-screen layout */
:focus-visible { outline: 3px solid #2563eb !important; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
@media (max-width: 700px) { .app-header { flex-wrap: wrap; gap: 12px; } .header-actions { flex-wrap: wrap; max-width: 100%; } .main-nav-bar { overflow-x: auto; justify-content: flex-start; } .main-nav-bar .nav-tab-btn { flex: 0 0 auto; } .table-responsive { overflow-x: auto !important; } #billing-custom-select-wrap, #billing-dropdown-popover { min-width: 0 !important; width: 100% !important; } .modal-wrap { max-width: calc(100vw - 24px) !important; } #landing-access-screen { overflow-y: auto !important; } }

#view-jobs .view-header-controls .custom-select-item {
  text-align: center;
}

.app-header { border-bottom-color: var(--brand-gold); }
.nav-tab-btn.active {
  background: var(--brand-gold-soft);
  color: var(--brand-navy);
  border-bottom-color: var(--brand-gold);
}
.nav-tab-btn.active .tab-badge {
  background: var(--brand-gold);
  color: var(--brand-navy);
  border-color: var(--brand-gold);
}
.btn-primary {
  background: var(--brand-gold);
  color: var(--brand-navy);
  border-color: var(--brand-gold);
}
.btn-primary:hover { background: var(--brand-navy); color: #fff; }
.btn-confirm-interactive:hover,
.btn-pdf-header-action:hover {
  background-color: var(--brand-gold) !important;
  color: var(--brand-navy) !important;
  border-color: var(--brand-gold) !important;
}
.finput:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 4px rgba(243, 197, 15, .22);
}
.fcard-header, .modal-head { border-bottom-color: var(--brand-gold); }
.step-item.active { border-color: var(--brand-gold); }
body.dark-theme .app-header { border-bottom-color: var(--brand-gold); }


.job-editable-row { cursor: pointer; }
.job-editable-row:hover > td { background: var(--brand-gold-soft); color: var(--brand-navy); }
.job-editable-row:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
.job-edit-dialog {
  margin: auto;
  width: min(660px, 94vw);
  max-height: 90vh;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-dark);
}
.job-edit-dialog::backdrop { background: rgba(29, 34, 89, .35); }
.job-edit-header, .job-edit-actions { padding: 1rem clamp(1rem, 4vw, 1.75rem); }
.job-edit-header { border-bottom: 2px solid var(--brand-gold); }
.job-edit-header h2:focus { outline: none; }
.job-edit-header p { margin-top: .25rem; }
.job-edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1rem;
  padding: 1rem clamp(1rem, 4vw, 1.75rem);
}
.job-edit-fields label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 700; }
.job-edit-wide { grid-column: 1 / -1; }
.job-edit-fields textarea { resize: vertical; }
.job-edit-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; border-top: 1px solid var(--border); }
.job-edit-actions button { min-height: 42px; padding: .55rem 1rem; }
.job-edit-error { color: #b91c1c; padding: 0 1.5rem .75rem; }
.job-edit-error:empty { display: none; }
@media (max-width: 520px) {
  .job-edit-fields { grid-template-columns: 1fr; }
}

.map-area-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.map-area-actions .btn-confirm-interactive { flex:0 0 auto; height:42px; gap:.4rem; padding:0 .85rem; }
.map-area-actions .btn-confirm-interactive i { width:1em; font-size:1em; text-align:center; }
.quote-deliverables-toggle { display:flex; gap:.5rem; align-items:center; margin:.25rem 0 .6rem; }

#jobs-tbody tr:not(.jobs-year-heading) td:nth-last-child(2) { white-space: nowrap; }

/* Map editor: keep each drawing tool beside its own delete action. */
#card-step-3 .map-location-field { width:100%; margin-bottom:1.5rem; }
#card-step-3 .map-location-field .input-row { display:grid !important; gap:10px !important; grid-template-columns:minmax(0,1fr) auto; }
#card-step-3 .map-location-field .finput { width:100% !important; }
.map-editor { gap:12px; min-width:0; }
.map-editor-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 20px; }
.map-editor-heading label { margin:0; }
.map-editor-heading > span { font-size:.8rem; color:var(--text-muted, #64748b); }
.map-editor-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px; border:1px solid var(--border); border-radius:14px; background:#f8fafc; }
.map-tool-group { display:flex; align-items:stretch; min-width:0; border:1px solid var(--tool-color); border-radius:10px; overflow:hidden; background:white; }
.map-tool-property { --tool-color:#dc2626; --tool-tint:#fff1f2; }
.map-tool-survey { --tool-color:#2563eb; --tool-tint:#eff6ff; }
.map-editor-toolbar .btn-confirm-interactive { flex:0 0 auto; height:42px; min-height:42px; gap:8px; padding:0 14px; white-space:nowrap; border-radius:0 !important; border:0 !important; box-shadow:none !important; }
.map-tool-group .map-draw-button { background:var(--tool-tint) !important; }
.map-tool-group .map-draw-button i { color:var(--tool-color); }
.map-tool-group .map-delete-button { width:42px; padding:0; border-left:1px solid var(--border) !important; }
.map-editor-toolbar .map-clear-all { margin-left:auto; color:#64748b !important; background:transparent !important; border-radius:9px !important; }
.map-editor-toolbar .btn-confirm-interactive:hover { transform:none !important; background:#e9edf5 !important; }
.map-tool-group .map-draw-button.is-drawing { background:var(--brand-gold, #f3c50f) !important; color:#1d2259 !important; }
.map-editor-toolbar .btn-confirm-interactive:disabled { opacity:.4; cursor:not-allowed !important; transform:none !important; }
#card-step-3 #map-container { border:1px solid var(--border); border-radius:14px; overflow:hidden; box-shadow:0 4px 16px rgba(29,34,89,.06); }
.map-editor-help { display:flex; align-items:baseline; gap:8px; margin:0; font-size:.82rem; line-height:1.5; color:#64748b; }
.map-editor-help i { color:#1d2259; }
@media (max-width:700px) {
  #card-step-3 .fcard-body { padding:1.25rem; }
  .map-editor-toolbar { gap:10px; }
  .map-tool-group { flex:1 1 240px; }
  .map-tool-group .map-draw-button { flex:1; justify-content:flex-start !important; min-width:0; }
  .map-editor-toolbar .map-clear-all { margin-left:0; }
  #card-step-3 #map-container { height:400px !important; }
}
@media (max-width:420px) {
  #card-step-3 .map-location-field .input-row { grid-template-columns:minmax(0,1fr); }
  #card-step-3 .map-location-field #btn-search-map { width:100%; }
  .map-editor-heading > span { display:none; }
}

#card-step-3 { background:#fff; }

/* Form fields need enough space for their focus rings and adjacent actions. */
.fcard-body .input-row { gap:14px !important; align-items:center !important; min-width:0; }
.fcard-body .input-row > .finput { min-width:0 !important; }
.fcard-body.grid-2 { gap:1.5rem 2rem; }
.fcard-body .fgroup { min-width:0; }
.fcard-body:not(.grid-2) > .fgroup + .fgroup { margin-top:1rem; }
.map-editor-toolbar .map-clear-all { border:1.5px solid #cbd5e1 !important; border-radius:10px !important; background:#fff !important; color:#1d2259 !important; padding:0 16px; }
.map-editor-toolbar .map-clear-all:disabled { opacity:.65; background:#f1f5f9 !important; color:#64748b !important; }
#quote-topographic-scale-group, #quote-architectural-scale-group { margin:16px 0 8px 28px; padding:16px 0 0; border-top:1px solid #dce3ed; max-width:calc(100% - 28px); }
#quote-topographic-scale-group .fgroup, #quote-architectural-scale-group .fgroup { max-width:22rem; gap:10px; }
#quote-topographic-scale-group .custom-select-container, #quote-architectural-scale-group .custom-select-container { width:100%; }
#quote-topographic-scale-group[hidden], #quote-architectural-scale-group[hidden], #quote-service-scales[hidden] { display:none !important; }
@media(max-width:700px) {
 .fcard-body.grid-2 { grid-template-columns:minmax(0,1fr); }
 .fcard-body .input-row { flex-wrap:wrap !important; }
 .fcard-body .input-row > .finput { flex:1 1 100% !important; width:100% !important; }
}

.fcard-header-left { min-width:0; }
@media(max-width:700px) {
 .fcard-header { padding:1.25rem; align-items:flex-start; }
 #card-step-5 .fcard-header-left { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
 #card-step-5 .fcard-header-left > div:last-child { margin-left:0 !important; flex-wrap:wrap; }
 #card-step-5 .fcard-header-left > div:last-child button { flex:1 1 120px; }
}

.jobs-reference-cell { display:flex; flex-direction:column; align-items:center; gap:9px; }
.jobs-revision-select { display:block; width:100%; max-width:180px; min-height:34px; margin:7px auto 0; padding:5px 8px; border:1px solid #cbd5e1; border-radius:8px; background:#f8fafc; color:#1d2259; font:600 .76rem 'Outfit',sans-serif; cursor:pointer; }
.jobs-reference-cell .jobs-revision-select { margin-top:0; }

/* Consistent listboxes, positioned outside table and modal scroll areas. */
.unified-select-popover { display:none; position:fixed; z-index:2147483000; width:max-content; box-sizing:border-box; padding:6px 0; overflow-y:auto; overscroll-behavior:contain; border:1px solid #cbd5e1; border-radius:14px; background:#fff; box-shadow:0 12px 32px rgba(29,34,89,.18); font-family:'Outfit',sans-serif; }
.unified-select-popover .custom-select-item { padding:11px 18px; color:#1d2259; font-size:.86rem; font-weight:700; line-height:1.3; text-align:center; cursor:pointer; white-space:normal; overflow-wrap:break-word; }
.unified-select-popover .custom-select-item.active, .unified-select-popover .custom-select-item:hover, .unified-select-popover .custom-select-item:focus { background:#f1f5f9; outline:none; }
.unified-select-popover .option-status-pendente { color:#b45309; }
.unified-select-popover .option-status-aceite { color:#15803d; }
.unified-select-popover .option-status-terminado { color:#0369a1; }
.unified-select-popover .option-status-recusado { color:#be123c; }
.unified-select-popover [aria-disabled="true"] { opacity:.4; cursor:not-allowed; }
.select-styled-trigger { display:inline-flex; align-items:center; justify-content:space-between; gap:10px; font-family:'Outfit',sans-serif; cursor:pointer; max-width:100%; }
.select-styled-trigger .trigger-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.select-styled-trigger i { font-size:.75rem; flex-shrink:0; }
.revision-select-trigger { min-height:36px; min-width:120px; padding:7px 12px; border:1px solid #cbd5e1; border-radius:12px; background:#fff; color:#1d2259; font-size:.82rem; font-weight:800; box-shadow:0 2px 6px rgba(29,34,89,.04); }
.hist-table td { padding:14px 12px; }
.hist-proposal-cell { min-width:245px; }
.hist-proposal-info { display:flex; flex-direction:column; align-items:center; gap:7px; line-height:1.3; }
.hist-client-name { color:#64748b; font-size:.82rem; font-weight:600; max-width:260px; }
.hist-version-field { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:5px; min-height:36px; }
.hist-version-label { font-size:.76rem; font-weight:700; color:#64748b; }
.hist-table .hist-actions-cell > div { flex-wrap:wrap; row-gap:8px !important; }

button.select-styled-trigger.status-select { min-height:36px; padding:7px 14px; border-width:1px; border-style:solid; background-image:none !important; }
button.select-styled-trigger.status-pendente { background-color:#fef3c7 !important; color:#b45309 !important; border-color:#fcd34d !important; }
button.select-styled-trigger.status-aceite { background-color:#dcfce7 !important; color:#15803d !important; border-color:#86efac !important; }
button.select-styled-trigger.status-terminado { background-color:#e0f2fe !important; color:#0369a1 !important; border-color:#7dd3fc !important; }
button.select-styled-trigger.status-recusado { background-color:#ffe4e6 !important; color:#be123c !important; border-color:#fda4af !important; }
.select-styled-trigger:disabled { opacity:.5; cursor:not-allowed; }

/* Subject themes use the same dropdown as the other form choices. */
#card-step-4 .grid-2 { grid-template-columns:minmax(0,1fr); }
#card-step-4 .custom-select-container { width:100%; }
#card-step-4 .select-styled-trigger { text-align:left; }
#card-step-4 .custom-select-container:has(#assunto:invalid) .trigger-label { color:#94a3b8; font-weight:400; }
.proposal-subject-manager { display:flex; flex-direction:column; gap:16px; }
.proposal-subject-manager h4, .proposal-subject-manager p { margin:0; }
#subject-editor-container { display:flex; flex-direction:column; gap:12px; }
.subject-editor-row { display:flex; align-items:center; gap:14px; }
.subject-editor-row .finput { flex:1; min-width:0; }
.subject-editor-row .btn-danger-sm { flex:0 0 38px; height:38px; }
#btn-editor-add-subject { align-self:flex-start; }

/* Expandable configuration groups leave room for future settings. */
.settings-section { margin:16px 0; border:1px solid #cbd5e1; border-radius:14px; background:#fff; }
.settings-section > summary { padding:18px; font-weight:800; color:#1d2259; cursor:pointer; }
.settings-section[open] > summary { border-bottom:1px solid #e2e8f0; background:#f8fafc; border-radius:14px 14px 0 0; }
.settings-section-body { padding:18px; display:flex; flex-direction:column; gap:18px; }
.settings-section-body > p { margin:0; line-height:1.5; }
.settings-section-body > .btn { align-self:flex-start; }
#purpose-editor-container { display:flex; flex-direction:column; gap:18px; }
.purpose-editor-row { display:flex; align-items:flex-start; gap:14px; padding-bottom:18px; border-bottom:1px solid #e2e8f0; }
.purpose-editor-row:last-child { border-bottom:0; padding-bottom:0; }
.purpose-editor-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:16px; flex:1; min-width:0; }
.purpose-editor-fields .fgroup { margin:0; min-width:0; }
.purpose-editor-fields .finput { width:100%; min-width:0; }
.purpose-editor-row .btn-danger-sm { margin-top:28px; flex:0 0 38px; height:38px; }
.settings-save-row { position:sticky; bottom:-1.5rem; background:#fff; padding:18px 0; margin-top:16px; border-top:1px solid #e2e8f0; display:flex; justify-content:flex-end; z-index:2; }
@media(max-width:650px) {
 .purpose-editor-fields { grid-template-columns:minmax(0,1fr); }
 .settings-section-body { padding:14px; }
 .settings-save-row .btn { width:100%; }
}

/* Full-size add buttons in configuration groups. */
#btn-editor-add-subject, #btn-editor-add-purpose {
 display:inline-flex; align-items:center; justify-content:center; gap:8px;
 min-height:42px; padding:10px 16px; box-sizing:border-box;
 border:1.5px solid #cbd5e1; border-radius:10px; background:#fff; color:#1d2259;
 font:700 .88rem/1.25 'Outfit',sans-serif; text-decoration:none; white-space:nowrap;
 flex:0 0 auto; max-width:100%;
}
#btn-editor-add-subject:focus-visible, #btn-editor-add-purpose:focus-visible {
 outline:2px solid #345cff; outline-offset:3px;
}
