/* BEAM Partner Interactive Toolkit - Stylesheet */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --secondary: #475569;
  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --dark: #0f172a;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  z-index: 40;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #1e293b;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 0.5rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-title span {
  color: #38bdf8;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background-color: #1e293b;
  color: #ffffff;
}

.nav-item.active {
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid #1e293b;
  background-color: #0b1120;
}

.partner-tier-card {
  background: linear-gradient(145deg, #1e293b, #111e38);
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: 0.85rem;
  font-size: 0.8rem;
}

.partner-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.partner-badge {
  background-color: #059669;
  color: #ecfdf5;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
}

.tier-select-wrapper {
  margin-top: 0.5rem;
}

.tier-select-wrapper label {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.tier-select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background-color: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

/* Main Content Area */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.top-bar {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-info h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.page-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quick-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.stat-chip {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-chip strong {
  color: var(--primary);
}

.content-body {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-wizard {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.card-title-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Wizard Questions */
.wizard-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.q-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all 0.2s ease;
  position: relative;
}

.q-box:focus-within, .q-box.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.q-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.q-num {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.q-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.q-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Custom Option Radio / Checkboxes */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.option-pill {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-alt);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.option-pill:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-border);
}

.option-pill input[type="radio"],
.option-pill input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.option-pill.selected {
  background-color: #eff6ff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.12);
}

.opt-content {
  display: flex;
  flex-direction: column;
}

.opt-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}

.opt-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.3;
}

/* Vertical Selector Select box */
.vertical-select-wrap {
  margin-bottom: 0.75rem;
}

.custom-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background-color: var(--surface);
  color: var(--text-main);
  outline: none;
  font-weight: 500;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--primary);
}

/* Pricing / Result Summary Sticky Card */
.pricing-sticky {
  position: sticky;
  top: 5rem;
}

.result-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.result-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.edition-rec-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.edition-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.75rem;
}

.cost-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 0.35rem 0;
}

.cost-row.subtle {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cost-row.total-row {
  border-top: 2px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.cost-row.total-row .cost-val {
  color: var(--primary);
  font-size: 1.35rem;
}

.cost-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cost-val {
  font-weight: 700;
}

/* Partner Commission Card Box */
.commission-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid var(--success-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.comm-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.35rem;
}

.comm-amount {
  font-size: 1.2rem;
  font-weight: 800;
  color: #047857;
}

.comm-detail {
  font-size: 0.75rem;
  color: #047857;
  opacity: 0.9;
}

/* Action Buttons */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--surface-alt);
  border-color: var(--secondary);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

/* Good-Better-Best Comparison Table */
.tier-table-wrapper {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.tier-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tier-table th, .tier-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tier-table th {
  background-color: var(--surface-alt);
  font-weight: 700;
  color: var(--text-main);
}

.tier-table tr:last-child td {
  border-bottom: none;
}

.tier-table .highlight-col {
  background-color: #f0f7ff;
  border-left: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
}

.tier-table th.highlight-col {
  background-color: #dbeafe;
  color: var(--primary);
  font-weight: 800;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-green { background-color: #d1fae5; color: #065f46; }
.badge-yellow { background-color: #fef3c7; color: #92400e; }
.badge-purple { background-color: #ede9fe; color: #5b21b6; }
.badge-gray { background-color: #f1f5f9; color: #475569; }

/* Checklist Component Styles */
.checklist-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.mode-toggle {
  display: inline-flex;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.mode-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.progress-track-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 250px;
}

.progress-bar-bg {
  flex-grow: 1;
  height: 10px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* Stage Accordions */
.stage-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stage-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background-color: var(--surface);
  transition: background-color 0.15s ease;
}

.stage-header:hover {
  background-color: var(--surface-alt);
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stage-badge-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #f1f5f9;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.stage-card.completed .stage-badge-num {
  background-color: var(--success);
  color: white;
}

.stage-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.stage-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stage-body {
  padding: 0 1.5rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: none;
}

.stage-card.open .stage-body {
  display: block;
}

.stage-card.open .stage-chevron {
  transform: rotate(180deg);
}

.stage-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

/* Checklist Items */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.check-item:last-child {
  border-bottom: none;
}

.check-item input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--success);
  cursor: pointer;
  flex-shrink: 0;
}

.check-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-info {
  flex-grow: 1;
}

.task-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.task-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.task-tip-box {
  background-color: var(--warning-light);
  border-left: 3px solid var(--warning);
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #78350f;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 0.4rem;
}

/* Objection Cards (LAER) */
.objection-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.objection-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.laer-step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.85rem;
}

.laer-step:last-child {
  border-bottom: none;
}

.laer-badge {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  height: fit-content;
}

.laer-listen { background-color: #f1f5f9; color: #334155; }
.laer-ack { background-color: #fef3c7; color: #92400e; }
.laer-explore { background-color: #ede9fe; color: #5b21b6; }
.laer-respond { background-color: #d1fae5; color: #065f46; }

.laer-content {
  color: var(--text-main);
  line-height: 1.4;
}

.laer-content.quote {
  font-style: italic;
  font-weight: 600;
  color: #1e3a8a;
}

/* Red lines list */
.redline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.redline-card {
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.redline-title {
  color: #be123c;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.redline-desc {
  font-size: 0.8rem;
  color: #4c0519;
}

/* Module Explorer */
.search-bar-wrap {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex-grow: 1;
  min-width: 280px;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.category-filter-select {
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background-color: var(--surface);
  cursor: pointer;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.module-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-border);
}

.mod-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.mod-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.mod-price {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.05rem;
}

.mod-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.mod-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.mod-includes {
  color: var(--secondary);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-container {
  background-color: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

.proposal-preview-box {
  background-color: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #1e293b;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 110;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .grid-wizard {
    grid-template-columns: 1fr;
  }
  .pricing-sticky {
    position: static;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .content-body {
    padding: 1rem;
  }
}

/* Branded Proposal & Contract Document Styles (Mousafeiris Tech Template) */

.modal-container.modal-lg {
  max-width: 960px;
  width: 95vw;
}

.modal-tabs-header {
  display: flex;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  gap: 0.5rem;
}

.modal-tab-btn {
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-tab-btn.active {
  color: #0f4c5c;
  border-bottom-color: #0f4c5c;
  background-color: var(--surface);
}

.doc-wrapper {
  background-color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius);
  max-height: 65vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

/* Simulated A4 Pages */
.doc-sheet {
  background-color: #ffffff;
  width: 100%;
  max-width: 800px;
  min-height: 1050px;
  padding: 3rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  font-family: var(--font-sans);
  color: #1e293b;
  position: relative;
  page-break-after: always;
}

/* Header & Logo */
.doc-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f4c5c;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
}

.doc-brand-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f4c5c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-brand-sub {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 600;
  margin-top: 0.15rem;
}

.doc-company-details {
  text-align: right;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}

/* Proposal Title & Recipient Card */
.doc-proposal-title-bar {
  text-align: center;
  margin: 1.5rem 0 2rem 0;
}

.doc-proposal-title-bar h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f4c5c;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doc-client-meta-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background-color: #f8fafc;
  border-left: 4px solid #0f4c5c;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.88rem;
}

.doc-client-meta-grid div {
  margin-bottom: 0.25rem;
}

/* Formal Items Table (Matches PDF 2) */
.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.88rem;
}

.doc-items-table th, .doc-items-table td {
  border: 1.5px solid #1e293b;
  padding: 0.65rem 0.85rem;
}

.doc-items-table th {
  background-color: #f1f5f9;
  font-weight: 800;
  text-align: left;
  letter-spacing: 0.03em;
  color: #0f172a;
}

.doc-items-table th.text-center, .doc-items-table td.text-center {
  text-align: center;
}

.doc-items-table th.text-right, .doc-items-table td.text-right {
  text-align: right;
}

.doc-items-table tr.total-row td {
  font-weight: 800;
  font-size: 1.05rem;
  background-color: #f8fafc;
  border-top: 2.5px solid #0f4c5c;
}

/* Terms & Notes (Matches PDF 2 Page 3) */
.doc-terms-box {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.6;
}

.doc-terms-title {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f4c5c;
  margin-bottom: 0.4rem;
}

.doc-signature-block {
  margin-top: 2.5rem;
  display: flex;
  justify-content: flex-end;
}

.doc-stamp-box {
  text-align: center;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.75rem;
  min-width: 260px;
}

.doc-stamp-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b3c5d;
}

.doc-stamp-sub {
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* Support Contract Attachment (Matches PDF 1) */
.contract-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f4c5c;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.contract-section {
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.contract-sec-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

.contract-cost-table, .contract-zones-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem 0;
  font-size: 0.85rem;
}

.contract-cost-table td, .contract-zones-table th, .contract-zones-table td {
  border: 1px solid #cbd5e1;
  padding: 0.5rem 0.75rem;
}

.contract-zones-table th {
  background-color: #f1f5f9;
  font-weight: 700;
}

.contract-example-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0f4c5c;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.contract-bullet-list {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Print Stylesheet Overrides */
@media print {
  /* Hide standard page elements */
  body * {
    visibility: hidden;
  }
  
  /* Show only the printable modal container */
  #modal-tab-doc, #modal-tab-doc * {
    visibility: visible;
  }

  #modal-tab-doc {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
  }

  .doc-wrapper {
    background: transparent !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .doc-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 2cm !important;
    width: 100% !important;
    min-height: auto !important;
    page-break-after: always !important;
  }

  .no-print, .modal-header, .modal-tabs-header, .modal-footer, .sidebar, .top-bar {
    display: none !important;
  }
}


/* ===== Printable offer / contract panel (Προσφορές tab) ===== */
.print-docs-card { border-left: 4px solid #005f6a; }
.print-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.9rem;
}
.print-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.print-field-wide { grid-column: 1 / -1; }
.print-input {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--surface);
  font-family: inherit;
}
.print-input:focus { outline: none; border-color: #005f6a; box-shadow: 0 0 0 3px rgba(0, 95, 106, 0.15); }
.print-options { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.8rem; }
.print-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--text-main); cursor: pointer; }
.print-check input { width: 16px; height: 16px; accent-color: #005f6a; flex-shrink: 0; }
.print-check-inline { font-size: 0.78rem; color: var(--text-muted); margin-right: 0.25rem; }
.print-selection-summary { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.9rem; line-height: 1.9; }
.print-chip { display: inline-block; background: #e6f2f3; color: #00474f; border-radius: 999px; padding: 0.1rem 0.65rem; margin: 0 0.25rem 0.25rem 0; font-weight: 600; }
.print-chip em { font-weight: 400; font-style: normal; color: #4b7a80; }
.print-warn { color: #b45309; font-weight: 600; }
.print-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ===================================================================
   Mobile & tablet layer (desktop > 900px is unchanged)
   =================================================================== */
.mobile-menu-btn, .sidebar-close-btn, .nav-backdrop { display: none; }

@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body.nav-open { overflow: hidden; }

  .app-container { display: block; min-height: 100vh; }

  /* Off-canvas drawer */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: min(300px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-header { position: relative; padding-right: 3.5rem; }
  .sidebar-close-btn {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 0.75rem; right: 0.75rem;
    width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid #334155; background: #1e293b; color: #e2e8f0;
    font-size: 1.1rem; cursor: pointer;
  }
  .sidebar-nav { flex-direction: column !important; overflow: visible !important; flex-grow: 0; }
  .nav-item { min-height: 48px; font-size: 1rem; }
  .tier-select { font-size: 16px; min-height: 44px; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* The page itself scrolls (no inner scroll container) */
  .main-wrapper { height: auto; overflow: visible; min-height: 100vh; }

  /* Top bar */
  .top-bar {
    flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center;
    padding: 0.6rem 1rem;
    padding-top: calc(0.6rem + env(safe-area-inset-top));
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .mobile-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 10px; border: 1px solid var(--border);
    background: #0f172a; color: #fff; cursor: pointer;
  }
  .page-info { flex: 1 1 0; min-width: 0; }
  .page-info h1 { font-size: 1.05rem; line-height: 1.3; }
  .page-info p { font-size: 0.78rem; line-height: 1.35; }
  .quick-stats { flex-basis: 100%; gap: 0.5rem; flex-wrap: wrap; }
  .stat-chip { font-size: 0.78rem; padding: 0.3rem 0.6rem; flex: 1 1 auto; min-width: 0; }

  .content-body { padding: 1rem 0.85rem 2.5rem; }
  .grid-2, .grid-3, .grid-wizard { grid-template-columns: 1fr !important; gap: 1rem; }
  .card { padding: 1rem; min-width: 0; }
  .card-header { flex-wrap: wrap; gap: 0.5rem; }
  .pricing-sticky { position: static !important; }

  /* Every element fits the viewport; wide tables scroll inside their wrapper */
  .tab-panel, .tab-panel * { max-width: 100%; }
  .tab-panel table { max-width: none; }
  .tier-table-wrapper, .tab-panel div[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }
  .tier-table { min-width: 560px; }
  .tier-table th, .tier-table td { padding: 0.6rem 0.7rem; }
  .tab-panel pre, .tab-panel code { white-space: pre-wrap; word-break: break-word; }

  /* Touch targets and iOS no-zoom inputs */
  input[type="text"], input[type="number"], input[type="date"], input[type="email"],
  input[type="search"], input:not([type]), select, textarea {
    font-size: 16px !important;
    min-height: 44px;
  }
  .btn, .mode-btn, .modal-close, .modal-tab-btn { min-height: 44px; }
  .btn-sm { min-height: 44px; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .option-pill { min-height: 44px; }
  .print-check, .print-check-inline { min-height: 44px; }
  .print-check input { width: 20px; height: 20px; }

  /* Checklists toolbar stacks */
  .checklist-toolbar { flex-direction: column; align-items: stretch; padding: 1rem; }
  .mode-toggle { display: flex; width: 100%; }
  .mode-btn { flex: 1 1 0; padding: 0.5rem 0.6rem; font-size: 0.82rem; }
  .progress-track-wrapper { min-width: 0; }
  #checklist-sector-select { min-width: 0 !important; width: 100%; }
  .checklist-toolbar > div:last-child { width: 100%; }
  .checklist-toolbar > div:last-child .btn { flex: 1 1 0; justify-content: center; }

  /* Search / filter bars */
  .search-bar-wrap { flex-direction: column; align-items: stretch; }

  /* Print card + saved quotes */
  .print-form-grid { grid-template-columns: 1fr; }
  .print-actions .btn { flex: 1 1 100%; justify-content: center; }
  #saved-quotes-container .card > div:last-child { width: 100%; }
  #saved-quotes-container .card > div:last-child .btn { flex: 1 1 auto; justify-content: center; }

  /* Modals become full-screen sheets */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal-container, .modal-container.modal-lg {
    max-width: 100% !important; width: 100%;
    max-height: none; height: 100%; border-radius: 0;
  }
  .modal-header, .modal-body, .modal-footer { padding: 0.9rem 1rem; }
  .modal-footer { flex-wrap: wrap; padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }
  .modal-close { min-width: 44px; }
  .proposal-preview-box { max-height: none; font-size: 0.8rem; }

  /* Toast */
  .toast { left: 0.75rem; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .page-info p { display: none; }
  .content-body { padding-left: 0.65rem; padding-right: 0.65rem; }
  .card { padding: 0.85rem; border-radius: 12px; }
}

/* ===== AgroData tab ===== */
.src-link { font-size: 0.75rem; color: #2563eb; text-decoration: underline; word-break: break-all; }
.agro-p { font-size: 0.88rem; color: #334155; line-height: 1.5; margin-bottom: 0.6rem; }
.agro-note { font-size: 0.8rem; background: #f8fafc; border-left: 3px solid #94a3b8; padding: 0.5rem 0.75rem; margin-top: 0.5rem; color: #475569; line-height: 1.45; }
.agro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.agro-grid .card { margin-bottom: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.agro-ed-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.agro-ed-name { font-weight: 800; color: #14532d; font-size: 1rem; }
.agro-ed-dev, .agro-ed-for { font-size: 0.8rem; color: #475569; }
.agro-ed-total { font-size: 0.82rem; color: #166534; margin-top: auto; }
.agro-ul { padding-left: 1.2rem; font-size: 0.82rem; color: #334155; display: flex; flex-direction: column; gap: 0.25rem; }
.agro-small { font-size: 0.78rem; color: #64748b; margin-top: 0.6rem; line-height: 1.45; }
.agro-calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.agro-calc label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; color: #334155; }
.agro-calc-result { margin-top: 1rem; border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: var(--radius); padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
.agro-calc-result > div { display: flex; justify-content: space-between; gap: 1rem; }
.agro-calc-total { border-top: 1px dashed #86efac; padding-top: 0.4rem; font-size: 0.95rem; color: #14532d; }
.agro-yes { color: #16a34a; font-weight: 800; }
.agro-no { color: #cbd5e1; }
.agro-table td:not(:first-child), .agro-table th:not(:first-child) { text-align: center; }
.agro-sources li { word-break: break-word; }
@media (max-width: 900px) {
  .agro-calc-result > div { flex-wrap: wrap; }
  .agro-table { min-width: 560px; }
}
