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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f4f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

header {
  background: #fff;
  color: #1a1a1a;
  padding: 14px 24px;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
}

.logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.header-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1a1a;
}

.tagline {
  font-size: 0.7rem;
  color: #c0392b;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn {
  padding: 9px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  border: none;
  display: inline-block;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-btn-primary {
  background: #c0392b;
  color: #fff;
}

.nav-btn-primary:hover {
  background: #a93226;
  transform: translateY(-1px);
}

.nav-btn-secondary {
  background: #f0f0f0;
  color: #555;
  border: 1px solid #ddd;
}

.nav-btn-secondary:hover {
  background: #e5e5e5;
  color: #1a1a1a;
}

main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px;
}

/* === STEP BAR === */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.step.active, .step.done {
  opacity: 1;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #999;
  font-size: 0.75rem;
  font-weight: 800;
  transition: all 0.3s;
  flex-shrink: 0;
}

.step.active .step-num {
  background: #c0392b;
  color: #fff;
}

.step.done .step-num {
  background: #27ae60;
  color: #fff;
}

.step-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step.active .step-text {
  color: #c0392b;
}

.step.done .step-text {
  color: #27ae60;
}

.step-line {
  flex: 1;
  height: 2px;
  background: #e8e8e8;
  margin: 0 12px;
  max-width: 60px;
  transition: background 0.3s;
}

.step-line.done {
  background: #27ae60;
}

/* === SEARCH === */
.search-section {
  margin-bottom: 24px;
}

.search-bar {
  display: flex;
  gap: 10px;
}

#address-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

#address-input:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

#address-input::placeholder {
  color: #aaa;
}

#search-btn {
  padding: 14px 28px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

#search-btn:hover {
  background: #a93226;
  transform: translateY(-1px);
}

#search-btn:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

/* === MAP === */
.map-section {
  margin-bottom: 24px;
}

.map-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  padding: 10px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  color: #555;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.tool-btn:hover:not(:disabled) {
  border-color: #bbb;
  color: #1a1a1a;
  background: #f5f5f5;
}

.tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tool-btn.active {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.main-btn.active {
  background: #c0392b;
}

.subtract-btn.active {
  background: #2980b9;
}

.edit-btn.active {
  background: #f39c12;
  border-color: transparent;
  color: #fff;
}

.delete-btn.active {
  background: #e74c3c;
  border-color: transparent;
  color: #fff;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: #ddd;
  align-self: center;
}

.clear-btn {
  margin-left: auto;
  color: #999;
}

.clear-btn:hover:not(:disabled) {
  background: #f0f0f0;
  color: #555;
}

#map {
  width: 100%;
  height: 500px;
  border-radius: 10px;
  border: 2px solid #ddd;
  z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#map.drawing-active {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

#map.drawing-subtract {
  border-color: #2980b9;
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

#map.editing-active {
  border-color: #f39c12;
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

.map-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #999;
  text-align: center;
  line-height: 1.5;
}

.leaflet-draw-toolbar {
  display: none !important;
}

.leaflet-draw-actions {
  display: none !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #555 !important;
  border-radius: 8px !important;
}

.leaflet-control-zoom {
  border: 1px solid #ddd !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
}

.leaflet-control-zoom a:hover {
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
}

.leaflet-control-layers-toggle {
  width: 36px !important;
  height: 36px !important;
}

.leaflet-control-layers {
  border-radius: 10px !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
}

.shape-popup {
  text-align: center;
}

.shape-popup .popup-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.shape-popup .popup-area {
  font-size: 1.1rem;
  font-weight: 800;
  color: #c0392b;
  margin-bottom: 8px;
}

.shape-popup .popup-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 8px;
}

.shape-popup .popup-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.shape-popup .popup-btn {
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}

.shape-popup .popup-btn-rename {
  background: rgba(52,152,219,0.1);
  color: #2980b9;
}

.shape-popup .popup-btn-rename:hover {
  background: rgba(52,152,219,0.2);
}

.shape-popup .popup-btn-delete {
  background: rgba(231,76,60,0.1);
  color: #e74c3c;
}

.shape-popup .popup-btn-delete:hover {
  background: rgba(231,76,60,0.15);
}

.shape-label {
  background: rgba(0,0,0,0.75) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px !important;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  font-family: 'Inter', sans-serif !important;
  letter-spacing: 0.5px;
  line-height: 1.4 !important;
  white-space: nowrap;
}

/* === COLLAPSIBLE SECTIONS === */
.section-toggle {
  cursor: pointer;
  user-select: none;
}

.section-toggle:hover {
  color: #c0392b;
}

.section-chevron {
  font-size: 0.6rem;
  transition: transform 0.3s;
  color: #999;
  margin-left: auto;
}

.section-body.collapsed .section-chevron,
.collapsed + .section-chevron {
  transform: rotate(-90deg);
}

.section-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}

.section-body.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* === STICKY PRICING BAR === */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #e8e8e8;
  z-index: 100;
  padding: 10px 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.sticky-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.sticky-item {
  text-align: center;
}

.sticky-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  font-weight: 600;
  margin-bottom: 2px;
}

.sticky-value {
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a1a;
}

.sticky-total .sticky-value {
  color: #c0392b;
  font-size: 1.15rem;
}

.sticky-total {
  padding-left: 24px;
  border-left: 2px solid #e8e8e8;
}

/* === PROPOSAL BTN ROW === */
.proposal-btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.proposal-link-result {
  margin-top: 12px;
}

.proposal-link-label {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.proposal-link-row {
  display: flex;
  gap: 8px;
}

.proposal-link-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f8f8;
  color: #1a1a1a;
  font-family: inherit;
}

.copy-link-btn {
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
  transition: background 0.2s;
}

.copy-link-btn:hover {
  background: #a93226;
}

/* === RESULTS CARDS === */
.results-section {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.result-card {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  border: 1px solid #e8e8e8;
  transition: border-color 0.25s, transform 0.25s;
}

.result-card:hover {
  border-color: #ccc;
  transform: translateY(-2px);
}

.result-card.total-card {
  border-color: #c0392b;
  background: linear-gradient(135deg, #fdf2f0, #fff);
}

.result-label {
  display: block;
  font-size: 0.68rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.result-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1a1a1a;
}

.result-value.price {
  color: #c0392b;
}

/* === SECTION HEADING === */
.section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* === MARGIN TRACKER === */
.margin-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e8e8e8;
}

.margin-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: #27ae60;
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
}

.margin-grid {
  display: flex;
  gap: 16px;
}

.margin-item {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #eee;
}

.margin-label {
  display: block;
  font-size: 0.68rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.margin-val {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1a1a;
}

.margin-val.profit {
  color: #27ae60;
}

/* === ADD-ONS === */
.addons-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e8e8e8;
}

.addon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.addon-row:last-child {
  border-bottom: none;
}

.addon-name {
  flex: 1;
  font-weight: 600;
  color: #1a1a1a;
}

.addon-detail {
  color: #999;
  font-size: 0.8rem;
}

.addon-price {
  font-weight: 700;
  color: #c0392b;
  min-width: 80px;
  text-align: right;
}

.addon-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.2s;
}

.addon-remove:hover {
  background: rgba(231, 76, 60, 0.1);
}

.addon-add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.addon-add-row select {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
}

.addon-add-row select:focus {
  border-color: #c0392b;
}

.addon-add-row input {
  width: 85px;
  padding: 9px 12px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
}

.addon-add-row input:focus {
  border-color: #c0392b;
}

/* === CATALOG === */
.catalog-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e8e8e8;
}

.toggle-btn {
  font-size: 0.72rem;
  padding: 4px 14px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  color: #777;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: #eee;
  color: #1a1a1a;
}

.catalog-list {
  margin-bottom: 12px;
}

.catalog-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.catalog-item-name {
  flex: 1;
  font-weight: 600;
  color: #1a1a1a;
}

.catalog-item-info {
  color: #999;
  font-size: 0.8rem;
}

.catalog-item-prices {
  font-size: 0.8rem;
  text-align: right;
}

.catalog-item-prices .price-line {
  color: #c0392b;
  font-weight: 600;
}

.catalog-item-prices .cost-line {
  color: #999;
  font-size: 0.75rem;
}

.catalog-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.catalog-form input,
.catalog-form select {
  padding: 9px 12px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
}

.catalog-form input:focus,
.catalog-form select:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

#cat-name {
  flex: 1;
  min-width: 150px;
}

#cat-price, #cat-cost {
  width: 100px;
}

#cat-desc {
  flex: 2;
  min-width: 150px;
}

/* === PROPOSAL FORM === */
.proposal-section {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e8e8e8;
}

.proposal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proposal-form input,
.proposal-form textarea {
  padding: 12px 16px;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
  background: #fff;
  color: #1a1a1a;
}

.proposal-form input::placeholder,
.proposal-form textarea::placeholder {
  color: #aaa;
}

.proposal-form input:focus,
.proposal-form textarea:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.proposal-btn {
  padding: 13px 28px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  align-self: flex-start;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.proposal-btn:hover:not(:disabled) {
  background: #a93226;
  transform: translateY(-1px);
}

.proposal-btn:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

/* === DASHBOARD STATS === */
.stats-section {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  border: 1px solid #e8e8e8;
  transition: border-color 0.25s, transform 0.25s;
}

.stat-card:hover {
  border-color: #ccc;
  transform: translateY(-2px);
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1a1a1a;
}

.stat-revenue { color: #c0392b; }
.stat-margin { color: #2980b9; }
.stat-profit { color: #27ae60; }

/* === DASHBOARD TABLE === */
.dashboard-section {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e8e8e8;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.dashboard-search input {
  padding: 9px 16px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  width: 280px;
  transition: border-color 0.25s, box-shadow 0.25s;
  background: #fff;
  color: #1a1a1a;
}

.dashboard-search input::placeholder {
  color: #aaa;
}

.dashboard-search input:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.proposals-table-wrap {
  overflow-x: auto;
}

.proposals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.proposals-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  border-bottom: 1px solid #e8e8e8;
  user-select: none;
  font-weight: 600;
}

.proposals-table th.sortable {
  cursor: pointer;
  transition: color 0.2s;
}

.proposals-table th.sortable:hover {
  color: #c0392b;
}

.proposals-table th.sort-asc::after {
  content: ' \25B2';
  font-size: 0.6rem;
  color: #c0392b;
}

.proposals-table th.sort-desc::after {
  content: ' \25BC';
  font-size: 0.6rem;
  color: #c0392b;
}

.proposals-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.proposals-table tbody tr {
  transition: background 0.15s;
}

.proposals-table tbody tr:hover {
  background: #fafafa;
}

.td-name { font-weight: 600; color: #1a1a1a; }
.td-addr { color: #777; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-sqft { color: #777; }
.td-price { font-weight: 700; color: #c0392b; }
.td-date { color: #999; white-space: nowrap; font-size: 0.8rem; }

.margin-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.margin-high { background: rgba(39, 174, 96, 0.15); color: #1e8449; }
.margin-mid { background: rgba(243, 156, 18, 0.15); color: #c47f00; }
.margin-low { background: rgba(231, 76, 60, 0.15); color: #c0392b; }

.td-actions {
  white-space: nowrap;
}

.action-btn {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-right: 4px;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: inherit;
}

.action-btn:hover { transform: translateY(-1px); }

.action-view {
  background: rgba(52, 152, 219, 0.1);
  color: #2980b9;
}

.action-view:hover {
  background: rgba(52, 152, 219, 0.2);
}

.action-delete {
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
}

.action-delete:hover {
  background: rgba(231, 76, 60, 0.15);
}

.action-copy {
  background: rgba(52, 73, 94, 0.08);
  color: #2c3e50;
}

.action-copy:hover {
  background: rgba(52, 73, 94, 0.15);
}

.action-copied {
  background: #27ae60 !important;
  color: #fff !important;
}

.td-status {
  white-space: nowrap;
}

.status-btn {
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  color: #aaa;
  margin-right: 4px;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: inherit;
}

.status-btn:hover {
  border-color: #bbb;
  color: #666;
}

.status-btn.status-active {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

.status-btn.status-active:hover {
  background: #219a52;
  border-color: #219a52;
}

.status-btn.status-paid.status-active {
  background: #2980b9;
  color: #fff;
  border-color: #2980b9;
}

.status-btn.status-paid.status-active:hover {
  background: #2472a4;
  border-color: #2472a4;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  border: 1px solid #e8e8e8;
}

.modal-box h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: #1a1a1a;
}

.modal-box p {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 9px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.modal-cancel {
  background: #f0f0f0;
  color: #666;
}

.modal-cancel:hover {
  background: #e5e5e5;
  color: #333;
}

.modal-confirm {
  background: #e74c3c;
  color: #fff;
}

.modal-confirm:hover {
  background: #c0392b;
}

/* === SIDEBAR NAV === */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-right: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a1a;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 1000;
  transition: left 0.3s ease;
  box-shadow: 2px 0 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #eee;
}

.sidebar-header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a1a1a;
}

.sidebar-header .sidebar-tagline {
  font-size: 0.65rem;
  color: #c0392b;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.sidebar-close:hover {
  color: #1a1a1a;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  text-decoration: none;
  color: #444;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.sidebar-nav a:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.sidebar-nav a.active {
  color: #c0392b;
  background: #fdf2f0;
  border-right: 3px solid #c0392b;
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-nav .logout-link {
  margin-top: auto;
  border-top: 1px solid #eee;
  color: #999;
}
.sidebar-nav .logout-link:hover {
  color: #c0392b;
  background: #fdf2f0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  font-size: 0.72rem;
  color: #bbb;
  letter-spacing: 0.3px;
}

@media print {
  .sidebar, .sidebar-overlay, .menu-toggle { display: none !important; }
}

/* === FOOTER === */
footer {
  background: #fff;
  color: #aaa;
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  border-top: 1px solid #e8e8e8;
  letter-spacing: 0.5px;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  color: #999;
  padding: 40px 16px;
  font-size: 0.9rem;
}

/* === RESPONSIVE === */

footer {
  padding-bottom: 70px;
}

@media (max-width: 768px) {
  .header-content {
    gap: 10px;
  }

  .logo {
    width: 44px;
    height: 44px;
  }

  .header-text h1 {
    font-size: 1.1rem;
  }

  .steps-bar {
    padding: 12px 10px;
    gap: 0;
  }

  .step-text {
    display: none;
  }

  .step-num {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .step-line {
    margin: 0 8px;
  }

  .search-bar {
    flex-direction: column;
  }

  #search-btn {
    justify-content: center;
    min-height: 48px;
  }

  #address-input {
    min-height: 48px;
    font-size: 1rem;
  }

  .map-toolbar {
    gap: 6px;
  }

  .tool-btn {
    padding: 10px 10px;
    font-size: 0.72rem;
    min-height: 44px;
    flex: 1;
    justify-content: center;
  }

  .tool-btn .btn-label {
    display: none;
  }

  .tool-btn svg {
    width: 18px;
    height: 18px;
  }

  .toolbar-divider {
    display: none;
  }

  .clear-btn {
    margin-left: 0;
    flex: 0 0 auto;
  }

  #map {
    height: 350px;
    border-radius: 8px;
  }

  .results-section {
    flex-wrap: wrap;
    gap: 8px;
  }

  .result-card {
    min-width: calc(50% - 4px);
    padding: 14px 10px;
  }

  .result-value {
    font-size: 1.3rem;
  }

  .margin-grid {
    flex-direction: column;
    gap: 8px;
  }

  .addon-add-row {
    flex-wrap: wrap;
  }

  .addon-add-row select {
    min-width: 100%;
    min-height: 44px;
  }

  .addon-add-row input {
    min-height: 44px;
    flex: 1;
  }

  .addon-add-row .tool-btn {
    flex: 0 0 auto;
  }

  .addon-row {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .addon-name {
    flex: 1 1 100%;
    margin-bottom: 4px;
  }

  .addon-remove {
    padding: 8px 12px;
    font-size: 1.2rem;
  }

  .catalog-form {
    flex-direction: column;
  }

  .catalog-form input,
  .catalog-form select {
    min-height: 44px;
  }

  #cat-price, #cat-cost {
    width: 100%;
  }

  .proposal-form input,
  .proposal-form textarea {
    min-height: 48px;
    font-size: 1rem;
  }

  .proposal-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .proposal-btn-row {
    flex-direction: column;
  }

  .proposal-btn-row .tool-btn {
    width: 100%;
    justify-content: center;
  }

  main {
    padding: 16px;
    padding-bottom: 80px;
  }

  .stats-section {
    flex-wrap: wrap;
  }

  .stat-card {
    min-width: calc(50% - 7px);
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search input {
    width: 100%;
    min-height: 44px;
  }

  .proposals-table { font-size: 0.78rem; }
  .proposals-table th, .proposals-table td { padding: 8px 6px; }

  .sticky-bar-inner {
    gap: 16px;
  }

  .sticky-value {
    font-size: 0.88rem;
  }

  .sticky-total .sticky-value {
    font-size: 1rem;
  }

  .sticky-total {
    padding-left: 16px;
  }
}

.undo-btn, .redo-btn {
  padding: 10px 12px;
}

.fullscreen-btn {
  margin-left: auto;
}

.leaflet-marker-icon.leaflet-div-icon {
  background: #fff;
  border: 2px solid #c0392b;
  border-radius: 50%;
  width: 12px !important;
  height: 12px !important;
  margin-left: -6px !important;
  margin-top: -6px !important;
}

.map-section.map-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: #fff;
  margin: 0;
  padding: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.map-section.map-fullscreen .map-toolbar {
  position: relative;
  z-index: 2001;
  border-radius: 0;
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 2px solid #e8e8e8;
  flex-shrink: 0;
}

.map-section.map-fullscreen .map-container {
  flex: 1;
  height: auto !important;
  border-radius: 0;
}

.map-section.map-fullscreen .map-hint {
  display: none;
}

.map-section.map-fullscreen .fullscreen-btn {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.map-section.map-fullscreen .fullscreen-btn:hover {
  background: #a93226;
}

body.map-is-fullscreen {
  overflow: hidden;
}

body.map-is-fullscreen header,
body.map-is-fullscreen .sidebar,
body.map-is-fullscreen .sidebar-overlay,
body.map-is-fullscreen .steps-bar,
body.map-is-fullscreen .search-section,
body.map-is-fullscreen .sticky-pricing,
body.map-is-fullscreen #install-banner,
body.map-is-fullscreen footer {
  display: none !important;
}

.map-section.map-fullscreen .tool-btn .btn-label {
  display: inline !important;
  font-size: 0.72rem;
}
