/*
File Version: 1.2026.06.25.01
Last Updated: 2026-06-25 00:00 local time
Updated By: Suresh Jat
Purpose: Shared Phoenix Estimate application styling.

Changed By: Suresh Jat
Changed On: 2026-05-16 10:53 local time
Reason: Added full-window Estimate workspace styles without application header or menu chrome.

Changed By: Suresh Jat
Changed On: 2026-05-16 12:08 local time
Reason: Improved Project Summary collapse rail and hover styling.

Changed By: Suresh Jat
Changed On: 2026-05-16 12:35 local time
Reason: Highlighted key Project Summary totals and reclaimed Takeoff grid header space.

Changed By: Suresh Jat
Changed On: 2026-05-16 17:02 local time
Reason: Extended the Project Summary collapse rail and styled Takeoff plus/minus expand controls.

Changed By: Suresh Jat
Changed On: 2026-05-16 17:02 local time
Reason: Added Reports tab icon grid and popup report viewer styling.

Changed By: Suresh Jat
Changed On: 2026-05-16 18:12 local time
Reason: Matched Reports tab icon styling to Home page themed SVG icon behavior.

Changed By: Suresh Jat
Changed On: 2026-05-25 00:00 local time
Reason: Added Estimate Adjustments tab layout and dirty-state styling.

Changed By: Suresh Jat
Changed On: 2026-05-25 00:00 local time
Reason: Stretched Estimate tab panels to fill the workspace height and avoid exposed page background below shorter tab content.

Changed By: Suresh Jat
Changed On: 2026-05-25 00:00 local time
Reason: Kept stretched Estimate tab panels top-aligned so short tab contents do not center vertically.

Changed By: Suresh Jat
Changed On: 2026-05-28 11:16 local time
Reason: Added image icon styling for the top Estimate toolbar buttons.

Changed By: Suresh Jat
Changed On: 2026-05-28 11:27 local time
Reason: Slightly increased Estimate icon button and toolbar image sizes.

Changed By: Suresh Jat
Changed On: 2026-05-28 12:00 local time
Reason: Added themed Project Summary logo panel using legacy application name and version data.

Changed By: Suresh Jat
Changed On: 2026-05-28 12:12 local time
Reason: Adjusted the Project Summary logo panel to match the legacy Estimate page composition.

Changed By: Suresh Jat
Changed On: 2026-05-28 12:24 local time
Reason: Center-aligned Project Summary logo panel text.

Changed By: Suresh Jat
Changed On: 2026-06-24 00:00 local time
Reason: Added Price List Management estimate priced item grid styling.

Changed By: Suresh Jat
Changed On: 2026-06-24 00:00 local time
Reason: Used Item Number as the price item row selector and removed manual Save styling needs.

Changed By: Suresh Jat
Changed On: 2026-06-24 00:00 local time
Reason: Added Price List Management selection, create modal, and price sheet popup grid styling.

Changed By: Suresh Jat
Changed On: 2026-06-24 00:00 local time
Reason: Matched Price List action buttons to the current app toolbar button styling.

Changed By: Suresh Jat
Changed On: 2026-06-25 00:00 local time
Reason: Added Administration Company Information form and image library picker styling.

*/
:root {
  --bg: #f5f7fb;
  --bg-accent: #dbeafe;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef3f8;
  --card: #ffffff;
  --card-strong: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --border: #d8e0ea;
  --border-strong: #bcc9d8;
  --primary: #4ca3dd;
  --primary-strong: #2f83ba;
  --primary-soft: rgba(76, 163, 221, 0.18);
  --success: #1c9b6d;
  --danger: #d05b66;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --nav-width: 310px;
  --menu-icon-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5h16v3H4V5Zm0 5.5h16v3H4v-3ZM4 16h16v3H4v-3Z'/%3E%3C/svg%3E");
  --menu-icon-new: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 3v8h8v2h-8v8h-2v-8H3v-2h8V3h2Z'/%3E%3C/svg%3E");
  --menu-icon-open: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6.5A2.5 2.5 0 0 1 5.5 4H10l2 2h6.5A2.5 2.5 0 0 1 21 8.5V10H6.7l-2.1 8H19l1.6-6H23l-2.2 8.2A2.5 2.5 0 0 1 18.4 22H4.6A2.6 2.6 0 0 1 2 19.4V6.5Z'/%3E%3C/svg%3E");
  --menu-icon-import: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.2l3.6-3.6L18 11l-6 6-6-6 1.4-1.4 3.6 3.6V3ZM4 19h16v2H4v-2Z'/%3E%3C/svg%3E");
  --menu-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 3h11v13h-2V5H8V3ZM5 7h10v14H5V7Zm2 2v10h6V9H7Z'/%3E%3C/svg%3E");
  --menu-icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m19.4 13.5 1.6 1.2-2 3.5-1.9-.8a7.5 7.5 0 0 1-1.7 1l-.3 2.1h-4l-.3-2.1a7.5 7.5 0 0 1-1.7-1l-1.9.8-2-3.5 1.6-1.2a7.2 7.2 0 0 1 0-2l-1.6-1.2 2-3.5 1.9.8a7.5 7.5 0 0 1 1.7-1l.3-2.1h4l.3 2.1a7.5 7.5 0 0 1 1.7 1l1.9-.8 2 3.5-1.6 1.2a7.2 7.2 0 0 1 0 2ZM13 15.5a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/%3E%3C/svg%3E");
  --menu-icon-style: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a9 9 0 0 0 0 18h1.4a2 2 0 0 0 1.5-3.3 1.5 1.5 0 0 1 1.1-2.5h1.7A3.3 3.3 0 0 0 21 12 9 9 0 0 0 12 3ZM7.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm6 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E");
  --menu-icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 10V8a5 5 0 0 1 10 0v2h2v11H5V10h2Zm2 0h6V8a3 3 0 0 0-6 0v2Zm2 4v3h2v-3h-2Z'/%3E%3C/svg%3E");
  --menu-icon-recent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a9 9 0 1 1-8.5 6h2.2A7 7 0 1 0 12 5a7 7 0 0 0-5 2H10v2H3V2h2v3.4A9 9 0 0 1 12 3Zm1 4v5l4 2-1 1.7-5-2.7V7h2Z'/%3E%3C/svg%3E");
  --menu-icon-report: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14v18H5V3Zm3 4v2h8V7H8Zm0 4v2h8v-2H8Zm0 4v2h5v-2H8Z'/%3E%3C/svg%3E");
  --menu-icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0 2c3.3 0 6 1.8 6 4v2H3v-2c0-2.2 2.7-4 6-4Zm7.5-1.5a3 3 0 1 1 0-6 3 3 0 0 1 0 6Zm0 1.5c2.5 0 4.5 1.4 4.5 3.1V18h-4v-1c0-1.3-.7-2.6-1.9-3.6.4-.2.9-.4 1.4-.4Z'/%3E%3C/svg%3E");
  --menu-icon-price: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5h16v4H4V5Zm0 6h16v8H4v-8Zm3 2v4h5v-4H7Zm8 0v1.5h3V13h-3Zm0 3.5H18V15h-3v1.5Z'/%3E%3C/svg%3E");
  --menu-icon-rule: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v6c0 5 3.8 8.6 9 10 5.2-1.4 9-5 9-10V6l-9-4Zm1 5v4h4v2h-4v4h-2v-4H7v-2h4V7h2Z'/%3E%3C/svg%3E");
  --menu-icon-company: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 21V3h10v6h6v12h-6v-4h-4v4H4Zm3-14v2h2V7H7Zm0 4v2h2v-2H7Zm0 4v2h2v-2H7Zm5-8v2h2V7h-2Zm0 4v2h2v-2h-2Zm4 2v2h2v-2h-2Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  --bg: #f5f7fb;
  --bg-accent: #dbeafe;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef3f8;
  --card: #ffffff;
  --card-strong: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --border: #d8e0ea;
  --border-strong: #bcc9d8;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 10px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
code { font-family: Consolas, monospace; font-size: .92em; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-shell { width: min(980px, 100%); }
.login-card { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2rem; align-items: center; }
.login-logo-wrap { display: grid; place-items: center; }
.login-logo { width: min(360px, 100%); filter: drop-shadow(0 25px 45px rgba(0,0,0,.35)); }
.login-panel, .panel-card, .hero-card, .toolbar-card, .table-card, .sidebar, .success-banner, .topbar, .global-toolbar, .app-nav { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--radius); }
.login-panel { padding: 2rem; }

.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--muted); margin-bottom: .5rem; }
h1, h2 { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.form-grid { display: grid; gap: 1rem; }
.form-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
label { display: inline-block; margin-bottom: .4rem; font-size: .92rem; }
.input, select, button { font: inherit; }
.input, select { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem; }
.input:focus, select:focus, .nav-toggle:focus, .splitter:focus { outline: 2px solid color-mix(in srgb, var(--primary) 70%, white); outline-offset: 2px; }
.btn { border: none; border-radius: 8px; padding: .65rem .9rem; cursor: pointer; font-weight: 700; transition: transform .12s ease, opacity .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, var(--primary), var(--primary-strong)); color: #fff; }
.btn-secondary { background: color-mix(in srgb, var(--surface-2) 88%, transparent); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.inline-row, .checkbox-row, .topbar-actions, .hero-actions, .card-title-row { display: flex; align-items: center; gap: 1rem; }
.inline-row { justify-content: space-between; }
.checkbox-row.compact { margin: 0; white-space: nowrap; }
.link-muted { color: var(--muted); }
.validation { color: #ffadb5; font-size: .85rem; }
.alert-banner, .success-banner { padding: .95rem 1rem; margin-bottom: 1rem; }
.alert-banner {
    color: #721c24;
    background: rgba(208,91,102,.14);
    border: 1px solid rgba(208,91,102,.35);
    border-radius: 14px;
}
.success-banner { color: #fff; background: color-mix(in srgb, var(--success) 88%, #123 12%); border: 1px solid color-mix(in srgb, var(--success) 68%, #fff 32%); }
.alert-banner.is-hidden,
.success-banner.is-hidden { display: none; }

.app-shell { min-height: 100vh; padding: .75rem; }
.full-window-page {
  overflow: auto;
}
.full-window-shell {
  padding: .45rem;
}
.full-window-content {
  min-height: calc(100vh - .9rem);
}
.topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: linear-gradient(360deg, var(--primary), var(--primary-strong)); color: #fff; padding: .55rem 1rem; margin-bottom: .75rem; min-height: 3.2rem; }
.topbar .muted,
.topbar .eyebrow { color: rgba(255,255,255,.78); }
.brand-title { font-size: 1.45rem; font-weight: 800; }
.topbar-actions {
  gap: .55rem;
}
.topbar-app-button {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: .22rem;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .16);
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.topbar-app-button:hover,
.topbar-app-button:focus-visible {
  background: #fff;
  border-color: rgba(255, 255, 255, .78);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, .22);
}
.topbar-app-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .86);
  outline-offset: 2px;
}
.topbar-app-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.classic-app-button {
  color: var(--primary-strong);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}
.jobordo-button {
  width: 6rem;
  padding-inline: .38rem;
}
.user-chip { color: #fff; font-weight: 700; text-shadow: 0 1px 1px rgba(15, 23, 42, .18); }
.global-toolbar { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .65rem .75rem; margin-bottom: .75rem; background: var(--card-strong); }
.sticky-toolbar { position: sticky; top: .8rem; z-index: 30; }
.search-feedback-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(245, 247, 251, .62);
  backdrop-filter: blur(1px);
}
.search-feedback-layer[hidden] { display: none; }
.search-feedback-layer img {
  width: min(560px, 88vw);
  height: auto;
  border-radius: 8px;
  filter: drop-shadow(0 14px 30px rgba(15, 23, 42, .18));
}
.global-search-form { display: flex; align-items: center; gap: .8rem; flex: 1; flex-wrap: wrap; }
.search-input { max-width: 420px; }
.toolbar-icon-button {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--primary-strong);
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, filter .15s ease;
}
.toolbar-icon-button:hover,
.toolbar-icon-button:focus-visible {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  color: var(--primary-strong);
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, .14));
}
.toolbar-icon-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 2px;
}
.toolbar-icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-toolbar-button svg {
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
}
.home-toolbar-button .home-icon-path {
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(1px 0 0 var(--text))
    drop-shadow(-1px 0 0 var(--text))
    drop-shadow(0 1px 0 var(--text))
    drop-shadow(0 -1px 0 var(--text));
}
.classic-toolbar {
  align-items: stretch;
  flex-wrap: wrap;
  padding: 0;
  gap: .5rem;
  overflow: visible;
}
.classic-toolbar .global-search-form {
  justify-content: flex-end;
  padding: .4rem .5rem;
}
.classic-toolbar > .btn,
.classic-toolbar > .toolbar-icon-button {
  align-self: center;
  margin-right: .5rem;
}
.classic-menu {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  min-height: 2.25rem;
  position: relative;
  z-index: 35;
}
.classic-menu-item,
.classic-submenu-item {
  position: relative;
}
.classic-menu-link,
.classic-submenu-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.25rem;
  padding: .45rem .7rem;
  color: var(--text);
  white-space: nowrap;
}
.classic-menu-link:hover,
.classic-menu-link:focus-visible,
.classic-menu-link.active,
.classic-submenu-link:hover,
.classic-submenu-link:focus-visible,
.classic-submenu-link.active {
  background: var(--primary-soft);
  color: var(--text);
}
.classic-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 13rem;
  padding: .25rem 0;
  background: var(--card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  z-index: 80;
}
.classic-submenu.flyout {
  top: -.25rem;
  left: 100%;
}
.classic-menu-item:hover > .classic-submenu,
.classic-menu-item:focus-within > .classic-submenu,
.classic-submenu-item:hover > .classic-submenu,
.classic-submenu-item:focus-within > .classic-submenu {
  display: block;
}
.classic-submenu-link::before {
  content: '';
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  background-color: var(--primary);
  -webkit-mask: var(--menu-icon, var(--menu-icon-default)) center / contain no-repeat;
  mask: var(--menu-icon, var(--menu-icon-default)) center / contain no-repeat;
}
.classic-submenu-link[data-menu-key^='recent-'] { --menu-icon: var(--menu-icon-recent); }
.classic-submenu-item:has(.flyout) > .classic-submenu-link::after {
  content: '>';
  margin-left: auto;
  color: var(--muted);
}
.app-body-shell { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); gap: .75rem; align-items: start; transition: grid-template-columns .18s ease; }
.app-body-shell.classic-body-shell {
  display: block;
}
.app-nav { position: sticky; top: 7.4rem; width: var(--nav-width); max-height: calc(100vh - 9rem); overflow: hidden; transition: width .18s ease, padding .18s ease, opacity .18s ease, box-shadow .18s ease; padding: 1rem; z-index: 25; }
.app-nav-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.nav-title { margin: 0; }
.nav-toggle { border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 88%, transparent); color: var(--text); border-radius: 8px; width: 2.25rem; height: 2.25rem; cursor: pointer; }
.app-nav-scroll { overflow: auto; max-height: calc(100vh - 13rem); padding-right: .2rem; }
:is(html, body).nav-collapsed { --nav-width: 44px; }
:is(html, body).nav-collapsed .app-body-shell { gap: .5rem; }
:is(html, body).nav-collapsed .app-nav { padding: .35rem; border-radius: 8px; }
:is(html, body).nav-collapsed .app-nav:hover,
:is(html, body).nav-collapsed .app-nav:focus-within {
  width: 280px;
  padding: .85rem;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
}
:is(html, body).nav-collapsed .menu-group-title,
:is(html, body).nav-collapsed .menu-nested,
:is(html, body).nav-collapsed .nav-title,
:is(html, body).nav-collapsed .menu-link { font-size: 0; }
:is(html, body).nav-collapsed .app-nav-header { justify-content: center; margin-bottom: .35rem; }
:is(html, body).nav-collapsed .nav-toggle { width: 2rem; height: 2rem; border-radius: 7px; }
:is(html, body).nav-collapsed .app-nav-scroll { overflow: hidden; max-height: calc(100vh - 11rem); padding-right: 0; }
:is(html, body).nav-collapsed .menu-group + .menu-group { margin-top: .25rem; }
:is(html, body).nav-collapsed .menu-link { display: grid; place-items: center; padding: 0; min-height: 32px; border-radius: 7px; }
:is(html, body).nav-collapsed .menu-link::before { content: ''; width: 1rem; height: 1rem; background-color: var(--primary); }
:is(html, body).nav-collapsed .menu-link.active::before { background-color: var(--primary-strong); }
:is(html, body).nav-collapsed .menu-group-title { margin-bottom: .15rem; }
:is(html, body).nav-collapsed .app-nav:hover .app-nav-header,
:is(html, body).nav-collapsed .app-nav:focus-within .app-nav-header { justify-content: space-between; margin-bottom: .75rem; }
:is(html, body).nav-collapsed .app-nav:hover .nav-title,
:is(html, body).nav-collapsed .app-nav:focus-within .nav-title,
:is(html, body).nav-collapsed .app-nav:hover .menu-group-title,
:is(html, body).nav-collapsed .app-nav:focus-within .menu-group-title,
:is(html, body).nav-collapsed .app-nav:hover .menu-link,
:is(html, body).nav-collapsed .app-nav:focus-within .menu-link { font-size: inherit; }
:is(html, body).nav-collapsed .app-nav:hover .menu-link,
:is(html, body).nav-collapsed .app-nav:focus-within .menu-link {
  display: flex;
  padding: .65rem .75rem;
  min-height: 0;
}
:is(html, body).nav-collapsed .app-nav:hover .menu-link::before,
:is(html, body).nav-collapsed .app-nav:focus-within .menu-link::before {
  content: '';
}
:is(html, body).nav-collapsed .app-nav:hover .menu-nested,
:is(html, body).nav-collapsed .app-nav:focus-within .menu-nested {
  display: block;
  font-size: inherit;
}
:is(html, body).nav-collapsed .app-nav:hover .app-nav-scroll,
:is(html, body).nav-collapsed .app-nav:focus-within .app-nav-scroll {
  overflow: auto;
  max-height: calc(100vh - 13rem);
  padding-right: .2rem;
}
.authenticated-page { min-width: 0; }
.page-body { display: block; }
.workspace { display: grid; grid-template-columns: 310px 1fr; gap: 1.25rem; }
.sidebar { padding: 1rem; }
.sidebar-section + .sidebar-section { margin-top: 1.25rem; }
.section-title { font-size: .88rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.menu-group + .menu-group { margin-top: 1rem; }
.menu-group-title { font-weight: 700; margin-bottom: .55rem; }
.menu-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem .8rem;
  border-radius: 12px;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.menu-link::before {
  content: '';
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  background-color: var(--primary);
  opacity: .95;
  -webkit-mask: var(--menu-icon, var(--menu-icon-default)) center / contain no-repeat;
  mask: var(--menu-icon, var(--menu-icon-default)) center / contain no-repeat;
}
.menu-link[data-menu-key='new'],
.classic-submenu-link[data-menu-key='new'] { --menu-icon: var(--menu-icon-new); }
.menu-link[data-menu-key='open'],
.classic-submenu-link[data-menu-key='open'] { --menu-icon: var(--menu-icon-open); }
.menu-link[data-menu-key='import'],
.classic-submenu-link[data-menu-key='import'] { --menu-icon: var(--menu-icon-import); }
.menu-link[data-menu-key='copy'],
.classic-submenu-link[data-menu-key='copy'] { --menu-icon: var(--menu-icon-copy); }
.menu-link[data-menu-key='settings'],
.classic-submenu-link[data-menu-key='settings'],
.menu-link[data-menu-key='app-defaults'],
.classic-submenu-link[data-menu-key='app-defaults'],
.menu-link[data-menu-key='site-settings'],
.classic-submenu-link[data-menu-key='site-settings'],
.menu-link[data-menu-key='pricelist-management'],
.classic-submenu-link[data-menu-key='pricelist-management'] { --menu-icon: var(--menu-icon-settings); }
.menu-link[data-menu-key='app-style'],
.classic-submenu-link[data-menu-key='app-style'] { --menu-icon: var(--menu-icon-style); }
.menu-link[data-menu-key='change-password'],
.classic-submenu-link[data-menu-key='change-password'],
.menu-link[data-menu-key='password-policy'],
.classic-submenu-link[data-menu-key='password-policy'] { --menu-icon: var(--menu-icon-lock); }
.menu-link[data-menu-key='recent'],
.classic-submenu-link[data-menu-key='recent'] { --menu-icon: var(--menu-icon-recent); }
.menu-link[data-menu-key='system-reports'],
.classic-submenu-link[data-menu-key='system-reports'] { --menu-icon: var(--menu-icon-report); }
.menu-link[data-menu-key='users'],
.classic-submenu-link[data-menu-key='users'] { --menu-icon: var(--menu-icon-users); }
.menu-link[data-menu-key='price-lists'],
.classic-submenu-link[data-menu-key='price-lists'],
.menu-link[data-menu-key='estimate-priced-items'],
.classic-submenu-link[data-menu-key='estimate-priced-items'] { --menu-icon: var(--menu-icon-price); }
.menu-link[data-menu-key='rule-engine'],
.classic-submenu-link[data-menu-key='rule-engine'] { --menu-icon: var(--menu-icon-rule); }
.menu-link[data-menu-key='company'],
.classic-submenu-link[data-menu-key='company'] { --menu-icon: var(--menu-icon-company); }
.menu-link:hover, .folder-row:hover, .home-tree-link:hover { background: color-mix(in srgb, var(--surface-3) 84%, transparent); color: var(--text); }
.menu-link.active { background: var(--primary-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border)); }
.menu-link:hover::before,
.menu-link.active::before { background-color: var(--primary-strong); opacity: 1; }
.menu-nested { padding-left: .65rem; }
.menu-link.nested { font-size: .92rem; }
.folder-row { display: flex; justify-content: space-between; align-items: center; padding: .75rem .8rem; border-radius: 12px; }
.folder-row.selected { background: var(--primary-soft); color: #fff; }
.folder-count { color: var(--muted); font-size: .85rem; }
.content-area { display: grid; gap: 1.25rem; min-width: 0; }
.hero-card, .toolbar-card, .table-card, .panel-card { padding: 1rem; }
.hero-card { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-left: 4px solid var(--primary); }
.hero-card.compact { margin-bottom: 1rem; }
.toolbar-card { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.data-table th, .data-table td { padding: .95rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th {
  color: var(--text);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: color-mix(in srgb, var(--card-strong) 88%, var(--primary-soft));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.data-table th:first-child { border-top-left-radius: 8px; }
.data-table th:last-child { border-top-right-radius: 8px; }
.data-table .home-icon-column {
  width: 3.35rem;
  min-width: 3.35rem;
  padding-right: .35rem;
}
.data-table .home-icon-cell {
  width: 3.35rem;
  min-width: 3.35rem;
  padding: .48rem .35rem .48rem 1rem;
}
.home-record-icon {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--primary);
  border-radius: 8px;
  transition: color .15s ease, background .15s ease, transform .15s ease, filter .15s ease;
}
.home-record-icon svg {
  width: 2rem;
  height: 2rem;
  display: block;
  overflow: visible;
}
.home-record-icon:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, .18));
}
.clickable-row:hover .home-record-icon {
  color: var(--primary-strong);
}
.sort-header {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  white-space: nowrap;
  min-height: 1.55rem;
  padding: .15rem .35rem;
  margin: -.15rem -.35rem;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.sort-header::after {
  content: '';
  width: 0;
  height: 0;
  border-left: .28rem solid transparent;
  border-right: .28rem solid transparent;
  opacity: 0;
}
.sort-header:hover,
.sort-header:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--primary-soft) 76%, transparent);
}
.sort-header.active {
  color: var(--primary-strong);
  background: var(--primary-soft);
}
.sort-header.active.asc::after {
  border-bottom: .42rem solid currentColor;
  opacity: 1;
}
.sort-header.active.desc::after {
  border-top: .42rem solid currentColor;
  opacity: 1;
}
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--surface-3); }
.bom-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: -2px;
}
.status-pill { display: inline-flex; padding: .35rem .65rem; border-radius: 999px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.empty-state-cell { text-align: center; color: var(--muted); }
.settings-tabs {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.settings-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: .65rem 1rem;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}
.settings-tab:hover { background: color-mix(in srgb, var(--surface-3) 84%, transparent); color: var(--text); }
.settings-tab.active { background: var(--primary-soft); color: var(--text); border-color: color-mix(in srgb, var(--primary) 36%, var(--border)); }
.panel-card > h1:first-child,
.panel-card > h2:first-child,
.table-card > h1:first-child,
.table-card > h2:first-child {
  margin: -1rem -1rem 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 70%, var(--card)), var(--surface-2));
  font-size: 1.05rem;
}
.settings-grid { display: grid; grid-template-columns: minmax(18rem, 1.2fr) minmax(14rem, .8fr); gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
.preview-card { display: grid; place-items: start center; min-width: 0; }
.style-preview.estimate-summary-brand { width: min(100%, 17rem); min-height: 25rem; margin: 0; }
.style-preview.estimate-summary-brand img { width: min(92%, 13rem); }
.settings-page .settings-default-form {
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 0;
}
.settings-page .settings-default-form .btn {
  justify-self: start;
  min-width: 9.5rem;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(230px, 1fr) minmax(260px, 1.1fr) minmax(220px, .95fr);
  gap: 1rem;
  align-items: end;
}
.settings-form-grid label,
.settings-form-grid .settings-check span {
  white-space: nowrap;
}
.settings-check {
  min-height: 2.75rem;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
}
.company-selector-form {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(14rem, 20rem);
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.company-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.company-wide {
  grid-column: 1 / -1;
}
.company-image-section {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) auto;
  gap: 1rem;
  align-items: end;
}
.company-image-preview {
  display: grid;
  place-items: center;
  width: min(100%, 18rem);
  aspect-ratio: 16 / 9;
  margin: .45rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  overflow: hidden;
}
.company-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.company-image-empty {
  color: var(--muted);
  font-weight: 700;
}
.company-image-actions {
  display: flex;
  align-items: center;
  min-height: 3rem;
}
.company-image-library-dialog {
  width: min(760px, 100%);
  max-height: min(86vh, 720px);
  display: grid;
  grid-template-rows: auto minmax(10rem, 1fr) auto;
  gap: 1rem;
}
.company-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.company-modal-header h2 {
  margin: 0;
}
.company-image-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  overflow: auto;
  padding-right: .25rem;
}
.company-image-option {
  display: grid;
  grid-template-rows: 96px auto;
  gap: .45rem;
  min-width: 0;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.company-image-option:hover,
.company-image-option.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
}
.company-image-option img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  background: var(--surface);
  border-radius: 6px;
}
.company-image-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
}
.company-upload-form {
  display: grid;
  gap: .55rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.company-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}
.settings-menu-section { margin-top: 1rem; }
.defaults-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-pair { background: color-mix(in srgb, var(--surface-2) 74%, transparent); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; }
.info-pair .label { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; margin-bottom: .4rem; }
.placeholder-page { display: grid; gap: 1rem; }

.home-split-shell { display: grid; grid-template-columns: minmax(220px, min(var(--home-left-width, 20%), 45%)) 10px minmax(0, 1fr); gap: 0; height: calc(100dvh - 10.75rem); min-height: 0; overflow: hidden; align-items: stretch; }
.home-split-pane { min-width: 0; min-height: 0; }
.home-tree-pane { display: flex; padding-right: 1rem; overflow: hidden; }
.home-grid-pane { display: flex; flex-direction: column; overflow: hidden; padding-left: 1rem; min-width: 0; min-height: 0; }
.home-grid-pane > .table-wrap { flex: 1 1 auto; min-height: 0; }
.home-grid-pane > .pager { flex: 0 0 auto; }

.open-estimate-shell {
  display: grid;
  gap: 1rem;
}
.open-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(10rem, 1fr)) auto;
  gap: .8rem;
  align-items: end;
}
.open-filter-form .btn {
  min-height: 2.75rem;
}
.open-estimate-grid {
  min-height: 22rem;
}
.open-estimate-table .open-estimate-row.selected,
.open-estimate-table .open-estimate-row.selected:hover {
  background: var(--primary-soft);
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, var(--border));
  outline-offset: -2px;
}
.open-estimate-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.open-estimate-actions form {
  margin: 0;
}
.open-estimate-actions .btn {
  min-width: 6.5rem;
}
.open-estimate-actions .btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.copy-estimate-page {
  max-width: 720px;
}

.copy-estimate-shell {
  padding: 1.25rem;
}

.copy-estimate-form {
  display: grid;
  gap: .85rem;
  max-width: 540px;
}

.required-marker {
  color: var(--danger);
  font-weight: 800;
}

.copy-estimate-option {
  justify-content: flex-start;
}

.copy-estimate-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  padding-top: .35rem;
}

.home-reports-page {
  display: grid;
  gap: 1rem;
}

.home-reports-shell {
  display: grid;
  gap: .75rem;
  padding: 1.25rem;
}

.home-reports-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.home-reports-header h1 {
  margin: 0;
}

.home-reports-selector {
  display: grid;
  gap: .35rem;
  width: min(38rem, 100%);
}

.home-report-grid {
  min-height: 22rem;
  padding-top: 1.35rem;
}

.home-report-tile.disabled {
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .open-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .open-filter-form {
    grid-template-columns: 1fr;
  }
}
.split-pane-title { margin-bottom: 1rem; }
.tree-panel-group { display: grid; grid-template-rows: minmax(0, 1fr); gap: 1rem; flex: 1 1 auto; min-height: 0; height: 100%; overflow: hidden; }
.tree-panel { min-height: 0; max-height: 100%; overflow-y: auto; padding: .85rem; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 72%, transparent); }
.home-tree-list { list-style: none; margin: 0; padding-left: 0; display: grid; gap: .35rem; }
.home-tree-list .home-tree-list { padding-left: 1rem; margin-top: .35rem; }
.home-tree-link { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-radius: 12px; color: var(--muted); }
.home-tree-link.selected { background: var(--primary-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); }
.tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.splitter { width: 10px; cursor: col-resize; border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 32%, transparent), color-mix(in srgb, var(--surface-3) 92%, transparent)); align-self: stretch; }
.splitter:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 55%, transparent), color-mix(in srgb, var(--surface-3) 92%, transparent)); }

@media (max-width: 1180px) {
  .app-body-shell { grid-template-columns: 1fr; }
  .app-nav { position: relative; top: 0; max-height: none; }
}

@media (max-width: 980px) {
  .login-card, .workspace, .settings-grid, .settings-form-grid, .company-selector-form, .company-form-grid, .company-image-section, .company-upload-row, .defaults-grid { grid-template-columns: 1fr; }
  .settings-form-grid label,
  .settings-form-grid .settings-check span { white-space: normal; }
  .hero-card, .topbar, .global-toolbar { flex-direction: column; align-items: flex-start; }
  .classic-toolbar .global-search-form { justify-content: flex-start; width: 100%; }
  .classic-menu { width: 100%; }
  .classic-submenu,
  .classic-submenu.flyout {
    position: static;
    min-width: 100%;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
  }
  .home-split-shell { grid-template-columns: 1fr; height: auto; min-height: 560px; overflow: visible; }
  .splitter { display: none; }
  .home-tree-pane, .home-grid-pane { padding: 0; }
  .home-grid-pane { display: block; overflow: visible; }
  .home-tree-pane { overflow: visible; }
  .tree-panel-group,
  .tree-panel { height: auto; max-height: none; }
}

/* Home explorer improvements: hierarchical collapse/expand tree and estimate paging. */
.home-tree-node.collapsed > .tree-children { display: none; }
.home-tree-row { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.tree-toggle, .tree-toggle-placeholder { flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem; display: inline-grid; place-items: center; }
.tree-toggle { border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 84%, transparent); color: var(--text); border-radius: 8px; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.home-tree-node.expanded > .home-tree-row .tree-toggle { transform: rotate(90deg); }
.tree-children { margin-left: .7rem; border-left: 1px dotted color-mix(in srgb, var(--border-strong) 80%, transparent); padding-left: .45rem; }
.home-tree-link { flex: 1; min-width: 0; }
.tree-icon { width: 1rem; height: .78rem; flex: 0 0 auto; border-radius: 2px; background: color-mix(in srgb, var(--primary) 56%, #d9a51f); position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.tree-icon::before { content: ''; position: absolute; left: .08rem; top: -.24rem; width: .48rem; height: .26rem; border-radius: 2px 2px 0 0; background: inherit; }
.home-tree-link[data-node-type='public-root'] .tree-icon { background: color-mix(in srgb, var(--muted) 70%, var(--surface-3)); }
.home-tree-link[data-folder-active='true'] .tree-icon {
  background: color-mix(in srgb, #23a65a 74%, #d9a51f);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.2),
    0 0 0 1px color-mix(in srgb, #23a65a 42%, transparent);
}
.home-tree-link[data-folder-active='true'] .tree-icon::after {
  content: '';
  position: absolute;
  right: -.14rem;
  bottom: -.12rem;
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: #23a65a;
  border: 1px solid var(--surface);
}
.home-tree-link[data-folder-active='false'] .tree-icon {
  background: color-mix(in srgb, var(--muted) 72%, var(--surface-3));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-strong) 68%, transparent);
  filter: grayscale(1);
  opacity: .58;
}
.home-tree-link[data-node-type='bom'] .tree-icon,
.home-tree-link[data-node-type='bom-root'] .tree-icon,
.home-tree-link[data-node-type='root'] .tree-icon { background: var(--primary); }
.home-tree-link[data-node-type='bom'] .tree-icon,
.home-tree-link[data-node-type='bom-root'] .tree-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  background:
    linear-gradient(90deg, var(--primary-strong) 0 .2rem, var(--surface) .2rem 100%) 0 .06rem / .9rem .22rem no-repeat,
    linear-gradient(90deg, var(--primary-strong) 0 .2rem, var(--surface) .2rem 100%) .1rem .39rem / .9rem .22rem no-repeat,
    linear-gradient(90deg, var(--primary-strong) 0 .2rem, var(--surface) .2rem 100%) 0 .72rem / .9rem .22rem no-repeat;
  box-shadow: none;
}
.home-tree-link[data-node-type='bom'] .tree-icon::before,
.home-tree-link[data-node-type='bom-root'] .tree-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--primary) 56%, var(--border));
  border-radius: 3px;
  background: transparent;
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager-summary { color: var(--muted); }
.pager-actions { display: flex; align-items: center; gap: .75rem; }
.page-size-form { display: inline-flex; align-items: center; gap: .45rem; margin: 0; }
.page-size-label { margin: 0; color: var(--muted); font-size: .88rem; }
.page-size-select { width: auto; min-width: 4.5rem; padding: .55rem 1.9rem .55rem .7rem; }
.pager-btn { padding: .65rem .95rem; }
.pager-btn.disabled { opacity: .45; cursor: not-allowed; transform: none; }
.is-resizing, .is-resizing * { cursor: col-resize !important; user-select: none; }

/* Windows Explorer-style tree behavior and visuals. */
.home-tree-node[data-has-children='true'].collapsed > .tree-children { display: none; }
.home-tree-row { min-height: 2rem; }
.tree-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  transition: background .12s ease, color .12s ease;
}
.tree-toggle::before { content: '▸'; }
.home-tree-node.expanded > .home-tree-row .tree-toggle { transform: none; }
.home-tree-node.expanded > .home-tree-row .tree-toggle::before { content: '▾'; }
.tree-toggle:hover,
.tree-toggle:focus-visible {
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  color: var(--text);
  outline: none;
}
.home-tree-link {
  min-height: 2rem;
  padding: .38rem .55rem;
  border: 1px solid transparent;
}
.home-tree-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 70%, white 10%);
  outline-offset: 1px;
}
.home-tree-link[aria-current='page'] {
  background: color-mix(in srgb, var(--primary-soft) 82%, transparent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
}
.tree-children {
  margin-left: .8rem;
  padding-left: .6rem;
  border-left: 1px dotted color-mix(in srgb, var(--border-strong) 80%, transparent);
}
.tree-icon {
  width: 1.08rem;
  height: .82rem;
  border-radius: 2px;
}
.tree-toggle {
  color: var(--primary);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}
.tree-toggle::before {
  content: '';
  width: 0;
  height: 0;
  border-top: .32rem solid transparent;
  border-bottom: .32rem solid transparent;
  border-left: .44rem solid currentColor;
  display: block;
  transition: transform .12s ease;
}
.home-tree-node.expanded > .home-tree-row .tree-toggle::before { transform: rotate(90deg); }
.tree-toggle:hover,
.tree-toggle:focus-visible {
  background: color-mix(in srgb, var(--primary-soft) 76%, transparent);
  color: var(--primary-strong);
}
.home-tree-node[data-has-children='true'] > .home-tree-row { cursor: default; }
.home-tree-node[data-has-children='true'] > .home-tree-row .tree-icon { cursor: pointer; }
.folder-draggable-row { cursor: grab; }
.folder-draggable-row:active { cursor: grabbing; }
.home-tree-row.is-folder-dragging {
  opacity: .55;
}
.home-tree-node.is-folder-drop-target > .home-tree-row .home-tree-link {
  background: color-mix(in srgb, var(--primary-soft) 88%, transparent);
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 36%, transparent);
}
.folder-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 12rem;
  display: none;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
}
.folder-context-menu.is-open { display: grid; gap: .15rem; }
.estimate-context-menu {
  position: fixed;
  z-index: 1220;
  min-width: 13rem;
  display: none;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
}
.estimate-context-menu.is-open { display: grid; gap: .15rem; }
.folder-context-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.1rem;
  padding: .45rem .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.folder-context-item[hidden] { display: none; }
.estimate-context-item[hidden],
.estimate-context-submenu-shell[hidden] { display: none; }
.folder-context-item:hover,
.folder-context-item:focus-visible {
  background: var(--primary-soft);
  outline: none;
}
.estimate-context-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.1rem;
  padding: .45rem .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.estimate-context-item:hover,
.estimate-context-item:focus-visible {
  background: var(--primary-soft);
  outline: none;
}
.estimate-context-item.has-submenu::after {
  content: '';
  margin-left: auto;
  width: 0;
  height: 0;
  border-top: .28rem solid transparent;
  border-bottom: .28rem solid transparent;
  border-left: .4rem solid currentColor;
  opacity: .72;
}
.estimate-context-submenu-shell { position: relative; }
.estimate-move-submenu {
  position: absolute;
  left: calc(100% + .35rem);
  top: 0;
  display: none;
  min-width: 14rem;
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
}
.estimate-context-submenu-shell:hover .estimate-move-submenu,
.estimate-context-submenu-shell:focus-within .estimate-move-submenu {
  display: block;
}
.estimate-move-children {
  margin-left: 1rem;
  padding-left: .35rem;
  border-left: 1px dotted color-mix(in srgb, var(--border-strong) 80%, transparent);
}
.estimate-context-empty {
  padding: .5rem .6rem;
  color: var(--muted);
  font-size: .9rem;
}
.folder-context-icon {
  width: 1rem;
  height: 1rem;
  display: inline-grid;
  place-items: center;
  color: var(--primary-strong);
  flex: 0 0 auto;
}
.folder-context-icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}
.estimate-context-icon {
  width: 1rem;
  height: 1rem;
  display: inline-grid;
  place-items: center;
  color: var(--primary-strong);
  flex: 0 0 auto;
}
.estimate-context-icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}
.estimate-context-icon-cutout {
  fill: none;
  stroke: var(--surface);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.folder-context-icon-cutout {
  fill: none;
  stroke: var(--surface);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.folder-editor-popover {
  position: fixed;
  z-index: 1210;
  display: none;
  width: min(18rem, calc(100vw - 1.5rem));
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .2);
}
.folder-editor-popover.is-open { display: block; }
.folder-editor-label {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .86rem;
}
.folder-editor-input {
  width: 100%;
}
.folder-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: .45rem;
  margin-top: .7rem;
}
.folder-editor-actions .btn {
  padding: .55rem .8rem;
}

.home-estimate-dialog { width: min(420px, 100%); }
.home-estimate-form {
  display: grid;
  gap: .8rem;
}
.home-estimate-form label {
  color: var(--muted);
  font-size: .88rem;
}
.home-restore-dialog {
  display: grid;
  gap: .9rem;
}
.home-restore-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  margin-bottom: .75rem;
}
.home-restore-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(6rem, 1fr));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}
.home-restore-calendar-heading {
  padding: .5rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 74%, var(--card)), var(--surface-2));
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.home-restore-calendar-heading:nth-child(7n) { border-right: 0; }
.home-restore-calendar-day {
  min-height: 6rem;
  padding: .45rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.home-restore-calendar-day:nth-child(7n) { border-right: 0; }
.home-restore-calendar-day.empty {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.home-restore-calendar-number {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .78rem;
}
.home-restore-calendar-event {
  display: block;
  width: 100%;
  margin-bottom: .3rem;
  padding: .3rem .4rem;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}
.home-restore-calendar-event:hover,
.home-restore-calendar-event:focus-visible {
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface-3));
  outline: none;
}
.home-restore-calendar-event:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.home-restore-calendar-event:disabled:hover {
  background: var(--primary-soft);
}
.home-restore-table { min-width: 620px; }
.home-restore-action {
  width: 2.25rem;
  height: 2.25rem;
}

/* Estimate.aspx Phase 2 replacement. */
.estimate-page { gap: 1rem; }
.full-window-content .estimate-page {
  min-height: calc(100vh - .9rem);
  grid-template-rows: auto auto minmax(0, 1fr);
}
.estimate-hero { align-items: flex-start; }
.estimate-action-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}
.estimate-action-button {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary-strong);
  cursor: pointer;
  padding: 0;
}
.estimate-action-button:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}
.estimate-action-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.estimate-action-button svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.estimate-action-button img {
  width: 1.85rem;
  height: 1.85rem;
  display: block;
  object-fit: contain;
}
.estimate-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 20%) minmax(0, 1fr);
  gap: .75rem;
  align-items: stretch;
}
.full-window-content .estimate-workspace {
  min-height: 0;
  height: 100%;
}
.estimate-workspace.summary-collapsed { grid-template-columns: 20px minmax(0, 1fr); }
.estimate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .42);
}
.estimate-modal-backdrop[hidden] { display: none; }
.estimate-modal {
  width: min(400px, 100%);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.estimate-wide-modal { width: min(900px, 100%); }
.estimate-modal-header,
.estimate-modal-title-row {
  margin: -1rem -1rem 1rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 70%, var(--card)), var(--surface-2));
}
.estimate-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.estimate-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.estimate-modal-title-row h2 { margin-bottom: 0; }
.estimate-save-as-form,
.estimate-export-form,
.estimate-bom-form {
  display: grid;
  gap: .85rem;
}
.estimate-modal-actions {
  display: flex;
  justify-content: center;
  gap: .6rem;
}
.estimate-bom-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem;
  align-items: center;
  margin-bottom: .75rem;
}
.estimate-modal-table-wrap {
  max-height: min(60vh, 520px);
  overflow: auto;
}
.estimate-modal-table th button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.estimate-modal-table th button.active {
  color: var(--primary-strong);
}
.estimate-modal-table th button.active::after {
  content: attr(data-sort-direction);
  margin-left: .35rem;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.estimate-modal-table th,
.estimate-modal-table td { white-space: nowrap; }
.estimate-modal-table td:first-child,
.estimate-modal-table th:first-child { white-space: normal; }
.home-bom-detail-dialog { width: min(1100px, 100%); }
.home-bom-detail-table { min-width: 860px; }
.home-bom-detail-table td:nth-child(2),
.home-bom-detail-table th:nth-child(2) { white-space: normal; }
.home-bom-detail-pager {
  margin-top: .8rem;
  margin-bottom: 0;
}
.estimate-sort-table { min-width: 640px; }
.estimate-sort-row { cursor: grab; }
.estimate-sort-row.dragging { opacity: .55; cursor: grabbing; }
.estimate-sort-row.drag-over-before { box-shadow: inset 0 3px 0 var(--primary); }
.estimate-sort-row.drag-over-after { box-shadow: inset 0 -3px 0 var(--primary); }
.estimate-sort-row .sort-order-cell {
  width: 8rem;
  color: var(--muted);
  text-align: right;
}
.estimate-summary-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  min-width: 0;
  position: sticky;
  top: 5.7rem;
}
.full-window-content .estimate-summary-panel {
  top: .45rem;
}
.estimate-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 70%, var(--card)), var(--surface-2));
}
.estimate-summary-header h2 { margin: 0; font-size: 1rem; }
.project-summary-toggle {
  position: absolute;
  top: 0;
  right: -.62rem;
  bottom: auto;
  z-index: 4;
  width: 1.05rem;
  height: calc(100vh - .9rem);
  min-height: 14rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 999px;
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-3) 86%, var(--primary-soft)));
  color: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.project-summary-toggle::before {
  content: '';
  position: absolute;
  top: .55rem;
  bottom: .55rem;
  left: 50%;
  width: .22rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 42%, var(--border));
  transform: translateX(-50%);
}
.project-summary-toggle:hover,
.project-summary-toggle:focus-visible {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 74%, var(--surface)), var(--surface-3));
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  outline: none;
  transform: translateX(1px);
}
.project-summary-toggle:hover::before,
.project-summary-toggle:focus-visible::before {
  background: var(--primary-strong);
}
.project-summary-toggle-indicator {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: .72rem;
  height: .72rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: 0 2px 8px rgba(15, 23, 42, .16);
}
.project-summary-toggle {
  overflow: hidden;
}
.project-summary-list { margin: 0; padding: .35rem 0; }
.project-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  padding: .45rem .85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 64%, transparent);
}
.project-summary-row:last-child { border-bottom: 0; }
.project-summary-row dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.project-summary-row dd { margin: 0; font-weight: 700; text-align: right; white-space: nowrap; }
.project-summary-row-strong {
  background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
  border-left: 3px solid var(--primary);
}
.project-summary-row-strong dt,
.project-summary-row-strong dd {
  color: var(--text);
  font-weight: 900;
}
.empty-summary { padding: .85rem; color: var(--muted); font-size: .9rem; }
.estimate-summary-brand {
  position: relative;
  min-height: clamp(23rem, 52vh, 36rem);
  margin: .85rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 44%, var(--surface)), color-mix(in srgb, var(--primary) 62%, var(--primary-strong))),
    var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.estimate-summary-brand img {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  width: min(92%, 13rem);
  height: auto;
  max-height: 64%;
  object-fit: contain;
  opacity: .38;
  transform: translateX(-50%);
}
.estimate-summary-brand-name,
.estimate-summary-brand-version {
  position: absolute;
  left: 1rem;
  right: 1rem;
  z-index: 1;
  color: #fff;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 2px 3px rgba(15, 23, 42, .6);
}
.estimate-summary-brand-name {
  top: 5rem;
  font-size: 1.55rem;
}
.estimate-summary-brand-version {
  bottom: 5.4rem;
  font-size: 1.2rem;
  font-style: italic;
}
.estimate-workspace.summary-collapsed .estimate-summary-panel { align-self: start; }
.estimate-workspace.summary-collapsed .project-summary-list,
.estimate-workspace.summary-collapsed .empty-summary,
.estimate-workspace.summary-collapsed .estimate-summary-brand,
.estimate-workspace.summary-collapsed .estimate-summary-header h2 { display: none; }
.estimate-workspace.summary-collapsed .estimate-summary-panel {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.estimate-workspace.summary-collapsed .estimate-summary-header {
  justify-content: center;
  min-height: 14rem;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
.estimate-workspace.summary-collapsed .project-summary-toggle {
  left: .1rem;
  right: auto;
  top: 0;
  bottom: auto;
  height: calc(100vh - .9rem);
  min-height: 14rem;
}
.estimate-main-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 1rem;
  grid-template-rows: minmax(0, 1fr);
}
.estimate-main-panel > .panel-card,
.estimate-main-panel > .table-card {
  min-height: 100%;
  align-content: start;
  align-items: start;
}
.estimate-tabs {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.estimate-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: .65rem 1rem;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}
.estimate-tab:hover { background: color-mix(in srgb, var(--surface-3) 84%, transparent); color: var(--text); }
.estimate-tab.active { background: var(--primary-soft); color: var(--text); border-color: color-mix(in srgb, var(--primary) 36%, var(--border)); }
.estimate-tab.disabled {
  opacity: .48;
  cursor: not-allowed;
}
.estimate-tab.disabled:hover {
  background: transparent;
  color: var(--muted);
}
.estimate-grid-card { display: grid; gap: .55rem; }
.grid-toolbar-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.grid-message { min-height: 1.4rem; color: var(--muted); }
.grid-message.success { color: color-mix(in srgb, var(--success) 80%, white); }
.grid-message.error { color: #ffadb5; }
.estimate-grid-wrap { border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.estimate-grid-table,
.estimate-child-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.estimate-grid-table { min-width: 1120px; }
.estimate-grid-table th,
.estimate-grid-table td,
.estimate-child-table th,
.estimate-child-table td { border-bottom: 1px solid var(--border); padding: .45rem; vertical-align: middle; }
.estimate-grid-table th,
.estimate-child-table th {
  color: var(--text);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 74%, var(--card)), var(--surface-2));
  border-top: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.estimate-grid-table th:first-child,
.estimate-child-table th:first-child { border-top-left-radius: 8px; }
.estimate-grid-table th:last-child,
.estimate-child-table th:last-child { border-top-right-radius: 8px; }
.estimate-parent-row { background: color-mix(in srgb, var(--surface-2) 58%, transparent); }
.estimate-parent-row.collapsed { background: color-mix(in srgb, var(--surface) 78%, transparent); }
.estimate-parent-row.label-row {
  background: color-mix(in srgb, var(--primary-soft) 42%, #fff);
  font-weight: 800;
}
.estimate-parent-row.label-row .grid-input,
.estimate-parent-row.label-row .readonly-cell { font-weight: 800; }
.estimate-parent-row.selected { box-shadow: inset 4px 0 0 var(--primary); }
.estimate-parent-row[data-row-key^='new-'] { box-shadow: inset 4px 0 0 var(--primary); }
.estimate-child-row > td { padding: .65rem 1rem 1rem 3rem; background: color-mix(in srgb, var(--surface) 90%, transparent); }
.wbs-grid-shell { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--surface-2) 62%, transparent); }
.wbs-grid-title { padding: .7rem .9rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.estimate-child-table { min-width: 980px; }
.grid-expand-cell,
.grid-row-number-cell,
.grid-select-cell { text-align: center; white-space: nowrap; }
.grid-expand-cell,
.grid-row-number-cell,
.grid-select-cell,
.grid-actions-cell { vertical-align: middle; }
.grid-actions-cell > * + * { margin-left: .45rem; }
.expand-col,
.row-number-col,
.select-col { width: 44px; }
.grid-row-number {
  color: var(--muted);
  font-size: .85rem;
  min-width: 1.65rem;
  height: 1.75rem;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 0 .25rem;
}
.grid-row-number:hover,
.estimate-parent-row.selected .grid-row-number {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  color: var(--text);
}
.grid-icon-button { width: 1.75rem; height: 1.75rem; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); color: var(--text); cursor: pointer; }
.grid-icon-button:hover { background: color-mix(in srgb, var(--surface-3) 88%, transparent); }
.grid-icon-button:disabled { opacity: .45; cursor: not-allowed; }
.grid-expand-button {
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
  color: var(--primary-strong);
}
.grid-expand-button:hover {
  color: var(--text);
  background: var(--primary-soft);
}
.grid-delete-button { color: #ffd6db; border-color: rgba(208,91,102,.38); font-size: 1.1rem; line-height: 1; }
.grid-delete-button:hover { background: rgba(208,91,102,.18); }
.grid-input { width: 100%; min-width: 4.7rem; border-radius: 8px; padding: .5rem .55rem; background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text); border: 1px solid var(--border); }
.grid-input:disabled { opacity: .65; cursor: not-allowed; }
.grid-input.compact { min-width: 4rem; }
.grid-input.numeric { min-width: 4.25rem; text-align: right; }
.description-input { min-width: 22rem; }
.wbs-item-name-input { min-width: 12rem; }
.wbs-item-picker {
  position: fixed;
  z-index: 1200;
  max-height: min(22rem, calc(100vh - 2rem));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.wbs-item-picker[hidden] { display: none; }
.wbs-item-picker-header,
.wbs-item-picker-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.2fr) minmax(12rem, 1.8fr) minmax(5rem, .6fr) minmax(4rem, .45fr);
  gap: .45rem;
  align-items: center;
}
.wbs-item-picker-header {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 74%, var(--card)), var(--surface-2));
  color: var(--text);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.wbs-item-picker-body {
  max-height: 18rem;
  overflow: auto;
}
.wbs-item-picker-row {
  width: 100%;
  min-height: 2.05rem;
  padding: .42rem .6rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}
.wbs-item-picker-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wbs-item-picker-row:hover,
.wbs-item-picker-row.is-selected {
  background: var(--primary-soft);
}
.wbs-item-picker-empty {
  padding: .75rem;
  color: var(--muted);
  font-size: .86rem;
}
.readonly-cell { color: var(--muted); white-space: nowrap; }
.grid-actions-cell { min-width: 7rem; white-space: nowrap; }
.estimate-task-totals {
  display: flex;
  align-items: stretch;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.task-total-item {
  min-width: 126px;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.task-total-item span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  margin-bottom: .2rem;
}
.task-total-item strong { font-size: .92rem; white-space: nowrap; }
.grid-btn { padding: .48rem .65rem; border-radius: 10px; font-size: .82rem; }
.grid-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.grid-btn.danger { color: #ffd6db; border-color: rgba(208,91,102,.38); }
.child-count { color: var(--muted); font-size: .78rem; }
.tools-col { width: 72px; }
.compact-settings-grid { margin-top: 1rem; }
.settings-default-form {
  grid-template-columns: minmax(220px, 320px) auto;
  align-items: end;
  margin-bottom: 1rem;
}

/* Changed By: Suresh Jat
   Changed On: 2026-05-09 00:00 local time
   Reason: Added modern Estimate Settings tab form layout and state styling. */
.estimate-settings-panel { display: grid; gap: .85rem; }
.estimate-settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: .85rem 1rem;
  align-items: end;
}
.settings-field { min-width: 0; }
.settings-field.wide { grid-column: span 2; }
.settings-field label,
.settings-check { color: var(--muted); font-size: .88rem; }
.settings-field label { display: block; margin-bottom: .35rem; }
.settings-field .input,
.settings-field select { min-height: 2.45rem; }
.settings-field .numeric { text-align: right; }
.required-marker { color: var(--danger); font-weight: 800; }
.settings-check {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
}
.settings-check input { flex: 0 0 auto; }
.estimate-settings-panel.is-dirty {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}
.estimate-action-button.is-busy { opacity: .7; cursor: wait; }

/* Changed By: Suresh Jat
   Changed On: 2026-05-09 00:00 local time
   Reason: Added modern Estimate Detail tab form layout and state styling. */
.estimate-detail-panel,
.estimate-detail-form { display: grid; gap: 1rem; }
.detail-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 1rem;
  align-items: start;
}
.detail-form-section {
  display: grid;
  gap: .8rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
}
.detail-form-section h3 {
  margin: -.85rem -.85rem 0;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 68%, var(--card)), var(--surface-2));
  font-size: .95rem;
  color: var(--text);
}
.detail-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: .8rem 1rem;
}
.detail-field-grid.single { grid-template-columns: 1fr; }
.detail-textarea-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
.detail-check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}
.detail-party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1rem;
}
.estimate-detail-panel.is-dirty {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}

/* Changed By: Suresh Jat
   Changed On: 2026-05-25 00:00 local time
   Reason: Added modern Estimate Adjustments tab grid layout and state styling. */
.estimate-adjustments-panel {
  display: grid;
  gap: .85rem;
}
.adjustment-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.adjustment-bond-field {
  width: min(360px, 100%);
}
.estimate-adjustment-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  overflow: auto;
}
.estimate-adjustment-table {
  min-width: 720px;
}
.estimate-adjustment-table th:first-child {
  width: 68%;
}
.adjustment-note-input {
  min-width: 26rem;
}
.adjustment-amount-input {
  min-width: 8rem;
}
.estimate-adjustments-panel.is-dirty {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}

.price-list-page {
  display: grid;
  gap: .85rem;
}
.price-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.price-list-header h1 {
  margin: .2rem 0 0;
  font-size: 1.35rem;
}
.price-list-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.price-list-action-button {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--primary-strong);
  cursor: pointer;
  padding: 0 .8rem;
  font: inherit;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, filter .15s ease;
}
.price-list-action-button.primary {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}
.price-list-action-button:hover,
.price-list-action-button:focus-visible {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  color: var(--primary-strong);
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, .14));
}
.price-list-action-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 2px;
}
.price-list-action-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.price-list-action-button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.price-list-grid-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  overflow: auto;
  max-height: calc(100vh - 16rem);
}
.price-list-grid {
  min-width: 980px;
}
.price-list-selection-grid {
  min-width: 680px;
}
.price-list-selection-grid th:first-child {
  width: 80%;
}
.price-list-selection-grid th:nth-child(2) {
  width: 20%;
}
.price-list-selection-grid tbody tr {
  cursor: pointer;
}
.price-list-selection-grid tr.is-selected,
.price-sheet-grid tr.is-selected {
  background: var(--primary-soft);
}
.price-list-grid th:first-child,
.price-list-grid td:first-child {
  width: 7rem;
  min-width: 7rem;
  text-align: center;
}
.price-list-grid th:nth-child(4),
.price-list-grid td:nth-child(4) {
  width: 8rem;
  min-width: 8rem;
}
.price-list-grid th:nth-child(6),
.price-list-grid td:nth-child(6),
.price-list-grid th:nth-child(7),
.price-list-grid td:nth-child(7) {
  width: 7rem;
  min-width: 7rem;
}
.price-list-grid tr.is-selected {
  background: var(--primary-soft);
}
.item-number-cell {
  padding: .2rem .35rem;
}
.item-number-selector {
  width: 100%;
  min-height: 2rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.item-number-selector:hover,
.item-number-selector:focus-visible,
.item-number-selector[aria-pressed='true'] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 84%, transparent);
  outline: none;
}
.price-list-page.is-dirty {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, .38);
}
.modal-backdrop.is-open {
  display: grid;
}
.modal-dialog {
  width: min(570px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.modal-dialog h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.required {
  color: var(--danger);
  font-weight: 800;
}
.price-sheet-page {
  min-height: 100vh;
}
.price-sheet-grid-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  overflow: auto;
  max-height: calc(100vh - 9rem);
}
.price-sheet-grid {
  min-width: 1000px;
}
.price-sheet-grid th:first-child,
.price-sheet-grid td:first-child {
  width: 2.5rem;
  min-width: 2.5rem;
  text-align: center;
}
.price-sheet-grid th:nth-child(2) {
  width: 30%;
}
.price-sheet-grid th:nth-child(3) {
  width: 34%;
}
.price-sheet-grid th:nth-child(4),
.price-sheet-grid th:nth-child(5),
.price-sheet-grid th:nth-child(6),
.price-sheet-grid th:nth-child(7) {
  width: 9%;
}
.sheet-selector-cell {
  padding: .25rem;
}
.sheet-selector-button {
  width: 100%;
  min-height: 2rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--primary-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.sheet-selector-button:hover,
.sheet-selector-button:focus-visible {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 84%, transparent);
  outline: none;
}

.import-shell {
  display: grid;
  gap: 1rem;
}
.import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.import-header h1 {
  margin: 0;
  font-size: 1.35rem;
}
.import-steps {
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.import-steps li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .75rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}
.import-steps li.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
  background: var(--primary-soft);
}
.import-step {
  min-height: 18rem;
}
.import-form-grid,
.import-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(12rem, 1fr));
  gap: .9rem;
}
.import-file-panel,
.import-mapping-panel {
  display: grid;
  gap: .75rem;
}
.import-cached-file {
  color: var(--muted);
  font-size: .9rem;
}
.import-preview-wrap {
  max-height: 26rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.import-preview-table {
  min-width: 54rem;
}
.import-preview-table td,
.import-preview-table th {
  white-space: nowrap;
}
.import-skipped-row {
  opacity: .55;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}
.import-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.import-open-link {
  margin-left: .75rem;
  font-weight: 700;
}

/* Changed By: Suresh Jat
   Changed On: 2026-05-16 17:02 local time
   Reason: Added report icon grid and popup report viewer styles. */
.estimate-reports-panel {
  min-height: 25rem;
}
.estimate-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4.5rem 2.5rem;
  align-items: start;
  padding: 2.3rem 1rem 1.5rem;
}
.estimate-report-tile {
  display: grid;
  justify-items: center;
  gap: .55rem;
  min-height: 7.4rem;
  color: var(--text);
  text-align: center;
}
.estimate-report-tile.disabled {
  opacity: .48;
  pointer-events: none;
}
.estimate-report-icon {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  color: var(--primary);
  border-radius: 8px;
  transition: color .15s ease, background .15s ease, transform .15s ease, filter .15s ease;
}
.estimate-report-icon svg {
  width: 4rem;
  height: 4rem;
  display: block;
  overflow: visible;
}
.estimate-report-tile:hover .estimate-report-icon,
.estimate-report-tile:focus-visible .estimate-report-icon {
  color: var(--primary-strong);
  background: var(--primary-soft);
  transform: translateY(-2px) scale(1.06);
  filter: drop-shadow(0 7px 12px rgba(15, 23, 42, .2));
}
.estimate-report-name {
  max-width: 12rem;
  font-size: .95rem;
  line-height: 1.22;
}
.estimate-report-tile:hover .estimate-report-name,
.estimate-report-tile:focus-visible .estimate-report-name {
  color: var(--primary-strong);
}
.report-viewer-page {
  min-height: calc(100vh - .9rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: .55rem;
}
.report-viewer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.report-viewer-toolbar h1 {
  margin: 0;
  font-size: 1.2rem;
}
.report-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
}
.report-pdf-frame {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.report-loading {
  position: fixed;
  top: 45%;
  left: 50%;
  z-index: 90;
  transform: translate(-50%, -50%);
  padding: 1rem 1.35rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
}
.report-print-frame {
  position: fixed;
  width: 0;
  height: 0;
  border: 0;
  visibility: hidden;
}

@media (max-width: 980px) {
  .estimate-tabs { align-items: stretch; }
  .estimate-tab { flex: 0 0 auto; }
  .import-header { align-items: flex-start; flex-direction: column; }
  .import-form-grid,
  .import-map-grid { grid-template-columns: 1fr; }
  .estimate-workspace,
  .estimate-workspace.summary-collapsed { grid-template-columns: 1fr; }
  .estimate-summary-panel { position: relative; top: 0; }
  .estimate-workspace.summary-collapsed .estimate-summary-panel { max-height: 44px; }
  .estimate-settings-form,
  .estimate-report-grid { grid-template-columns: 1fr; }
  .settings-field.wide { grid-column: auto; }
  .detail-field-grid,
  .detail-textarea-grid,
  .detail-top-grid,
  .detail-check-grid,
  .detail-party-grid,
  .settings-default-form { grid-template-columns: 1fr; }
}
