:root {
  --ink: #243033;
  --muted: #66736f;
  --line: #e1e5df;
  --soft: #f7f4ee;
  --paper: #ffffff;
  --cream: #fffaf1;
  --sage: #6f8f72;
  --sage-dark: #42654a;
  --terracotta: #b86f52;
  --navy: #1d3656;
  --navy2: #112741;
  --warn: #a15c11;
  --danger: #a23b3b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: var(--navy); font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(34px, 5vw, 52px); line-height: 1; letter-spacing: -0.04em; }
h2 { margin-bottom: 12px; font-size: 26px; letter-spacing: -0.02em; }
h3 { margin-bottom: 12px; }
pre { overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fbfcfe; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.28), transparent 26%), linear-gradient(135deg, #223b5c, #6f8f72 55%, #b86f52); }
.login-panel { width: min(640px, 100%); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.5); border-radius: 28px; padding: 42px; box-shadow: 0 28px 90px rgba(24, 44, 66, 0.32); }
.brand-line { display: flex; align-items: center; gap: 18px; }
.mark { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 20px; background: var(--navy); color: white; font-size: 34px; font-weight: 950; box-shadow: inset 0 -10px 18px rgba(0,0,0,.16); }
.mark.small { width: 48px; height: 48px; font-size: 24px; border-radius: 15px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--sage-dark); font-size: 13px; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.login-text, .large { color: var(--muted); font-size: 19px; line-height: 1.55; }
.login-features { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px; }
.login-features span { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: var(--cream); font-weight: 900; color: var(--navy); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 292px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 24px; background: rgba(255,255,255,.92); border-right: 1px solid var(--line); backdrop-filter: blur(8px); }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-row strong { display: block; font-size: 21px; }
.logo-row span { display: block; color: var(--muted); font-size: 13px; }
nav { display: grid; gap: 8px; }
nav button { min-height: 54px; border-radius: 16px; padding: 12px 14px; background: transparent; color: #344054; text-align: left; font-weight: 950; display: flex; align-items: center; gap: 10px; }
nav button.active, nav button:hover { background: var(--navy); color: white; }
.content { min-width: 0; padding: 34px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 24px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 10px 28px rgba(29, 54, 86, .05); }
.stack { display: grid; gap: 18px; }
.hero { display: grid; grid-template-columns: 1.3fr .9fr; gap: 22px; align-items: center; background: linear-gradient(135deg, #fff, var(--cream)); }
.hero h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }
.hero-actions { display: grid; gap: 12px; }
.intro { background: linear-gradient(135deg, #fff, #f8fbf7); }
.stat-grid, .card-grid { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat { border: 1px solid var(--line); border-radius: 22px; padding: 22px; background: white; }
.stat span { display: block; color: var(--muted); font-weight: 900; }
.stat strong { display: block; margin-top: 8px; font-size: 42px; line-height: 1; }
.stat.warn { border-color: #f0c48b; background: #fff8ed; }
.stat.warn strong { color: var(--warn); }
.primary, .secondary, .danger, .big-action { min-height: 50px; border-radius: 15px; padding: 13px 18px; font-weight: 950; text-align: center; text-decoration: none; display: inline-grid; place-items: center; }
.primary, .big-action { background: var(--navy); color: white; }
.primary:hover, .big-action:hover { background: var(--navy2); }
.secondary { background: #e9efe8; color: var(--navy); }
.danger { background: #f8e0dc; color: var(--danger); }
.big-action { min-height: 88px; font-size: 20px; }
.tall { min-height: 60px; }
.full { width: 100%; }
form.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
form.grid h2, form.grid .wide, form.grid .sub-form, form.grid .primary, form.grid .secondary, form.grid .check-line, form.grid .form-title { grid-column: 1 / -1; }
.form-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
label { display: grid; gap: 8px; color: #344054; font-weight: 900; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: white; color: var(--ink); font-size: 18px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 4px solid rgba(111, 143, 114, .22); border-color: var(--sage); }
.check-line { display: flex; align-items: center; gap: 10px; }
.check-line input { width: 24px; height: 24px; }
.sub-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px; border: 1px dashed #ccd8cd; border-radius: 20px; background: #fbfcf7; }
.sub-form h3, .sub-form .secondary, .sub-form .muted, .sub-form .check-line, .line-preview { grid-column: 1 / -1; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-header h2 { margin-bottom: 0; }
.search { max-width: 560px; }
.quick-find { display: grid; gap: 12px; }
.find-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.result-note { margin-bottom: 0; }
.card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: white; }
.card.attention { border-color: #f0c48b; background: #fffaf0; }
.card.done { opacity: .65; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title strong { font-size: 19px; }
.card-title div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card p { margin-bottom: 0; color: var(--muted); }
.pill { border-radius: 999px; padding: 6px 10px; background: #e8f2e8; color: var(--sage-dark); font-size: 12px; font-weight: 950; white-space: nowrap; }
.warn-pill { background: #fff0d8; color: var(--warn); }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
dt { color: var(--muted); font-size: 12px; font-weight: 950; text-transform: uppercase; }
dd { margin: 2px 0 0; font-weight: 900; }
.button-row { display: flex; gap: 10px; }
.button-row button { flex: 1; }
.muted { color: var(--muted); }
.note { border-left: 4px solid var(--sage); padding-left: 10px; }
.error, .notice { border-radius: 16px; padding: 14px 16px; font-weight: 900; margin-bottom: 14px; }
.error { border: 1px solid #f2b8b8; background: #fff1f1; color: #8a2424; }
.notice { border: 1px solid #c8dfca; background: #f0f8f0; color: #315739; }
.list { display: grid; gap: 10px; }
.row { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: white; }
.row span { color: var(--muted); }
.row-actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.thumb { width: 100%; max-height: 190px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.empty-thumb { height: 150px; border-radius: 16px; border: 1px dashed #cbd5ca; background: #f8fbf7; display: grid; place-items: center; font-size: 44px; font-weight: 950; color: var(--sage); }
.clean-list { margin: 0; padding-left: 20px; }
.small-list { font-size: 14px; color: var(--muted); margin-top: 10px; }
@media (max-width: 1080px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); } nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } nav button { justify-content: center; text-align: center; } .stat-grid, .two-column, .hero { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .content { padding: 18px; } .login-panel { padding: 28px; border-radius: 22px; } .brand-line, .topbar, .section-header, .row, .form-title { flex-direction: column; align-items: stretch; } .top-actions { justify-content: stretch; } .top-actions button { flex: 1; } nav, .stat-grid, .two-column, .hero, form.grid, .sub-form, .find-row { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr; } }


/* =========================================================
   Mobile Friendly Layout
   ========================================================= */

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .app-shell,
  .layout,
  .dashboard-layout {
    display: block !important;
  }

  aside,
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: #fffdf8;
  }

  .brand,
  .logo-row {
    margin-bottom: 10px !important;
  }

  nav,
  .nav,
  .side-nav {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  nav button,
  nav a,
  .nav button,
  .nav a,
  .side-nav button,
  .side-nav a {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
  }

  main,
  .main,
  .content {
    width: 100% !important;
    padding: 18px 14px 90px !important;
  }

  header,
  .page-header,
  .topbar {
    display: block !important;
  }

  h1 {
    font-size: 34px !important;
    line-height: 1.05 !important;
    margin-bottom: 14px !important;
  }

  h2 {
    font-size: 24px !important;
  }

  .hero,
  .welcome-card,
  .panel,
  .card {
    border-radius: 20px !important;
  }

  .hero,
  .welcome-card {
    display: block !important;
    padding: 22px !important;
  }

  .hero h2,
  .welcome-card h2 {
    font-size: 30px !important;
    line-height: 1.08 !important;
  }

  .hero-actions,
  .quick-actions,
  .actions,
  .header-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 16px !important;
  }

  button,
  .button,
  .btn,
  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
  }

  .stats,
  .stat-grid,
  .dashboard-stats,
  .grid,
  .cards-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .search-row,
  .form-row,
  .inline-form,
  .filters {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .material-card,
  .purchase-card,
  .project-card,
  .wishlist-card,
  .location-card {
    padding: 16px !important;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .modal,
  dialog,
  .dialog {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin: 12px !important;
    border-radius: 20px !important;
  }

  .modal-body,
  .dialog-body {
    max-height: 75vh;
    overflow-y: auto;
  }

  .logout,
  .logout-button {
    width: 100% !important;
    margin-top: 10px !important;
  }
}

@media (max-width: 480px) {
  main,
  .main,
  .content {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  h1 {
    font-size: 30px !important;
  }

  .hero h2,
  .welcome-card h2 {
    font-size: 26px !important;
  }

  .card,
  .panel,
  .hero,
  .welcome-card {
    padding: 16px !important;
  }

  nav button,
  nav a,
  .nav button,
  .nav a,
  .side-nav button,
  .side-nav a {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }
}


/* =========================================================
   Mobile Fix v2 - true phone layout
   ========================================================= */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

img, video, canvas, svg {
  max-width: 100%;
}

@media (max-width: 760px) {
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app,
  .app-shell,
  .layout,
  .dashboard-layout {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow-x: hidden !important;
  }

  aside,
  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    padding: 14px 12px !important;
    overflow: hidden !important;
  }

  .brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .brand h1,
  .brand-title {
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  .brand p,
  .brand-subtitle {
    font-size: 14px !important;
  }

  nav,
  .nav,
  .side-nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  nav button,
  nav a,
  .nav button,
  .nav a,
  .side-nav button,
  .side-nav a {
    width: 100% !important;
    min-width: 0 !important;
    height: 62px !important;
    padding: 8px 6px !important;
    border-radius: 14px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .logout,
  .logout-button,
  button.logout {
    width: 100% !important;
    margin: 12px 0 0 !important;
  }

  main,
  .main,
  .content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 10px 90px !important;
    overflow-x: hidden !important;
  }

  .page-header,
  header {
    display: block !important;
    width: 100% !important;
  }

  .page-header .actions,
  .header-actions,
  .top-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 14px !important;
  }

  h1 {
    font-size: 34px !important;
    line-height: 1.05 !important;
  }

  h2 {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }

  .eyebrow,
  .kicker {
    font-size: 15px !important;
    letter-spacing: .08em !important;
  }

  .hero,
  .welcome-card,
  .panel,
  .card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .hero,
  .welcome-card {
    display: block !important;
    padding: 20px !important;
  }

  .hero h2,
  .welcome-card h2 {
    font-size: 25px !important;
    line-height: 1.12 !important;
    max-width: 100% !important;
  }

  .hero p,
  .welcome-card p {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  .hero-actions,
  .quick-actions,
  .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .stats,
  .stat-grid,
  .dashboard-stats,
  .grid,
  .cards-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .search-row,
  .form-row,
  .inline-form,
  .filters {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  button,
  .button,
  .btn {
    min-height: 48px !important;
    width: 100%;
    font-size: 16px !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 430px) {
  nav,
  .nav,
  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  h1 {
    font-size: 30px !important;
  }

  .hero h2,
  .welcome-card h2 {
    font-size: 23px !important;
  }
}


/* =========================================================
   Dashboard v3 - Premium Craft Room Command Center
   ========================================================= */

.home-v3 {
  gap: 22px;
}

.command-center {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(238, 168, 124, .34), transparent 34%),
    linear-gradient(135deg, #fffaf2 0%, #f7efe3 55%, #eef4ec 100%);
  border: 1px solid rgba(90, 63, 45, .12);
  box-shadow: 0 24px 60px rgba(86, 68, 49, .12);
}

.command-center h2 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: .95;
  letter-spacing: -0.06em;
  margin: 8px 0 16px;
  color: #35251d;
}

.command-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.command-actions button {
  justify-content: flex-start;
  text-align: left;
  font-size: 17px !important;
  border-radius: 20px;
}

.stat-grid.premium .stat {
  min-height: 128px;
  border-radius: 26px;
  background: #fffdf8;
  border: 1px solid rgba(90, 63, 45, .1);
  box-shadow: 0 16px 36px rgba(79, 62, 44, .08);
}

.stat-grid.premium .stat strong {
  font-size: 42px;
}

.project-row strong {
  color: #2f241d;
}

@media (max-width: 900px) {
  .command-center {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .command-center h2 {
    font-size: 42px;
  }
}


/* =========================================================
   Material Detail Overlay
   ========================================================= */

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(35, 26, 20, .42);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  padding: 18px;
}

.detail-panel {
  width: min(920px, 100%);
  height: 100%;
  overflow-y: auto;
  border-radius: 30px;
  background: #fffdf8;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(27, 20, 14, .28);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.detail-head h2 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: .95;
  margin: 4px 0 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-photo,
.empty-detail-photo {
  min-height: 330px;
  border-radius: 28px;
  background: #f4eadc;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 72px;
  font-weight: 900;
  color: #8d6d51;
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fact-card {
  border: 1px solid rgba(90, 63, 45, .12);
  background: white;
  border-radius: 22px;
  padding: 18px;
}

.fact-card span {
  display: block;
  color: #867466;
  font-size: 14px;
  margin-bottom: 8px;
}

.fact-card strong {
  font-size: 24px;
  color: #35251d;
}

.panel.soft {
  background: #fffaf2;
}

@media (max-width: 760px) {
  .detail-overlay {
    padding: 8px;
  }

  .detail-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .detail-grid,
  .detail-facts,
  .detail-head {
    grid-template-columns: 1fr;
    display: grid;
  }
}


/* =========================================================
   Materiory 0.5 Design System Upgrade
   ========================================================= */

:root {
  --bg: #f8f3ea;
  --surface: #fffdf8;
  --surface-2: #fff8ef;
  --ink: #33251d;
  --muted: #7d6d61;
  --line: rgba(80, 57, 42, .12);
  --primary: #3f6f5f;
  --primary-dark: #2f594c;
  --primary-soft: #e6f0eb;
  --terracotta: #c97f5c;
  --gold: #d9a441;
  --danger: #b94b4b;
  --shadow: 0 18px 50px rgba(69, 49, 35, .10);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

body {
  background:
    radial-gradient(circle at top left, rgba(201, 127, 92, .12), transparent 32%),
    radial-gradient(circle at top right, rgba(63, 111, 95, .10), transparent 34%),
    var(--bg) !important;
  color: var(--ink);
}

.shell {
  background: transparent !important;
}

.sidebar {
  background: rgba(255, 253, 248, .82) !important;
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line) !important;
  box-shadow: 12px 0 35px rgba(69, 49, 35, .06);
}

.logo-row {
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fffaf2, #eef4ec);
  border: 1px solid var(--line);
}

.logo-row strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.logo-row span {
  color: var(--muted);
}

.mark {
  background: linear-gradient(135deg, var(--primary), var(--terracotta)) !important;
  box-shadow: 0 12px 30px rgba(63, 111, 95, .25);
}

nav button {
  border-radius: 16px !important;
  font-weight: 750;
  color: #5f5148;
}

nav button.active {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 12px 26px rgba(63, 111, 95, .25);
}

.content {
  max-width: 1480px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1 {
  letter-spacing: -0.055em;
}

.panel,
.card,
.stat,
.quick-find,
.command-center {
  border: 1px solid var(--line) !important;
  background: rgba(255, 253, 248, .88) !important;
  box-shadow: var(--shadow);
}

.panel {
  border-radius: var(--radius-lg) !important;
}

.card {
  border-radius: var(--radius-md) !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(69, 49, 35, .13);
  border-color: rgba(63, 111, 95, .28) !important;
}

.primary,
button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: white !important;
  border: 0 !important;
  box-shadow: 0 12px 26px rgba(63, 111, 95, .22);
}

.secondary,
button.secondary {
  background: #fffaf2 !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}

.danger,
button.danger {
  background: #fff3f1 !important;
  color: var(--danger) !important;
  border: 1px solid rgba(185, 75, 75, .22) !important;
}

button,
.button,
.btn {
  font-weight: 800;
  letter-spacing: -0.01em;
}

input,
select,
textarea {
  background: white !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(63, 111, 95, .16);
  border-color: rgba(63, 111, 95, .45) !important;
}

.eyebrow {
  color: var(--primary-dark) !important;
  font-weight: 900;
}

.muted {
  color: var(--muted) !important;
}

.notice {
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border: 1px solid rgba(63, 111, 95, .18) !important;
  border-radius: 18px !important;
}

.error {
  background: #fff2ef !important;
  color: var(--danger) !important;
  border: 1px solid rgba(185, 75, 75, .18) !important;
  border-radius: 18px !important;
}

.pill {
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border: 1px solid rgba(63, 111, 95, .18);
  font-weight: 850;
}

.warn-pill,
.stat.warn {
  background: #fff6df !important;
  color: #8a5e00 !important;
}

.thumb,
.empty-thumb {
  border-radius: 18px !important;
}

.empty-thumb {
  background: linear-gradient(135deg, #f4eadc, #e9f1ec) !important;
  color: var(--primary-dark) !important;
}

.row {
  border-radius: 16px;
  background: rgba(255, 250, 242, .78);
  border: 1px solid rgba(80, 57, 42, .08);
}

.command-center {
  background:
    radial-gradient(circle at top left, rgba(201, 127, 92, .22), transparent 36%),
    linear-gradient(135deg, #fffdf8 0%, #fff5e8 52%, #eef4ec 100%) !important;
}

.command-center h2 {
  color: var(--ink) !important;
}

.command-actions button {
  border-radius: 22px !important;
}

.detail-panel {
  background: var(--surface) !important;
}

.fact-card {
  box-shadow: 0 12px 28px rgba(69, 49, 35, .07);
}

.login-page {
  background:
    radial-gradient(circle at 20% 20%, rgba(201, 127, 92, .22), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(63, 111, 95, .22), transparent 36%),
    var(--bg) !important;
}

.login-panel {
  border-radius: 34px !important;
  background: rgba(255, 253, 248, .9) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 30px 90px rgba(69, 49, 35, .18);
}

.login-panel h1 {
  letter-spacing: -0.06em;
}



/* =========================================================
   Receipt Center v1
   ========================================================= */

.receipt-center {
  gap: 24px;
}

.receipt-hero {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 24px;
  align-items: center;
  padding: 32px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(63, 111, 95, .18), transparent 36%),
    linear-gradient(135deg, #fffdf8, #fff4e7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.receipt-hero h2 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: .96;
  letter-spacing: -0.055em;
  margin: 8px 0 14px;
}

.receipt-steps {
  display: grid;
  gap: 12px;
}

.receipt-steps div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 253, 248, .8);
  border: 1px solid var(--line);
}

.receipt-steps strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: white;
}

.receipt-workspace {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 22px;
}

.receipt-upload-card,
.receipt-items-card {
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(255,253,248,.9);
  box-shadow: var(--shadow);
  padding: 24px;
}

.upload-drop {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  min-height: 260px;
  border: 2px dashed rgba(63,111,95,.28);
  border-radius: 26px;
  background: #f7f1e8;
  margin-bottom: 18px;
  padding: 20px;
}

.upload-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.mini-grid,
.line-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.line-builder .wide,
.line-builder .check-line,
.line-builder button,
.receipt-items-card .line-preview,
.receipt-items-card > button {
  grid-column: 1 / -1;
}

.receipt-list {
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .receipt-hero,
  .receipt-workspace,
  .mini-grid,
  .line-builder {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Craft Room Map v1
   ========================================================= */

.craft-map-page .intro h2 {
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: -0.05em;
  line-height: .98;
}

.craft-map {
  display: grid;
  gap: 22px;
}

.room-card {
  border-radius: 34px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(63, 111, 95, .12), transparent 32%),
    rgba(255,253,248,.9);
  box-shadow: var(--shadow);
  padding: 26px;
}

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

.room-header h2 {
  font-size: 42px;
  line-height: .95;
  letter-spacing: -0.05em;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.area-card {
  padding: 18px;
  border-radius: 26px;
  background: #fffaf2;
  border: 1px solid rgba(80, 57, 42, .10);
}

.area-card h3 {
  margin-bottom: 14px;
  font-size: 22px;
}

.location-chip-grid {
  display: grid;
  gap: 10px;
}

.location-chip {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(80, 57, 42, .10);
}

.location-chip strong {
  font-size: 17px;
}

.location-chip span,
.location-chip small {
  color: var(--muted);
}

.small-btn {
  min-height: 34px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  width: fit-content !important;
}


/* =========================================================
   Project Planner v1
   ========================================================= */

.project-check {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fffaf2;
  border: 1px solid rgba(80, 57, 42, .10);
}

.project-meter {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfce;
  margin-bottom: 8px;
}

.project-meter div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--terracotta));
}

.project-check h4 {
  margin: 12px 0 6px;
  font-size: 15px;
  color: var(--ink);
}

.missing-list li {
  color: #8a4b2b;
}
