:root {
  /* Palette + type sourced directly from abreeza.com.au's own stylesheet */
  --border: #e2e4ea;
  --text: #14151a;
  --muted: #626b7a;
  --bg: #f4f5f8;
  --surface-alt: #e6e6e6;
  --card: #ffffff;
  --primary: #041579;
  --primary-dark: #030f5c;
  --danger: #b0342b;
  --accent: #eef0fa;
  --shadow: 0 2px 10px rgba(4, 21, 121, 0.06);
}

* { box-sizing: border-box; }

body {
  font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("logo.png") no-repeat center center;
  background-size: 640px auto;
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3 { color: var(--primary); font-weight: 700; letter-spacing: -0.01em; }
h1 { margin-top: 0; font-weight: 800; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { display: flex; align-items: center; gap: 0.6rem; color: var(--primary); font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.topbar .brand img { height: 28px; width: auto; display: block; }
.topbar nav a { color: var(--text); text-decoration: none; margin-left: 1.5rem; font-size: 0.92rem; font-weight: 600; }
.topbar nav a:hover { color: var(--primary); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

.hint { color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); font-style: italic; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.flash-list { margin-bottom: 1rem; }
.flash { background: #fff4d6; border: 1px solid #e6c877; padding: 0.6rem 0.9rem; border-radius: 10px; margin-bottom: 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: 50rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fbeceb; }
.btn-sm { padding: 0.25rem 0.7rem; font-size: 0.8rem; }

.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; text-align: left; }
.table th { background: var(--accent); color: var(--primary); font-weight: 700; }
.table .num { text-align: right; }

.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 50rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; background: #e5e7eb; color: #374151; }
.badge-draft { background: #e5e7eb; color: #374151; }
.badge-pushed { background: #d1fae5; color: #065f46; }

.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 1rem 0; }
.form-card label { display: block; margin-bottom: 0.6rem; font-size: 0.9rem; font-weight: 600; }
.form-card input, .form-card select, .form-card textarea {
  display: block; width: 100%; max-width: 420px; margin-top: 0.25rem;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem;
  font-family: inherit; font-weight: 400;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent);
}
.form-inline { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline label { font-size: 0.85rem; font-weight: 600; }
.form-inline input, .form-inline select { padding: 0.32rem 0.45rem; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }

.area-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 1.25rem 0; }
.area-header { display: flex; align-items: center; justify-content: space-between; }

.table-scroll { overflow-x: auto; }
.items-table { min-width: 1100px; }
.cell-input { width: 100%; padding: 0.25rem; border: 1px solid transparent; border-radius: 6px; font-size: 0.85rem; background: transparent; font-family: inherit; }
.cell-input:hover, .cell-input:focus { border-color: var(--border); background: #fff; }
.cell-num { width: 5.5rem; text-align: right; }
.cell-dim { width: 3.2rem; text-align: right; }
.cell-wide { min-width: 10rem; }
.dims { white-space: nowrap; }
.row-actions { white-space: nowrap; }

.add-item summary { cursor: pointer; color: var(--primary); font-weight: 700; margin: 0.75rem 0 0; font-size: 0.9rem; }
.add-item .form-card { margin-top: 0.5rem; }

.category-block { border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1.1rem; margin-bottom: 0.75rem; background: var(--bg); border-top: 3px solid var(--primary); }
.category-block h3 { margin: 0 0 0.5rem; color: var(--primary); }
.category-block h4 { margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }
.checkbox-label { display: flex !important; align-items: center; gap: 0.4rem; font-size: 0.85rem; max-width: none !important; font-weight: 400 !important; }
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }
.additions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.4rem 1rem; margin-top: 0.4rem; }
.addition-item input[type="number"] { width: 3.5rem; margin-left: auto; }

.material-picker-wrap { display: inline-flex; flex-direction: column; gap: 0.3rem; margin-right: 0.5rem; }
.material-picker { display: flex; gap: 0.3rem; align-items: center; }
.material-picker select { min-width: 10rem; }
.rate-override { width: 4.5rem; }
.add-toggle { align-self: flex-start; font-size: 0.75rem; padding: 0.15rem 0.55rem; }
.add-material-inline { display: inline-flex; gap: 0.3rem; align-items: center; margin-top: 0.3rem; background: var(--accent); padding: 0.35rem 0.5rem; border-radius: 8px; }
.add-material-inline input, .add-material-inline select { padding: 0.2rem 0.3rem; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }
.add-material-inline .new-mat-name { width: 8rem; }
.add-material-inline .new-mat-cost { width: 4.5rem; }
.checklist-wrap { margin-bottom: 0.5rem; }

.sub-section { margin: 0.5rem 0; border-top: 1px dashed var(--border); padding-top: 0.4rem; }
.sub-section summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.sub-section summary:hover { color: var(--primary); }
.category-block.editing { border-color: var(--primary); border-top-width: 3px; border-width: 2px; border-top-color: var(--primary); background: var(--accent); }

.totals-summary { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 1.25rem 0; max-width: 420px; margin-left: auto; }
.totals-table { width: 100%; border-collapse: collapse; }
.totals-table td { padding: 0.3rem 0; font-size: 0.9rem; }
.totals-table .num { text-align: right; }
.totals-table .grand-total td { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--border); padding-top: 0.5rem; color: var(--primary); }

.calc-result { background: var(--accent); border-radius: 50rem; padding: 0.5rem 0.9rem; display: inline-block; font-size: 0.95rem; }
