:root {
  --red: #b3262d;
  --red-dark: #8e1e24;
  --red-deep: #731a20;
  --red-soft: #fae9e9;
  --cream: #fffdf7;
  --panel: #fff7e0;
  --yellow: #f8e8a8;
  --yellow-bright: #ffdf75;
  --ink: #2b2524;
  --muted: #766c68;
  --soft: #a59a91;
  --line: #e8dcc4;
  --green: #43845d;
  --blue: #527b99;
  --danger: #b44a50;
  --shadow: 0 12px 34px rgba(61, 38, 28, .075);
  --radius: 15px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); font-family: var(--sans); }
body { font-size: 13px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

/* Sign-in */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; overflow: hidden; background: radial-gradient(circle at 8% 5%, rgba(248,232,168,.46), transparent 29%), radial-gradient(circle at 92% 93%, rgba(179,38,45,.09), transparent 30%), #fbf7ef; }
.login-screen::before { content: ""; position: absolute; width: 560px; height: 560px; border: 1px solid rgba(179,38,45,.10); border-radius: 50%; right: -300px; top: -250px; box-shadow: 0 0 0 45px rgba(179,38,45,.025), 0 0 0 90px rgba(179,38,45,.02); }
.login-decoration { position: absolute; left: -170px; bottom: -270px; width: 530px; height: 530px; border-radius: 50%; background: linear-gradient(135deg, rgba(248,232,168,.25), rgba(179,38,45,.035)); }
.login-card { width: min(100%, 430px); position: relative; z-index: 1; padding: 38px 40px 31px; background: rgba(255,255,255,.94); border: 1px solid rgba(232,220,196,.88); border-radius: 19px; box-shadow: 0 22px 70px rgba(67,43,29,.12); }
.login-brand, .brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; position: relative; background: var(--red); color: #fff; font-weight: 900; font-size: 22px; box-shadow: 0 6px 14px rgba(179,38,45,.2); }
.brand-mark span { position: absolute; width: 7px; height: 7px; right: 6px; top: 6px; border-radius: 50%; background: var(--yellow-bright); }
.login-brand strong, .brand-word strong { display: block; font-size: 15px; letter-spacing: .4px; }
.login-brand small, .brand-word small { display: block; margin-top: 3px; color: var(--soft); font: 8px var(--mono); letter-spacing: 1px; }
.login-kicker { margin-top: 42px; color: #a47b2d; font: 700 9px var(--mono); letter-spacing: 1.4px; }
.login-card h1 { margin: 10px 0 7px; font-size: 30px; letter-spacing: -1.1px; font-weight: 750; }
.login-intro { margin: 0 0 25px; color: var(--muted); line-height: 1.6; font-size: 12px; }
.login-card label, .field-label { display: block; margin: 13px 0 7px; color: #625651; font-size: 10px; font-weight: 750; letter-spacing: .35px; }
.login-card input, .field-control, .search-input { width: 100%; min-height: 42px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border .15s, box-shadow .15s; }
.login-card input:focus, .field-control:focus, .search-input:focus, textarea:focus { border-color: #c65a60; box-shadow: 0 0 0 3px rgba(179,38,45,.09); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 60px; }
.password-toggle { position: absolute; right: 10px; top: 9px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.login-submit { width: 100%; justify-content: space-between; margin-top: 23px; min-height: 45px; }
.login-submit span { font-size: 18px; line-height: 1; }
.form-error { padding: 10px 11px; border: 1px solid #f0c7c9; border-radius: 8px; background: #fff2f2; color: #96333a; font-size: 11px; margin-top: 12px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; color: #91857d; font-size: 9px; }
.secure-dot { width: 7px; height: 7px; display: inline-block; flex: none; border-radius: 50%; background: #55936b; box-shadow: 0 0 0 3px rgba(85,147,107,.12); }
.login-side-note { position: absolute; left: 37px; bottom: 27px; color: #a79a8e; font: 9px/1.6 var(--mono); letter-spacing: 1px; }
.login-side-note span { color: #c6b9aa; }

/* App shell */
.app-shell { min-height: 100vh; background: radial-gradient(circle at 12% 0%, rgba(248,232,168,.15), transparent 27%), radial-gradient(circle at 100% 10%, rgba(179,38,45,.04), transparent 25%), #faf7f0; }
.topbar { height: 67px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 0 27px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.brand-mark.small { width: 35px; height: 35px; border-radius: 9px; font-size: 19px; }
.brand-word strong { font-size: 13px; }
.brand-word small { font-size: 8px; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.backend-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 9px var(--mono); }
.backend-status i { width: 7px; height: 7px; border-radius: 50%; background: #c3a65b; }
.backend-status.connected i { background: var(--green); box-shadow: 0 0 0 3px rgba(67,132,93,.11); }
.backend-status.disconnected i { background: var(--danger); }
.top-divider { height: 25px; width: 1px; background: var(--line); }
.operator-chip { display: flex; align-items: center; gap: 8px; }
.operator-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 850; }
.operator-chip b { display: block; font-size: 10px; }
.operator-chip small { display: block; margin-top: 2px; color: #a0948a; font: 7px var(--mono); letter-spacing: .7px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 10px 13px; min-height: 36px; font-size: 10px; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--red); box-shadow: 0 5px 13px rgba(179,38,45,.16); }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); box-shadow: 0 7px 16px rgba(179,38,45,.2); }
.btn-secondary { background: #fff; color: #6e393a; border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: #fffaf0; border-color: #d9c6a4; }
.btn-danger { background: #fff; color: #a2343b; border-color: #edc8c9; }
.btn-danger:hover:not(:disabled) { background: #fff2f2; }
.btn-quiet { min-height: 31px; padding: 7px 9px; color: var(--muted); background: #fff; border-color: var(--line); font-size: 9px; }
.btn-yellow { background: var(--yellow); color: #624c14; border-color: #ecd47b; }
.btn-small { min-height: 29px; padding: 6px 9px; font-size: 9px; }
.app-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); min-height: calc(100vh - 67px); }
.sidebar { display: flex; flex-direction: column; min-height: calc(100vh - 67px); position: sticky; top: 67px; height: calc(100vh - 67px); padding: 25px 13px 17px; background: #fff; border-right: 1px solid var(--line); }
.nav-caption { padding: 0 11px; color: #a69a8c; font: 700 8px var(--mono); letter-spacing: 1.15px; }
.nav-gap { margin-top: 24px; }
.side-nav { flex: 1; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; margin-top: 5px; padding: 11px 11px; border: 0; border-radius: 8px; text-align: left; color: #716762; background: transparent; font-size: 10px; font-weight: 600; }
.nav-item:hover { background: #fbf5e8; color: var(--red-dark); }
.nav-item.active { color: var(--red-dark); background: #faeded; box-shadow: inset 3px 0 0 var(--red); font-weight: 800; }
.nav-icon { width: 18px; text-align: center; color: #b17d4e; font-size: 15px; }
.nav-item.active .nav-icon { color: var(--red); }
.nav-subitem { padding-left: 22px; color: #867970; font-weight: 500; }
.nav-subitem .nav-icon { font-size: 13px; color: #c39b68; }
.form-filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex: 1; }
.form-section-filter { width: min(210px, 100%); min-height: 34px; padding: 7px 10px; font-size: 9px; }
@media (max-width: 480px) { .form-filters { width: 100%; } .form-filters .search-wrap { flex: 1 1 100%; } .form-section-filter { width: 100%; } }
.sidebar-bottom { margin-top: 20px; }
.sidebar-rule { height: 1px; background: var(--line); margin: 0 10px 15px; }
.sidebar-note { display: flex; gap: 9px; align-items: flex-start; padding: 0 9px; }
.sidebar-note b { display: block; font-size: 9px; color: #655852; }
.sidebar-note small { display: block; margin-top: 4px; color: #a2968b; font-size: 8px; line-height: 1.5; }
.version-label { padding: 17px 9px 0; color: #b1a599; font: 7px var(--mono); letter-spacing: .6px; }
.page-host { width: 100%; max-width: 1500px; margin: 0 auto; padding: 28px clamp(20px, 3vw, 44px) 40px; outline: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.page-kicker { color: #a47c32; font: 700 8px var(--mono); letter-spacing: 1.3px; text-transform: uppercase; }
.page-heading h1 { margin: 7px 0 5px; color: #2c2523; font-size: clamp(23px, 2.2vw, 31px); letter-spacing: -1px; line-height: 1.05; }
.page-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.page-meta { color: #a89a8f; font: 8px var(--mono); text-transform: uppercase; white-space: nowrap; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h2, .panel-heading h3 { margin: 0; color: #3c302c; font-size: 13px; letter-spacing: -.2px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.eyebrow { color: #a47b2f; font: 700 8px var(--mono); letter-spacing: 1px; }
.action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 15px; }
.stat-card { min-height: 105px; padding: 15px 16px; position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 19px rgba(61,38,28,.04); }
.stat-card::after { content: ""; position: absolute; width: 76px; height: 76px; right: -22px; bottom: -28px; border-radius: 50%; background: rgba(248,232,168,.27); }
.stat-card.red::after { background: rgba(179,38,45,.06); }
.stat-label { color: #9a8b80; font: 8px var(--mono); letter-spacing: .7px; text-transform: uppercase; }
.stat-value { margin-top: 13px; color: #352a27; font-size: 26px; font-weight: 800; letter-spacing: -.9px; }
.stat-hint { margin-top: 3px; color: #9b9088; font-size: 8px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(260px,.9fr); gap: 14px; }
.quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.quick-card { padding: 13px; text-align: left; background: #fffdf8; border: 1px solid #eee3cc; border-radius: 10px; color: var(--ink); }
.quick-card:hover { border-color: #d8c18f; background: #fff9e9; }
.quick-card .quick-icon { display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 9px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 14px; }
.quick-card b { display: block; font-size: 10px; }
.quick-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.note-list { display: grid; gap: 11px; }
.note-item { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 9px; line-height: 1.55; }
.note-bullet { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--panel); color: #8c6b2d; font-size: 10px; }

/* Tables and records */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.search-wrap { width: min(260px,100%); position: relative; }
.search-wrap .search-input { min-height: 34px; padding: 8px 10px 8px 31px; font-size: 9px; }
.search-symbol { position: absolute; top: 8px; left: 11px; color: #a99887; font-size: 12px; }
.table-wrap { overflow: auto; width: 100%; border: 1px solid #eee5d7; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 10px 12px; text-align: left; color: #82746b; background: #fff9ec; border-bottom: 1px solid var(--line); font: 700 8px var(--mono); letter-spacing: .45px; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #f0e9dd; color: #504542; vertical-align: middle; max-width: 340px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffdf8; }
.cell-main { color: #3a2f2c; font-weight: 700; }
.cell-muted { display: block; margin-top: 3px; color: #9c9086; font-size: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid #eee0bc; border-radius: 99px; background: #fff9e9; color: #86672e; font: 8px var(--mono); white-space: nowrap; }
.pill.green { border-color: #d5e8d9; background: #f0f8f1; color: #477d55; }
.pill.red { border-color: #f0d3d4; background: #fff3f3; color: #a0444a; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.icon-button { width: 28px; height: 27px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #806e62; font-size: 11px; }
.icon-button:hover { color: var(--red); background: #fff8f7; }
.empty-state { padding: 34px 15px; text-align: center; color: #93867c; }
.empty-state .empty-icon { margin-bottom: 9px; color: #c29b5d; font-size: 23px; }
.empty-state b { display: block; color: #544844; font-size: 11px; }
.empty-state small { display: block; margin-top: 5px; font-size: 9px; }

/* Upload queue and console */
.queue-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(270px,.8fr); gap: 14px; }
.drop-zone { display: grid; place-items: center; min-height: 150px; padding: 18px; border: 1px dashed #d7c39b; border-radius: 11px; background: #fffdf7; text-align: center; cursor: pointer; transition: background .15s,border .15s; }
.drop-zone.dragover { border-color: var(--red); background: #fff3f1; }
.drop-zone .drop-icon { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 8px; border-radius: 10px; background: var(--yellow); color: #70551c; font-size: 18px; }
.drop-zone b { color: #544541; font-size: 10px; }
.drop-zone small { display: block; margin-top: 5px; color: #9e9187; font-size: 8px; }
.file-queue { display: grid; gap: 7px; margin-top: 12px; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) 65px 76px 28px; gap: 10px; align-items: center; padding: 9px 10px; background: #fff; border: 1px solid #eee5d7; border-radius: 8px; }
.file-info { min-width: 0; display: flex; align-items: center; gap: 9px; }
.file-type { width: 29px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #fae8e7; color: #a43b42; font: 700 7px var(--mono); }
.file-name { overflow: hidden; color: #4d403c; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { margin-top: 3px; color: #a2968c; font-size: 8px; }
.file-size { color: #9b8d82; font: 8px var(--mono); }
.file-status { font: 8px var(--mono); color: #9b8d82; }
.file-status.completed { color: var(--green); }
.file-status.failed { color: var(--danger); }
.file-status.processing { color: var(--blue); }
.remove-file { border: 0; background: transparent; color: #a99a8e; font-size: 17px; }
.remove-file:hover { color: var(--red); }
.queue-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 13px; }
.queue-stat { padding: 10px; border: 1px solid #eee5d7; border-radius: 8px; background: #fffdf8; }
.queue-stat b { display: block; color: #3e302c; font-size: 17px; }
.queue-stat small { display: block; margin-top: 3px; color: #9b8e83; font: 7px var(--mono); letter-spacing: .5px; text-transform: uppercase; }
.console { height: 320px; overflow: auto; padding: 10px; border-radius: 9px; background: #171719; color: #e6dfd7; font: 8px/1.6 var(--mono); }
.console-line { display: grid; grid-template-columns: 62px 58px minmax(0,1fr); gap: 7px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
.console-time { color: #79777a; }
.console-tag { color: #d6b96d; }
.console-tag.SUCCESS { color: #8dc49b; }
.console-tag.ERROR { color: #e48c90; }
.console-tag.WARN { color: #e3c37a; }
.console-message { overflow-wrap: anywhere; color: #d7d0c9; }
.progress-track { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #eee9df; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

/* Settings and editors */
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.settings-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-card.full { grid-column: 1 / -1; }
.settings-card h2 { margin: 0; font-size: 13px; }
.settings-card > p { margin: 5px 0 14px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; }
.field-grid.one { grid-template-columns: 1fr; }
.field-label { margin: 0 0 6px; }
.field-control { min-height: 35px; padding: 8px 9px; font-size: 9px; }
.field-help { margin-top: 5px; color: #9b9088; font-size: 8px; line-height: 1.4; }
.field-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.notice { display: flex; gap: 9px; padding: 11px 12px; border: 1px solid #ead9a8; border-radius: 9px; background: #fff9e6; color: #765d2e; font-size: 9px; line-height: 1.5; }
.notice.red { border-color: #efd1d2; background: #fff5f4; color: #8e464a; }
.notice.green { border-color: #d6e7d7; background: #f4faf2; color: #4c7751; }
.status-line { display: flex; align-items: center; gap: 8px; color: #6c5f58; font-size: 9px; }
.status-line b { color: #3b302d; }
.html-preview { width: 100%; min-height: 330px; border: 1px solid #e9dfcf; border-radius: 8px; background: #fff; }
.code-area { width: 100%; min-height: 250px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: #1d1d20; color: #e8e0d7; font: 9px/1.55 var(--mono); outline: none; }

/* Modal and toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(39,29,25,.48); backdrop-filter: blur(3px); }
.modal-card { width: min(100%, 570px); max-height: min(90vh,760px); overflow: auto; padding: 21px; border: 1px solid #e9dcc5; border-radius: 14px; background: #fffdf8; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.modal-card.wide { width: min(100%, 780px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-header h2 { margin: 0; color: #392c29; font-size: 16px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.modal-close { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #816d61; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); }
.modal-drop { cursor: pointer; display: grid; place-items: center; min-height: 95px; padding: 12px; border: 1px dashed #d7c39b; border-radius: 9px; background: #fffaf0; text-align: center; }
.modal-drop small { color: #9c8f84; font-size: 8px; }
.modal-drop.dragover { border-color: var(--red); background: #fff3f1; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-cell { min-width: 0; padding: 10px; border: 1px solid #eee6d9; border-radius: 8px; background: #fff; }
.detail-cell label { display: block; color: #9a8c81; font: 7px var(--mono); text-transform: uppercase; }
.detail-cell div { margin-top: 6px; color: #4a3e39; font-size: 9px; overflow-wrap: anywhere; white-space: pre-wrap; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; width: min(350px,calc(100vw - 40px)); }
.toast { padding: 11px 13px; border: 1px solid #e8ddc9; border-radius: 9px; background: #fff; box-shadow: 0 10px 30px rgba(52,34,27,.13); color: #51443e; font-size: 9px; line-height: 1.5; animation: toast-in .2s ease-out; }
.toast.success { border-left: 3px solid #548f61; }
.toast.error { border-left: 3px solid #b84950; }
.toast.info { border-left: 3px solid #c39a46; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.spinner { width: 13px; height: 13px; display: inline-block; vertical-align: middle; border: 2px solid #e8d7b7; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { padding: 45px; text-align: center; color: var(--muted); font-size: 10px; }

@media (max-width: 1050px) {
  .app-layout { grid-template-columns: 205px minmax(0,1fr); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .queue-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: 59px; padding: 0 14px; }
  .topbar-right { gap: 9px; }
  .backend-status, .top-divider, .operator-chip small { display: none; }
  .app-layout { display: block; min-height: calc(100vh - 59px); }
  .sidebar { position: sticky; top: 59px; z-index: 20; height: auto; min-height: 0; padding: 8px 9px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar > .nav-caption, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 5px; width: max-content; }
  .nav-item { width: auto; margin: 0; padding: 9px 10px; white-space: nowrap; font-size: 9px; }
  .nav-caption.nav-gap { display: none; }
  .nav-icon { width: auto; }
  .page-host { padding: 20px 14px 30px; }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; }
  .settings-card.full { grid-column: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-meta { display: none; }
  .login-card { padding: 30px 25px 25px; }
  .login-side-note { display: none; }
}
@media (max-width: 480px) {
  .operator-chip { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 90px; padding: 11px; }
  .stat-value { font-size: 22px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .field-grid, .detail-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: minmax(0,1fr) 55px 24px; }
  .file-status { display: none; }
  .queue-stats { grid-template-columns: repeat(2,1fr); }
}

/* v2.2 usability pass: larger type, controls and icons */
body { font-size: 15px; }
.topbar { height: 74px; padding-inline: 32px; }
.brand-mark.small { width: 43px; height: 43px; font-size: 23px; }
.brand-word strong { font-size: 16px; }
.brand-word small { font-size: 9px; }
.backend-status { font-size: 11px; }
.operator-avatar { width: 36px; height: 36px; font-size: 11px; }
.operator-chip b { font-size: 12px; }
.operator-chip small { font-size: 8px; }
.btn { min-height: 42px; padding: 11px 16px; gap: 9px; font-size: 13px; border-radius: 8px; }
.btn-quiet { min-height: 38px; font-size: 12px; }
.btn-small { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.app-layout { grid-template-columns: 250px minmax(0,1fr); min-height: calc(100vh - 74px); }
.sidebar { min-height: calc(100vh - 74px); top: 74px; height: calc(100vh - 74px); padding: 29px 14px 18px; }
.nav-caption { font-size: 10px; }
.nav-gap { margin-top: 27px; }
.nav-item { padding: 13px 12px; gap: 13px; font-size: 13px; }
.nav-icon { width: 24px; font-size: 22px; }
.nav-subitem .nav-icon { font-size: 19px; }
.nav-item.active { box-shadow: inset 4px 0 0 var(--red); }
.sidebar-note b { font-size: 11px; }
.sidebar-note small { font-size: 10px; }
.version-label { font-size: 8px; }
.page-host { padding: 34px clamp(22px, 3.2vw, 48px) 46px; }
.page-kicker { font-size: 10px; }
.page-heading h1 { font-size: clamp(28px, 2.4vw, 36px); }
.page-heading p { font-size: 13px; }
.page-meta { font-size: 10px; }
.panel-pad { padding: 22px; }
.panel-heading h2, .panel-heading h3 { font-size: 17px; }
.panel-heading p { font-size: 12px; }
.field-label, .login-card label { font-size: 12px; }
.field-control { min-height: 43px; padding: 10px 12px; font-size: 13px; border-radius: 7px; }
.field-help { font-size: 11px; }
.notice { padding: 13px 15px; font-size: 12px; }
.status-line { font-size: 12px; }
.table-toolbar { margin-bottom: 15px; }
.search-wrap .search-input { min-height: 42px; padding: 9px 12px 9px 36px; font-size: 12px; }
.search-symbol { top: 9px; left: 12px; font-size: 17px; }
.form-section-filter { min-height: 42px; font-size: 12px; }
table { font-size: 13px; }
th { padding: 13px 14px; font-size: 10px; }
td { padding: 14px; }
.cell-main { font-size: 14px; }
.cell-muted { font-size: 10px; }
.pill { padding: 5px 9px; font-size: 10px; }
.icon-button { width: 36px; height: 35px; border-radius: 8px; font-size: 17px; }
.icon-button.danger { color: #a2343b; }
.empty-state { padding: 42px 16px; }
.empty-state .empty-icon { font-size: 30px; }
.empty-state b { font-size: 14px; }
.empty-state small { font-size: 12px; }
.settings-grid { gap: 18px; }
.settings-card { padding: 22px; }
.settings-card h2 { font-size: 17px; }
.settings-card > p { font-size: 12px; }
.field-grid { gap: 14px 16px; }
.modal-card { padding: 25px; }
.modal-header h2 { font-size: 21px; }
.modal-header p { font-size: 12px; }
.modal-close { width: 36px; height: 36px; font-size: 22px; }
.modal-drop small { font-size: 10px; }
.login-card label { margin: 16px 0 8px; }
.login-card input { min-height: 46px; font-size: 13px; }
.login-intro { font-size: 13px; }
.login-submit { min-height: 50px; }
.login-foot { font-size: 10px; }

/* Form Manager controls arranged like the desktop Form Manager reference */
.form-manager-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.form-manager-actions .button-symbol { font-size: 20px; line-height: .8; }
.selected-count { color: var(--muted); font-size: 12px; margin-left: 3px; }
.refresh-forms-button { margin-left: auto; }
.forms-library-heading { margin-bottom: 13px; }
.select-column { width: 48px; min-width: 48px; text-align: center !important; }
.table-checkbox { width: 18px; height: 18px; accent-color: var(--red); vertical-align: middle; cursor: pointer; }
.form-manager-actions button:disabled { opacity: .48; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.upload-drop-zone { display: grid; place-items: center; gap: 10px; min-height: 145px; padding: 18px; border: 1px solid #d9c69f; background: #fffdf8; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-drop-zone b { color: var(--red); font-size: 14px; }
.upload-drop-zone span { color: var(--red); font-size: 13px; }
.upload-drop-zone strong { color: var(--red); font-size: 14px; }
.upload-drop-zone.dragover { border-color: var(--red); background: #fff0ef; }
.upload-file-row { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 7px 0 17px; }
.upload-file-row span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.upload-file-row .btn { min-width: 118px; }
.database-connection-card { background: #fffefa; }
.database-connection-card .panel-heading { margin-bottom: 18px; }
.settings-heading-icon { color: var(--red); font-size: 23px; margin-right: 6px; vertical-align: -2px; }
.database-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.db-password-field { grid-column: 1 / 2; }
.db-ssl-check { align-self: end; min-height: 43px; font-size: 12px; }
.db-ssl-check input { width: 17px; height: 17px; accent-color: var(--red); }
.database-security-help { margin-top: 13px; font-size: 11px; }
.database-error-notice { margin-bottom: 16px; }
.database-connect-actions { justify-content: flex-end; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.database-connect-actions .btn { min-width: 170px; }

@media (max-width: 760px) {
  .topbar { height: 62px; padding-inline: 14px; }
  .app-layout { display: block; min-height: calc(100vh - 62px); }
  .sidebar { top: 62px; height: auto; min-height: 0; padding: 9px; }
  .nav-item { font-size: 12px; padding: 10px 11px; }
  .nav-icon { width: auto; font-size: 19px; }
  .page-host { padding: 22px 14px 32px; }
  .form-manager-actions { gap: 8px; }
  .refresh-forms-button { margin-left: 0; }
  .database-fields { grid-template-columns: 1fr; }
  .db-password-field { grid-column: auto; }
}
@media (max-width: 480px) {
  .form-manager-actions .btn { flex: 1 1 auto; }
  .selected-count { width: 100%; }
  .upload-file-row { align-items: flex-start; flex-direction: column; }
  .upload-file-row .btn { width: 100%; }
}

/* v2.3 visual direction: straightforward desktop admin workspace, based on the Erudite Form Manager reference */
:root {
  --red: #b3262d;
  --red-dark: #8e1e24;
  --red-deep: #731a20;
  --red-soft: #fae9e9;
  --cream: #ffffff;
  --panel: #fff7e0;
  --yellow: #f8e8a8;
  --yellow-bright: #ffdf75;
  --ink: #2b2524;
  --muted: #766c68;
  --soft: #a59a91;
  --line: #e8dcc4;
  --shadow: none;
  --radius: 2px;
  --sans: "Segoe UI", Arial, Helvetica, sans-serif;
}
html, body { min-height: 100%; background: #fff; color: var(--ink); font-family: var(--sans); }
body { font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font-family: var(--sans); }

/* Simple, solid header */
.app-shell { min-height: 100vh; background: #fff; }
.topbar {
  height: 78px;
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 22px 0 27px;
  background: var(--red);
  border: 0;
  color: #fff;
}
.brand-lockup { gap: 0; }
.brand-word strong { color: #fff; font-size: 25px; line-height: 1.05; letter-spacing: .2px; }
.brand-word small { margin-top: 5px; color: rgba(255,255,255,.92); font: 700 12px/1.1 var(--sans); letter-spacing: 0; }
.topbar-right { gap: 15px; }
.backend-status { color: #fff; font: 13px var(--sans); white-space: nowrap; }
.backend-status i { width: 9px; height: 9px; background: #e9c66b; }
.backend-status.connected i { background: #9fdaa9; box-shadow: none; }
.backend-status.disconnected i { background: #ffd0d0; }
.operator-chip { gap: 8px; }
.operator-avatar { width: 31px; height: 31px; background: rgba(255,255,255,.17); color: #fff; font-size: 11px; }
.operator-chip b { color: #fff; font-size: 12px; }
.operator-chip small { color: rgba(255,255,255,.75); font: 9px var(--sans); letter-spacing: .3px; }
.top-divider { background: rgba(255,255,255,.3); }
.btn-database { min-height: 40px; padding: 9px 17px; border: 1px solid #f3dc91; border-radius: 1px; background: #f8e8a8; color: #251f1a; font-size: 13px; font-weight: 700; }
.btn-database:hover:not(:disabled) { background: #ffedb0; }
.btn-quiet { min-height: 38px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.45); border-radius: 1px; background: transparent; color: #fff; font-size: 12px; }
.btn-quiet:hover:not(:disabled) { background: rgba(255,255,255,.12); }

/* Cream navigation rail */
.app-layout { grid-template-columns: 220px minmax(0,1fr); min-height: calc(100vh - 78px); }
.sidebar {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  min-height: calc(100vh - 78px);
  padding: 25px 9px 17px;
  background: #fff7e0;
  border-right: 1px solid #eadfc9;
}
.nav-caption { padding: 0 12px; color: #766c68; font: 700 12px var(--sans); letter-spacing: .2px; }
.nav-gap { margin-top: 24px; }
.nav-item {
  min-height: 49px;
  margin-top: 5px;
  padding: 12px 14px;
  gap: 12px;
  border-radius: 0;
  color: #4b4140;
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: #fbefc9; color: var(--red-dark); }
.nav-item.active { background: #f8e8a8; color: var(--red-dark); box-shadow: none; font-weight: 700; }
.nav-icon { width: 25px; color: #8c7160; font-size: 22px; line-height: 1; }
.nav-item.active .nav-icon { color: var(--red); }
.nav-subitem { padding-left: 22px; }
.nav-subitem .nav-icon { font-size: 20px; }
.sidebar-bottom { margin-top: 20px; }
.sidebar-rule { background: #e7d9bd; }
.sidebar-note b { color: #61554e; font-size: 12px; }
.sidebar-note small { color: #877b70; font-size: 11px; }
.version-label { color: #968879; font-size: 9px; }

/* Main workspace stays wide and uncluttered */
.page-host { width: 100%; max-width: none; margin: 0; padding: 27px 27px 36px; background: #fff; }
.page-heading { align-items: flex-end; margin-bottom: 18px; gap: 16px; }
.page-kicker { color: #8e6e3b; font: 700 11px var(--sans); letter-spacing: .4px; }
.page-heading h1 { margin: 4px 0 6px; color: #211d1b; font-size: clamp(25px, 2vw, 30px); letter-spacing: -.25px; line-height: 1.2; font-weight: 700; }
.page-heading p { color: #665b56; font-size: 14px; line-height: 1.5; }
.page-meta { color: #766c68; font: 11px var(--sans); }
.panel, .settings-card { border: 1px solid #e1d5c2; border-radius: 2px; box-shadow: none; background: #fff; }
.panel-pad { padding: 18px; }
.panel-heading { margin-bottom: 15px; }
.panel-heading h2, .panel-heading h3 { color: #302724; font-size: 18px; letter-spacing: 0; }
.panel-heading p { color: #71655e; font-size: 13px; }
.eyebrow { color: #8e6e3b; font: 700 11px var(--sans); letter-spacing: .3px; }

/* Straightforward buttons and fields */
.btn {
  min-height: 40px;
  padding: 9px 15px;
  gap: 8px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 650;
  transition: background .12s, border-color .12s;
  transform: none !important;
  box-shadow: none !important;
}
.btn-primary { color: #fff; background: var(--red); border-color: var(--red); }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-secondary { color: #332a26; background: #fff; border-color: #d8cbb5; }
.btn-secondary:hover:not(:disabled) { background: #faf5e9; border-color: #c8b797; }
.btn-yellow { color: #34291c; background: #f8e8a8; border-color: #e8d58e; }
.btn-yellow:hover:not(:disabled) { background: #f5dfa0; }
.btn-danger { color: #9c222a; background: #f9dddd; border-color: #e9bfc2; }
.btn-danger:hover:not(:disabled) { background: #f5cecf; }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.field-label, .login-card label { color: #483d38; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.field-control, .search-input, .login-card input {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #bdb3a6;
  border-radius: 1px;
  background: #fff;
  color: #2b2524;
  font-size: 14px;
}
.field-control:focus, .search-input:focus, .login-card input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px rgba(179,38,45,.09); }
.field-help { color: #736862; font-size: 12px; }
.notice { border-radius: 1px; font-size: 13px; }
.status-line { font-size: 13px; }

/* Tables: visible headings, simple grid, comfortable rows */
.table-wrap { width: 100%; overflow: auto; border: 1px solid #cfc7bb; border-radius: 1px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  color: #2d2521;
  background: #fff7e0;
  border: 1px solid #cfc7bb;
  font: 700 13px var(--sans);
  letter-spacing: .1px;
  text-align: center;
}
td { padding: 10px 12px; color: #302a27; border-bottom: 1px solid #eee8de; font-size: 14px; vertical-align: middle; }
tbody tr:hover { background: #fffaf0; }
.cell-main { color: #27211e; font-size: 14px; font-weight: 600; }
.cell-muted { color: #706660; font-size: 12px; }
.pill { border: 1px solid #e8d9b4; border-radius: 2px; background: #fff9e9; color: #6e5726; font: 12px var(--sans); }
.icon-button { width: 35px; height: 34px; border-radius: 2px; font-size: 17px; }
.empty-state { padding: 40px 18px; color: #6c625c; }
.empty-state b { color: #302825; font-size: 15px; }
.empty-state small { font-size: 13px; }
.search-wrap { width: min(230px, 100%); }
.search-wrap .search-input { min-height: 39px; padding: 7px 10px 7px 32px; font-size: 13px; }
.search-symbol { top: 7px; left: 10px; color: #74685e; font-size: 17px; }

/* Form Manager: actions first, broad three-column table below */
.form-manager-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 14px; }
.form-manager-actions .button-symbol { font-size: 19px; line-height: .9; }
.selected-count { color: #756a63; font-size: 12px; margin-left: 2px; }
.forms-filter-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.forms-filter-controls .search-wrap { width: 190px; }
.form-section-filter { width: 180px; min-height: 39px; padding: 7px 9px; font-size: 13px; }
.refresh-forms-button { margin-left: 2px; min-width: 92px; }
.forms-table-viewport { height: calc(100vh - 290px); min-height: 370px; display: flex; flex-direction: column; }
.forms-table-viewport .table-wrap { height: 100%; min-height: 0; flex: 1; overflow: auto; }
.forms-table { border-collapse: separate; border-spacing: 0; }
.forms-table th { text-align: center; height: 38px; padding: 7px 12px; }
.forms-table td { height: 37px; padding: 7px 12px; border-bottom: 0; }
.forms-table tbody tr { cursor: pointer; }
.forms-table tbody tr:hover { background: #fffaf0; }
.forms-table tbody tr.is-selected { background: #f5e3ae; }
.forms-table tbody tr.is-selected td { color: #2d2521; }
.forms-table tbody tr:focus { outline: 2px solid #bd777b; outline-offset: -2px; }

/* Question import workspace and processing details */
.queue-layout { gap: 18px; }
.drop-zone, .upload-drop-zone, .modal-drop { border-radius: 2px; background: #fffdf8; }
.drop-zone { min-height: 175px; border: 1px dashed #cdbf9f; }
.drop-zone .drop-icon { width: 45px; height: 45px; border-radius: 2px; font-size: 23px; }
.drop-zone b { color: #302724; font-size: 14px; }
.drop-zone small { color: #746960; font-size: 12px; }
.file-row { border-radius: 2px; padding: 10px; }
.file-name { font-size: 13px; }
.file-sub, .file-size, .file-status { font-size: 11px; }
.file-type { width: 34px; height: 35px; font-size: 9px; }
.queue-stat { border-radius: 2px; }
.queue-stat b { font-size: 20px; }
.queue-stat small { font: 11px var(--sans); }
.console { height: 320px; border-radius: 2px; font: 11px/1.6 Consolas, monospace; }
.console-line { grid-template-columns: 72px 65px minmax(0,1fr); }
.progress-track { height: 6px; }

/* Configuration, editors and dialogs */
.settings-grid { gap: 15px; }
.settings-card { padding: 20px; }
.settings-card h2 { font-size: 18px; }
.settings-card > p { color: #6f645d; font-size: 13px; }
.field-grid { gap: 14px 16px; }
.modal-backdrop { background: rgba(34,27,23,.43); backdrop-filter: none; }
.modal-card { border: 1px solid #d8cbb5; border-radius: 2px; background: #fffdf7; box-shadow: 0 12px 35px rgba(0,0,0,.18); padding: 24px; }
.modal-header h2 { color: #2c2421; font-size: 22px; }
.modal-header p { color: #6e625c; font-size: 13px; }
.modal-close { width: 34px; height: 34px; border-radius: 2px; font-size: 21px; }
.modal-drop { min-height: 120px; border: 1px dashed #cdbf9f; }
.modal-drop small { font-size: 12px; }
.detail-cell { border-radius: 2px; }
.detail-cell label { font: 11px var(--sans); }
.detail-cell div { font-size: 13px; }
.html-preview { border-radius: 2px; }
.code-area { border-radius: 2px; font-size: 12px; }
.toast { border-radius: 2px; font-size: 13px; padding: 12px 14px; }
.page-loading { padding: 45px; font-size: 13px; }
.spinner { width: 16px; height: 16px; }

/* Sign-in uses the same restrained palette */
.login-screen { background: #fff9ea; }
.login-screen::before, .login-decoration { display: none; }
.login-card { border: 1px solid #e4d8c1; border-radius: 2px; box-shadow: 0 6px 22px rgba(54,39,27,.09); }
.login-brand strong { font-size: 16px; }
.login-brand small { font-size: 10px; }
.login-kicker { font: 700 11px var(--sans); letter-spacing: .5px; }
.login-card h1 { font-size: 30px; letter-spacing: 0; }
.login-intro { color: #655a53; font-size: 14px; }
.login-foot { font-size: 11px; }
.password-toggle { font-size: 12px; }

@media (max-width: 1000px) {
  .forms-filter-controls { margin-left: 0; }
  .forms-table-viewport { height: calc(100vh - 320px); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 72px; padding: 10px 14px; gap: 10px; }
  .brand-word strong { font-size: 21px; }
  .brand-word small { font-size: 10px; }
  .topbar-right { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .backend-status { display: none; }
  .operator-chip { display: none; }
  .app-layout { display: block; min-height: calc(100vh - 72px); }
  .sidebar { position: sticky; top: 72px; z-index: 20; height: auto; min-height: 0; padding: 8px; border-right: 0; border-bottom: 1px solid #eadfc9; overflow-x: auto; }
  .side-nav { display: flex; gap: 5px; width: max-content; }
  .nav-caption.nav-gap { display: none; }
  .nav-caption { display: none; }
  .nav-item { width: auto; min-height: 42px; margin: 0; padding: 9px 11px; white-space: nowrap; font-size: 13px; }
  .nav-icon { width: auto; font-size: 18px; }
  .sidebar-bottom { display: none; }
  .page-host { padding: 22px 14px 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-meta { display: none; }
  .form-manager-actions { gap: 7px; }
  .forms-filter-controls { flex: 1 1 100%; order: 2; }
  .forms-filter-controls .search-wrap { flex: 1; width: auto; }
  .forms-filter-controls .form-section-filter { flex: 1; width: auto; }
  .refresh-forms-button { margin-left: auto; }
  .forms-table-viewport { height: 58vh; min-height: 300px; }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; }
  .settings-card.full { grid-column: auto; }
}
@media (max-width: 480px) {
  .btn-database { min-height: 36px; padding: 7px 9px; font-size: 11px; }
  .btn-quiet { min-height: 34px; padding: 6px 8px; font-size: 11px; }
  .form-manager-actions > .btn { flex: 1 1 calc(50% - 8px); }
  .selected-count { width: 100%; order: 1; }
  .forms-filter-controls { flex-direction: column; align-items: stretch; }
  .forms-filter-controls .form-section-filter { width: 100%; }
  .forms-table th, .forms-table td { padding: 8px 7px; font-size: 12px; }
  .forms-table-viewport { height: 55vh; }
}

/* v2.4 — three independent server-persisted database workspaces */
.database-workspace { margin-top: 22px; }
.settings-workspace-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:0 0 12px; padding:0 2px; }
.settings-workspace-heading h2 { margin:0; color:#302724; font-size:21px; letter-spacing:-.35px; }
.settings-workspace-heading p { margin:5px 0 0; color:#71655e; font-size:13px; line-height:1.5; }
.database-workspace .settings-card { border-radius:2px; box-shadow:none; }
.database-workspace .database-connection-card { margin-bottom:14px; }
.database-workspace .panel-heading h3 { margin:0; font-size:17px; color:#302724; }
.database-workspace .panel-heading p { margin-top:5px; font-size:12px; line-height:1.5; }
.settings-connection-state { color:#6c625b; font-size:12px; font-weight:700; white-space:nowrap; }
.workspace-mappings { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.mapping-editor { min-width:0; }
.mapping-editor .panel-heading { align-items:flex-start; }
.mapping-editor .panel-heading h2 { font-size:17px; }
.mapping-editor .panel-heading p { font-size:12px; line-height:1.45; }
.mapping-fields-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 13px; margin-top:12px; }
.mapping-field { min-width:0; }
.mapping-field .field-label { min-height:15px; margin-top:4px; font-size:10px; }
.mapping-field .field-control { min-height:40px; font-size:12px; }
.settings-intro { margin-bottom:16px; padding:13px 15px; font-size:13px; line-height:1.55; }
.database-workspace .database-fields { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px 14px; }
.database-workspace .database-fields .field-control { min-height:42px; font-size:13px; }
.database-workspace .field-label { font-size:11px; }
.database-workspace .field-help { font-size:11px; line-height:1.5; }
.database-workspace .database-connect-actions { margin-top:14px; }
.database-workspace .database-connect-actions .btn { min-height:40px; padding:9px 16px; font-size:12px; }
@media (max-width:900px) {
  .workspace-mappings { grid-template-columns:1fr; }
  .database-workspace .database-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:560px) {
  .settings-workspace-heading { align-items:flex-start; flex-direction:column; }
  .database-workspace .database-fields,
  .mapping-fields-grid { grid-template-columns:1fr; }
}

/* Free Resources manager — restrained red/cream desktop administration layout */
.free-resource-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:18px 0 10px; }
.free-resource-search { display:flex; align-items:center; gap:0; flex:1 1 360px; max-width:640px; min-width:250px; }
.free-resource-search .search-symbol { display:grid; place-items:center; width:38px; height:38px; border:1px solid #d8cbbb; border-right:0; background:#fffdf7; color:#8f755f; font-size:19px; }
.free-resource-search .search-input { min-width:0; flex:1; height:38px; border:1px solid #d8cbbb; border-radius:0; background:#fff; padding:8px 11px; font-size:12px; }
.free-resource-search .btn { min-height:38px; margin-left:7px; }
.free-resource-toolbar-actions { display:flex; flex-wrap:wrap; gap:8px; }
.free-resource-summary { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:8px 0 15px; color:#897b70; font-size:10px; }
.free-resource-summary span:first-child, .free-resource-summary span:nth-child(2) { color:#5b4b43; font-weight:700; }
.free-resource-sections { display:grid; gap:18px; align-items:start; }
.free-resource-section { min-width:0; overflow:hidden; border:1px solid #d9cbbb; background:#fff; }
.free-resource-section-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 17px 13px; border-bottom:1px solid #e5daca; background:#fffaf0; }
.free-resource-section-heading { min-width:0; }
.free-resource-section-kicker { color:#9c6b2a; font:700 9px var(--mono); letter-spacing:.85px; }
.free-resource-section-heading h2 { margin:4px 0 0; color:#342a26; font-size:18px; line-height:1.25; font-weight:750; overflow-wrap:anywhere; }
.free-resource-section-heading p { margin:5px 0 0; color:#75665d; font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.free-resource-section-heading .resource-no-description { color:#a69a90; font-style:italic; }
.resource-count { display:inline-block; margin-top:7px; color:#8a7565; font-size:10px; font-weight:700; }
.free-resource-section-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; flex:none; }
.free-resource-section-actions .btn { min-height:34px; padding:8px 11px; font-size:10px; }
.free-resource-table-wrap { overflow:auto; border:0; border-radius:0; box-shadow:none; }
.free-resource-table { width:100%; min-width:760px; border-collapse:collapse; }
.free-resource-table th { padding:11px 12px; background:#fff7e5; border-bottom:1px solid #d9cbbb; color:#55483f; font-size:9px; letter-spacing:.35px; text-align:left; }
.free-resource-table td { padding:11px 12px; border-bottom:1px solid #efe8dc; color:#51443d; font-size:11px; vertical-align:middle; }
.free-resource-table tbody tr:last-child td { border-bottom:0; }
.free-resource-table tbody tr:hover { background:#fffdf7; }
.resource-id-cell { color:#8a7b70; font-variant-numeric:tabular-nums; }
.resource-title-cell { color:#3c302b; font-weight:700; }
.resource-description-cell { max-width:460px; white-space:normal; line-height:1.45; color:#74665d !important; }
.resource-date-cell { white-space:nowrap; color:#8b7e74 !important; font-size:10px !important; }
.resource-file-link { display:inline-flex; align-items:center; gap:8px; max-width:100%; color:#9e252d; font-size:10px; font-weight:700; text-decoration:none; }
.resource-file-link:hover, .resource-video-link:hover { text-decoration:underline; }
.resource-file-link > span:nth-child(2) { overflow-wrap:anywhere; }
.resource-file-icon { display:grid; place-items:center; flex:none; min-width:32px; height:26px; padding:0 5px; border:1px solid #edd1ce; background:#fff3f0; color:#9e252d; font:700 8px var(--mono); }
.resource-link-arrow { color:#aa8b66; }
.resource-video-link { color:#a3262d; font-size:10px; font-weight:700; text-decoration:none; white-space:nowrap; }
.resource-section-empty-row { padding:22px !important; text-align:center; color:#988a7e !important; font-size:11px !important; }
.free-resource-empty { padding:58px 20px; border:1px dashed #d6c8b5; background:#fffdf8; text-align:center; }
.free-resource-empty-icon { color:#a3262d; font-size:29px; }
.free-resource-empty h2 { margin:8px 0 0; color:#3c302b; font-size:17px; }
.free-resource-empty p { margin:7px 0 0; color:#8d7e72; font-size:11px; }
.resource-upload-drop { display:grid; gap:7px; place-items:center; min-height:130px; margin:8px 0 4px; padding:18px; border:1px dashed #cbb89b; background:#fffdf7; color:#a3262d; cursor:pointer; text-align:center; }
.resource-upload-drop:hover, .resource-upload-drop.dragover { border-color:#a3262d; background:#fff5ef; }
.resource-upload-drop b { font-size:11px; letter-spacing:.3px; }
.resource-upload-drop span { color:#9b8c80; font-size:10px; }
.resource-upload-drop strong { font-size:11px; }
.resource-upload-drop small { color:#8e8177; font-size:10px; }
.field-help-inline { color:#998b7d; font-size:9px; font-weight:400; letter-spacing:0; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media (max-width:760px) {
  .free-resource-toolbar { align-items:stretch; }
  .free-resource-search { max-width:none; flex-basis:100%; }
  .free-resource-toolbar-actions { justify-content:stretch; }
  .free-resource-toolbar-actions .btn { flex:1; }
  .free-resource-section-header { align-items:flex-start; flex-direction:column; }
  .free-resource-section-actions { width:100%; justify-content:flex-start; }
}
.resource-pinned-section { min-height:36px; display:flex; align-items:center; padding:8px 10px; border:1px solid #e3d5bf; background:#fff8e8; color:#58473d; font-size:11px; font-weight:700; }

/* v2.6 — Homepage form-card metadata and explicit workspace tabs */
.settings-tabs { display:flex; align-items:stretch; gap:4px; flex-wrap:wrap; margin:16px 0 18px; padding:5px; border:1px solid #dfd2b9; background:#fffaf0; }
.settings-tab { border:0; border-bottom:3px solid transparent; background:transparent; color:#675a51; padding:12px 20px 10px; min-height:43px; font-size:13px; font-weight:700; }
.settings-tab:hover { background:#fff3cf; color:var(--red); }
.settings-tab.active { background:#f8e8a8; color:var(--red-dark); border-bottom-color:var(--red); }
.settings-tab-panel { min-width:0; }
.settings-tab-panel .database-workspace { margin-top:0; }
.homepage-settings-note { border:1px solid #dfd2b9; background:#fffefa; padding:20px; }
.homepage-card-fields { display:flex; flex-wrap:wrap; gap:9px; margin:13px 0; }
.homepage-card-fields span { display:inline-flex; align-items:center; min-height:32px; padding:7px 11px; border:1px solid #e6d8b8; background:#fff8e7; color:#594b40; font-size:12px; font-weight:650; }
.form-homepage-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; margin:12px 0 2px; }
.form-homepage-fields > div { min-width:0; }
.inr-input-wrap { position:relative; display:flex; align-items:center; }
.inr-input-wrap > span { position:absolute; left:12px; z-index:1; color:#806e5e; font-size:14px; font-weight:750; }
.inr-input-wrap .field-control { padding-left:30px; }
.form-title-description { width:100%; min-height:94px; resize:vertical; line-height:1.5; }
.form-picture-drop { min-height:112px; margin-top:7px; }
.form-picture-drop small { color:#756960; font-size:11px; }
.form-picture-current { display:flex; align-items:center; gap:12px; margin:8px 0; padding:9px; border:1px solid #e2d6c4; background:#fffaf0; }
.form-picture-current img { width:76px; height:62px; object-fit:cover; border:1px solid #d8c8ae; background:#fff; }
.form-picture-current span { color:#786b62; font-size:11px; }
.form-title-cell { display:flex; align-items:center; gap:10px; min-width:0; }
.form-row-picture, .form-row-picture-placeholder { width:42px; height:36px; flex:none; object-fit:cover; border:1px solid #e2d6c4; background:#fffaf0; }
.form-row-picture-placeholder { display:grid; place-items:center; color:#a18d76; font:700 9px var(--mono); }
.form-title-cell > span { min-width:0; display:block; }
.form-title-cell b { display:block; color:#302724; font-size:12px; font-weight:700; }
.form-title-cell small { display:block; max-width:360px; margin-top:3px; color:#81766e; font-size:10px; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.forms-table-extended { min-width:920px; }
.forms-table-extended th { white-space:nowrap; }
.forms-table-extended td { vertical-align:middle; }
@media (max-width:760px) {
  .settings-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .settings-tab { padding:10px 8px; }
  .form-homepage-fields { grid-template-columns:1fr; }
}

/* BLOG upload mode: keep unused Form Manager inputs visible but greyed out with one slash. */
.blog-disabled-field {
  position: relative;
  opacity: .42;
  filter: grayscale(.18);
}
.blog-disabled-field::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 52%;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(103, 78, 69, .78);
  transform: rotate(-5deg);
  transform-origin: center;
  pointer-events: none;
}
.blog-disabled-field input,
.blog-disabled-field button,
.blog-disabled-field [role="button"] { cursor: not-allowed; }

/* HOME_PAGE content type choices: HTML and picture remain visible side by side. */
.homepage-type-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:8px; }
.homepage-type-option { position:relative; display:flex; align-items:center; gap:12px; min-height:76px; padding:12px 14px; border:1px solid #d8cbb7; background:#fffdf8; cursor:pointer; transition:border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.homepage-type-option input { position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
.homepage-type-option.is-selected { border-color:var(--red); background:#fff7ef; box-shadow:inset 0 0 0 1px var(--red); }
.homepage-type-option:focus-within { outline:2px solid var(--red); outline-offset:2px; }
.homepage-type-option-icon { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border:1px solid #e2d6c5; background:#f5ecdf; color:var(--red); font:700 15px var(--sans); }
.homepage-type-option-copy { display:flex; flex-direction:column; gap:4px; }
.homepage-type-option-copy b { color:#312821; font:700 12px var(--sans); }
.homepage-type-option-copy small { color:#817469; font:11px/1.4 var(--sans); }
@media (max-width:560px) { .homepage-type-options { grid-template-columns:1fr; } }

/* HOME_PAGE Form Manager mode: one HTML asset or one cropped 1600 × 500 banner. */
.homepage-crop-panel { margin-top: 15px; padding: 13px; border: 1px solid #dfd2b9; background: #fffaf0; }
.homepage-crop-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; color:#342a25; font-size:12px; }
.homepage-crop-heading span { color:#827469; font:11px var(--sans); }
.homepage-crop-viewport { position:relative; width:100%; aspect-ratio:16 / 5; min-height:0; overflow:hidden; border:1px solid #4a3b32; background:#302724; cursor:grab; touch-action:none; user-select:none; }
.homepage-crop-viewport.is-dragging { cursor:grabbing; }
.homepage-crop-viewport img { position:absolute; display:block; max-width:none; max-height:none; pointer-events:none; user-select:none; }
.homepage-crop-controls { display:grid; grid-template-columns:55px minmax(100px,1fr) auto; align-items:center; gap:12px; margin-top:12px; }
.homepage-crop-controls label { color:#65584f; font:700 10px var(--sans); letter-spacing:.08em; }
.homepage-crop-controls input[type="range"] { width:100%; accent-color:var(--red); }
.homepage-crop-panel .field-help { margin-top:9px; }
#homePageContentTypeField .field-help { margin-top:6px; }
@media (max-width:560px) {
  .homepage-crop-heading { align-items:flex-start; flex-direction:column; gap:4px; }
  .homepage-crop-controls { grid-template-columns:42px minmax(75px,1fr) auto; gap:8px; }
}
