#panel-gewe .topbar {background:#1a1f2e;color:#fff;height:52px;display:flex;align-items:center;padding:0 20px;gap:32px;flex-shrink:0}
#panel-gewe .topbar .logo {font-size:16px;font-weight:600;color:#fff;white-space:nowrap}
#panel-gewe .topbar .right {margin-left:auto;display:flex;align-items:center;gap:16px;color:rgba(255,255,255,.8);font-size:13px}
#panel-gewe .main {display:flex;flex:1;overflow:hidden}
#panel-gewe .sidebar {width:190px;background:#fff;border-right:1px solid #e8eaed;overflow-y:auto;flex-shrink:0}
#panel-gewe .sidebar .menu-group {padding:8px 0}
#panel-gewe .sidebar .menu-title {padding:10px 20px 4px;font-size:12px;color:#999;font-weight:500}
#panel-gewe .sidebar .menu-item {padding:10px 20px 10px 36px;cursor:pointer;color:#555;transition:all .15s}
#panel-gewe .sidebar .menu-item:hover {background:#f5f7fa;color:#1677ff}
#panel-gewe .sidebar .menu-item.active {color:#1677ff;background:#e8f3ff;font-weight:500}
#panel-gewe .content {flex:1;overflow-y:auto;padding:20px;min-width:0;width:0}
#panel-gewe .page {min-width:0;width:100%}
#panel-gewe .page {display:none}
#panel-gewe .page.active {display:block}
#panel-gewe .card {background:#fff;border-radius:8px;padding:20px;margin-bottom:16px;box-shadow:0 1px 4px rgba(0,0,0,.06);min-width:0;overflow:hidden}
#panel-gewe .card-title {font-size:15px;font-weight:600;margin-bottom:16px;color:#1a1f2e}
#panel-gewe .form-row {display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin-bottom:12px}
#panel-gewe .form-item {display:flex;flex-direction:column;gap:4px}
#panel-gewe .form-item label {font-size:12px;color:#666}
#panel-gewe .form-item input, #panel-gewe .form-item select, #panel-gewe .form-item textarea {border:1px solid #d9d9d9;border-radius:6px;padding:7px 11px;font-size:14px;outline:none;font-family:inherit;background:#fff}
#panel-gewe .form-item input:focus, #panel-gewe .form-item select:focus, #panel-gewe .form-item textarea:focus {border-color:#1677ff;box-shadow:0 0 0 2px rgba(22,119,255,.1)}
#panel-gewe .form-item textarea {resize:vertical;min-height:90px}
#panel-gewe .btn {padding:7px 16px;border-radius:6px;border:none;cursor:pointer;font-size:14px;font-family:inherit;display:inline-flex;align-items:center;gap:6px;transition:all .15s;white-space:nowrap}
#panel-gewe .btn-primary {background:#1677ff;color:#fff}
#panel-gewe .btn-primary:hover {background:#0958d9}
#panel-gewe .btn-primary:disabled {background:#a0c4ff;cursor:not-allowed}
#panel-gewe .btn-default {background:#fff;color:#333;border:1px solid #d9d9d9}
#panel-gewe .btn-default:hover {border-color:#1677ff;color:#1677ff}
#panel-gewe .btn-danger {background:#fff;color:#ff4d4f;border:1px solid #ffccc7}
#panel-gewe .btn-danger:hover {background:#fff1f0}
#panel-gewe .btn-sm {padding:4px 10px;font-size:13px}
#panel-gewe table {width:100%;border-collapse:collapse}
#panel-gewe th {background:#fafafa;padding:12px 16px;text-align:left;font-weight:500;border-bottom:1px solid #f0f0f0;white-space:nowrap;color:#555}
#panel-gewe td {padding:12px 16px;border-bottom:1px solid #f5f5f5;vertical-align:middle}
#panel-gewe tr:last-child td {border-bottom:none}
#panel-gewe tr:hover td {background:#fafafa}
#panel-gewe .tag {display:inline-flex;align-items:center;padding:2px 8px;border-radius:4px;font-size:12px}
#panel-gewe .tag-green {background:#f6ffed;color:#52c41a;border:1px solid #b7eb8f}
#panel-gewe .tag-blue {background:#e6f4ff;color:#1677ff;border:1px solid #91caff}
#panel-gewe .tag-red {background:#fff2f0;color:#ff4d4f;border:1px solid #ffccc7}
#panel-gewe .tag-gray {background:#fafafa;color:#999;border:1px solid #d9d9d9}
#panel-gewe .stat-bar {display:flex;gap:16px;margin-bottom:16px}
#panel-gewe .stat {background:#fff;border-radius:8px;padding:16px 20px;flex:1;box-shadow:0 1px 4px rgba(0,0,0,.06);text-align:center}
#panel-gewe .stat .num {font-size:28px;font-weight:600;color:#1677ff}
#panel-gewe .stat .label {font-size:12px;color:#999;margin-top:4px}
#panel-gewe .log-box {background:#1a1f2e;color:#d4d4d4;padding:14px;border-radius:6px;font-size:13px;font-family:monospace;max-height:260px;overflow-y:auto;line-height:1.7}
#panel-gewe .log-ok {color:#52c41a}
#panel-gewe .log-fail {color:#ff4d4f}
#panel-gewe .log-info {color:#91caff}
#panel-gewe .slots {display:flex;gap:8px;flex-wrap:wrap}
#panel-gewe .slot-label {display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border:1px solid #d9d9d9;border-radius:20px;cursor:pointer;font-size:13px;user-select:none;transition:all .15s}
#panel-gewe .slot-label:hover {border-color:#1677ff;color:#1677ff}
#panel-gewe .slot-label input {display:none}
#panel-gewe .slot-label.checked {background:#e8f3ff;border-color:#1677ff;color:#1677ff}
#panel-gewe .toast-container {position:fixed;top:70px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:8px}
#panel-gewe .toast {background:#fff;border-radius:8px;padding:12px 16px;box-shadow:0 4px 16px rgba(0,0,0,.15);display:flex;align-items:center;gap:10px;font-size:14px;animation:slideIn .2s ease;min-width:240px}
#panel-gewe .toast-success {border-left:4px solid #52c41a}
#panel-gewe .toast-error {border-left:4px solid #ff4d4f}
#panel-gewe .toast-info {border-left:4px solid #1677ff}
#panel-gewe to {transform:translateX(0);opacity:1}
#panel-gewe }
.modal-mask {position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;display:flex;align-items:center;justify-content:center}
.modal {background:#fff;border-radius:10px;padding:24px;min-width:400px;max-width:520px;box-shadow:0 8px 32px rgba(0,0,0,.15)}
.modal-title {font-size:16px;font-weight:600;margin-bottom:20px;color:#333}
.modal-footer {display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
#panel-gewe .modal {background:#fff;border-radius:10px;padding:24px;min-width:400px;max-width:520px;box-shadow:0 8px 32px rgba(0,0,0,.15)}
#panel-gewe .modal-title {font-size:16px;font-weight:600;margin-bottom:20px}
#panel-gewe .modal-footer {display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
#panel-gewe .qr-wrap {text-align:center;padding:20px 0}
#panel-gewe .qr-wrap img {width:220px;height:220px;border:1px solid #eee;border-radius:8px}
#panel-gewe .qr-tip {margin-top:12px;color:#999;font-size:13px;text-align:center}
#panel-gewe .hidden {display:none!important}
#panel-gewe .sop-rule-card {background:#fafafa;border:1px solid #e8e8e8;border-radius:6px;padding:12px;margin-bottom:8px}
#panel-gewe .modal-mask.hidden { display: none !important; }
#panel-gewe:not(.active) .modal-mask { display: none !important; }
#panel-gewe.active .modal-mask:not(.hidden) { display: flex !important; }
#panel-gewe .page { display: none; }
#panel-gewe .page.active { display: block; }
#panel-gewe { min-height: calc(100vh - 70px); background: #f0f2f5; color: #333; }
#panel-gewe .content { flex: none; width: auto; overflow: visible; padding: 20px; }

/* ══════════════════════════════════════════════════════
   Dark Mode: GEWE panel — activate when body:not(.day)
   ══════════════════════════════════════════════════════ */
body:not(.day) #panel-gewe {
  background: #0d0d0d !important;
  color: #ccc;
}

/* ── Sidebar ── */
body:not(.day) #panel-gewe .sidebar {
  background: #141414;
  border-right-color: #2a2a2a;
}
body:not(.day) #panel-gewe .sidebar .menu-title {
  color: #777;
}
body:not(.day) #panel-gewe .sidebar .menu-item {
  color: #aaa;
}
body:not(.day) #panel-gewe .sidebar .menu-item:hover {
  background: #1e1e1e;
  color: #4096ff;
}
body:not(.day) #panel-gewe .sidebar .menu-item.active {
  color: #4096ff;
  background: #0d2137;
}

/* ── Cards ── */
body:not(.day) #panel-gewe .card {
  background: #141414;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
body:not(.day) #panel-gewe .card-title {
  color: #e8e8e8;
}

/* ── Forms ── */
body:not(.day) #panel-gewe .form-item label {
  color: #999;
}
body:not(.day) #panel-gewe .form-item input,
body:not(.day) #panel-gewe .form-item select,
body:not(.day) #panel-gewe .form-item textarea {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #ccc;
}
body:not(.day) #panel-gewe .form-item input:focus,
body:not(.day) #panel-gewe .form-item select:focus,
body:not(.day) #panel-gewe .form-item textarea:focus {
  border-color: #4096ff;
  box-shadow: 0 0 0 2px rgba(64,150,255,.2);
}
body:not(.day) #panel-gewe .form-item input::placeholder,
body:not(.day) #panel-gewe .form-item textarea::placeholder {
  color: #666;
}

/* ── Buttons ── */
body:not(.day) #panel-gewe .btn-default {
  background: #1e1e1e;
  color: #ccc;
  border-color: #3a3a3a;
}
body:not(.day) #panel-gewe .btn-default:hover {
  border-color: #4096ff;
  color: #4096ff;
  background: #0d2137;
}
body:not(.day) #panel-gewe .btn-danger {
  background: #1e1e1e;
  border-color: #5a1a1a;
}
body:not(.day) #panel-gewe .btn-danger:hover {
  background: #2a0f0f;
}
body:not(.day) #panel-gewe .btn-primary {
  background: #1677ff;
  color: #fff;
}
body:not(.day) #panel-gewe .btn-primary:hover {
  background: #0958d9;
}
body:not(.day) #panel-gewe .btn-primary:disabled {
  background: #1a3a5c;
  color: #5ab4ff;
}

/* ── Tables ── */
body:not(.day) #panel-gewe th {
  background: #1a1a1a;
  border-bottom-color: #2a2a2a;
  color: #999;
}
body:not(.day) #panel-gewe td {
  border-bottom-color: #2a2a2a;
  color: #ccc;
}
body:not(.day) #panel-gewe tr:hover td {
  background: #1a1a1a;
}

/* ── Tags (keep semantic colors, darken backgrounds) ── */
body:not(.day) #panel-gewe .tag-green {
  background: #0f3020;
  border-color: #1a5a30;
}
body:not(.day) #panel-gewe .tag-blue {
  background: #0d2137;
  border-color: #1a4a7a;
}
body:not(.day) #panel-gewe .tag-red {
  background: #2a0f0f;
  border-color: #5a1a1a;
}
body:not(.day) #panel-gewe .tag-gray {
  background: #1a1a1a;
  color: #777;
  border-color: #3a3a3a;
}

/* ── Stats ── */
body:not(.day) #panel-gewe .stat {
  background: #141414;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
body:not(.day) #panel-gewe .stat .num {
  color: #4096ff;
}
body:not(.day) #panel-gewe .stat .label {
  color: #888;
}

/* ── Log box (already dark, minor tweaks) ── */
body:not(.day) #panel-gewe .log-box {
  background: #0a0a0a;
  color: #c0c0c0;
  border: 1px solid #2a2a2a;
}

/* ── Slot labels ── */
body:not(.day) #panel-gewe .slot-label {
  border-color: #3a3a3a;
  color: #999;
}
body:not(.day) #panel-gewe .slot-label:hover {
  border-color: #4096ff;
  color: #4096ff;
}
body:not(.day) #panel-gewe .slot-label.checked {
  background: #0d2137;
  border-color: #4096ff;
  color: #4096ff;
}

/* ── Toast ── */
body:not(.day) #panel-gewe .toast {
  background: #1e1e1e;
  color: #ccc;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ── Modals ── */
body:not(.day) .modal {
  background: #1e1e2e;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
body:not(.day) .modal-title {
  color: #e8e8e8;
}
body:not(.day) #panel-gewe .modal {
  background: #1e1e1e;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
body:not(.day) #panel-gewe .modal-title {
  color: #e8e8e8;
}
body:not(.day) #panel-gewe .qr-wrap img {
  border-color: #3a3a3a;
}
body:not(.day) #panel-gewe .qr-tip {
  color: #888;
}

/* ── SOP rule cards ── */
body:not(.day) #panel-gewe .sop-rule-card {
  background: #1a1a1a;
  border-color: #2a2a2a;
}

/* ══════════════════════════════════════════════════════
   Publish page specific dark mode overrides
   ══════════════════════════════════════════════════════ */

/* Step number circles — keep blue bg, white text */

/* Inline title colors in publish page */
body:not(.day) #panel-gewe #page-publish [style*="color:#1a1f2e"] {
  color: #e8e8e8 !important;
}

/* Subtitle / meta text */
body:not(.day) #panel-gewe #page-publish [style*="color:#999"] {
  color: #888 !important;
}
body:not(.day) #panel-gewe #page-publish [style*="color:#666"] {
  color: #999 !important;
}

/* Preview arrow between buttons */
body:not(.day) #panel-gewe #page-publish [style*="color:#d9d9d9"] {
  color: #555 !important;
}

/* Cell editor modal meta block */
body:not(.day) #cell-meta {
  background: #1a1a1a !important;
  color: #999 !important;
}

/* Publish table header — matrix (already dark bg, keep) */

/* File badge text */
body:not(.day) #cell-file-badge {
  color: #888 !important;
}

/* Publish preview card */
body:not(.day) #pub-preview-card [style*="color:#999"] {
  color: #888 !important;
}