/*
 * Get Estimating — application.css
 * Estimate editor styles ported directly from construction_estimator/combo_v28/css/sw-styles.css
 * Layout/nav styles adapted from get_financed conventions
 */

/* ============================================================
   RESET / BASE
   ============================================================ */

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

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #333;
  margin: 0;
  background: #f5f5f5;
}

textarea { font-family: inherit; font-size: inherit; }

a { color: #5E97AC; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { color: #4e4e4e; font-size: 22px; margin: 0 0 16px 0; }
h2 { font-size: 18px; color: #555; margin: 16px 0 8px 0; }
h4 { font-size: 13px; color: #666; margin: 0 0 4px 0; }

/* ============================================================
   AUTH LAYOUT — sign-in page (no sidebar)
   ============================================================ */

.auth-body {
  background: #f5f5f5;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
}

.auth-logo {
  display: block;
}

.auth-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 32px 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 20px;
}

.auth-flash {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

/* ============================================================
   LAYOUT — sidebar + main content
   ============================================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  min-width: 200px;
  background: #f4f4f4;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 16px 14px 12px;
  font-size: 15px;
  font-weight: bold;
  color: #555;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo {
  flex-shrink: 0;
}

.sidebar-nav {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  flex: 1;
}

.sidebar-nav li a {
  display: block;
  padding: 9px 16px;
  color: #444;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  background: #e8e8e8;
  border-left-color: #5E97AC;
  text-decoration: none;
}

.sidebar-footer {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.btn-signout {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
  width: 100%;
}

.sidebar-divider {
  border-top: 1px solid #ddd;
  margin: 4px 0 10px;
}

.btn-signout:hover { background: #eee; }

/* ============================================================
   MAIN + LIBRARY PANEL LAYOUT
   ============================================================ */
.main-with-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  background-color: #f5f5f5;
}

.main-content--dashboard {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  background-color: #ffffff;
}

.main-content-floorplan-editor {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  background-color: #efefef;
}

.main-content-estimator {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  background-color: #fcfcfc;
}

.main-content--library-tasks {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  background-color: #e9e9e9;
}

.main-content__body {
  padding: 20px 28px 60px 28px;
  min-width: max-content;
}

/* ============================================================
   LIBRARY PANEL — always-visible right sidebar (in-flow flex sibling)
   ============================================================ */
.library-panel {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: row;
  background: #f0f0f0;
  border-left: 1px solid #d0d0d0;
  z-index: 200;
  box-shadow: 0 0px 12px rgba(0, 0, 0, 0.24);
}

/* Always-visible collapsed strip */
.library-panel-strip {
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 5px;
  gap: 8px;
  flex-shrink: 0;
}

.library-panel-strip-label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.04em;
}

.library-panel-toggle {
  background: #747474;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 11px;
  width: 90px;
  text-align: center;
}

.library-panel-toggle:hover { background: #5a5a5a; color: #ffffff; }

.library-new-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.library-new-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  padding: 8px 4px;
  margin: 0 10px;
  cursor: grab;
  font-size: 11px;
  color: #555;
  text-align: center;
  gap: 3px;
  user-select: none;
}

.library-new-item:hover { background: #e8e8e8; border-color: #aaa; color: #222; }

.library-new-item-group { background: #fdbd41; border-color: #e0a800; color: #000000; }
.library-new-item-group:hover { background: #f0b030; border-color: #c99600; }

.library-new-item-task { background: #80d47e; border-color: #5fb85c; color: #000000; }
.library-new-item-task:hover { background: #6abf68; border-color: #4da04a; }

.library-new-item-note { background: #65CFEF; border-color: #3db8e0; color: #000000; }
.library-new-item-note:hover { background: #4ec0e8; border-color: #28a8d4; }

.library-new-item-component { background: #6b6b6b; border-color: #505050; color: #ffffff; }
.library-new-item-component:hover { background: #505050; border-color: #3a3a3a; }

.library-new-item-assembly { background: #898989; border-color: #cccccc; color: #ffffff; }
.library-new-item-assembly:hover { background: #737373; border-color: #cccccc; color: #ffffff; }

/* Expanded search panel — hidden until .open */
.library-panel-body {
  width: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.25s ease;
  background: #f0f0f0;
  border-left: 1px solid #d0d0d0;
}

.main-with-panel.open .library-panel-body {
  width: 420px;
  overflow-y: auto;
  padding: 12px 10px;
}

/* Library search internals */
.library-search-box { margin-bottom: 10px; }

.library-search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #c0c0c0;
  color: #333;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  box-sizing: border-box;
}

.library-search-box input::placeholder { color: #aaa; }
.library-search-box input:focus { outline: none; border-color: #5E97AC; }

.library-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #555;
}

.library-type-filters label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 15px;
}

.library-type-filters input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.library-results {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.library-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 4px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  cursor: grab;
  user-select: none;
}

.library-item:hover { background: #e8e8e8; }
.library-item .drag-handle { color: #aaa; font-size: 13px; flex-shrink: 0; }
.library-menu-tasks-handle { display: flex; align-items: center; gap: 3px; border-radius: 3px; padding: 1px 4px; flex-shrink: 0; }
.library-item-task .library-menu-tasks-handle { background-color: #d4edda; }
.library-item-note .library-menu-tasks-handle { background-color: #d0e8f8; }
.library-item-group .library-menu-tasks-handle { background-color: #fde8cc; }
.library-item-assembly .library-menu-tasks-handle { background-color: #e8e8e8; }
.library-item-library_set .library-menu-tasks-handle { background-color: #ead4f5; }
.library-item-type { font-size: 9px; color: #999; min-width: 44px; text-transform: uppercase; }
.library-item-description { flex: 1; font-size: 11px; color: #444; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}

.flash-notice { background: #dbf8db; color: #439b43; border: 1px solid #1ecf18; }
.flash-alert  { background: #fde8e8; color: #c0392b; border: 1px solid #e08080; }

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.page-header h1 { margin: 0; }

.assembly-name-field {
  font-size: 2rem;
  font-weight: bold;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 0;
  margin: 0;
  outline: none;
  width: 100%;
  color: inherit;
}

.assembly-name-field:hover,
.assembly-name-field:focus {
  border-bottom-color: #ccc;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.project-client      { color: #787878; margin: 0 0 2px 0; font-size: 18px; }
.project-description { color: rgb(120, 120, 120); font-size: 18px; margin: 0px 0px 6px; }

/* ============================================================
   SHOW PAGE LAYOUT
   ============================================================ */

.show-actions {
  margin-top: 20px;
  margin-left: 5px;
}

.show-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 16px;
}

.show-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.show-card {
  flex: 1;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 16px 20px;
}

.show-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.show-card-header h2 {
  margin: 0;
  font-size: 15px;
  color: #555;
  border-bottom: none;
  padding-bottom: 0;
}

.show-card h2 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #555;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.show-field {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
}

.show-label {
  width: 130px;
  flex-shrink: 0;
  color: #888;
  font-size: 13px;
}

.assign-user-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.assign-user-form h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #666;
}

.assign-user-form form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.assign-user-form select {
  flex: 1;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-active    { background: #dcfce7; color: #166534; width: fit-content; }
.badge-inactive  { background: #f3f4f6; color: #6b7280; }
.badge-pending   { background: #fef3c7; color: #92400e; width: fit-content; }
.badge-completed { background: #dbeafe; color: #1e40af; width: fit-content; }
.badge-archived  { background: #dcdcdc; color: #6b7280; width: fit-content; }
.badge-draft     { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #dcfce7; color: #166534; }

/* ============================================================
   TABLES (index pages)
   ============================================================ */

.index-list {
  width: 100%;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.index-list-header {
  display: flex;
  align-items: center;
  background: #f2f2f2;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
  padding: 8px 12px;
}

.index-list-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.index-list-row:last-child { border-bottom: none; }
.index-list-row:hover { background: #fafafa; }

.index-list-cell { padding: 0 8px 0 0; }
.index-col      { flex: 1; }
.index-col-name { flex: 2; font-size: 16px; }
.index-col-actions { width: 130px; flex-shrink: 0; }
.index-list-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; justify-content: flex-end; }
.index-list-actions form { margin: 0; }

.btn-edit,
.btn-index-delete {
  display: inline-flex;
  align-items: center;
  height: 26px;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.btn-edit { background: #4a90d9; border: 1px solid #3a7fc1; color: #fff; }
.btn-edit:hover { background: #3a7fc1; text-decoration: none; color: #fff; }

.btn-index-delete { background: #f0f0f0; border: 1px solid #ccc; color: #444; }
.btn-index-delete:hover { background: #e0e0e0; }

.empty-state {
  color: #999;
  font-style: italic;
  padding: 20px 0;
}

/* ============================================================
   FORMS
   ============================================================ */

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  margin-bottom: 3px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="password"],
.field textarea,
.field select {
  background-color: #EAEAEA;
  border: 0;
  border-radius: 4px;
  width: 280px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
}

.field textarea { height: auto; padding: 6px 8px; resize: vertical; }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

input[type="submit"],
button[type="submit"] {
  background-color: rgb(255, 151, 46);
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 2px 2px 3px #ccc;
}

input[type="submit"]:hover,
button[type="submit"]:hover { background-color: #e08020; }

.button-link-cancel {
  display: inline-block;
  background: #d8d8d8;
  color: #555;
  border: 0;
  border-radius: 5px;
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 2px 2px 3px #ccc;
  text-decoration: none;
}

.button-link-cancel:hover {
  background: #c4c4c4;
  color: #333;
  text-decoration: none;
}

/* ============================================================
   BUTTONS — add / action
   ============================================================ */

.btn-add {
  display: inline-block;
  background: #747474;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #ffffff;
  border-radius: 3px;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn-add:hover { background: #5a5a5a; color: #ffffff; text-decoration: none; }

.btn-add-blue {
  background: #4a90d9;
  color: #fff;
  margin-bottom: 16px;
  padding: 7px 7px;
}
.btn-add-blue:hover { background: #3a7bc8; color: #fff; text-decoration: none; }

input[type="submit"].btn-add-blue,
button[type="submit"].btn-add-blue { background-color: #4a90d9; }
input[type="submit"].btn-add-blue:hover,
button[type="submit"].btn-add-blue:hover { background-color: #3a7bc8; }

.btn-add-sm {
  padding: 2px 7px;
  font-size: 11px;
}

/* button_to renders a form — reset its margin */
.estimate-add-actions form,
.group-header-actions form,
.task-actions form,
.note-actions form { display: inline; margin: 0; }

/* ============================================================
   LOGIN
   ============================================================ */

.login-layout {
  display: flex;
  justify-content: center;
  padding-top: 100px;
  background: #f5f5f5;
  min-height: 100vh;
}

.login-form-wrapper {
  text-align: center;
}

.login-form-wrapper h1 { color: #555; }

.login-form-wrapper input[type="email"],
.login-form-wrapper input[type="password"] {
  display: block;
  background-color: rgb(234, 234, 234);
  border: 0;
  margin: 10px auto;
  border-radius: 4px;
  width: 250px;
  height: 30px;
  padding-left: 10px;
}

.login-form-wrapper input[type="submit"] {
  width: 180px;
  height: 32px;
  margin: 16px auto 0;
  display: block;
}

/* ============================================================
   ESTIMATE EDITOR — ported from sw-styles.css
   ============================================================ */

.estimate-editor {
  margin-top: 10px;
}

/* --- Task rows --- */
/* Matches .task-element in sw-styles.css */

.estimate-task-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  width: 100%;
  border-bottom: dotted 2px #ccc;
  padding: 5px 8px 5px 0;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  background: #fff;
  position: relative;
}

.task-description {
  font-size: 13px;
  font-weight: bold;
  min-width: 200px;
  flex: 1;
  padding-right: 10px;
  word-break: break-word;
}

.task-costs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 12px;
  color: #555;
}

.cost-label { color: #888; font-size: 11px; }
.cost-value { font-weight: bold; color: #333; margin-right: 4px; }

.task-total-price { color: #333; font-weight: bold; }

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.task-actions a,
.task-actions form button { font-size: 11px; }

/* --- Assembly task row layout --- */


/* Component list container (estimate panel + library show) */
.assembly-components-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each component item — single horizontal flex row */
.assembly-component-item {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 4px 10px;
  padding: 6px 0px;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
}

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

/* Description field — wider than the numeric fields */
.assembly-component-item .ac-description-field input[type="text"] {
  width: 370px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  height: 22px;
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 0 4px;
}

.ac-unit-select {
  border: none;
  background-color: #f1eff1;
}

.btn-toggle-ratio {
  border: none;
  background-color: #9bcad2;
  color: white;
}

[data-assembly-component-row-target="qtyPerUnitWrapper"] input[type="number"] {
  background: #f5f5f5;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  height: 24px;
  padding: 0 4px;
  width: 60px;
}

.assembly-component-item .ac-description-field input[type="text"]:focus {
  outline: none;
  border-bottom-color: #5E97AC;
}

/* Unit select inside task-field */
.ac-fields select {
  background-color: #D7E9EC;
  border: 0;
  border-bottom: solid 1px #C2DD2E;
  border-radius: 0;
  height: 22px;
  padding: 0 2px;
  font-size: 12px;
  width: 52px;
}

/* Auto-quantity display */
.assembly-qty-auto {
  display: inline-block;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 11px;
  color: #686868;
  height: 22px;
  line-height: 18px;
  min-width: 54px;
}

/* Ratio toggle area */
.ac-ratio-toggle {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-bottom: 0;
}

/* Delete button area */
.ac-delete {
  margin-left: auto;
}

.ac-totals {
  margin-left: auto;
}

.assembly-task-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assembly-task-header {
  width: 100%;
}

.estimate-assembly-task-row .task-inline-description input[type="text"] {
  max-width: none;
}

.assembly-unit-badge {
  display: inline-block;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: bold;
  color: #666;
  height: 22px;
  line-height: 18px;
}

.assembly-meta {
  margin-bottom: 16px;
}

.assembly-components-section {
  margin: 33px 0px 0px 0px;
}

.assembly-components-section h2 {
  margin-top: 10px;
}

.assembly-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.assembly-unit-label {
  color: #606060;
  font-size: 1rem;
}

.assembly-unit-badge--dark {
  display: inline-block;
  background: #8d8d8d;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #e9e9e9;
  height: 22px;
  line-height: 18px;
}

.assembly-components-panel {
  width: 100%;
  margin-top: 24px;
}

.assembly-panel-footer {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  margin-top: 10px;
  margin-bottom: 7px;
}

.assembly-panel-pair {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.assembly-panel-pair--ai {
  flex: 1;
}

.assembly-panel-pair--ai [data-ai-assembly-target="form"] {
  flex: 1;
}

.btn-panel-toggle {
  display: inline-block;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #444;
}

.btn-panel-toggle:hover { background: #e0e0e0; }

.btn-panel-toggle--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
}

.btn-panel-toggle--active {
  background: #ddeeff;
  border-color: #99bbe0;
  color: #1a5a9a;
}

.btn-panel-toggle--ai {
  background: #ff972d;
  color: #fff;
  border-color: #ff972d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  width: auto;
  padding: 0 8px;
  height: 28px;
  border-radius: 4px;
}

.btn-panel-toggle--ai:hover {
  background: #e07a18;
  border-color: #e07a18;
}

.btn-panel-toggle--ai.btn-panel-toggle--active {
  background: #1a5a9a;
  border-color: #1a5a9a;
  color: #fff;
}

.ai-assembly-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 38px;
  margin-right: 12px;
  width: 100%;
}

@property --ai-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes ai-border-spin {
  from { --ai-border-angle: 0deg; }
  to   { --ai-border-angle: 360deg; }
}

.ai-assembly-fields input[type="text"],
.ai-assembly-fields textarea {
  background: linear-gradient(#f7f7f7, #f7f7f7) padding-box,
              conic-gradient(from var(--ai-border-angle), #e8f6ff, #4a9fd4, #e8f6ff) border-box;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 16px;
  min-height: 72px;
  height: 72px;
  width: 65%;
  outline: none;
  box-sizing: border-box;
  margin: 5px 0px 5px 58px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.07);
  resize: none;
  overflow: hidden;
  line-height: 1.4;
}

.ai-assembly-fields input[type="text"]:focus,
.ai-assembly-fields textarea:focus {
  background: linear-gradient(#f7f7f7, #f7f7f7) padding-box,
              conic-gradient(from var(--ai-border-angle), #e8f6ff, #4a9fd4, #e8f6ff) border-box;
  border-color: transparent;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.07);
}

.ai-assembly-fields input[type="text"].ai-border-spin,
.ai-assembly-fields textarea.ai-border-spin {
  animation: ai-border-spin 1.5s ease-in-out 1 forwards;
}

.ai-assembly-fields input[type="text"].ai-border-spin-slow,
.ai-assembly-fields textarea.ai-border-spin-slow {
  animation: ai-border-spin 5s ease-in-out 9 forwards;
}

.btn-generate-ai {
  background-color: rgb(255, 151, 46);
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 7px 18px 22px 18px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 2px 2px 3px #ccc;
  margin: 0px 0px 17px 58px;
}

.btn-generate-ai:hover { background-color: rgb(230, 130, 20); }
.btn-generate-ai:disabled { background-color: #ccc; box-shadow: none; cursor: default; }

@keyframes btn-generate-pulse {
  0%, 100% { background-color: rgb(255, 151, 46); }
  50%       { background-color: rgb(200, 105, 10); }
}

.btn-generate-ai--loading {
  animation: btn-generate-pulse 1s ease-in-out infinite;
  cursor: default;
}

.ai-assembly-error {
  color: #c0392b;
  font-size: 11px;
  margin-top: 4px;
  padding: 2px 0;
}

.estimate-ai-heading {
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 500;
  color: #555;
}

.estimate-ai-prompt {
  margin: 82px 0 34px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.estimate-ai-prompt .estimate-ai-heading {
  width: 65%;
  font-family: 'Rubik', sans-serif;
}

.estimate-ai-prompt form {
  width: 65%;
}

.estimate-ai-prompt .ai-assembly-fields {
  margin-top: 0;
}

.estimate-ai-prompt .ai-assembly-fields input[type="text"],
.estimate-ai-prompt .ai-assembly-fields textarea {
  margin: 5px 0 5px 0;
  width: 100%;
}

.estimate-ai-prompt .btn-generate-ai {
  margin: 0;
  font-weight: 600;
}

.assembly-ai-heading {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 500;
  color: #444;
  font-family: 'Rubik', sans-serif;
}

.assembly-ai-heading--inline {
  margin: 0 0 4px 58px;
}

.assembly-ai-section {
  margin-top: 32px;
}

.assembly-ai-section .ai-assembly-fields {
  margin-top: 0;
}

.assembly-ai-section .ai-assembly-fields input[type="text"],
.assembly-ai-section .ai-assembly-fields textarea {
  margin: 5px 0px 5px 0px;
  width: 75%;
}

.assembly-ai-section .btn-generate-ai {
  margin: 0px 0px 17px 0px;
}

.ai-assembly-room-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ai-assembly-room-label {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
}

.ai-assembly-room-select {
  flex: 1;
  background: #f5f5f5;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}

.ai-assembly-room-select:focus {
  outline: none;
  border-bottom-color: #e8890e;
}

.ai-assembly-ceiling-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ai-assembly-ceiling-input {
  width: 70px;
  background: #f5f5f5;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 12px;
  color: #333;
}

.ai-assembly-ceiling-input:focus {
  outline: none;
  border-bottom-color: #e8890e;
}

.assembly-unit-select {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 1px 3px;
  font-size: 11px;
  font-weight: bold;
  color: #666;
  height: 22px;
  cursor: pointer;
}

.add-component-fields {
  margin-right: 12px;
  margin-top: 38px;
}

.add-component-fields input[type="text"],
.save-to-library-form input[type="text"] {
  background: #f5f5f5;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12px;
  height: 24px;
  width: 338px;
  outline: none;
}

.save-to-library-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-to-library-form .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.save-to-library-form .checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.add-component-fields .unit-select {
  background: #f5f5f5;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  height: 24px;
  padding: 0 4px;
  margin: 0 8px;
}

.assembly-expand-toggle {
  margin-right: 5px;
  margin-top: 5px;
  border: none;
  background: #ff972d;
  cursor: pointer;
  padding: 4px 10px 4px 10px;
  border-radius: 3px;
  color: white;
  font-size: 10px;
}

.assembly-expand-toggle:hover {
  background: #ffa54a;
  color: white;
}

/* --- Task edit form (inline within turbo-frame) --- */

.task-edit-form {
  padding: 8px 10px 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: solid 22px #80d47e;
  border-radius: 0 4px 4px 0;
}

.task-edit-section { margin-bottom: 10px; }

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: flex-end;
}

.field-row .field { margin-bottom: 0; }

/* Qty inputs get the light-blue background from sw-styles.css #task_labor_qty_new */
.field-row .field input[type="number"] {
  background-color: #D7E9EC;
  border-bottom: solid 1px #C2DD2E;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  width: 70px;
  height: 26px;
}

/* UM and cost-per-unit fields inherit background */
.field-row .field input[type="text"] {
  background-color: inherit;
  border-bottom: solid 1px #C2DD2E;
  border-top: 0; border-left: 0; border-right: 0;
  border-radius: 0;
  width: 60px;
  height: 26px;
}

.field-row .field label {
  font-size: 10px;
  color: #888;
  margin-bottom: 2px;
}

/* Computed/display-only output fields */
.field-computed span {
  display: inline-block;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: bold;
  min-width: 70px;
}

.task-edit-totals {
  display: flex;
  gap: 16px;
  font-size: 13px;
  padding: 6px 0 2px;
  border-top: 1px solid #eee;
  margin-top: 6px;
}

.task-edit-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

/* --- Group blocks --- */
/* Matches .group-header-element-new in sw-styles.css */

.estimate-group-block {
  margin-top: 12px;
  margin-bottom: 14px;
}

.estimate-group-header {
  display: flex;
  align-items: center;
  background-color: rgb(253, 189, 65);
  font-size: 15px;
  font-weight: normal;
  padding: 7px 10px 7px 0;
  border-top: solid 2px #e5e5e5;
  border-right: solid 2px #b3b3b3;
  border-bottom: solid 2px #939393;
  color: #747474;
  border-radius: 5px;
  min-height: 36px;
  gap: 8px;
  overflow: hidden;
}

/* Nested group — slightly darker per sw-styles.css depth variants */
.estimate-group-block .estimate-group-block .estimate-group-header {
  background-color: #fcb842;
  font-size: 14px;
}

.estimate-group-block .estimate-group-block .estimate-group-block .estimate-group-header {
  background-color: #fcac42;
}

.group-name {
  flex: 1;
  font-weight: bold;
  color: #747474;
}

.group-name-input {
  flex: 1;
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  color: #3b2907;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  font-size: 18px;
  width: 100%;
  padding: 0;
}

.group-name-input::placeholder {
  color: #ab7d23;
  opacity: 1;
}

.group-name-input:focus {
  border-bottom-color: #b8860b;
  background: rgba(255,255,255,0.4);
}

.group-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.group-subtotal {
  font-size: 16px;
  color: #000000;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 15px;
  border-radius: 3px;
  text-align: right;
}

.estimate-group-header form {
  flex: 1;
  min-width: 0;
}

.estimate-group-children {
  display: flow-root;
  padding-left: 16px;
  padding-bottom: 14px;
  border-left: 2px solid #ffc76244;
  background-color: #00000017;
  min-height: 32px;
}

.estimate-group-children:not(:has(*))::before {
  content: "Drop items here";
  display: block;
  padding: 8px 10px;
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  pointer-events: none;
}

.estimate-root-children {
  /* no extra indent at root level */
}

.estimate-root-wrapper {
  position: relative;
}

.estimate-empty-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 4px;
  font-size: 20px;
  color: #aaa;
  text-align: center;
  padding: 0 24px;
  box-sizing: border-box;
}

.estimate-root-children:not(:has(turbo-frame)) {
  min-height: 120px;
}

.estimate-group-rename-form,
.group-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  background: #fffde0;
  border: 1px solid #ffc762;
  border-radius: 4px;
}

.group-rename-form input[type="text"] {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  height: 26px;
  padding: 0 6px;
  width: 220px;
  font-size: 13px;
}

/* --- Note rows --- */
/* Matches .note-div22 in sw-styles.css */

.estimate-note-row {
  display: flex;
  align-items: center;
  background-color: #FCFAEC;
  border-bottom: solid 2px #b3b3b3;
  padding: 5px 8px 5px 0;
  gap: 6px;
}

.note-icon { color: #00a9db; font-size: 14px; flex-shrink: 0; font-weight: 800; }
.note-description { flex: 1; font-size: 13px; color: #555; font-style: italic; }

.estimate-note-row form { flex: 1; min-width: 0; }

.note-description-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  font-style: italic;
  padding: 0;
}

.note-description-input:hover,
.note-description-input:focus {
  border-bottom-color: #65CFEF;
  background: rgba(255,255,255,0.5);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.note-edit-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  background: #FCFAEC;
  border-left: solid 22px #65CFEF;
}

.note-edit-form input[type="text"] {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  height: 26px;
  padding: 0 6px;
  width: 320px;
  font-size: 13px;
}

/* --- Drag handle --- */

.drag-handle {
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.drag-icon {
  display: inline-block;
  transform: rotate(90deg);
}

.task-drag-handle {
  width: 22px;
  align-self: stretch;
  background-color: #80d47e;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  margin: -5px 6px -5px 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
}

.assembly-badge {
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.task-drag-handle:hover { background-color: #6abf68; }

.estimate-assembly-task-row .task-drag-handle { background-color: #898989; border-radius: 0; }
.estimate-assembly-task-row .task-drag-handle:hover { background-color: #505050; }

.task-menu-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  flex-shrink: 0;
}

.task-menu-btn {
  background: #e8e8e8;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 1.1rem;
  line-height: 1;
  color: #555;
  width: 24px;
  text-align: center;
}

.task-menu-btn:hover {
  background: #d0d0d0;
  color: #333;
}

.task-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 160px;
}

.task-menu-dropdown--open {
  display: block;
}

.task-menu-item {
  display: block;
  padding: 7px 14px;
  font-size: 0.875rem;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.task-menu-item:hover {
  background: #f0f0f0;
  text-decoration: none;
}

.note-drag-handle {
  width: 22px;
  align-self: stretch;
  background-color: #65CFEF;
  flex-shrink: 0;
  margin: -5px 2px -5px 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
}

.note-drag-handle:hover { background-color: #4bbddf; }

.group-drag-handle {
  width: 22px;
  align-self: stretch;
  background-color: #ffd383;
  flex-shrink: 0;
  margin: -9px 8px -9px 0;
  cursor: grab;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  color: #c7880e;
  font-size: 14px;
  line-height: 1;
}

.group-drag-handle:hover { background-color: #f0a830; }

.component-drag-handle {
  width: 22px;
  align-self: stretch;
  background-color: #80d47e;
  flex-shrink: 0;
  margin: -6px 8px -6px 0;
  cursor: grab;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
}

.component-drag-handle:hover { background-color: #6abf68; }

.library-trash-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: grab;
}

.library-trash-icon {
  width: 42px;
  height: auto;
  opacity: 0.7;
}

.library-trash-icon-open { display: none; }
.library-trash-zone:hover .library-trash-icon-closed,
body.dragging-to-trash   .library-trash-icon-closed { display: none; }
.library-trash-zone:hover .library-trash-icon-open,
body.dragging-to-trash   .library-trash-icon-open   { display: block; }

.drag-ghost { opacity: 0.25; }
.dragging-to-trash .drag-ghost { opacity: 0 !important; }

/* --- Add actions --- */

.estimate-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
  margin-top: 4px;
  border-top: 1px dashed #ddd;
}

.estimate-add-actions-group {
  padding: 6px 0 2px;
  margin-top: 2px;
}

/* Insert assembly picker */
.insert-assembly-picker {
  position: relative;
}

.insert-assembly-picker summary { list-style: none; cursor: pointer; }
.insert-assembly-picker summary::-webkit-details-marker { display: none; }

.insert-assembly-list {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 180px;
  padding: 4px 0;
}

.insert-assembly-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
}

.insert-assembly-option:hover { background: #f0f8ff; }

/* --- Totals footer --- */

.project-header-card {
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 26%);
  padding: 16px 20px 14px 20px;
  margin-bottom: 16px;
}

.project-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.project-header-title-area {
  flex: 1;
  min-width: 0;
}

.project-header-title-area h1 {
  margin: 0 0 6px 0;
}

.project-header-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #ebebeb;
  padding-top: 12px;
}

.project-header-bottom .btn-add {
  font-size: 15px;
  padding: 0 13px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-add--floorplans { background: #3c8dc7; }
.btn-add--floorplans:hover { background: #2e72a8; }

.project-summary-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
  gap: 16px;
}

.project-summary-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.estimate-totals-header {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px 16px;
  min-width: 320px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.estimate-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

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

.estimate-totals-price-total {
  font-size: 16px;
}

.estimate-totals-cost-total {
  font-size: 13px;
  color: #777;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 2px solid #e0e0e0 !important;
}

.estimate-totals-tax-row {
  padding-top: 6px;
}

.estimate-totals-amount-due {
  font-size: 15px;
  font-weight: bold;
  padding-top: 5px;
  margin-top: 4px;
  border-top: 2px solid #ccc;
  border-bottom: none;
}

/* --- Inline task row fields (Phase 10 autosave layout) --- */

.task-inline-body {
  flex: 1;
  min-width: 0;
}

.task-inline-description {
  padding-top: 6px;
}

.task-inline-description input[type="text"] {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  height: 24px;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 0 4px;
  margin-bottom: 6px;
}

.task-inline-description input[type="text"]:focus {
  outline: none;
  border-bottom-color: #5E97AC;
}

.task-sections-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
}

.task-inline-sections {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 16px;
}

.task-inline-section {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-section-label {
  font-size: 10px;
  font-weight: bold;
  color: #999;
  text-transform: uppercase;
  min-width: 36px;
  align-self: flex-end;
  padding-bottom: 4px;
}

.assembly-section-icon {
  align-self: flex-end;
  margin-bottom: 4px;
  margin-right: 2px;
  flex-shrink: 0;
}

.task-field-row--room {
  margin: 9px 0px 0px 0px;
}

.task-inline-section--room .task-field {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.task-inline-section--room .task-field select {
  width: 240px;
}

.task-field-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}

.task-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 54px;
}

.task-field label {
  font-size: 9px;
  color: #aaa;
  margin-bottom: 1px;
  text-transform: uppercase;
}

/* Qty number inputs — light blue from sw-styles.css #task_labor_qty_new */
.task-field input[type="number"] {
  background-color: #D7E9EC;
  border: 0;
  border-bottom: solid 1px #C2DD2E;
  border-radius: 0;
  width: 54px;
  height: 22px;
  padding: 0 4px;
  font-size: 12px;
}

/* UM / text inputs — inherit bg */
.task-field select {
  background-color: inherit;
  border: 0;
  border-bottom: solid 1px #C2DD2E;
  border-radius: 0;
  width: 54px;
  height: 22px;
  padding: 0 2px;
  font-size: 12px;
  cursor: pointer;
}

.task-field input[type="text"] {
  background-color: inherit;
  border: 0;
  border-bottom: solid 1px #C2DD2E;
  border-radius: 0;
  width: 40px;
  height: 22px;
  padding: 0 4px;
  font-size: 12px;
}

.task-field input:focus {
  outline: none;
  border-bottom-color: #5E97AC;
}

/* Computed display fields */
.task-field-computed span {
  display: inline-block;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: bold;
  min-width: 60px;
  height: 22px;
  line-height: 18px;
}

/* Direct SF input — editable number field alongside L×W dims */
.assembly-sf-input {
  width: 72px;
  font-size: 11px;
  font-weight: bold;
  text-align: right;
  padding: 2px 5px;
  height: 26px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
}
.assembly-sf-input:focus {
  outline: none;
  border-color: #5E97AC;
}

.task-inline-totals {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  align-items: flex-end;
}

.task-inline-totals > span {
  display: contents;
}

/* ============================================================
   LIBRARY EDITOR (mirrors estimate editor)
   ============================================================ */

.library-editor { margin-top: 10px; }
.library-root-children { /* same as estimate-root-children */ }

/* ============================================================
   PRINT
   ============================================================ */

.print-layout {
  background: #fff;
  color: #111;
  margin: 0;
  padding: 0;
}

.print-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 40px;
}

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 2px solid #111;
}

.print-header-left { }

.print-logo {
  display: block;
  margin-bottom: 14px;
  filter: grayscale(100%);
  opacity: 0.7;
}

.print-project-name {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px 0;
}

.print-meta-line {
  font-size: 12px;
  color: #666;
  margin: 2px 0;
}

.print-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.print-actions a {
  background: #f2f2f2;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  text-decoration: none;
  color: #333;
}

.print-estimate {
  margin-bottom: 48px;
}

.print-group {
  margin-bottom: 24px;
}

.print-group-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #555;
  padding-bottom: 6px;
  border-bottom: 1px solid #bbb;
  margin-bottom: 2px;
}

.print-group-children {
  padding-left: 16px;
}

.print-task-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 7px 0;
  border-bottom: 1px solid #eee;
}

.print-task-description {
  flex: 1;
  font-size: 13px;
  color: #111;
}

.print-task-price {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.print-note-row {
  padding: 5px 0 5px 2px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.print-totals {
  width: 340px;
  margin-left: auto;
  border-top: 1px solid #999;
  padding-top: 14px;
}

.print-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 5px 0;
  font-size: 13px;
  color: #444;
}

.print-amount-due {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid #aaa;
}

@media print {
  .no-print,
  .print-actions { display: none !important; }

  .print-page { padding: 0; max-width: none; }

  @page { margin: 0.75in; size: letter portrait; }
}

/* ============================================================
   PRINT MODE DIALOG
   ============================================================ */

.print-mode-dialog {
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  max-width: 420px;
  width: 100%;
}

.print-mode-dialog::backdrop { background: rgba(0,0,0,0.45); }

.print-mode-dialog__box { padding: 24px 28px 20px; }

.print-mode-dialog__title {
  font-size: 16px;
  font-weight: 700;
  color: #0a4394;
  margin: 0 0 25px 0;
}

.print-mode-dialog__options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.print-mode-dialog__option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

.print-mode-dialog__option:hover { background: #eef5fb; border-color: #5E97AC; text-decoration: none; }

.print-mode-dialog__option-name { font-size: 14px; font-weight: 600; color: #333; }
.print-mode-dialog__option:hover .print-mode-dialog__option-name { color: #1a5f7a; }
.print-mode-dialog__option-desc { font-size: 11px; color: #888; }

.print-mode-dialog__footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* ============================================================
   PRINT PAGE — INTERNAL / FULL MODE ADDITIONS
   ============================================================ */

.print-internal-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b00;
  border: 1px solid #b00;
  border-radius: 3px;
  padding: 2px 7px;
}

.print-col-header {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.print-col-header-desc { flex: 1; }
.print-col-header-cost, .print-col-header-price { white-space: nowrap; min-width: 80px; text-align: right; }

.print-task-cost {
  font-size: 13px;
  font-weight: 500;
  color: #888;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.print-task-row--has-components { border-bottom: none; padding-bottom: 2px; }

.print-components {
  border-left: 3px solid #d0e8f0;
  margin: 0 0 6px 12px;
  padding-left: 8px;
}

.print-component-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 3px 0;
  border-bottom: 1px dotted #eee;
}

.print-component-description { flex: 1; font-size: 12px; color: #555; font-style: italic; }

.print-component-cost, .print-component-price {
  font-size: 12px;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.print-component-cost { color: #aaa; }
.print-component-price { color: #666; }

.print-totals-row--cost { color: #888; font-size: 12px; }

@media print {
  .print-mode-dialog { display: none !important; }
}

/* ============================================================
   CHANGE ORDERS
   ============================================================ */

.co-items-list { margin-top: 12px; }

.co-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}

.co-item-task { border-left: solid 10px #80d47e; }
.co-item-group { border-left: solid 10px #ffc762; font-weight: bold; }
.co-item-note { border-left: solid 10px #65CFEF; font-style: italic; }
.co-item-description { flex: 1; }
.co-item-price { font-weight: bold; }

/* ============================================================
   DASHBOARD — matches application_home.php menu_list layout
   ============================================================ */

.dashboard-menu-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 16px;
}

/* Full-width break between rows — mirrors <div class="clearboth"> in original */
.dashboard-menu-break {
  flex-basis: 100%;
  height: 0;
}

/* Matches .menu_list: float:left, margin 50px 0 50px 50px, width 270px */
.menu-list {
  margin: 30px 0 30px 40px;
  font-size: 16px;
  width: 240px;
}

.menu-list ul {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
}

.menu-list ul li {
  margin-bottom: 4px;
}

.menu-list ul li a {
  color: #5E97AC;
  font-size: 14px;
}

.menu-list ul li a:hover {
  text-decoration: underline;
}

/* Matches .menu_label: font-size 20px, bold, color #555 */
.menu-label {
  font-size: 20px;
  font-weight: bold;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 4px;
}

/* Matches #ghosted_menu_item: dimmed, not interactive */
.ghosted-menu-item {
  color: #bbb;
  font-size: 14px;
  cursor: default;
}

/* ============================================================
   Library Management Pages
   ============================================================ */

.lib-page-section {
  margin-bottom: 32px;
  margin-top: 32px;
}

.lib-page-section h2 {
  font-size: 18px;
  font-weight: bold;
  color: #444;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.lib-count {
  font-size: 13px;
  font-weight: normal;
  color: #888;
  margin-left: 8px;
}

/* Add form — simple (notes, groups) */
.lib-add-form-simple {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lib-add-form-simple input[type="text"] {
  width: 400px;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Add form — tasks (with cost columns) */
.lib-add-form {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px 16px;
}

.lib-add-form__description input[type="text"] {
  width: 100%;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.lib-add-form__costs {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.lib-add-form__cost-group {
  flex: 1;
  min-width: 200px;
}

.lib-add-form__cost-label {
  font-size: 12px;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.lib-add-form__cost-fields {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.lib-field-num {
  width: 72px;
  font-size: 13px;
  padding: 4px 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.lib-field-um {
  width: 48px;
  font-size: 13px;
  padding: 4px 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-transform: uppercase;
}

.lib-add-form__note-row {
  margin-bottom: 10px;
}

.lib-add-form__note {
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
}

/* List rows */
.lib-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  background-color: #ffffff;
  margin: 6px 0px;
}

.lib-list-row:hover {
  background: #fafafa;
}

.lib-list-description {
  flex: 1;
  color: #333;
}

.lib-list-cost {
  width: 80px;
  text-align: right;
  color: #555;
  font-size: 13px;
}

.lib-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.lib-list-actions a {
  font-size: 13px;
}

.lib-list-actions .btn-destroy {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.lib-list-actions .btn-destroy:hover {
  text-decoration: underline;
}

/* ============================================================
   Utility
   ============================================================ */

.hidden { display: none !important; }

/* ============================================================
   Floorplans — index
   ============================================================ */

.floorplan-upload-btn {
  margin-bottom: 0;
}

.floorplans-index-actions {
  margin-bottom: 16px;
}

.floorplans-index-btn {
  font-size: 15px;
  padding: 0 13px;
  height: 34px;
  display: inline-flex;
  align-items: center;
}

.floorplans-upload {
  margin-bottom: 24px;
}

.floorplans-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.floorplan-name-input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  width: 220px;
}

.floorplan-file-input {
  font-size: 14px;
}

.floorplans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.floorplan-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.floorplan-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.floorplan-card-link:hover { background: #f9f9f9; }

.floorplan-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.floorplan-thumb-placeholder {
  width: 100%;
  height: 150px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
}
.floorplan-thumb-placeholder--converting {
  background: #eff6ff;
  color: #3b82f6;
  font-style: italic;
}
.floorplan-thumb-placeholder--failed {
  background: #fef2f2;
  color: #ef4444;
}

.floorplan-card-label {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.floorplan-card-name {
  font-weight: 600;
  font-size: 14px;
}

.floorplan-card-count {
  font-size: 12px;
  color: #6b7280;
}

.floorplan-card-actions {
  display: flex;
  gap: 6px;
  margin: 0 10px 10px;
}

.floorplan-card-open {
  font-size: 12px;
  padding: 4px 10px;
  background: #3c8dc7;
  line-height: 1.6;
  width: 70px;
  text-align: center;
  display: inline-block;
}

.floorplan-card-open:hover { background: #2f72a8; color: #fff; text-decoration: none; }

.floorplan-card-delete {
  font-size: 12px;
  padding: 4px 10px;
}

.floorplans-empty {
  color: #6b7280;
  font-size: 14px;
  margin-top: 16px;
}

/* ============================================================
   Floorplans — editor
   ============================================================ */

.floorplan-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floorplan-editor__main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Room inventory sidebar — fixed single column, full viewport height */
.floorplan-room-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  background: #ececec;
  border-left: 1px solid #d0d0d0;
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.25);
  z-index: 150;
  transition: width 0.25s ease;
  overflow: hidden;
}

.floorplan-editor.rooms-open .floorplan-room-sidebar {
  width: 220px;
}

.floorplan-room-sidebar__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  flex-shrink: 0;
  border-bottom: 1px solid #d0d0d0;
  background: #e8e8e8;
  cursor: pointer;
}
.floorplan-room-sidebar__top:hover {
  background: #d4d4d4;
}

.floorplan-room-sidebar__toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  padding: 2px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.floorplan-editor.rooms-open .floorplan-room-sidebar__toggle {
  transform: scaleX(-1);
}

.floorplan-room-sidebar__count-row {
  padding: 6px;
}

.floorplan-room-sidebar__count {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  box-sizing: border-box;
  background: #434953;
  color: #ffffff;
}

.floorplan-room-sidebar__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 220px;
  padding-bottom: 50px;
}

.floorplan-room-sidebar__header {
  margin-top: 12px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #d8d8d8;
  background: #e8e8e8;
  white-space: nowrap;
}

.floorplan-room-sidebar__list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Push floorplan page content left to avoid sidebar overlap */
.main-content-floorplan-editor .main-content__body {
  padding-right: 64px;
}

.floorplan-room-list__item {
  display: flex;
  flex-direction: column;
}

.room-drag-handle {
  cursor: grab;
  padding: 4px 5px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 2px;
  user-select: none;
  flex-shrink: 0;
}

.room-drag-handle:active {
  cursor: grabbing;
}

.floorplan-room-list__name-row {
  display: flex;
  align-items: center;
  background: #4875bd;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.floorplan-room-list__name-row:hover {
  background: #3a63a8;
}

.floorplan-room-list__name-btn {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: none;
  font-size: 13px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.floorplan-room-list__name-arrow {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 8px 6px 0;
  flex-shrink: 0;
  line-height: 1;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.floorplan-room-list__item.active .floorplan-room-list__name-row {
  background: #dbeafe;
}

.floorplan-room-list__item.active .floorplan-room-list__name-btn,
.floorplan-room-list__item.active .floorplan-room-list__name-arrow {
  color: #1e40af;
  font-weight: 600;
}

.floorplan-room-list__fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  border-top: none;
}

.floorplan-room-list__item.fields-open .floorplan-room-list__name-row {
  border-radius: 4px 4px 0 0;
  background-color: #e78f02;
}

.floorplan-room-list__item.fields-open .floorplan-room-list__name-btn,
.floorplan-room-list__item.fields-open .floorplan-room-list__name-arrow {
  color: white;
}

.floorplan-room-list__item.fields-open .floorplan-room-list__fields {
  max-height: 500px;
}

.floorplan-room-list__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0px 8px 0px 8px;
  margin-top: 15px;
}

.floorplan-room-list__field:last-child {
  padding-bottom: 8px;
}

.floorplan-room-list__field-label {
  font-size: 10px;
  color: #363636;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.floorplan-room-list__field-input {
  border: 1px solid #c7d2f0;
  border-radius: 3px;
  padding: 6px 6px;
  font-size: 12px;
  background: #fff;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.floorplan-room-list__field-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.floorplan-room-list__field-input--textarea {
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  background: linear-gradient(to bottom, #e8f4fd, #cde6f7);
  min-height: 70px;
  box-shadow: 0 2px 8px rgba(80, 140, 200, 0.48);
}

.room-inventory-metadata-spacer {
  height: 28px;
}

.floorplan-room-list__sf-value {
  font-size: 12px;
  color: #181818;
  padding: 5px 6px;
  background: #dadada;
  border-radius: 3px;
  font-weight: 600;
}

.floorplan-room-list__estimate-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  font-size: 12px;
  color: #000000;
  padding: 5px 6px;
  background: #ffd139;
  border-radius: 3px;
  font-weight: 600;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

.floorplan-room-list__estimate-link:hover {
  background: #fbdb71;
  color: #000000;
  text-decoration: none;
}

.floorplan-editor__toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.floorplan-editor__toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.floorplan-editor__toolbar-row + .floorplan-editor__toolbar-row {
  border-top: 1px solid #b8b8b8;
  padding-top: 15px;
}

.floorplan-editor__toolbar .btn-add {
  font-size: 15px;
  padding: 0 13px;
  height: 34px;
  display: inline-flex;
  align-items: center;
}

.floorplan-editor__toolbar-row:last-child .btn-add {
  background: #d5d5d5;
  color: #222222;
}

.floorplan-editor__toolbar-row:last-child .btn-add[data-floorplan-editor-target="expressModeBtn"]:hover {
  background: #3a9c4e;
  color: #ffffff;
}

.floorplan-editor__toolbar-row:last-child .btn-add[data-floorplan-editor-target="expressModeBtn"].active {
  background: #3a9c4e;
  color: #ffffff;
}

.floorplan-editor__toolbar-row:last-child .btn-add[data-floorplan-editor-target="expressModeBtn"].active:hover {
  background: #2e7d3e;
  color: #ffffff;
}

.floorplan-mode-btn--delete {
  background: #d9534f !important;
  color: #ffffff !important;
}

.floorplan-mode-btn--delete:hover {
  background: #b52b27 !important;
  color: #ffffff !important;
}


.floorplan-mode-btn.active,
.floorplan-editor__toolbar-row:last-child .floorplan-mode-btn.active {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.floorplan-editor__toolbar-row:last-child .btn-add[data-floorplan-editor-target="modeScaleBtn"].active {
  background: #f5c400;
  color: #000000;
  border-color: #f5c400;
}


.floorplan-modal__extra-row {
  margin-top: 8px;
}

.floorplan-modal__notes-input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.4;
}

.floorplan-modal__ceiling-row {
  margin-top: 8px;
}

.floorplan-modal__ceiling-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #555;
}

.floorplan-modal__ceiling-input {
  width: 100px;
}

.floorplan-scale-badge {
  margin-left: 8px;
}

.floorplan-canvas-divider {
  height: 2px;
  background: #878787;
  margin: 10px 0px 11px 0px;
}

.floorplan-editor__canvas-wrapper {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  background: #f9f9f9;
  width: 100%;
}

.floorplan-editor__canvas-wrapper canvas {
  display: block;
}

/* Modal overlay */
.floorplan-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.floorplan-modal__box {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  min-width: 680px;
  max-width: 960px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.floorplan-modal__prompt {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 500;
}

.floorplan-modal__input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.floorplan-modal__description-input {
  height: 135px;
  resize: vertical;
  border: none;
  outline: none;
  background: linear-gradient(to bottom, #e8f4fd, #cde6f7);
  box-shadow: 0 2px 8px rgba(80, 140, 200, 0.28);
  font-family: inherit;
}

.floorplan-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.floorplan-modal__actions .btn-add {
  margin-bottom: 0;
  padding: 6px 14px;
}

/* Room link icon button (assembly row → floorplan) */
.btn-room-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #e78f02;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  color: #ffffff;
  font-weight: 700;
  padding: 0;
  flex-shrink: 0;
}
.btn-room-link:hover { background: #cf8002; }

/* Create Estimate button + Project Description section in sidebar */
.floorplan-room-sidebar__actions {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-create-estimate {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 13px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  background: #2e7d32;
  color: #fff;
}
.btn-create-estimate:hover {
  background: #1b5e20;
}

.floorplan-project-desc__toggle {
  width: 100%;
  text-align: center;
  background: #f9c826;
  border: none;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  margin-top: 6px;
}
.floorplan-project-desc__toggle:hover {
  background: #fbc02d;
}
.floorplan-project-desc__body.hidden {
  display: none;
}
.floorplan-project-desc__textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  min-height: 80px;
  background: #fafafa;
  color: #333;
}

/* Estimate generation modal */
.estimate-gen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.estimate-gen-modal.hidden { display: none; }
.estimate-gen-modal__box {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  width: 560px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.estimate-gen-modal__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.estimate-gen-modal__warning {
  background: #fff8e1;
  border: 1px solid #f5c400;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: #7a5700;
}
.estimate-gen-modal__warning.hidden { display: none; }
.estimate-gen-modal__label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.estimate-gen-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.estimate-gen-modal__rooms-header {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}
.estimate-gen-modal__room-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 6px 10px;
  background: #f9f9f9;
}
.estimate-gen-modal__room-item {
  font-size: 12px;
  color: #444;
  padding: 3px 0;
  border-bottom: 1px solid #efefef;
}
.estimate-gen-modal__room-item:last-child { border-bottom: none; }
.estimate-gen-modal__error {
  color: #c0392b;
  font-size: 13px;
}
.estimate-gen-modal__error.hidden { display: none; }
.estimate-gen-modal__actions {
  display: flex;
  gap: 10px;
}
.btn-modal-generate,
.btn-modal-cancel {
  font-size: 15px;
  padding: 0 13px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-modal-generate {
  background: #4a90d9;
  color: #fff;
}
.btn-modal-generate:hover {
  background: #3a7bc8;
  color: #fff;
}
.btn-modal-cancel {
  background: #d5d5d5;
  color: #222;
}
.btn-modal-cancel:hover {
  background: #c0c0c0;
  color: #222;
}

/* Estimate generation loading overlay */
.estimate-gen-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}
.estimate-gen-loading.hidden { display: none; }
.estimate-gen-loading__box {
  background: #fff;
  border-radius: 8px;
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.estimate-gen-loading__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #4875bd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.estimate-gen-loading__sub { font-size: 13px; color: #888; margin: 0; }

/* Assembly task highlight on arrival from floorplan */
.estimate-task-row--highlighted {
  animation: task-highlight-pulse 6s ease-out forwards;
}
@keyframes task-highlight-pulse {
  0%   { background: #fffbe6; box-shadow: 0 0 0 3px #f59e0b; }
  60%  { background: #fffbe6; box-shadow: 0 0 0 3px #f59e0b; }
  100% { background: transparent; box-shadow: none; }
}
