:root {
  --burgundy: #7a1f2b;
  --burgundy-dark: #5c1620;
  --bg: #f7f4f1;
  --card: #ffffff;
  --ink: #2b2320;
  --muted: #7d6f68;
  --line: #e5dcd6;
  --ok: #1e7e34;
  --warn: #b7791f;
  --bad: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; }

/* header */
.topbar { background: var(--burgundy); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-row { display: flex; align-items: center; justify-content: space-between;
              padding: 0.6rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem;
         display: flex; align-items: center; gap: 0.5rem; }
.brand-icon { width: 30px; height: 30px; }
.userbox { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.roleform label { margin-right: 0.3rem; opacity: 0.85; }
.roleform select { padding: 0.3rem 0.5rem; border-radius: 6px; border: none; font-size: 0.9rem; }
.logout { color: #ffd9de; }
.mainnav { display: flex; gap: 0.2rem; overflow-x: auto; padding: 0 0.6rem 0.55rem;
           background: var(--burgundy-dark); white-space: nowrap; }
.mainnav a { color: #f3e2e5; text-decoration: none; padding: 0.45rem 0.7rem; border-radius: 6px;
             font-size: 0.92rem; }
.mainnav a:hover, .mainnav a:focus { background: rgba(255,255,255,0.15); color: #fff; }

/* page */
.page { max-width: 1100px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.row-between { display: flex; justify-content: space-between; align-items: center;
               gap: 0.6rem; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 0.9rem; text-decoration: none; color: var(--ink); display: block; }
.stat:hover { border-color: var(--burgundy); }
.stat .n { font-size: 1.7rem; font-weight: 700; color: var(--burgundy); }
.stat .l { color: var(--muted); font-size: 0.9rem; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
th { background: #f3ece8; font-weight: 600; white-space: nowrap; }
tr.alert-overdue td { background: #fdecea; }
tr.alert-soon td { background: #fef6e7; }
td.num, th.num { text-align: right; white-space: nowrap; }
a { color: var(--burgundy); }

/* forms */
form label { display: block; margin: 0.55rem 0; font-weight: 500; }
input[type=text], input[type=number], input[type=date], input[type=password],
input[type=email], select, textarea {
  width: 100%; padding: 0.6rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; margin-top: 0.25rem; }
textarea { min-height: 80px; resize: vertical; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.btn { display: inline-block; padding: 0.6rem 1.1rem; border-radius: 8px; border: 1px solid var(--line);
       background: #fff; color: var(--ink); text-decoration: none; font-size: 1rem;
       cursor: pointer; margin: 0.25rem 0.25rem 0.25rem 0; }
.btn.primary { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.btn.primary:hover { background: var(--burgundy-dark); }
.btn.big { font-size: 1.1rem; padding: 0.8rem 1.4rem; }
.btn.danger { color: var(--bad); border-color: #e5b3b0; }
.btn.small { font-size: 0.85rem; padding: 0.4rem 0.7rem; }
.inline { display: inline; }
.inline button { margin: 0; }

/* floor entry: big tap targets */
.floor input[type=number] { font-size: 1.6rem; padding: 0.8rem; text-align: center; }
.floor .btn.big { font-size: 1.25rem; padding: 1rem 1.6rem; }
.floor label { font-size: 1.05rem; }
.stages { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 0.6rem 0; }
.stage { padding: 0.5rem 0.8rem; border-radius: 20px; border: 1px solid var(--line);
         background: #fff; font-size: 0.9rem; }
.stage.done { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.stage.now { border: 2px solid var(--burgundy); font-weight: 700; }

/* flash */
.flash { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: #e6f4ea; border: 1px solid #a3d9b1; color: #14532d; }
.flash.err { background: #fdecea; border: 1px solid #f0a9a5; color: #7a1f1a; }

/* misc */
.tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: 0.5rem 1rem; border-radius: 8px; background: #fff; border: 1px solid var(--line);
          text-decoration: none; color: var(--ink); }
.tabs a.active { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 0.3rem 0.8rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.img-grid img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.hero-img { max-width: 320px; width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 12px; font-size: 0.82rem;
         background: #eee7e2; }
.badge.green { background: #e6f4ea; color: #14532d; }
.badge.red { background: #fdecea; color: #7a1f1a; }
.badge.amber { background: #fef6e7; color: #7a4d0f; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
              background: var(--burgundy-dark); padding: 1rem; }
.login-card { background: #fff; border-radius: 14px; padding: 2rem; width: 100%; max-width: 380px;
              text-align: center; }
.login-icon { width: 64px; height: 64px; }
.login-card h1 { margin: 0.5rem 0 0.2rem; }
.login-card form { text-align: left; margin-top: 1rem; }
.login-card .btn.big { width: 100%; margin-top: 0.8rem; }

/* print documents */
@media print {
  .topbar, .noprint { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .doc { page-break-after: always; border: none; }
}
.doc { background: #fff; border: 1px solid var(--line); border-radius: 10px;
       padding: 1.5rem; margin-bottom: 1.5rem; }
.doc h2 { border-bottom: 2px solid var(--burgundy); padding-bottom: 0.4rem; }
.doc .dochead { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 640px) {
  .page { padding: 0.7rem; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 0.4rem; }
}

/* ============ Poppy Drive ERP — new interface theme (Oct 2026) ============ */
:root {
  --side0: #2a080d;
  --side1: #3d0e15;
  --accent: #7a1f2b;
  --accent-bright: #a33242;
  --gold: #c9a227;
  --topbar: #ffffff;
  --pagebg: #f4f5f7;
  --ink2: #1f1a17;
  --pill-cutting: #fef3e2; --pill-cutting-t: #9a5b00;
  --pill-sewing: #e8f1fd;  --pill-sewing-t: #1d5fb8;
  --pill-finishing: #f0e9fb; --pill-finishing-t: #6b3fc4;
  --pill-qc: #fdecec; --pill-qc-t: #b3261e;
  --pill-packing: #e7f6ec; --pill-packing-t: #177245;
}
body { background: var(--pagebg); color: var(--ink2); }

/* app shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: 0 0 264px; background: linear-gradient(180deg, var(--side1), var(--side0));
  color: #f3e6e9; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  display: flex; flex-direction: column; transition: transform .22s ease; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.side-brand img { width: 42px; height: 42px; object-fit: contain; background: #fff;
  border-radius: 10px; padding: 3px; }
.side-brand .wm { font-weight: 800; font-size: 1.12rem; letter-spacing: .01em; line-height: 1.15; }
.side-brand .wm small { display: block; font-weight: 600; font-size: .62rem; letter-spacing: .14em;
  color: #e8b7be; }
.side-nav { flex: 1; overflow-y: auto; padding: .7rem .8rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; color: #efdde1; text-decoration: none;
  padding: .62rem .8rem; border-radius: 10px; font-size: .95rem; margin-bottom: 2px; }
.side-nav a svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .85; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--accent-bright); color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.side-nav a.active svg { opacity: 1; }
.side-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.side-foot .roleform { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.side-foot .roleform label { color: #d9b9bf; margin: 0; font-size: .8rem; }
.side-foot .roleform select { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px; padding: .35rem .5rem; font-size: .85rem; width: auto; margin: 0; }
.side-foot .roleform select option { color: #222; }
.side-co { color: #caa9af; line-height: 1.5; }
.side-co strong { color: #fff; display: block; font-size: .85rem; }

.main { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; }
/* topbar */
.topbar { background: var(--topbar); border-bottom: 1px solid #e7e9ee; position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; padding: .65rem 1.4rem; }
.hamb { display: none; background: none; border: none; cursor: pointer; padding: .4rem; }
.hamb svg { width: 24px; height: 24px; }
.brandmark { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink2); }
.brandmark img { width: 36px; height: 36px; object-fit: contain; }
.brandmark .wm { font-weight: 800; font-size: 1.2rem; color: var(--accent); line-height: 1.1; }
.brandmark .wm small { display: block; font-size: .6rem; letter-spacing: .16em; color: #8a8f98; font-weight: 600; }
.gsearch { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.gsearch input { width: 100%; padding: .6rem 1rem .6rem 2.6rem; border: 1px solid #e2e5ea; border-radius: 999px;
  background: #f6f7f9; font-size: .92rem; margin: 0; }
.gsearch input:focus { outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(122,31,43,.08); }
.gsearch svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #9aa0aa; }
.top-actions { display: flex; align-items: center; gap: .9rem; margin-left: auto; }
.iconbtn { position: relative; color: #5b6068; text-decoration: none; padding: .45rem; border-radius: 50%; }
.iconbtn:hover { background: #f1f2f5; color: var(--accent); }
.iconbtn svg { width: 22px; height: 22px; display: block; }
.iconbtn .dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: #d23b3b; border: 2px solid #fff; }
.userchip { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }
.userchip .who { line-height: 1.25; }
.userchip .who b { display: block; font-size: .92rem; }
.userchip .who span { font-size: .78rem; color: #8a8f98; }

/* page */
.main .page { max-width: 1440px; width: 100%; margin: 0 auto; padding: 1.6rem 1.8rem 3rem; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.3rem; }
.dash-head h1 { font-size: 1.65rem; margin: 0; font-weight: 800; }
.dash-head p { margin: .25rem 0 0; color: #6b7078; }
.dash-date { color: #6b7078; font-size: .92rem; white-space: nowrap; padding-top: .35rem; }

/* quick action cards */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem;
  margin-bottom: 1.4rem; }
.qa-card { background: #fff; border: 1px solid #eceef1; border-radius: 14px; padding: 1rem .95rem;
  text-decoration: none; color: var(--ink2); display: flex; flex-direction: column; gap: .15rem;
  transition: transform .12s ease, box-shadow .12s ease; position: relative; }
.qa-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(42,8,13,.08);
  border-color: #e3c9cd; }
.qa-card svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: .5rem; }
.qa-card b { font-size: .95rem; }
.qa-card span { font-size: .8rem; color: #8a8f98; }
.qa-card .chev { position: absolute; right: .7rem; top: 1rem; color: #c3c8cf; }

/* dashboard columns */
.dash-grid { display: grid; grid-template-columns: minmax(0,1fr) 348px; gap: 1.2rem; align-items: start;
  margin-bottom: 1.4rem; }
.panel { background: #fff; border: 1px solid #eceef1; border-radius: 14px; padding: 1.15rem 1.2rem;
  margin-bottom: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.panel-head h2 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.panel-head a { font-size: .88rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.panel table { font-size: .9rem; }
.panel th { background: #f7f8fa; color: #6b7078; font-weight: 600; border-bottom: 1px solid #eef0f3; }
.pill { display: inline-block; padding: .22rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  white-space: nowrap; }
.pill.cutting { background: var(--pill-cutting); color: var(--pill-cutting-t); }
.pill.sewing { background: var(--pill-sewing); color: var(--pill-sewing-t); }
.pill.finishing { background: var(--pill-finishing); color: var(--pill-finishing-t); }
.pill.qc { background: var(--pill-qc); color: var(--pill-qc-t); }
.pill.packing { background: var(--pill-packing); color: var(--pill-packing-t); }
.prog { display: flex; align-items: center; gap: .55rem; min-width: 130px; }
.prog .bar { flex: 1; height: 8px; border-radius: 999px; background: #ededef; overflow: hidden; }
.prog .bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.prog b { font-size: .82rem; min-width: 34px; text-align: right; }
.stylecell { display: flex; align-items: center; gap: .6rem; }
.stylethumb { width: 34px; height: 34px; border-radius: 8px; background: #f3e7e9; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .72rem; flex: 0 0 34px; }

/* quick action buttons */
.qa-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.qa-btns a { display: flex; align-items: center; gap: .6rem; border: 1px solid #eceef1; border-radius: 12px;
  padding: .75rem .8rem; text-decoration: none; color: var(--ink2); font-size: .88rem; font-weight: 600;
  background: #fff; transition: border-color .12s ease, box-shadow .12s ease; }
.qa-btns a:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(42,8,13,.07); }
.qa-btns a svg { width: 22px; height: 22px; color: var(--accent); flex: 0 0 22px; }

/* deadlines */
.dl-item { display: flex; gap: .85rem; align-items: center; padding: .65rem 0;
  border-bottom: 1px solid #f1f2f4; text-decoration: none; color: var(--ink2); }
.dl-item:last-child { border-bottom: none; }
.dl-date { flex: 0 0 52px; text-align: center; background: #fdf0f1; border-radius: 10px; padding: .4rem 0; }
.dl-date b { display: block; font-size: 1.05rem; color: var(--accent); line-height: 1.1; }
.dl-date span { font-size: .66rem; letter-spacing: .08em; color: #a86a72; font-weight: 700; }
.dl-item .t b { display: block; font-size: .9rem; }
.dl-item .t span { font-size: .8rem; color: #8a8f98; }
.dl-item .go { margin-left: auto; color: #c3c8cf; }

/* key modules */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }
.mod-tile { display: flex; gap: .8rem; align-items: center; background: #fff; border: 1px solid #eceef1;
  border-radius: 14px; padding: 1rem; text-decoration: none; color: var(--ink2);
  transition: transform .12s ease, box-shadow .12s ease; }
.mod-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(42,8,13,.08); }
.mod-tile svg { width: 32px; height: 32px; color: var(--accent); flex: 0 0 32px; }
.mod-tile b { display: block; font-size: .92rem; }
.mod-tile span { font-size: .79rem; color: #8a8f98; }

/* alert strip */
.alert-strip { display: grid; gap: .5rem; margin-bottom: 1.3rem; }
.alert-row { display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid #f3d9dc;
  border-left: 4px solid #d23b3b; border-radius: 10px; padding: .6rem .9rem; font-size: .9rem;
  text-decoration: none; color: var(--ink2); }
.alert-row.warn { border-color: #f3e5c3; border-left-color: #d99a1f; }
.alert-row:hover { box-shadow: 0 6px 16px rgba(42,8,13,.06); }

/* section titles inside new theme */
.main h1 { font-size: 1.5rem; }
.main .card, .main .stat, .main .tabs a { border-color: #e7e9ee; }

/* login refresh */
.login-body { background: linear-gradient(135deg, var(--side1), var(--side0)); }
.login-card .login-icon { width: 76px; height: 76px; object-fit: contain; }
.login-card h1 { color: var(--accent); }

/* search results */
.sr-group { margin-bottom: 1.4rem; }
.sr-group h2 { font-size: 1.05rem; color: var(--accent); margin: 0 0 .5rem; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .hamb { display: block; }
  .brandmark .wm { display: none; }
  .gsearch-btn { max-width: none; }
  .userchip .who { display: none; }
  .main .page { padding: 1rem .9rem 3rem; }
}
@media print {
  .sidebar, .topbar, .noprint { display: none !important; }
  .main { margin-left: 0; }
}

/* ---- Phase 1 UX: command center design system ---- */
.gsearch-btn { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1rem; border: 1px solid #e2e5ea; border-radius: 999px; background: #f6f7f9;
  color: #9aa0aa; font-size: .92rem; cursor: pointer; text-align: left; }
.gsearch-btn:hover { background: #fff; border-color: var(--accent); }
.gsearch-btn svg { width: 18px; height: 18px; flex: none; }
.gsearch-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { display: inline-block; padding: .1rem .4rem; border: 1px solid #e2e5ea; border-bottom-width: 2px;
  border-radius: 6px; background: #fff; font-size: .72rem; font-family: inherit; color: #6b7078; }

/* dropdown menus */
.dd { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: #fff;
  border: 1px solid #e7e9ee; border-radius: 12px; box-shadow: 0 18px 44px rgba(42,8,13,.14);
  padding: .4rem; z-index: 200; }
.menu a[role="menuitem"] { display: block; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink2); }
.menu a[role="menuitem"]:hover { background: #f7f4f2; }
.menu a[role="menuitem"] b { display: block; font-size: .92rem; }
.menu a[role="menuitem"] span { font-size: .78rem; color: #8a8f98; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .7rem; }
.menu-head b { font-size: .92rem; }
.menu-head a { font-size: .82rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.menu-empty { padding: 1rem .7rem; color: #8a8f98; font-size: .88rem; text-align: center; }
.menu.notif { min-width: 340px; max-width: 92vw; }
.notif-row { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border-radius: 8px; }
.notif-row:hover { background: #f7f4f2; }
.notif-row .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .4rem; flex: none; }
.notif-row .dot.red { background: #d23b3b; } .notif-row .dot.amber { background: #d99a2b; } .notif-row .dot.blue { background: #3b7dd2; }
.notif-row a { flex: 1; text-decoration: none; color: var(--ink2); min-width: 0; }
.notif-row a b { display: block; font-size: .88rem; }
.notif-row a span { font-size: .8rem; color: #8a8f98; display: block; }
.notif-row .x { border: none; background: none; color: #b9bec6; font-size: 1.1rem; cursor: pointer; padding: 0 .2rem; }
.notif-row .x:hover { color: var(--bad); }
.count-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #d23b3b; color: #fff; font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.iconbtn.bell { border: none; background: none; cursor: pointer; }

/* breadcrumbs: where am I */
.crumbs { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .6rem 1.8rem 0;
  font-size: .85rem; color: #8a8f98; max-width: 1440px; margin: 0 auto; width: 100%; }
.crumbs a { color: var(--accent); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: #c3c8cf; }
.crumbs .here { color: var(--ink2); font-weight: 700; }

/* command palette */
.palette-wrap { position: fixed; inset: 0; z-index: 500; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(30,10,14,.45); backdrop-filter: blur(2px); }
.palette { position: relative; max-width: 620px; margin: 12vh auto 0; background: #fff; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-bottom: 1px solid #eef0f3; }
.palette-input svg { width: 20px; height: 20px; color: #9aa0aa; flex: none; }
.palette-input input { flex: 1; border: none; outline: none; font-size: 1.05rem; background: none; }
.palette-results { max-height: 46vh; overflow-y: auto; padding: .5rem; }
.pal-group { margin-bottom: .4rem; }
.pal-gtitle { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9aa0aa;
  padding: .45rem .7rem .2rem; font-weight: 700; }
.pal-item { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 8px;
  text-decoration: none; color: var(--ink2); }
.pal-item.hi, .pal-item:hover { background: #f7f0f1; }
.pal-kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent);
  background: #f7ecee; border-radius: 6px; padding: .15rem .45rem; font-weight: 700; flex: none; min-width: 52px; text-align: center; }
.pal-label { font-size: .93rem; }
.pal-label em { font-style: normal; color: #8a8f98; font-size: .82rem; }
.pal-empty { padding: 1.4rem; text-align: center; color: #8a8f98; font-size: .9rem; }
.palette-foot { display: flex; gap: 1.1rem; padding: .6rem 1.1rem; border-top: 1px solid #eef0f3;
  font-size: .78rem; color: #9aa0aa; }

/* confirm modal */
.modal-wrap { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-wrap[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30,10,14,.45); }
.modal { position: relative; background: #fff; border-radius: 14px; padding: 1.4rem; max-width: 440px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.modal p { margin: 0 0 1.2rem; color: #6b7078; font-size: .93rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .7rem; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }

/* draft restore bar */
.draft-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: #fff8e6;
  border: 1px solid #f0dfae; border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .9rem; }

/* generic status pills (controlled vocabulary) */
.pill.st-draft { background: #eef0f3; color: #5b6068; }
.pill.st-neutral { background: #eef0f3; color: #5b6068; }
.pill.st-progress { background: #e8f1fd; color: #1d5fb8; }
.pill.st-warn { background: #fdf3e0; color: #9a5b00; }
.pill.st-ok { background: #e7f6ec; color: #177245; }
.pill.st-bad { background: #fdecec; color: #b3261e; }
.pill.st-muted { background: #f1f2f5; color: #9aa0aa; }
.pill.st-qc { background: #fdecec; color: #b3261e; }
.pill.st-cutting { background: var(--pill-cutting); color: var(--pill-cutting-t); }
.pill.st-sewing { background: var(--pill-sewing); color: var(--pill-sewing-t); }
.pill.st-finishing { background: var(--pill-finishing); color: var(--pill-finishing-t); }

/* exception center */
.exc-group { margin-bottom: 1.4rem; }
.exc-group > h2 { font-size: 1rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.exc-row { display: flex; gap: .8rem; align-items: flex-start; background: #fff; border: 1px solid #eceef1;
  border-radius: 12px; padding: .85rem 1rem; margin-bottom: .55rem; text-decoration: none; color: var(--ink2); }
.exc-row:hover { border-color: #e3c9cd; }
.exc-row .sev { flex: none; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: .25rem .6rem; border-radius: 999px; margin-top: .1rem; }
.exc-row .sev.urgent { background: #fdecec; color: #b3261e; }
.exc-row .sev.warn { background: #fdf3e0; color: #9a5b00; }
.exc-row .sev.info { background: #e8f1fd; color: #1d5fb8; }
.exc-row .body { flex: 1; min-width: 0; }
.exc-row .body b { display: block; font-size: .95rem; }
.exc-row .body span { font-size: .85rem; color: #8a8f98; }
.exc-row .x { border: none; background: none; color: #b9bec6; font-size: 1.2rem; cursor: pointer; }
.exc-allclear { background: #e7f6ec; border: 1px solid #bfe6cc; color: #177245; border-radius: 12px;
  padding: 1.2rem; text-align: center; font-weight: 600; }

/* command-center dashboard sections */
.cc-section { margin-bottom: 1.4rem; }
.cc-section > h2 { font-size: 1.08rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.cc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cc-dot.red { background: #d23b3b; } .cc-dot.green { background: #1e9e4a; } .cc-dot.amber { background: #d99a2b; }
.wq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.wq-col h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: #8a8f98; margin: 0 0 .6rem; }
.wq-item { display: block; background: #fff; border: 1px solid #eceef1; border-radius: 10px; padding: .7rem .85rem;
  margin-bottom: .5rem; text-decoration: none; color: var(--ink2); font-size: .9rem; }
.wq-item:hover { border-color: #e3c9cd; }
.wq-item small { display: block; color: #8a8f98; font-size: .78rem; margin-top: .15rem; }
.changed-day { font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); margin: 1rem 0 .5rem; }
.changed-row { display: flex; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid #f1f2f5; font-size: .9rem; }
.changed-row:last-child { border-bottom: none; }
.changed-row time { color: #9aa0aa; font-size: .8rem; flex: none; width: 64px; }

@media (max-width: 900px) {
  .gsearch-btn { max-width: none; }
  .gsearch-btn span { display: none; }
  .gsearch-btn kbd { display: none; }
  .qc-label { display: none; }
  .palette { margin: 8vh .8rem 0; }
  .menu.notif { position: fixed; left: .8rem; right: .8rem; top: 60px; min-width: 0; }
  .crumbs { padding: .5rem .9rem 0; }
}

/* --- Product DNA chain (Phase 2) --- */
.dna-card { margin-bottom: 1.2rem; }
.dna-chain { display: flex; align-items: stretch; gap: .35rem; margin: .9rem 0 .4rem; flex-wrap: wrap; }
.dna-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 86px; flex: 1; background: #faf7f8; border: 1px solid #eceef1; border-radius: 10px; padding: .6rem .4rem; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.dna-stage:hover { border-color: #8a1f2d; transform: translateY(-1px); }
.dna-stage b { font-size: 1.35rem; color: #8a1f2d; line-height: 1.1; }
.dna-stage span { font-size: .72rem; color: #8a8f98; text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem; text-align: center; }
.dna-arrow { align-self: center; color: #c9ccd2; font-size: 1.1rem; }
.dna-latest { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin-top: .9rem; border-top: 1px solid #f0f1f4; padding-top: .9rem; }
.dna-group h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #8a8f98; margin: 0 0 .4rem; }
.dna-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .85rem; }

.readonly-field { padding: .55rem .7rem; background: #f7f8f9; border: 1px solid #eceef1; border-radius: 8px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
