:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-border: #dbe2ec;
  --text: #142033;
  --muted: #62748a;
  --primary: #1d4f91;
  --primary-dark: #133965;
  --accent: #52a447;
  --danger: #a83232;
  --warning: #ad7b16;
  --shadow: 0 12px 30px rgba(16, 32, 57, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; scroll-behavior: auto; overflow: hidden; }
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; border: 0; border-radius: 10px; padding: 0.7rem 1rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
button.primary, .button.primary { background: var(--primary); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--primary-dark); }
button.secondary, .button.secondary { background: #eaf0f8; color: var(--primary); }
button.ghost { background: transparent; border: 1px solid var(--panel-border); color: var(--text); }
.sidebar button.ghost { color: #fff; border-color: rgba(255,255,255,0.62); background: rgba(255,255,255,0.03); }
.sidebar button.ghost:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.85); }
button.danger { background: var(--danger); color: #fff; }
button.full { width: 100%; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-screen { position: fixed; inset: 0; width: 100%; min-height: 100dvh; height: 100dvh; overflow-y: auto; display: grid; place-items: center; padding: 2rem; background: linear-gradient(135deg, #0e2a45, #1c5d99); }
.auth-card { width: min(560px, 100%); background: #fff; border-radius: 24px; padding: 2rem; box-shadow: var(--shadow); }
.brand-lockup { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.brand-mark { width: 74px; height: 74px; border-radius: 20px; background: transparent; display: grid; place-items: center; overflow: hidden; box-shadow: 0 8px 24px rgba(16,32,57,0.13); }
.brand-mark.small { width: 44px; height: 44px; border-radius: 13px; flex: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.15rem; margin-bottom: 1rem; }
h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.muted { color: var(--muted); }

#appShell { position: fixed; inset: 0; width: 100%; height: 100dvh; min-height: 100dvh; display: grid; grid-template-columns: 280px 1fr; overflow: hidden; }
.sidebar { background: #102033; color: #fff; padding: 1rem; display: flex; flex-direction: column; gap: 1.25rem; height: 100dvh; overflow-y: auto; }
.sidebar-brand { display: flex; gap: 0.75rem; align-items: center; padding: 0.5rem; }
.sidebar-brand span { color: #aebbd0; display: block; font-size: 0.85rem; margin-top: 0.15rem; }
.sidebar nav { display: grid; gap: 0.35rem; }
.nav-btn { width: 100%; background: transparent; color: #cbd6e4; justify-content: flex-start; }
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,0.11); color: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 0.75rem; }
#userBadge { color: #d7e0ee; font-size: 0.9rem; padding: 0.5rem; line-height: 1.35; }

.content { padding: 1.25rem; overflow-x: hidden; overflow-y: auto; height: 100dvh; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; }
.topbar h1 { margin-bottom: 0.1rem; }
.topbar p { color: var(--muted); margin: 0; }
.status-pill { background: #eaf0f8; color: var(--primary); border: 1px solid #cbd8ea; border-radius: 999px; padding: 0.55rem 0.85rem; white-space: nowrap; }
.status-pill.running { background: #e9f7e7; color: #287121; border-color: #c8e7c0; }
.view { display: none; }
.view.active { display: grid; gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.split-panel { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1rem; align-items: start; }
.metric-grid, .dashboard-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.metric-card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); display: block; font-size: 0.9rem; margin-bottom: 0.4rem; }
.metric-card strong { font-size: 1.5rem; }
.metric-card small { color: var(--muted); display: block; margin-top: 0.35rem; }
.dashboard-link-card { cursor: pointer; transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; }
.dashboard-link-card:hover { transform: translateY(-2px); border-color: #9fb5d2; box-shadow: 0 14px 32px rgba(16, 32, 57, 0.13); }
.dashboard-link-card:focus-visible { outline: 3px solid rgba(29, 79, 145, 0.3); outline-offset: 2px; }
#accountingDashboardCards { grid-template-columns: repeat(5, minmax(190px, 1fr)); overflow-x: auto; padding-bottom: 0.2rem; }
.account-activity-block { grid-column: 1 / -1; margin-top: 1rem; }
.timer-display { font-size: clamp(2.4rem, 8vw, 5rem); font-weight: 800; letter-spacing: -0.06em; color: var(--primary); }

.stacked-form { display: grid; gap: 0.9rem; }
.compact-form { max-width: 720px; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; align-items: end; }
.grid-form .full-width { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.5rem; align-items: center; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
label, .form-field { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.field-label { color: var(--muted); font-size: 0.9rem; }
input, select, textarea { width: 100%; border: 1px solid #cbd6e4; border-radius: 10px; background: #fff; color: var(--text); padding: 0.65rem 0.7rem; }
select[multiple] { min-height: 92px; }
textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.checkbox-row input { width: auto; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; border-bottom: 1px solid #e4eaf2; padding: 0.65rem; vertical-align: top; }
th { color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:hover td { background: #fbfcfe; }
.tag-chip { display: inline-flex; padding: 0.2rem 0.45rem; border-radius: 999px; background: #eaf0f8; color: var(--primary); font-size: 0.8rem; margin: 0.1rem; }
.small-action { padding: 0.35rem 0.55rem; border-radius: 8px; font-size: 0.85rem; }

.tab-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab-btn { background: #eaf0f8; color: var(--primary); }
.tab-btn.active { background: var(--primary); color: #fff; }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.report-summary { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1rem 0; }
.report-summary .metric-card { min-width: 170px; box-shadow: none; }
.roadmap-card { background: #f7fbf5; border: 1px solid #cce8c4; border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.settings-list { display: grid; gap: 0.75rem; }
.settings-list pre { background: #0d1b2a; color: #dbe8f6; border-radius: 12px; padding: 1rem; overflow-x: auto; }
.toast { position: fixed; right: 1rem; top: 1rem; z-index: 20; max-width: 420px; background: #102033; color: #fff; border-radius: 12px; padding: 0.85rem 1rem; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.hidden-by-role { display: none !important; }

@media (max-width: 1100px) {
  #appShell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { height: auto; max-height: 42dvh; overflow-y: auto; }
  .content { height: auto; min-height: 0; overflow-y: auto; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-footer { margin-top: 0; grid-template-columns: 1fr auto; align-items: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-panel { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 0.75rem; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .sidebar nav { grid-template-columns: 1fr; }
  .metric-grid, .grid-form { grid-template-columns: 1fr; }
}

/* v004 Clockify-style timer history and sidebar icons */
.nav-btn { display: flex; align-items: center; gap: 0.75rem; }
.nav-icon { width: 1.35rem; min-width: 1.35rem; display: inline-grid; place-items: center; font-size: 1.1rem; opacity: 0.92; }
.live-timer-panel { align-items: center; }
.timer-history { display: grid; gap: 1rem; }
.history-block { padding: 0; overflow: visible; }
.history-week-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--panel-border); }
.history-week-header h2 { margin: 0; }
.history-week-header span { color: var(--muted); font-weight: 700; }
.time-entry-list { display: grid; }
.empty-history { color: var(--muted); padding: 1.25rem; }
.day-group { display: grid; }
.day-group + .day-group { border-top: 1px solid var(--panel-border); }
.day-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #eef2f7; color: var(--muted); padding: 0.65rem 1.25rem; font-size: 0.9rem; }
.day-header strong { color: var(--text); }
.time-row { display: grid; grid-template-columns: minmax(220px, 1fr) 170px 110px 48px 48px; gap: 0.75rem; align-items: center; min-height: 72px; padding: 0.65rem 1rem 0.65rem 1.25rem; border-top: 1px solid #e4eaf2; background: #fff; }
.time-row:hover { background: #fbfcfe; }
.time-main { min-width: 0; }
.time-description { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-context { color: #d75a0b; margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-tags { margin-top: 0.25rem; min-height: 1.2rem; }
.time-when { color: var(--text); white-space: nowrap; text-align: right; }
.time-duration { text-align: right; font-size: 1rem; white-space: nowrap; }
.icon-button { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); border: 1px solid transparent; font-weight: 800; }
.icon-button:hover { background: #eaf0f8; color: var(--primary); border-color: #cbd8ea; }
.play-button { font-size: 1.05rem; }
.kebab-button { font-size: 1.35rem; line-height: 1; }
.entry-menu-wrap { position: relative; display: inline-flex; justify-self: end; }
.entry-menu { position: absolute; top: calc(100% + 0.35rem); right: 0; z-index: 30; min-width: 145px; background: #fff; border: 1px solid var(--panel-border); border-radius: 12px; box-shadow: 0 16px 35px rgba(16,32,57,0.16); padding: 0.35rem; display: grid; }
.entry-menu button { justify-content: flex-start; width: 100%; border-radius: 8px; background: transparent; color: var(--text); padding: 0.55rem 0.75rem; }
.entry-menu button:hover { background: #f1f5fa; }
.entry-menu .menu-danger { color: var(--danger); }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(11, 21, 34, 0.58); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.modal-card { width: min(900px, 100%); background: #fff; border: 1px solid var(--panel-border); border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,0.28); padding: 1rem; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-header h2 { margin: 0; }

@media (max-width: 920px) {
  .time-row { grid-template-columns: 1fr 1fr 95px 42px 42px; }
  .time-when { text-align: left; }
}
@media (max-width: 640px) {
  .time-row { grid-template-columns: 1fr auto auto; align-items: start; }
  .time-main { grid-column: 1 / -1; }
  .time-when { grid-column: 1 / 2; }
  .time-duration { text-align: left; }
}

/* v006 admin menus and setup workflow refinements */
.entry-menu.menu-fixed {
  position: fixed;
  right: auto;
  z-index: 1000;
  min-width: 170px;
}
.admin-actions {
  justify-content: flex-end;
  gap: 0.25rem;
}
.form-hint {
  align-self: end;
  margin: 0.2rem 0 0;
}


/* v008 time entry action menus, timer tag checkboxes, and printable reports */
.tag-checklist {
  min-height: 92px;
  max-height: 175px;
  overflow-y: auto;
  border: 1px solid #cbd6e4;
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem;
  display: grid;
  gap: 0.1rem;
}
.tag-check-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
}
.tag-check-option:hover { background: #f1f5fa; }
.tag-check-option input { width: auto; }
.tag-check-empty { padding: 0.45rem; }
.table-entry-actions { min-width: 40px; }
#entriesTable th:last-child,
#entriesTable td:last-child { width: 52px; text-align: right; }

/* v010 compact Clockify-style timer controls and inline entry editing */
.compact-timer-panel {
  display: grid;
  grid-template-columns: minmax(250px, 0.35fr) minmax(520px, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
}
.live-timer-display-block h2 { margin-bottom: 0.35rem; }
.live-timer-display-block .timer-display { font-size: clamp(2.2rem, 5vw, 4.3rem); line-height: 0.95; }
.active-start-editor {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.5rem;
  align-items: end;
  flex-wrap: wrap;
}
.active-start-editor label { min-width: 220px; }
.timer-quick-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.55fr) minmax(190px, 0.45fr) auto auto auto auto;
  gap: 0.55rem;
  align-items: center;
}
.timer-description-input,
.timer-project-select,
.timer-task-select { height: 46px; }
.timer-icon-button {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--primary);
}
.timer-icon-button.no-tags {
  background: #fdecec;
  border-color: #f5b9b9;
}
.timer-icon-button.has-tags {
  background: #eaf8ee;
  border-color: #a8dcb6;
}
.timer-icon-button img { width: 31px; height: 31px; display: block; opacity: 0.9; }
.timer-icon-button:hover { background: #eaf0f8; }
.timer-icon-button.no-tags:hover { background: #fbdede; }
.timer-icon-button.has-tags:hover { background: #ddf3e4; }
.timer-icon-button:hover img { opacity: 1; }
.timer-tag-picker { position: relative; }
.timer-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 1500;
  width: min(360px, 80vw);
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(16,32,57,0.18);
  padding: 0.75rem;
}
.popover-title { font-weight: 800; margin-bottom: 0.5rem; }
.timer-popover .tag-checklist { max-height: 260px; }
.timer-billable { white-space: nowrap; display: inline-flex; align-items: center; }
.timer-action-button { height: 46px; min-width: 78px; }
.inline-field {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  text-align: left;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  max-width: 100%;
}
.inline-field:hover {
  background: #eef4fc;
  outline: 1px solid #cbd8ea;
  cursor: pointer;
}
.time-description.inline-field { font-weight: 700; width: fit-content; max-width: 100%; }
.time-context.inline-field { color: #d75a0b; margin-top: 0.2rem; width: fit-content; max-width: 100%; }
.time-tags-inline { color: var(--primary); margin-top: 0.25rem; font-size: 0.86rem; background: #eaf0f8; padding: 0.18rem 0.45rem; border-radius: 999px; width: fit-content; max-width: 100%; }
.time-tags-inline:hover { outline: 1px solid #bfd0e5; }
.inline-time-group { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; }
.calendar-inline-button { width: 34px; height: 34px; }
.calendar-inline-button img { width: 22px; height: 22px; display: block; opacity: 0.88; }
.calendar-inline-button:hover img { opacity: 1; }
.time-duration.inline-field { justify-content: flex-end; text-align: right; padding: 0.15rem 0.25rem; }
.inline-edit-popover {
  position: fixed;
  z-index: 2000;
  width: min(390px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16,32,57,0.22);
  padding: 0.9rem;
}
.inline-edit-popover h3 { margin: 0 0 0.65rem; }
.inline-edit-popover > label, .inline-edit-popover .popover-field { margin-bottom: 0.65rem; }
.inline-edit-popover textarea { min-height: 100px; }
.inline-tag-list { max-height: 260px; margin-bottom: 0.7rem; }
.popover-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.7rem; }
@media (max-width: 1250px) {
  .compact-timer-panel { grid-template-columns: 1fr; }
  .timer-quick-form { grid-template-columns: minmax(240px, 1fr) minmax(210px, 0.7fr) minmax(170px, 0.55fr) auto auto auto auto; }
}
@media (max-width: 920px) {
  .timer-quick-form { grid-template-columns: 1fr 1fr; }
  .timer-tag-picker, .timer-billable, .timer-action-button { justify-self: start; }
}
@media (max-width: 640px) {
  .timer-quick-form { grid-template-columns: 1fr; }
  .inline-time-group { justify-content: flex-start; }
}

/* v011 live timer draft sync and larger custom icons */
.timer-tag-picker { display: inline-flex; justify-content: center; align-items: center; }

/* v013 roadmap/version and inline time-entry editing refinements */
.roadmap-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.roadmap-card.complete { background: #eef9ef; border-color: #b9e3bd; }
.roadmap-card.quote-placeholder { background: #fffaf0; border-color: #ecd7a6; }
.billable-inline { padding: 0.16rem 0.48rem; border-radius: 999px; width: fit-content; font-size: 0.82rem; margin-top: 0.25rem; }
.billable-inline.is-billable { background: #e6f4ea; color: #1f6f3a; }
.billable-inline.is-nonbillable { background: #f5f0f0; color: #8a3a37; }
.billable-inline:hover { outline: 1px solid #bfd0e5; }
.table-inline-field { padding: 0.18rem 0.32rem; max-width: 260px; }
.table-description-inline { font-weight: 700; }
.table-context-inline { color: #d75a0b; }
.table-tags-inline { margin-top: 0; }
.table-billable-inline { margin-top: 0; white-space: nowrap; }
#entriesTable td { vertical-align: middle; }
#entriesTable .time-duration { justify-content: flex-start; }

/* v014 billing status, print/report, and Clockify-style dashboard */
.billable-status-select { min-width: 132px; height: 38px; }
.billable-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.2;
}
.billable-chip.billable-yes { background: #e6f4ea; color: #18773f; }
.billable-chip.billable-no { background: #fdebea; color: #b12d28; }
.billable-chip.billable-extra { background: #e9f0ff; color: #275ecb; }
.billable-inline.is-billable_extra { background: #e9f0ff; color: #275ecb; }
.billable-inline.is-non_billable { background: #fdebea; color: #b12d28; }
.billable-inline.is-billable { background: #e6f4ea; color: #18773f; }
.dashboard-controls {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.dashboard-controls label { max-width: 180px; }
.dashboard-controls select,
.dashboard-controls input { min-height: 38px; }
.dashboard-range-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  flex-wrap: wrap;
}
#dashboardRangePreset { min-width: 150px; }
.range-display {
  min-height: 38px;
  border: 1px solid #d6deeb;
  border-radius: 10px;
  background: #fff;
  padding: 0.48rem 0.75rem;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(20,32,54,0.02);
}
.dashboard-custom-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #d6deeb;
  border-radius: 10px;
  padding: 0.25rem 0.35rem;
}
.dashboard-custom-dates[hidden] { display: none !important; }
.dashboard-custom-dates input { width: 142px; border: 0; min-height: 30px; padding: 0.15rem; }
.dashboard-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  overflow: hidden;
}
.dashboard-hero > div {
  padding: 1rem;
  min-height: 70px;
  background: #e9eef6;
  border-right: 1px solid #dbe2ec;
  text-align: center;
}
.dashboard-hero > div:last-child { border-right: 0; }
.dashboard-hero span { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 0.35rem; }
.dashboard-hero strong { font-size: 1.05rem; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.9rem;
  margin: 0.9rem 0;
}
.chart-panel { min-height: 300px; overflow: hidden; }
.bar-chart {
  height: 240px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(60px, 1fr);
  align-items: end;
  gap: 0.7rem;
  padding: 0.5rem 0.35rem 0;
  border-top: 1px solid #edf1f7;
  overflow: hidden;
}
.bar-chart[data-mode="month"] { grid-auto-columns: minmax(80px, 1fr); }
.bar-chart[data-mode="year"] { grid-auto-columns: minmax(90px, 1fr); }
.bar-day { height: 100%; display: grid; grid-template-rows: 22px 1fr 34px; align-items: end; text-align: center; color: var(--muted); font-size: 0.72rem; }
.bar-track { height: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #cbd8ea; }
.bar-fill { width: min(70%, 80px); background: #f06418; border-radius: 4px 4px 0 0; }
.bar-label { align-self: start; padding-top: 0.35rem; }
.project-bars { display: grid; gap: 0.65rem; padding-top: 0.4rem; }
.project-bar-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 68px 1fr 52px; gap: 0.55rem; align-items: center; font-size: 0.82rem; }
.project-bar-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-bar-row strong, .project-bar-row em { text-align: right; color: var(--muted); font-style: normal; }
.project-bar { height: 14px; background: #edf1f7; border-radius: 999px; overflow: hidden; }
.project-bar-fill { height: 100%; border-radius: 999px; background: #8d725f; }
.project-color-1 { background: #aa27d5; }
.project-color-2 { background: #8c745f; }
.project-color-3 { background: #f06418; }
.project-color-4 { background: #52a447; }
.project-color-5 { background: #2f7ecb; }
#teamActivityTable td { vertical-align: middle; }
#reportTable td { vertical-align: middle; }
@media (max-width: 1100px) {
  .dashboard-grid, .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-hero > div { border-right: 0; border-bottom: 1px solid #dbe2ec; }
}

/* v015 dashboard range selector and automatic chart aggregation */
@media (max-width: 760px) {
  .dashboard-controls { justify-content: flex-start; }
  .dashboard-range-control { width: 100%; }
  .range-display { width: 100%; text-align: left; }
}

/* v016 settings tabs, changelog viewer, and improved dashboard chart aggregation */
.settings-tab { display: none; }
.settings-tab.active { display: block; }
.settings-tab-row { margin-bottom: 0.85rem; }
.changelog-content { display: grid; gap: 0.45rem; }
.changelog-content h2 { margin: 0.35rem 0 0.1rem; font-size: 1.25rem; }
.changelog-content h3 { margin: 1rem 0 0.25rem; padding-bottom: 0.35rem; border-bottom: 1px solid #e3e9f2; color: var(--text); }
.changelog-content h4 { margin: 0.75rem 0 0.2rem; }
.changelog-content ul { margin: 0 0 0.25rem 1.1rem; padding: 0; }
.changelog-content li { margin: 0.22rem 0; }
.changelog-content p { margin: 0.25rem 0; color: var(--muted); }
.bar-chart[data-mode="hour"] { grid-auto-columns: minmax(36px, 1fr); gap: 0.35rem; }
.bar-chart[data-mode="day"] { grid-auto-columns: minmax(54px, 1fr); }
.bar-chart[data-mode="week"] { grid-auto-columns: minmax(72px, 1fr); }
.bar-chart[data-mode="month"] { grid-auto-columns: minmax(62px, 1fr); }
.bar-chart[data-mode="year"] { grid-auto-columns: minmax(80px, 1fr); }
.bar-chart[data-mode="hour"] .bar-label { font-size: 0.66rem; }
.bar-chart[data-mode="hour"] .bar-value { font-size: 0.66rem; }

/* v017 live timer tag summary, dashboard print/custom dates, and fixed 24-hour dashboard chart */
.active-start-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
}
.active-start-editor label { min-width: 230px; }
.active-timer-tags-line {
  display: grid;
  gap: 0.35rem;
  min-width: 220px;
}
.active-timer-tags-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem 0;
}
.no-tags-pill {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.8rem;
}
.dashboard-date-button {
  display: inline-grid;
  grid-template-columns: auto 150px;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  background: #fff;
  border: 1px solid #d6deeb;
  border-radius: 10px;
  padding: 0.35rem 0.45rem;
  font-weight: 700;
  white-space: nowrap;
}
.dashboard-date-button input {
  border: 0;
  min-height: 30px;
  padding: 0.1rem;
  width: 145px;
}
.range-display[hidden] { display: none !important; }
.bar-chart[data-mode="hour"] {
  grid-template-columns: repeat(24, minmax(0, 1fr));
  grid-auto-columns: unset;
  gap: 0.2rem;
}
.bar-chart[data-mode="hour"] .bar-fill { width: 80%; min-width: 4px; }
.bar-chart[data-mode="hour"] .bar-day { min-width: 0; }
.bar-chart[data-mode="hour"] .bar-label { font-size: 0.62rem; white-space: nowrap; }
.bar-chart[data-mode="hour"] .bar-value { font-size: 0.62rem; }
@media (max-width: 1300px) {
  .bar-chart[data-mode="hour"] .bar-label { font-size: 0.56rem; }
  .bar-chart[data-mode="hour"] .bar-value { font-size: 0.56rem; }
}


/* v018 dashboard/custom range, menu positioning, and admin task filters */
.admin-section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.admin-section-header h2 { margin: 0; }
.admin-filter-label { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.85rem; }
.admin-filter-label select { min-height: 36px; min-width: 120px; }
.dashboard-custom-dates { flex-wrap: nowrap; align-items: stretch; }
.dashboard-date-button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 38px; white-space: nowrap; color: var(--muted); font-size: 0.78rem; }
.dashboard-date-button input { width: 132px; border: 0; min-height: 30px; padding: 0.1rem; color: var(--text); }
.bar-day { grid-template-rows: 22px 1fr 46px; }
.bar-label { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; line-height: 1.1; overflow: visible; }
.bar-label span { display: block; }
.bar-chart[data-mode="hour"] { grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 0.05rem; padding-left: 0; padding-right: 0; }
.bar-chart[data-mode="hour"] .bar-day { grid-template-rows: 20px 1fr 34px; }
.bar-chart[data-mode="hour"] .bar-label, .bar-chart[data-mode="hour"] .bar-value { font-size: 0.50rem; letter-spacing: -0.02em; }
@media (max-width: 1500px) {
  .bar-chart[data-mode="hour"] .bar-label, .bar-chart[data-mode="hour"] .bar-value { font-size: 0.46rem; }
}

/* v019 role permissions and CRM roadmap styling */
.role-permissions-wrap { max-height: none; }
.role-permissions-table th,
.role-permissions-table td { text-align: center; }
.role-permissions-table th:first-child,
.role-permissions-table td:first-child { text-align: left; min-width: 260px; }
.role-permissions-table tbody tr:nth-child(even) { background: #f8fafc; }
.role-permissions-table td:not(:first-child) { font-weight: 700; }
.role-notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.role-notes-grid > div,
.crm-card {
  border: 1px solid #dbe2ec;
  border-radius: 14px;
  background: #fbfcfe;
}
.role-notes-grid > div { padding: 1rem; }
.role-notes-grid h3 { margin: 0 0 0.35rem; }
.role-notes-grid p { margin: 0; color: var(--muted); line-height: 1.45; }
.crm-card { border-left: 4px solid #52a447; }
@media (max-width: 1100px) {
  .role-notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .role-notes-grid { grid-template-columns: 1fr; }
}

/* v020 module switcher and CRM foundation */
.module-switcher {
  display: grid;
  gap: 0.35rem;
  padding: 0.35rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
}
.module-btn {
  width: 100%;
  justify-content: flex-start;
  color: #cbd6e4;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 700;
}
.module-btn:hover,
.module-btn.active { background: rgba(255,255,255,0.14); color: #fff; }
.nav-group { display: none !important; }
.nav-group.active { display: grid !important; gap: 0.35rem; }
.crm-tab { display: none; }
.crm-tab.active { display: block; }
.crm-tab-row { margin-bottom: 0.85rem; }
.accounting-card { border-left: 4px solid #31459a; }
@media (max-width: 760px) {
  .module-switcher { grid-template-columns: 1fr; }
}

/* v023 CRM quote/product groundwork */
.quote-line-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e6eaf3);
}

.quote-line-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.quote-line-panel-head-left { justify-content: flex-start; }
.quote-line-panel-head h3 { margin: 0; }
.line-type-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: #eaf0f8;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
}
.segmented-btn {
  background: transparent;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-width: 88px;
}
.segmented-btn.active {
  background: var(--primary);
  color: #fff;
}

.quote-line-form {
  background: #f8fafc;
  border: 1px solid var(--border, #e6eaf3);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.crm-tab-row {
  flex-wrap: wrap;
}

/* v025 module switcher, CRM sidebar navigation, and QuickBooks-style quote builder */
.module-switcher {
  background: linear-gradient(135deg, rgba(42, 71, 169, 0.95), rgba(56, 142, 80, 0.92));
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 22px rgba(0,0,0,0.14);
}
.module-btn {
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
}
.module-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.module-btn.active {
  background: #fff;
  color: #20376f;
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 8px 18px rgba(16,32,57,0.18);
}
.quote-builder-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.quote-builder-actions {
  display: flex;
  gap: 0.6rem;
  align-items: end;
  min-width: min(520px, 100%);
}
.quote-builder-actions label { flex: 1; }
.quote-builder-form {
  display: grid;
  gap: 0.85rem;
}
.quote-form-card {
  background: #f8fafc;
  border: 1px solid #e1e7f0;
  border-radius: 16px;
  padding: 1rem;
}
.quote-form-card-top {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.25fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.quote-form-card h3 { margin-top: 0; }
.quote-address-grid,
.quote-meta-grid,
.quote-project-card {
  display: grid;
  gap: 0.75rem;
}
.quote-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-project-card { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quote-project-card .full-width,
.quote-builder-form .full-width { grid-column: 1 / -1; }
.quickbooks-line-form {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.1fr) 100px minmax(320px, 2fr) 80px 110px 120px auto;
  gap: 0.65rem;
  align-items: end;
  background: #fff;
}
.quote-line-type-cell {
  align-self: end;
  margin-bottom: 0;
}
.line-product-service-select select { min-width: 180px; }
.quickbooks-line-form .line-description textarea { min-height: 42px; }
#crmInvoiceLineItemForm.quickbooks-line-form {
  grid-template-columns: minmax(180px, 1.1fr) 100px minmax(320px, 2fr) 80px 110px 120px auto;
}
.quote-list-panel { margin-top: 1rem; }
@media (max-width: 1350px) {
  .quote-form-card-top { grid-template-columns: 1fr; }
  .quote-project-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quickbooks-line-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #crmInvoiceLineItemForm.quickbooks-line-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quickbooks-line-form .quote-line-type-cell { grid-column: 1 / -1; width: fit-content; }
  .quickbooks-line-form .line-description { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .quote-builder-head, .quote-builder-actions { flex-direction: column; align-items: stretch; }
  .quote-address-grid, .quote-meta-grid, .quote-project-card, .quickbooks-line-form { grid-template-columns: 1fr; }
  #crmInvoiceLineItemForm.quickbooks-line-form { grid-template-columns: 1fr; }
}

/* v026-v027 horizontal subtabs for Time Tracking sections */
.subtab-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.85rem;
}
.timer-subtab,
.entries-subtab,
.admin-subtab-panel {
  display: none;
}
.timer-subtab.active,
.entries-subtab.active,
.admin-subtab-panel.active {
  display: block;
}
.timer-subtab.active {
  display: grid;
  gap: 1rem;
}
.entries-subtab.active.panel,
.admin-subtab-panel.active.panel {
  display: block;
}
.admin-subtab-panel h2,
.entries-subtab h2 {
  margin-top: 0;
}
.admin-subtab-row {
  margin-bottom: 1rem;
}

/* v027 Admin task workflow refinements */
.task-selector-form {
  margin-bottom: 1rem;
}
.task-add-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* v028 Admin task layout: separate add window and task list window */
.task-window {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  margin-top: 1rem;
}
.task-window h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}
.task-top-window .grid-form {
  margin: 0;
}
.task-add-form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.task-form-disabled label:nth-of-type(n+3) {
  opacity: 0.65;
}
.task-bottom-window .table-wrap {
  margin-top: 0;
}
#tasksTable th:first-child,
#tasksTable td:first-child {
  width: 64px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

/* v029 CRM horizontal subtabs within each sidebar section */
.crm-subtab-row {
  margin-bottom: 1rem;
}
.crm-subtab-panel {
  display: none;
}
.crm-subtab-panel.active {
  display: block;
}
.crm-subtab-panel h2 {
  margin-top: 0;
}

/* v030 CRM client master + accounting tax-code setup */
.accounting-subtab-row { margin-bottom: 1rem; }
.accounting-subtab-panel { display: none; }
.accounting-subtab-panel.active { display: block; }
.accounting-purchase-items-subtab-row { margin-bottom: 1rem; }
.accounting-purchase-items-subtab[hidden] { display: none !important; }
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem 1rem;
  background: #fbfcff;
}
.form-fieldset legend {
  padding: 0 0.5rem;
  color: var(--primary);
  font-weight: 800;
}
.client-detail-form .form-fieldset label {
  min-width: 0;
}
.client-detail-form .form-fieldset input,
.client-detail-form .form-fieldset select {
  width: 100%;
}

/* v032 CRM account/contact refinements */
.link-button.table-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent, #4051a3);
  font: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.link-button.table-link:hover { text-decoration: underline; }
.readonly-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding: 6px 0 14px;
}
.readonly-detail-row {
  border-bottom: 1px solid var(--border, #e4e7f0);
  padding: 8px 0;
  min-height: 42px;
}
.readonly-detail-row strong {
  display: block;
  color: var(--muted, #6b7280);
  font-size: 12px;
  margin-bottom: 3px;
}
.readonly-detail-row span {
  color: var(--text, #111827);
  white-space: normal;
}
@media (max-width: 900px) {
  .readonly-detail-grid { grid-template-columns: 1fr; }
}

/* v033 branding/account refinements */
.crm-account-link, .crm-contact-link { color: var(--text) !important; font-weight: 600; }
.client-detail-form .checkbox-row.inline-checkbox {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  justify-self: start;
  align-self: end;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
.client-detail-form .checkbox-row.inline-checkbox input { width: auto; margin: 0; }


/* v036 module-specific Settings and About tabs */
.about-tab { display: none; }
.about-tab.active { display: block; }
.module-settings-panel { display: block; }
.module-settings-panel[hidden] { display: none !important; }
.compact-settings-form { max-width: 900px; }
.settings-preview { background: #f5f7ff; border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; }
#projectNumberPreview { font-size: 1.1rem; color: var(--brand); }

/* v046 global confirmation dialog tones: information=white, caution=amber, warning/delete=red */
.confirm-card { max-width: 560px; }
.confirm-message { color: var(--text); line-height: 1.45; padding: 0.25rem 0 0.75rem; }
.confirm-message p { margin: 0 0 0.75rem; }
.confirm-actions { justify-content: flex-end; }
.confirm-info .modal-card {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-top: 0;
}
.confirm-caution .modal-card {
  border: 1px solid #92400e;
  border-top: 0;
  background: #d97706;
  color: #fff;
}
.confirm-warning .modal-card,
.confirm-danger .modal-card {
  border: 1px solid #7f1d1d;
  border-top: 0;
  background: #a83232;
  color: #fff;
}
.modal-card.confirm-caution-card {
  border: 1px solid #92400e !important;
  background: #d97706 !important;
  color: #fff !important;
}
.modal-card.confirm-warning-card,
.modal-card.confirm-danger-card {
  border: 1px solid #7f1d1d !important;
  background: #a83232 !important;
  color: #fff !important;
}
.modal-card.confirm-info-card {
  background: #fff !important;
  color: var(--text) !important;
}
.confirm-caution .modal-header h2,
.confirm-caution .confirm-message,
.confirm-caution .confirm-message p,
.confirm-caution .icon-button,
.confirm-warning .modal-header h2,
.confirm-warning .confirm-message,
.confirm-warning .confirm-message p,
.confirm-warning .icon-button,
.confirm-danger .modal-header h2,
.confirm-danger .confirm-message,
.confirm-danger .confirm-message p,
.confirm-danger .icon-button { color: #fff; }
.confirm-caution #appConfirmOk {
  background: #fff;
  color: #92400e;
  font-weight: 700;
}
.confirm-warning #appConfirmOk,
.confirm-danger #appConfirmOk {
  background: #fff;
  color: #7f1d1d;
  font-weight: 700;
}
.confirm-caution #appConfirmCancel,
.confirm-warning #appConfirmCancel,
.confirm-danger #appConfirmCancel {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.55);
}
#crmQuoteNumber[readonly], #editCrmQuoteNumber[readonly] { background: #f5f7ff; color: var(--muted); cursor: not-allowed; }
#crmProductsSettingsTab[hidden], #crmProjectNumbersSettingsTab[hidden], #crmQuoteFilesSettingsTab[hidden], #crmCustomerNotesSettingsTab[hidden] { display: none !important; }

/* v043-v046 quote builder validation, layout, and exit-button refinements */
.quote-notes-card {
  margin-top: 20px;
}


.crm-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.crm-list-header h2 { margin: 0; }
.crm-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}
.crm-filter-label select { min-width: 120px; }

/* v076 searchable/sortable lists, quote totals, and payment workflow */
.list-header-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.list-search-label {
  display: inline-grid;
  gap: 0.25rem;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.list-search-label input { min-width: 240px; }
.sort-header-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
}
.sort-header-button:hover { background: transparent; color: var(--primary); }
.sort-arrow { min-width: 0.8rem; color: #7a8798; font-size: 0.78rem; }
.sort-header-button.active .sort-arrow { color: var(--primary); }
.quote-totals-card {
  width: min(440px, 100%);
  margin: 20px 0 0 auto;
  padding: 0.85rem 1rem;
  background: #fff;
}
.quote-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e7edf5;
}
.quote-totals-row:last-child { border-bottom: 0; }
.quote-total-final { font-size: 1.12rem; color: var(--primary); }
.payment-modal-card { max-width: 720px; }
.payment-selector-card { max-width: 900px; }
.payment-selector-card .table-link { font-weight: 700; }

/* v077 dual-currency accounting dashboard and expanded accounting preferences */
.accounting-glance-title { margin: 1.35rem 0 0.75rem; }
.accounting-glance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.accounting-glance-card {
  min-width: 0;
  min-height: 285px;
  padding: 1.1rem;
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(27, 44, 75, 0.04);
}
.accounting-cash-card { grid-column: 1 / span 2; min-height: 330px; }
.accounting-outstanding-bills-card { min-height: 330px; }
.accounting-glance-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.accounting-glance-head > div { display: grid; gap: 0.2rem; }
.accounting-glance-head > div > span { font-weight: 800; color: #101b31; }
.accounting-glance-head > div > small, .accounting-glance-head > span { color: var(--muted); font-size: 0.76rem; }
.accounting-glance-head > select { width: auto; min-width: 142px; min-height: 34px; padding: 0.35rem 1.9rem 0.35rem 0.55rem; border: 1px solid #ccd6e3; border-radius: 9px; background: #fff; color: #33435a; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.accounting-glance-summary { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.currency-summary { display: grid; gap: 0.15rem; }
.currency-summary strong { font-size: 1.25rem; color: #10203a; }
.currency-summary small { color: var(--muted); }
.dual-currency-values { display: grid; gap: 0.18rem; }
.dual-currency-values strong { display: block; }
.metric-card .dual-currency-values strong { font-size: 1.03rem; }
.accounting-bars { display: grid; grid-template-columns: repeat(6, minmax(28px, 1fr)); gap: 0.55rem; height: 145px; align-items: end; padding-top: 0.5rem; }
.accounting-bar-month { display: grid; grid-template-rows: 1fr auto; gap: 0.35rem; height: 100%; min-width: 0; }
.accounting-bar-stack { display: flex; align-items: end; justify-content: center; gap: 3px; min-height: 0; }
.accounting-bar { width: min(16px, 42%); min-height: 2px; border-radius: 5px 5px 2px 2px; }
.accounting-bar-cad { background: #55b98d; }
.accounting-bar-usd { background: #4657a8; }
.accounting-bar-other { background: #d99035; }
.accounting-bar-month > small { text-align: center; color: var(--muted); font-size: 0.68rem; white-space: nowrap; overflow: hidden; }
.accounting-chart-legend { display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 0.65rem; color: var(--muted); font-size: 0.73rem; }
.accounting-chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.25rem; }
.accounting-receivables-glance { display: grid; gap: 0.8rem; }
.receivable-currency-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 0.65rem; }
.receivable-donut { width: 50px; height: 50px; border-radius: 50%; position: relative; }
.receivable-donut::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #fff; }
.receivable-currency-row strong { display: block; }
.receivable-currency-row small { color: var(--muted); }
.outstanding-bill-badge { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: #eef1ff; color: #4657a8; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.04em; }
.accounting-cash-flow-glance { display: grid; gap: 1rem; }
.cash-currency-block { display: grid; gap: 0.45rem; min-width: 0; overflow-x: auto; }
.cash-currency-chart { display: grid; grid-template-columns: 72px 1fr; gap: 0.75rem; align-items: center; min-width: 992px; }
.cash-currency-chart > strong { color: #20376f; }
.cash-currency-chart > strong small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.cash-currency-chart svg { width: 100%; height: 90px; overflow: visible; }
.cash-grid-line { stroke: #e4e9f0; stroke-width: 1; }
.cash-line-cad { stroke: #55b98d; fill: rgba(85,185,141,0.18); }
.cash-line-usd { stroke: #4657a8; fill: rgba(70,87,168,0.16); }
.cash-line-other { stroke: #d99035; fill: rgba(217,144,53,0.14); }
.cash-axis-labels { display: flex; justify-content: space-between; margin-left: 72px; color: var(--muted); font-size: 0.68rem; }
.cash-month-values { display: grid; grid-template-columns: repeat(12, minmax(72px, 1fr)); gap: 0.25rem; min-width: 992px; padding: 0.35rem 0 0 84px; }
.cash-month-values > div { min-width: 0; padding: 0.35rem 0.25rem; border-top: 1px solid #e6ebf2; text-align: center; }
.cash-month-values span, .cash-month-values strong { display: block; white-space: nowrap; }
.cash-month-values span { color: var(--muted); font-size: 0.66rem; }
.cash-month-values strong { margin-top: 0.18rem; color: #263c68; font-size: 0.64rem; }
.settings-button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.settings-switch { display: inline-flex; align-items: center; gap: 0.65rem; cursor: pointer; font-weight: 700; }
.settings-switch input { position: absolute; opacity: 0; pointer-events: none; }
.settings-switch-track { width: 44px; height: 24px; padding: 2px; border-radius: 999px; background: #b9c4d2; transition: background 0.2s ease; }
.settings-switch-track::after { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25); transition: transform 0.2s ease; }
.settings-switch input:checked + .settings-switch-track { background: #3f8f5d; }
.settings-switch input:checked + .settings-switch-track::after { transform: translateX(20px); }
.client-detail-form select[multiple] { min-height: 132px; }
#closingDateWrap[hidden] { display: none !important; }
@media (max-width: 1180px) {
  .accounting-glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-cash-card { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .list-header-actions, .crm-list-header, .entries-list-header, .admin-section-header, .section-head-row { align-items: stretch; }
  .list-search-label, .list-search-label input { min-width: 0; width: 100%; }
  .accounting-glance-grid { grid-template-columns: 1fr; }
  .accounting-cash-card { grid-column: 1; }
  .accounting-bars { gap: 0.25rem; }
}
#timeProjectsWorkspaceHost > .admin-tab,
#timeAdminSettingsHost > .admin-tab,
#aboutAdminHost > .admin-tab { margin-top: 1rem; }

/* v050 quote line editing, drag reorder, and editing-state tab */
.tab-btn.editing-quote-tab,
.tab-btn.editing-quote-tab.active {
  background: #d97706;
  color: #fff;
  border-color: #92400e;
}
.quote-line-drag-handle {
  cursor: grab;
  user-select: none;
  color: var(--muted);
  font-weight: 800;
  display: inline-flex;
  min-width: 18px;
  justify-content: center;
}
.quote-line-row.dragging td { opacity: 0.5; background: #fff7ed; }
.quote-line-row.drag-over td { background: #fff7ed; border-top: 2px solid #d97706; }
.quote-line-actions { display: inline-flex; gap: 0.25rem; align-items: center; }
.quote-line-editing-note { color: #92400e; font-weight: 700; }

/* v051: add breathing room between internal notes and quote/invoice action buttons */
.quote-internal-notes {
  margin-bottom: 14px;
}
.quote-bottom-actions {
  margin-top: 8px;
}

/* v053 live timer layout and company payment settings */
.compact-timer-panel {
  grid-template-columns: 1fr;
  align-items: start;
}
.live-timer-top-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1fr);
  gap: 1rem;
  align-items: end;
}
.live-timer-active-details {
  justify-content: start;
}
.live-timer-grid-form {
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr) minmax(360px, 1.4fr) auto minmax(140px, 0.5fr) auto;
  align-items: end;
}
.timer-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}
.timer-field input,
.timer-field select,
.timer-description-input,
.timer-project-select,
.timer-account-select,
.billable-status-select { height: 46px; }
.timer-tags-field { justify-content: start; align-items: start; gap: 0.25rem; }
.timer-tags-field .timer-icon-button { margin-top: 0; }
.timer-billable { display: grid; align-items: end; }
.timer-start-stop-field { display: flex; align-items: end; gap: 0.45rem; }
.company-logo-preview-wrap { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.payment-instructions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.company-logo-preview { max-height: 72px; max-width: 220px; object-fit: contain; border: 1px solid var(--panel-border); border-radius: 10px; padding: 0.35rem; background: #fff; }
@media (max-width: 1500px) {
  .live-timer-top-row { grid-template-columns: 1fr; }
  .live-timer-grid-form { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .timer-start-stop-field { grid-column: span 1; }
}
@media (max-width: 920px) {
  .live-timer-grid-form { grid-template-columns: 1fr 1fr; }
  .payment-instructions-grid { grid-template-columns: 1fr; }
  .timer-task-field { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .live-timer-grid-form { grid-template-columns: 1fr; }
  .timer-task-field { grid-column: auto; }
}

.auth-version { margin-top: 0.35rem; font-size: 0.78rem; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
input.locked-due-date { background: #f3f5fb; cursor: not-allowed; color: #5d6782; }

/* v060 project workspace + v059 Accounting shell + configurable project fields */
.accounting-tab,
.accounting-sales-panel {
  display: none;
}
.accounting-tab.active,
.accounting-sales-panel.active {
  display: block;
}
.section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head-row h2 {
  margin-top: 0;
}
.accounting-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.placeholder-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.placeholder-card h3 {
  margin-top: 0;
}
.small-button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}
.project-fields-form fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .section-head-row { flex-direction: column; align-items: stretch; }
  .accounting-placeholder-grid { grid-template-columns: 1fr; }
}

/* v063 CRM analytics dashboard */
:root {
  --crm-chart-1: #f06418;
  --crm-chart-2: #2f7ecb;
  --crm-chart-3: #52a447;
  --crm-chart-4: #8d725f;
  --crm-chart-5: #aa27d5;
  --crm-chart-6: #d7a21c;
}
.crm-dashboard-shell {
  display: none;
  gap: 1rem;
}
.crm-dashboard-shell.active {
  display: grid;
}
.crm-dashboard-intro {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}
.crm-dashboard-panel h3 {
  margin: 0 0 0.35rem;
}
.crm-dashboard-panel h4 {
  margin: 1rem 0 0.45rem;
  color: var(--text);
}
.crm-dashboard-cards {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.crm-dashboard-cards.compact {
  margin-bottom: 0.9rem;
}
.crm-dashboard-card strong {
  font-size: 1.35rem;
  line-height: 1.2;
}
.crm-dashboard-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.crm-bars {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.6rem;
}
.crm-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(160px, 1fr) minmax(90px, auto);
  gap: 0.65rem;
  align-items: center;
  font-size: 0.86rem;
}
.crm-bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-bar-row strong {
  text-align: right;
  color: var(--muted);
  font-weight: 700;
}
.crm-bar-track {
  min-height: 16px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}
.crm-bar-fill {
  min-height: 16px;
  border-radius: 999px;
  background: var(--crm-chart-1);
}
.crm-accent-1 { background: var(--crm-chart-1); }
.crm-accent-2 { background: var(--crm-chart-2); }
.crm-accent-3 { background: var(--crm-chart-3); }
.crm-accent-4 { background: var(--crm-chart-4); }
.crm-accent-5 { background: var(--crm-chart-5); }
.crm-pie-block {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  align-items: center;
  margin: 0.6rem 0 0.8rem;
}
.crm-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.crm-donut::after {
  content: '';
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--panel-border);
}
.crm-donut span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: var(--text);
}
.crm-pie-legend {
  display: grid;
  gap: 0.45rem;
}
.crm-pie-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(80px, 1fr) auto 42px;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.84rem;
}
.crm-pie-legend-row i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.crm-pie-legend-row strong,
.crm-pie-legend-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}
@media (max-width: 1150px) {
  .crm-dashboard-two-col { grid-template-columns: 1fr; }
  .crm-pie-block { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 760px) {
  .crm-bar-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .crm-bar-row strong { text-align: left; }
}

.owner-budget-hint-active { color: #315d96; font-weight: 600; }

/* v066 UI cleanup: dashboard controls, live timer start popover, and tag bubbles */
.dashboard-controls.dashboard-controls-split {
  justify-content: space-between;
  align-items: flex-start;
}
.dashboard-control-left {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.dashboard-control-left label {
  display: grid;
  gap: 0.2rem;
}
.dashboard-range-stack {
  display: grid;
  gap: 0.25rem;
}
.dashboard-range-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.dashboard-print-right {
  margin-left: auto;
}
.live-timer-display-block { position: relative; }
.timer-display-button {
  display: inline-block;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.timer-display-button:hover { filter: brightness(0.92); }
.timer-display-button:focus-visible { outline: 3px solid rgba(47, 111, 237, 0.28); outline-offset: 4px; border-radius: 12px; }
.timer-start-popover {
  position: absolute;
  top: calc(100% - 0.25rem);
  left: 0;
  z-index: 30;
  min-width: 330px;
  padding: 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(20, 32, 54, 0.18);
}
.timer-start-time-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0 !important;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.timer-start-time-row input {
  height: 42px;
  letter-spacing: normal;
  text-transform: none;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.timer-start-time-row strong {
  color: var(--muted);
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.9rem;
}
.active-timer-tags-below {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e5eaf3;
}
.entries-list-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .dashboard-controls.dashboard-controls-split { display: grid; }
  .dashboard-control-left { width: 100%; }
  .dashboard-print-right { margin-left: 0; }
  .timer-start-popover { position: static; margin-top: 0.4rem; min-width: 0; }
  .timer-start-time-row { grid-template-columns: 1fr; }
}


/* v067 tag checklist density and dashboard control alignment */
.tag-checklist {
  gap: 0;
  padding: 0.3rem;
}
.tag-check-option {
  gap: 0.42rem;
  padding: 0.22rem 0.32rem;
  line-height: 1.15;
  min-height: 30px;
}
.tag-check-option span {
  line-height: 1.15;
}
.inline-edit-popover .tag-check-option,
.timer-popover .tag-check-option {
  margin-bottom: 0 !important;
}
.inline-edit-popover .inline-tag-list,
.timer-popover .tag-checklist {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.dashboard-control-left {
  display: grid;
  grid-template-columns: auto auto;
  align-items: start;
  column-gap: 0.6rem;
  row-gap: 0.25rem;
}
.dashboard-view-block {
  width: 76px;
}
.dashboard-view-block select {
  min-width: 76px;
}
.dashboard-range-stack {
  gap: 0.4rem;
}
.dashboard-range-row {
  gap: 0.55rem;
  align-items: center;
  flex-wrap: nowrap;
}
#dashboardRangePreset {
  min-width: 220px;
}
.dashboard-range-nav {
  display: inline-flex;
  gap: 0.45rem;
}
.dashboard-range-nav .secondary {
  min-width: 38px;
}
#dashboardRangeLabel {
  width: max-content;
  min-width: 260px;
  text-align: left;
}
@media (max-width: 900px) {
  .dashboard-control-left {
    grid-template-columns: 1fr;
  }
  .dashboard-view-block {
    width: 100%;
  }
  #dashboardRangePreset, #dashboardRangeLabel {
    width: 100%;
    min-width: 0;
  }
  .dashboard-range-row {
    flex-wrap: wrap;
  }
}


/* v068 live timer tag popover and dashboard header final alignment */
.tag-check-option input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 16px;
}
.timer-tags-field .tag-checklist,
#timerTagsPopover .tag-checklist {
  min-height: 0;
  padding: 0.25rem;
  gap: 0;
}
.timer-tags-field .tag-check-option,
#timerTagsPopover .tag-check-option {
  min-height: 28px;
  padding: 0.18rem 0.3rem;
  gap: 0.42rem;
  line-height: 1.12;
}
#timerTagsPopover .popover-title {
  margin-bottom: 0.35rem;
}
.dashboard-controls.dashboard-controls-split {
  display: grid !important;
  grid-template-columns: max-content 1fr max-content;
  align-items: start;
  column-gap: 0.65rem;
  row-gap: 0;
  width: 100%;
}
.dashboard-control-left {
  grid-column: 1 / 3;
  display: grid !important;
  grid-template-columns: max-content max-content;
  align-items: start;
  column-gap: 0.65rem;
  row-gap: 0;
  width: max-content;
}
.dashboard-view-block {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 76px;
  margin: 0;
}
.dashboard-range-stack {
  grid-column: 2;
  display: grid !important;
  gap: 0.35rem;
  width: max-content;
}
.dashboard-range-row {
  display: grid !important;
  grid-template-columns: 220px max-content;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}
.dashboard-range-nav {
  display: inline-flex;
  gap: 0.45rem;
}
.dashboard-range-nav .secondary {
  width: 38px;
  min-width: 38px;
  padding-left: 0;
  padding-right: 0;
}
#dashboardRangePreset {
  width: 220px;
  min-width: 220px;
}
#dashboardRangeLabel {
  width: 220px;
  min-width: 220px;
  justify-content: center;
  text-align: center;
}
.dashboard-print-right {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-left: 0 !important;
}
@media (max-width: 900px) {
  .dashboard-controls.dashboard-controls-split {
    grid-template-columns: 1fr;
  }
  .dashboard-control-left {
    grid-column: 1;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .dashboard-view-block {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
  .dashboard-range-stack {
    grid-column: 1;
    width: 100%;
  }
  .dashboard-range-row {
    grid-template-columns: 1fr max-content;
  }
  #dashboardRangePreset,
  #dashboardRangeLabel {
    width: 100%;
    min-width: 0;
  }
  .dashboard-print-right {
    grid-column: 1;
    justify-self: start;
  }
}


/* v069 dashboard view simplification */
.dashboard-view-block {
  display: flex !important;
  align-items: flex-start;
  padding-top: 0 !important;
}
.dashboard-view-block select {
  min-height: 38px;
  width: 86px;
}
.dashboard-control-left label.dashboard-view-block {
  display: flex !important;
}

/* v078 multicurrency, paid invoice archive, and purchasing workspace */
.paid-invoices-window {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--panel-border);
}
.paid-invoices-window h3 { margin-bottom: 0.2rem; }
.multicurrency-setting { position: relative; display: grid; gap: 0.45rem; align-content: start; }
.multicurrency-controls { position: relative; display: grid; gap: 0.5rem; }
.multicurrency-trigger { width: min(280px, 100%); text-align: left; display: flex; justify-content: space-between; }
.multicurrency-dropdown {
  position: absolute;
  z-index: 50;
  top: 42px;
  left: 0;
  width: min(330px, 90vw);
  padding: 0.6rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(26, 43, 65, 0.2);
}
.currency-checkbox-group { display: grid; gap: 0.15rem; max-height: 250px; overflow-y: auto; margin-bottom: 0.55rem; padding-right: 0.2rem; }
.client-detail-form .form-fieldset .currency-check-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  padding: 0.48rem 0.55rem;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text);
}
.currency-check-option:hover { background: var(--bg); }
.client-detail-form .form-fieldset .currency-check-option input[type="checkbox"] { width: 18px !important; height: 18px !important; min-width: 18px !important; margin: 0 !important; padding: 0 !important; }
.currency-option-text { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0.35rem; align-items: baseline; min-width: 0; line-height: 1.25; }
.currency-option-text strong { color: var(--text); }
.currency-option-text span { color: var(--muted); overflow-wrap: anywhere; }
.multicurrency-dropdown .small-button { display: block; margin-left: auto; }
.selected-currency-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 28px; }
.currency-chip { padding: 0.22rem 0.55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--panel-border); font-size: 0.84rem; font-weight: 700; }
.purchases-panel, .accounting-sales-panel { display: none; }
.purchases-panel.active, .accounting-sales-panel.active { display: block; }
.purchases-subtab-row { margin-bottom: 1rem; }
.purchase-modal-card { width: min(850px, 95vw); max-height: 92vh; overflow: auto; }
.purchase-order-modal-card { width: min(1120px, 97vw); }
.purchase-line-builder { margin: 1rem 0; padding: 1rem; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg); }
.purchase-line-form { display: grid; grid-template-columns: 120px minmax(240px, 1fr) 100px 130px 150px auto; gap: 0.65rem; align-items: end; }
.purchase-line-form label { margin: 0; }
.purchase-total-strip { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 1.5rem; margin-top: 0.75rem; font-size: 0.95rem; }
.purchase-total-strip span { display: grid; gap: 0.15rem; min-width: 120px; }
.purchase-total-strip strong { font-size: 1.05rem; }
.purchase-row-actions { display: inline-flex; gap: 0.35rem; }
@media (max-width: 900px) {
  .purchase-line-form { grid-template-columns: 1fr 1fr; }
  .purchase-line-description { grid-column: 1 / -1; }
}
