:root {
  --ink: #1C2126;
  --ink-soft: #4A5058;
  --paper: #F1F2ED;
  --paper-raised: #FFFFFF;
  --denim: #2F4869;
  --denim-deep: #1F3350;
  --chalk: #C99A2E;
  --stitch-red: #A63A3A;
  --confirmed: #3F6B5C;
  --line: #D8D6CE;
  --line-soft: #E8E7E0;
  --radius: 3px;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
}
.display { font-family: 'Oswald', 'Arial Narrow', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.mono { font-family: 'IBM Plex Mono', monospace; }

#app { display:flex; min-height:100vh; }

/* ===== LOGIN ===== */
.login-screen { flex:1; display:flex; align-items:center; justify-content:center; background: #333; }
.login-box { background: var(--paper-raised); border-radius: var(--radius); padding: 40px 36px; width: 360px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.login-box .wordmark { font-size: 26px; font-weight: 600; letter-spacing: 0.08em; color: var(--denim-deep); margin-bottom:4px; }
.login-box .sub { color: var(--ink-soft); font-size:13px; margin-bottom:24px; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 200px; flex-shrink: 0; background: #333; color: #E9EDF2;
  padding: 28px 20px; display:flex; flex-direction:column; gap:32px; position:relative;
  overflow:hidden; min-height:100vh;
}
.sidebar::before {
  content:''; position:absolute; top:0; left:12px; bottom:0; width:1px;
  background-image: repeating-linear-gradient(to bottom, rgba(233,237,242,0.18) 0 2px, transparent 2px 10px);
}
.wordmark { font-size:22px; font-weight:600; letter-spacing:0.08em; }
.wordmark small { display:block; font-family:'IBM Plex Sans'; text-transform:none; letter-spacing:normal; font-size:11px; color:#9FB1C4; margin-top:3px; font-weight:400; }
.nav { display:flex; flex-direction:column; gap:4px; margin-left:10px; }
.nav button, .nav a { all:unset; cursor:pointer; padding:9px 10px; border-radius:var(--radius); font-size:13px; color:#C7D2DD; display:flex; align-items:center; gap:9px; }
.nav button:hover, .nav a:hover { background: rgba(255,255,255,0.06); color:#fff; }
.nav button.active, .nav a.active { background: rgba(255,255,255,0.1); color:#fff; font-weight:600; }
.nav-dot { width:6px; height:6px; border-radius:50%; background:var(--chalk); flex-shrink:0; }
.sidebar-foot { margin-top:auto; margin-left:10px; font-size:11px; color:#7E8FA0; }

/* ===== MAIN ===== */
.main { flex:1; padding:30px 36px; min-width:0; }
.topbar { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:24px; flex-wrap:wrap; gap:14px; }
.topbar h1 { font-size:26px; margin:0 0 4px; }
.topbar p { margin:0; color:var(--ink-soft); font-size:13px; }
.btn { all:unset; cursor:pointer; padding:10px 18px; border-radius:var(--radius); font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:7px; }
.btn-primary { background:var(--denim); color:#fff; }
.btn-primary:hover { background:var(--denim-deep); }
.btn-ghost { background:transparent; color:var(--denim); border:1px solid var(--line); }
.btn-ghost:hover { border-color:var(--denim); }
.btn-danger { background:transparent; color:var(--stitch-red); border:1px solid var(--line); }
.btn-danger:hover { border-color:var(--stitch-red); }
.btn-sm { padding:7px 12px; font-size:12px; }
.row-actions { display:flex; gap:8px; align-items:center; }

/* ===== CARDS / LISTS ===== */
.card { background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius); padding:8px 20px; }
.style-row, .user-row { display:flex; justify-content:space-between; align-items:center; cursor:pointer; padding:16px 4px; border-bottom:1px solid var(--line-soft); gap:12px; }
.style-row:last-child, .user-row:last-child { border-bottom:none; }
.style-name, .user-name { font-weight:600; font-size:14px; }
.style-meta, .user-meta { font-size:12px; color:var(--ink-soft); margin-top:2px; }
.stage-tag { font-size:11px; font-weight:600; padding:3px 9px; border-radius:9px; background:var(--line-soft); color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.02em; }
.badge { font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:9px; background:var(--line-soft); color:var(--ink-soft); text-transform:capitalize; }
.badge.admin { background:#EFE3EE; color:#7A3E74; }
.badge.buyer { background:#E4E9EE; color:#33506B; }
.badge.merchandiser { background:#E6EEE9; color:var(--confirmed); }
.badge.retailer-pnp { background:#DCE6F0; color:#1F3350; }
.badge.retailer-eagle { background:#F0E4D4; color:#8A5A24; }
.badge.retailer-pep { background:#E8DCE8; color:#6B2E6B; }
.tag-badges { display:flex; gap:5px; flex-wrap:wrap; }
.badge.ladies { background:#F2E3E6; color:#8A3B49; }
.badge.mens { background:#E4E9EE; color:#33506B; }
.badge.kids { background:#EFEBDA; color:#8A6E24; }
.badge.baby { background:#E6EEE9; color:#3F6B5C; }
.empty-state { border:1px dashed var(--line); border-radius:var(--radius); padding:40px 20px; text-align:center; color:var(--ink-soft); font-size:13px; }

/* ===== DETAIL ===== */
.back-link { font-size:13px; color:var(--denim); cursor:pointer; display:inline-block; margin-bottom:10px; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px 24px; font-size:13.5px; margin:16px 0; }
.detail-grid label { display:block; font-size:11px; font-weight:600; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.03em; margin-bottom:3px; }
.comment { padding:12px 0; border-bottom:1px solid var(--line-soft); font-size:13px; }
.comment:last-child { border-bottom:none; }
.comment .who { font-weight:600; font-size:12.5px; margin-bottom:2px; }
.comment .when { color:var(--ink-soft); font-size:11px; margin-top:3px; }

/* ===== FORMS ===== */
.field { margin-bottom:14px; }
.field label, label.flabel { display:block; font-size:11.5px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; text-transform:uppercase; letter-spacing:0.03em; }
input, select, textarea {
  width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:var(--radius);
  font-size:13.5px; font-family:inherit; background:#fff; color:var(--ink);
}
textarea { resize:vertical; min-height:70px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.err { color:var(--stitch-red); font-size:13px; margin-bottom:10px; }
.ok { color:var(--confirmed); font-size:13px; margin-bottom:10px; }
.hidden { display:none; }

/* ===== MODAL ===== */
.modal-back { position:fixed; inset:0; background:rgba(28,33,38,0.4); display:flex; align-items:center; justify-content:center; z-index:50; }
.modal { background:var(--paper-raised); border-radius:var(--radius); padding:26px; width:380px; max-width:90vw; box-shadow:0 10px 40px rgba(0,0,0,0.2); }
.modal h2 { font-size:17px; margin-top:0; }

@media (max-width: 780px) {
  #app { flex-direction:column; }
  .sidebar { width:100%; min-height:auto; flex-direction:row; align-items:center; gap:20px; padding:16px 18px; }
  .sidebar::before { display:none; }
  .nav { flex-direction:row; margin-left:0; }
  .sidebar-foot { display:none; }
  .main { padding:20px; }
  .detail-grid { grid-template-columns:1fr; }
  .drawer { width:100vw; right:-100vw; }
}

/* ===== BOARD ===== */
.board { display:flex; gap:16px; overflow-x:auto; padding-bottom:12px; }
.col { min-width:230px; flex:1; }
.col-head { display:flex; justify-content:space-between; align-items:center; padding:6px 4px 12px; border-bottom:2px solid var(--ink); margin-bottom:12px; }
.col-head span.label { font-size:12px; font-weight:700; letter-spacing:0.03em; }
.col-head span.count { font-family:'IBM Plex Mono'; font-size:12px; color:var(--ink-soft); background:var(--line-soft); padding:1px 7px; border-radius:10px; }
.col-body { display:flex; flex-direction:column; gap:12px; min-height:40px; }
.tag { background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius); padding:14px 14px 12px 18px; cursor:pointer; transition: transform .12s ease, box-shadow .12s ease; }
.tag:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(28,33,38,0.1); }
.tag .styleno { font-size:15px; font-weight:600; }
.tag .desc { font-size:12.5px; color:var(--ink-soft); margin:4px 0 8px; }
.tag .meta { display:flex; justify-content:space-between; align-items:center; font-size:11px; }
.rsp { font-family:'IBM Plex Mono'; font-size:11.5px; color:var(--ink); }
.empty-col { border:1px dashed var(--line); border-radius:var(--radius); padding:18px 10px; text-align:center; color:var(--ink-soft); font-size:11.5px; }

/* ===== DRAWER ===== */
.overlay { position:fixed; inset:0; background:rgba(28,33,38,0.35); z-index:40; display:none; }
.overlay.open { display:block; }
.drawer { position:fixed; top:0; right:-560px; width:560px; max-width:94vw; height:100vh; background:var(--paper); z-index:41; box-shadow: -8px 0 30px rgba(0,0,0,0.18); transition: right .25s ease; display:flex; flex-direction:column; }
.drawer.open { right:0; }
.drawer-head { padding:20px 24px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; background:var(--paper-raised); }
.drawer-head h2 { font-size:18px; margin:0; }
.drawer-close { all:unset; cursor:pointer; font-size:20px; color:var(--ink-soft); padding:4px 8px; }
.drawer-body { padding:20px 24px; overflow-y:auto; flex:1; }
.tabs { display:flex; gap:4px; padding:0 24px; background:var(--paper-raised); border-bottom:1px solid var(--line); }
.tab { all:unset; cursor:pointer; padding:11px 4px; margin-right:18px; font-size:12.5px; font-weight:600; color:var(--ink-soft); border-bottom:2px solid transparent; }
.tab.active { color:var(--ink); border-bottom-color: var(--chalk); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.row3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
footer.drawer-actions { padding:16px 24px; border-top:1px solid var(--line); background:var(--paper-raised); display:flex; gap:10px; justify-content:flex-end; }
.doc-preview { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:18px; font-family:'IBM Plex Mono'; font-size:12px; white-space:pre-wrap; max-height:420px; overflow-y:auto; line-height:1.6; }
.callout { background:#EFF2E9; border:1px solid #CBD7C1; border-radius:var(--radius); padding:10px 12px; font-size:12px; margin-bottom:12px; }
.toast { position:fixed; bottom:24px; right:24px; background:var(--ink); color:#fff; padding:11px 18px; border-radius:var(--radius); font-size:13px; z-index:60; opacity:0; transform:translateY(8px); transition:all .2s ease; pointer-events:none; }
.toast.show { opacity:1; transform:translateY(0); }
.tag-photo { width:100%; height:100px; object-fit:cover; border-radius:var(--radius); margin-bottom:10px; display:block; }
.photo-section { padding:16px 24px; background:var(--paper-raised); border-bottom:1px solid var(--line); }
.photo-grid { display:flex; flex-wrap:wrap; gap:8px; }
.photo-thumb-wrap { position:relative; width:84px; height:84px; }
.photo-thumb { width:84px; height:84px; object-fit:cover; border-radius:var(--radius); cursor:pointer; display:block; background:var(--line-soft); }
.photo-remove { all:unset; position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%; background:var(--stitch-red); color:#fff; font-size:13px; line-height:20px; text-align:center; cursor:pointer; }
.drawer-photo-placeholder { width:100%; height:80px; border:1px dashed var(--line); border-radius:var(--radius); display:flex; align-items:center; justify-content:center; color:var(--ink-soft); font-size:12.5px; }
.lightbox { position:fixed; inset:0; background:rgba(15,17,20,0.9); z-index:70; display:flex; align-items:center; justify-content:center; padding:40px; }
.lightbox img { max-width:90vw; max-height:90vh; object-fit:contain; border-radius:var(--radius); }
.lightbox-close { all:unset; position:fixed; top:20px; right:28px; font-size:32px; color:#fff; cursor:pointer; line-height:1; }
.wordmark {
    text-align: center;
}
.loginb {box-sizing: border-box}
.sidelogo img {
    max-width: 100%;
    padding: 10px;
    background: #fff;
}