/* ============================================================
   FlowDesk — Request & Workflow Management
   Design system + layout + components
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #ff6f61;
  --primary-600: #ec5a42;
  --primary-soft: #ffe9e6;
  --brand: #ff6f61;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --purple: #7c3aed;
  --purple-soft: #f3e8ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131c2e;
  --surface-2: #172236;
  --surface-3: #1e2b42;
  --border: #263449;
  --border-strong: #33455f;
  --text: #e8eefc;
  --text-2: #a6b6d0;
  --text-3: #6b7d9c;
  --primary: #ff8073;
  --primary-600: #ff6f61;
  --primary-soft: #35211d;
  --brand: #ff6f61;
  --success-soft: #10291a;
  --warn-soft: #2c2410;
  --danger-soft: #2c1518;
  --info-soft: #10263a;
  --purple-soft: #241a3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Boot splash ---------- */
.boot-splash {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--bg);
}
.boot-logo { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--primary); }
.boot-sub { color: var(--text-3); }

/* ============================================================
   Layout
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.4px;
}
.sidebar-brand .logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
}
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav-section-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--text-3); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; cursor: pointer;
  margin-bottom: 2px; user-select: none; position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item .nav-ico { width: 18px; text-align: center; font-size: 15px; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.nav-item .nav-badge.muted { background: var(--surface-3); color: var(--text-2); }

.sidebar-user {
  border-top: 1px solid var(--border); padding: 12px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: 60px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -0.3px; }
.topbar .crumb { color: var(--text-3); font-weight: 500; }
.topbar-spacer { flex: 1; }
.global-search {
  position: relative; width: 320px; max-width: 40vw;
}
.global-search input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13px;
}
.global-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.global-search .search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; position: relative;
  display: grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--danger); color: #fff; border-radius: 10px; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

.content { padding: 24px 26px 60px; overflow-y: auto; flex: 1; }
.content-narrow { max-width: 1240px; margin: 0 auto; }

/* ============================================================
   Reusable components
   ============================================================ */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
  text-transform: uppercase; user-select: none;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }

.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-chip .u-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .u-role { font-size: 11.5px; color: var(--text-3); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: filter .12s, background .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); background: var(--primary); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.block { width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge .dot-s { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.neutral { background: var(--surface-3); color: var(--text-2); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

.pri { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12px; }
.pri .bar { width: 3px; height: 12px; border-radius: 2px; }
.pri.urgent { color: var(--danger); } .pri.urgent .bar { background: var(--danger); }
.pri.high { color: var(--warn); } .pri.high .bar { background: var(--warn); }
.pri.medium { color: var(--info); } .pri.medium .bar { background: var(--info); }
.pri.low { color: var(--text-3); } .pri.low .bar { background: var(--text-3); }

/* Forms */
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { color: var(--text-3); font-size: 12px; margin-top: 5px; }
.input, textarea.input, select.input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-family: inherit;
}
.input:focus, textarea.input:focus, select.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 84px; }
.input.err { border-color: var(--danger); }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px){ .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; background: var(--surface); cursor: default;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--text); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
.ref-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--text-2); font-weight: 600; }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .stat-ico {
  position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 18px;
}
.stat .stat-val { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.stat .stat-label { color: var(--text-3); font-weight: 600; font-size: 12.5px; margin-top: 2px; }
.stat .stat-trend { font-size: 12px; margin-top: 8px; font-weight: 600; }
.stat .stat-trend.up { color: var(--success); }
.stat .stat-trend.down { color: var(--danger); }

/* Chips / filters */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--text-2); font-weight: 600; font-size: 12.5px;
  padding: 6px 13px; border-radius: 7px; cursor: pointer;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.filter-select {
  padding: 8px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}

/* Empty state */
.empty {
  text-align: center; padding: 54px 20px; color: var(--text-3);
}
.empty .empty-ico { font-size: 40px; margin-bottom: 10px; opacity: .6; }
.empty h3 { color: var(--text-2); margin: 0 0 4px; }

/* ============================================================
   Request detail
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@media (max-width: 960px){ .detail-grid { grid-template-columns: 1fr; } }

.detail-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.detail-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.detail-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: var(--text-3); font-size: 13px; }

.side-block { margin-bottom: 18px; }
.side-block .side-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); font-weight: 700; margin-bottom: 7px; }

.kv { display: flex; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 130px; color: var(--text-3); flex-shrink: 0; font-weight: 500; }
.kv .v { color: var(--text); font-weight: 500; }

/* Workflow status stepper */
.workflow-track { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin: 6px 0 4px; }
.wf-step { display: flex; align-items: center; }
.wf-node {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-3); white-space: nowrap;
}
.wf-node.done { background: var(--success-soft); color: var(--success); }
.wf-node.current { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-soft); }
.wf-arrow { color: var(--text-3); margin: 0 4px; }

/* Comments / activity timeline */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  border: none; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button .cnt { color: var(--text-3); font-weight: 600; margin-left: 4px; font-size: 12px; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment .c-author { font-weight: 700; }
.comment .c-time { color: var(--text-3); font-size: 12px; }
.comment .c-text { white-space: pre-wrap; word-wrap: break-word; }
.comment .c-text .mention { background: var(--primary-soft); color: var(--primary); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.internal-note { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 4px; }

.timeline { position: relative; padding-left: 8px; }
.tl-item { display: flex; gap: 12px; padding: 4px 0 16px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 26px; bottom: -4px; width: 2px; background: var(--border);
}
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; z-index: 1; border: 2px solid var(--surface);
}
.tl-body { flex: 1; padding-top: 3px; font-size: 13px; }
.tl-body .tl-time { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.tl-body b { font-weight: 700; }

.attach-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2);
}
.attach-item .a-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 16px; flex-shrink: 0; }
.attach-item .a-meta { flex: 1; min-width: 0; }
.attach-item .a-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-item .a-sub { color: var(--text-3); font-size: 12px; }

/* Composer */
.composer { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.composer textarea { width: 100%; border: none; background: transparent; resize: vertical; min-height: 62px; color: var(--text); font-family: inherit; font-size: 13.5px; }
.composer textarea:focus { outline: none; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; margin: auto 0; animation: pop .16s ease-out;
}
.modal.wide { max-width: 860px; }
.modal.slim { max-width: 460px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-head .m-close { margin-left: auto; }
.modal-body { padding: 20px 22px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.modal-foot .spacer { flex: 1; }

/* Toasts */
.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 12px 16px; min-width: 260px; max-width: 380px;
  display: flex; align-items: center; gap: 10px; animation: slidein .2s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .t-ico { font-size: 17px; }
.toast .t-msg { font-weight: 500; font-size: 13.5px; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Dropdown menu */
.menu {
  position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 150; min-width: 200px; max-height: 340px; overflow-y: auto;
}
.menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.menu-item:hover { background: var(--surface-3); }
.menu-item.active { background: var(--primary-soft); color: var(--primary); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); font-weight: 700; padding: 8px 10px 4px; }

/* Notifications panel */
.notif-panel { max-width: 400px; padding: 0; }
.notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item.unread:hover { background: var(--primary-soft); filter: brightness(0.98); }
.notif-item .n-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.notif-item .n-body { flex: 1; min-width: 0; }
.notif-item .n-msg { font-size: 13px; }
.notif-item .n-time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Misc helpers */
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; } .mt-24 { margin-top: 24px; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--surface-3); color: var(--text-2); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.chip-x { cursor: pointer; opacity: .6; } .chip-x:hover { opacity: 1; }
.progress { height: 7px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 20px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.field-builder-row {
  display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2);
}
.drag-handle { cursor: grab; color: var(--text-3); }
.status-editor-row, .transition-row {
  display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2);
}
.color-dot-lg { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; }

@media (max-width: 820px){
  .sidebar { position: fixed; z-index: 90; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .global-search { display: none; }
  .menu-toggle { display: grid !important; }
}
.menu-toggle { display: none; }
