/* Warm Minimalist Design System — inspired by "Тагильская, 4" reference */
:root {
  --bg-plaster: #e4ddd1;
  --bg-plaster-light: #ece6dc;
  --bg-plaster-warm: #dcd3c5;
  --card-bg: rgba(252, 249, 245, 0.94);
  --card-bg-solid: #fcf9f5;
  --card-border: rgba(196, 178, 158, 0.42);
  --pill-bg: #e7d9c9;
  --icon-circle: #e6d8c8;
  --total-bg-top: #e4d4c2;
  --total-bg-bot: #d8c3ad;
  --ink-primary: #2b1e16;
  --ink-secondary: #5a4638;
  --ink-muted: #867160;
  --accent: #7a5c44;
  --accent-dark: #5e4431;
  --accent-soft: rgba(122, 92, 68, 0.12);
  --danger: #a64438;
  --danger-soft: rgba(166, 68, 56, 0.1);
  --success: #4a7352;
  --divider: rgba(154, 132, 111, 0.32);
  --shadow-card: 0 8px 26px rgba(68, 48, 32, 0.065), 0 1px 2px rgba(68, 48, 32, 0.04);
  --shadow-float: 0 18px 46px rgba(48, 32, 20, 0.14);
  --radius-card: 18px;
  --radius-pill: 10px;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: var(--bg-plaster);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(155deg, #ede3d7 0%, #e7dbcd 48%, #e2d3c2 100%);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* =========================================================
   THE ESTIMATE SHEET (Shared by Live View & PNG/PDF Export)
   ========================================================= */

.estimate-sheet {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 44px 36px 38px;
  background-color: var(--bg-plaster);
  background-image:
    url("/static/img/bg-top.webp"),
    url("/static/img/bg-bottom-left.webp"),
    linear-gradient(170deg, #e7e0d4 0%, #e4ddd1 48%, #ded6c9 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: top center, bottom left, center;
  background-size: 100% auto, 42% auto, 100% 100%;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(62, 42, 26, 0.10);
  overflow: hidden;
}

.estimate-sheet.is-export {
  width: 920px;
  max-width: 920px;
  border-radius: 0;
  box-shadow: none;
  padding: 52px 40px 44px;
}

.sheet-header {
  position: relative;
  z-index: 2;
  max-width: 62%;
  padding-top: 16px;
  padding-bottom: 52px;
}

.sheet-brand {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 10px;
  opacity: 0.9;
}

.sheet-address {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  word-break: break-word;
}

.sheet-title-rule {
  width: 150px;
  height: 1.5px;
  background: rgba(94, 71, 52, 0.42);
  margin: 18px 0 14px;
}

.sheet-subtitle {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.48;
  text-transform: uppercase;
  color: var(--ink-secondary);
  white-space: pre-line;
}

/* 2-column Masonry-style / Balanced Grid */
.cards-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* Individual Section Card */
.section-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
}

.section-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.section-icon-badge {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--icon-circle);
  border: 1px solid rgba(173, 149, 123, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-primary);
}

.section-icon-badge svg {
  width: 28px;
  height: 28px;
}

.section-title-wrap {
  flex: 1;
  min-width: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.22;
  color: var(--ink-primary);
  word-break: break-word;
}

.section-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.item-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.38;
  color: var(--ink-primary);
}

.item-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.item-price {
  flex: 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-primary);
}

.section-empty {
  font-size: 13.5px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 6px 0;
}

.section-total-bar {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--pill-bg);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
}

.section-total-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.section-total-value {
  font-family: var(--font-serif);
  font-size: 18.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-primary);
}

/* Grand Total Card */
.grand-total-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(155deg, var(--total-bg-top) 0%, var(--total-bg-bot) 100%);
  border: 1px solid rgba(173, 146, 118, 0.45);
  border-radius: var(--radius-card);
  padding: 26px 24px 22px;
  box-shadow: var(--shadow-card);
}

.grand-total-card.span-full {
  grid-column: 1 / -1;
}

.grand-total-label {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

.grand-total-amount {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  margin-bottom: 18px;
}

.grand-total-divider {
  height: 1px;
  background: rgba(94, 71, 52, 0.25);
  margin-bottom: 14px;
}

.grand-total-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grand-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 16.5px;
  color: var(--ink-primary);
}

.grand-meta-row.subtle {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.grand-meta-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Optional Extra Blocks on Export (Receipts / Work Log) */
.extra-export-card {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-card);
}

.log-export-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-export-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(154, 132, 111, 0.24);
}

.log-export-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.log-export-date {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--accent-dark);
  white-space: nowrap;
}

/* Sheet Footer Signature */
.sheet-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
  padding-top: 6px;
}

.sheet-footer-line {
  flex: 1;
  max-width: 240px;
  height: 1px;
  background: rgba(94, 71, 52, 0.30);
}

.sheet-footer-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  text-align: center;
}

/* =========================================================
   APP CHROME, NAVIGATION, BUTTONS, MODALS (Mobile-first)
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 237, 228, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(173, 152, 130, 0.28);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 55%;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid rgba(154, 132, 111, 0.36);
  background: rgba(255, 252, 248, 0.85);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-primary);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.project-switcher-btn:hover {
  background: #fffdf9;
  border-color: var(--accent);
}

.project-switcher-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: #fffaf5;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-soft {
  background: rgba(255, 252, 248, 0.86);
  border-color: rgba(154, 132, 111, 0.35);
  color: var(--ink-primary);
}

.btn-soft:hover {
  background: #fffdf9;
  border-color: var(--accent);
}

.btn-soft.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #fffaf5;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  padding: 7px 9px;
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--ink-primary);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(166, 68, 56, 0.22);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.btn-icon-xs {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}

/* Main Workspace Container */
.workspace {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px 64px;
}

/* Segmented Tabs */
.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tabs-pill-group {
  display: inline-flex;
  background: rgba(255, 252, 248, 0.72);
  border: 1px solid rgba(168, 146, 124, 0.32);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--card-bg-solid);
  color: var(--ink-primary);
  box-shadow: 0 2px 8px rgba(68, 48, 32, 0.08);
}

.tab-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--pill-bg);
  color: var(--ink-secondary);
}

.tab-btn.active .tab-badge {
  background: var(--accent);
  color: #fffaf5;
}

/* Inline Editing Controls on Live Estimate */
.edit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px dashed rgba(122, 92, 68, 0.45);
  background: rgba(255, 252, 248, 0.85);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  transition: all 0.15s ease;
}

.edit-chip:hover {
  background: #fff;
  border-style: solid;
  border-color: var(--accent);
}

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

.item-row.editable {
  padding: 5px 6px;
  margin: 0 -6px;
  border-radius: 9px;
  transition: background 0.12s ease;
}

.item-row.editable:hover {
  background: rgba(231, 217, 201, 0.35);
}

.item-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.add-item-btn {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(122, 92, 68, 0.35);
  background: rgba(231, 217, 201, 0.18);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.add-item-btn:hover {
  background: rgba(231, 217, 201, 0.45);
  border-style: solid;
}

.add-section-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  border-radius: var(--radius-card);
  border: 2px dashed rgba(122, 92, 68, 0.36);
  background: rgba(252, 249, 245, 0.52);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.15s ease;
}

.add-section-card:hover {
  background: rgba(252, 249, 245, 0.88);
  border-color: var(--accent);
}

/* =========================================================
   RECEIPTS & WORK LOG PANELS
   ========================================================= */

.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

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

.panel-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 500;
}

.mode-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(231, 217, 201, 0.48);
  margin-bottom: 16px;
}

.receipts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.receipt-card {
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  border: 1px solid var(--card-border);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(68, 48, 32, 0.05);
}

.receipt-thumb-wrap {
  position: relative;
  height: 175px;
  background: #efe5d9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.receipt-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.receipt-thumb-wrap:hover img {
  transform: scale(1.03);
}

.receipt-no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.receipt-body {
  padding: 13px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.receipt-desc {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.38;
  color: var(--ink-primary);
  word-break: break-word;
}

.receipt-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(154, 132, 111, 0.2);
}

.receipt-amount {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-primary);
}

.receipt-date {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Work Log Timeline */
.log-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #fffdf9;
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.log-date-pill {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.log-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.48;
  color: var(--ink-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================
   FORMS, INPUTS, MODALS, TOASTS
   ========================================================= */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(154, 132, 111, 0.42);
  background: #fffdf9;
  font-size: 15px;
  color: var(--ink-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 92, 68, 0.14);
}

.textarea {
  resize: vertical;
  min-height: 82px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid rgba(154, 132, 111, 0.28);
  background: #fffdf9;
  color: var(--ink-primary);
  transition: all 0.14s ease;
}

.icon-option svg {
  width: 24px;
  height: 24px;
}

.icon-option:hover {
  border-color: var(--accent);
  background: var(--pill-bg);
}

.icon-option.selected {
  border-color: var(--accent-dark);
  background: var(--icon-circle);
  box-shadow: 0 0 0 2px rgba(122, 92, 68, 0.25);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(34, 24, 17, 0.46);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-float);
}

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

.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(18, 13, 10, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-backdrop.hidden {
  display: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: 88dvh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Objects list inside switcher modal */
.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--card-border);
  background: #fffdf9;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.project-list-item:hover {
  border-color: var(--accent);
}

.project-list-item.active {
  background: var(--pill-bg);
  border-color: var(--accent);
}

/* Toast Notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  z-index: 120;
  background: var(--ink-primary);
  color: #fffaf5;
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(34, 22, 14, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Login Page */
.login-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-plaster);
  background-image:
    url("/static/img/bg-top.webp"),
    url("/static/img/bg-bottom-left.webp"),
    linear-gradient(155deg, #ede3d7 0%, #e7dbcd 50%, #e1d2c1 100%);
  background-repeat: no-repeat;
  background-position: top right, bottom left, center;
  background-size: min(100%, 720px) auto, min(60%, 380px) auto, 100% 100%;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(252, 249, 245, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 32px 26px 28px;
  box-shadow: var(--shadow-float);
}

.login-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--ink-primary);
}

.login-sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.error-banner {
  background: var(--danger-soft);
  border: 1px solid rgba(166, 68, 56, 0.28);
  color: var(--danger);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

/* =========================================================
   PROGRESS, COMPLETION CHECKS & DAILY REPORT
   ========================================================= */

.done-toggle {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.7px solid rgba(122, 92, 68, 0.45);
  background: #fffdf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-right: 4px;
  color: transparent;
  transition: all 0.14s ease;
  align-self: center;
}

.done-toggle:hover {
  border-color: var(--success);
}

.done-toggle.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.item-row.is-done {
  background: rgba(74, 115, 82, 0.085);
  border-radius: 9px;
  padding: 5px 8px;
  margin: 0 -8px;
}

.item-row.is-done .item-name {
  color: #2f4d35;
}

.done-date-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(74, 115, 82, 0.14);
  color: #35593c;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

.todo-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(154, 132, 111, 0.16);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.sec-pct-pill {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(74, 115, 82, 0.13);
  color: #35593c;
  white-space: nowrap;
}

.sec-pct-pill.zero {
  background: rgba(154, 132, 111, 0.16);
  color: var(--ink-muted);
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 99px;
  background: rgba(122, 92, 68, 0.16);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5d8764 0%, #446d4c 100%);
  transition: width 0.25s ease;
}

.progress-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.progress-big-pct {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: #2f4d35;
}

.sec-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.sec-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 252, 248, 0.85);
  border: 1px solid var(--card-border);
  font-size: 12.5px;
}

.report-checklist-sec {
  margin-bottom: 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: #fffdf9;
  overflow: hidden;
}

.report-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(231, 217, 201, 0.42);
  border-bottom: 1px solid rgba(154, 132, 111, 0.22);
}

.report-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(154, 132, 111, 0.14);
  cursor: pointer;
  transition: background 0.12s ease;
}

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

.report-check-row:hover {
  background: rgba(231, 217, 201, 0.22);
}

.report-check-row.done-today {
  background: rgba(74, 115, 82, 0.13);
}

.report-check-row.done-other {
  background: rgba(74, 115, 82, 0.06);
}

.day-report-card {
  padding: 15px 16px;
  background: #fffdf9;
  border: 1px solid var(--card-border);
  border-radius: 15px;
}

.day-report-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 1px dashed rgba(154, 132, 111, 0.18);
}

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

/* Responsive (Mobile phones) — does NOT affect .is-export */
@media (max-width: 720px) {
  .estimate-sheet:not(.is-export) {
    padding: 26px 16px 26px;
    border-radius: 18px;
    background-size: 125% auto, 58% auto, 100% 100%;
    background-position: top right, bottom left, center;
  }

  .estimate-sheet:not(.is-export) .sheet-header {
    max-width: 72%;
    padding-bottom: 22px;
  }

  .estimate-sheet:not(.is-export) .sheet-address {
    font-size: 34px;
  }

  .estimate-sheet:not(.is-export) .sheet-subtitle {
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .estimate-sheet:not(.is-export) .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .estimate-sheet:not(.is-export) .grand-total-amount {
    font-size: 38px;
  }

  .hide-mobile {
    display: none;
  }

  .project-switcher-btn {
    max-width: 52%;
    padding: 8px 10px;
    font-size: 13.5px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-width: 100%;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}
