*,
*::before,
*::after { box-sizing: border-box; }
body { margin: 0; background: #f8f8f8; color: #111827; font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { align-items: center; background: #d12027; border: 0; border-radius: 4px; color: #fff; cursor: pointer; display: inline-flex; font-weight: 600; gap: 8px; justify-content: center; padding: 10px 14px; transition: background-color .2s, box-shadow .2s; }
button:hover { background: #b71c1c; }
button:focus-visible, input:focus, select:focus, textarea:focus { outline: none; border-color: #d12027; box-shadow: 0 0 0 3px rgba(209, 32, 39, .12); }
button.ghost { background: #fff; color: #1f2937; border: 1px solid #d1d5db; }
button.ghost:hover { background: #f8fafc; }
button svg { fill: currentColor; height: 20px; width: 20px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea { border: 1px solid #d1d5db; border-radius: 4px; padding: 10px 12px; background: #fff; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.login-header { background: #fff; box-shadow: 0 0 30px rgba(0,0,0,.15); padding: 16px 0; }
.login-header img { width: 160px; height: auto; }
.login-wrap { display: grid; place-items: start center; padding-top: 60px; min-height: 70vh; }
.login-card { width: min(480px, calc(100vw - 32px)); background: #fff; border-top: 4px solid #d12027; box-shadow: 0 0 16px rgba(0,0,0,.15); padding: 32px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.login-card p { color: #4b5563; margin-bottom: 24px; }
.login-card form { display: grid; gap: 20px; }
.login-card button { width: 100%; margin-top: 8px; }
.alert { background: rgba(209, 32, 39, .1); color: #d12027; border: 1px solid #d12027; border-radius: 4px; padding: 12px; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 64px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid #e5e7eb; color: #111827; grid-column: 1; grid-row: 2; }
.sidebar h1 { align-items: center; display: flex; font-size: 20px; font-weight: 500; height: 64px; margin: 0; padding: 0 20px; }
.sidebar nav { display: grid; }
.sidebar a { align-items: center; color: #111827; display: flex; gap: 28px; min-height: 48px; padding: 8px 16px; text-decoration: none; }
.sidebar a svg { fill: rgba(0,0,0,.54); flex: 0 0 24px; height: 24px; width: 24px; }
.sidebar a.active, .sidebar a:hover { background: rgba(209, 32, 39, .08); color: #d12027; text-decoration: none; }
.sidebar a.active svg, .sidebar a:hover svg { fill: #d12027; }
.panel { grid-column: 2; grid-row: 2; min-width: 0; }
.topbar { align-items: center; background: #d12027; box-shadow: 0 2px 4px rgba(0,0,0,.2); color: #fff; display: flex; grid-column: 1 / -1; grid-row: 1; height: 64px; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar h2 { margin: 0; font-size: 20px; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.top-actions .session-status { display: none; }
.mobile-menu-toggle { background: transparent; border-radius: 50%; display: none; flex: 0 0 44px; height: 44px; padding: 10px; width: 44px; }
.mobile-menu-toggle:hover { background: rgba(255,255,255,.12); }
.session-status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.session-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.session-status time { opacity: .8; }
.icon-only { background: transparent; border-radius: 50%; height: 44px; padding: 10px; width: 44px; }
.icon-only:hover { background: rgba(255,255,255,.12); }
.panel-body { padding: 24px; }
.page-title { font-size: 24px; font-weight: 400; line-height: 1.2; margin: 0 0 24px; }
.toolbar { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.split { display: grid; grid-template-columns: minmax(320px, .85fr) 1.15fr; gap: 24px; }
.modal { width: min(900px, calc(100vw - 40px)); border: 0; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.small-modal { width: min(460px, calc(100vw - 40px)); }
.modal::backdrop { background: rgba(0,0,0,.35); }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-editor { border: 1px solid #e5e7eb; padding: 12px; margin-top: 14px; }
.inline-editor legend { font-weight: 700; padding: 0 6px; }
.link-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.chips li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f3f4f6; padding: 8px 10px; }
.mini-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; }
.card { background: #fff; border-top: 4px solid #d12027; box-shadow: 0 0 16px rgba(0,0,0,.12); padding: 24px; display: grid; gap: 16px; max-width: 760px; }
.preview { border: 1px solid #e5e7eb; padding: 16px; max-height: 420px; overflow: auto; background: #fff; }
.media-result { display: grid; gap: 12px; }
.media-result img { max-width: 320px; max-height: 220px; border: 1px solid #e5e7eb; object-fit: contain; background: #fff; }
.tabulator { border: 1px solid #e5e7eb; background: #fff; }
.tabulator .tabulator-header { background: #fff; border-bottom: 1px solid #e5e7eb; color: #111827; }
.table-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.table-actions button { min-height: 32px; padding: 6px 9px; }
.table-actions button svg { height: 18px; width: 18px; }
.mui-page { min-width: 0; }
.page-header, .page-toolbar, .mui-toolbar { align-items: center; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-weight: 400; line-height: 1.2; margin: 0; }
.menu-page .page-header h1, .mui-page:not(.pages-page) .page-header h1 { font-size: 24px; }
.pages-page .page-header h1 { font-size: 34px; }
.toolbar-actions { align-items: flex-end; display: flex; gap: 16px; margin-left: auto; }
.title-cluster { align-items: center; display: flex; gap: 16px; min-width: 0; }
.db-badge { background: #f0fdf4; border: 1px solid #86efac; border-radius: 4px; color: #059669; font-size: 12px; padding: 4px 10px; }
.mui-contained { background: #d12027; border-radius: 4px; box-shadow: 0 3px 5px rgba(0,0,0,.2); min-height: 44px; padding: 8px 16px; text-transform: uppercase; }
.mui-contained.small { min-height: 56px; padding: 8px 16px; }
.mui-text { background: transparent; box-shadow: none; color: #d12027; padding: 8px 12px; text-transform: uppercase; }
.mui-text:hover { background: rgba(209,32,39,.08); }
.mui-text.danger { color: #991b1b; margin-right: auto; }
.mui-text.danger:hover { background: rgba(153,27,27,.08); }
.mui-select, .mui-field { color: #111827; display: grid; font-size: 14px; font-weight: 400; gap: 4px; position: relative; }
.mui-select > span, .mui-field > span { background: #fff; color: #6b7280; font-size: 12px; left: 12px; line-height: 1; padding: 0 4px; position: relative; top: 8px; width: max-content; z-index: 1; }
.mui-select.compact > span { background: #f8f8f8; }
.mui-select select, .mui-field input, .mui-field textarea { min-height: 56px; width: 100%; }
.mui-select.compact select { min-height: 44px; min-width: 88px; }
.toolbar-actions .mui-contained { height: 44px; }
.mui-field small { color: #777; font-size: 12px; font-weight: 400; padding-left: 14px; }
.mui-grid-table .tabulator-row { cursor: pointer; }
.mui-grid-table.tabulator { border-color: #ddd; border-radius: 4px; box-shadow: none; }
.mui-grid-table.tabulator .tabulator-header { background: #fff; border-bottom: 1px solid #e0e0e0; }
.mui-grid-table.tabulator .tabulator-header .tabulator-col { background: #fff; border-right: 1px solid #eee; }
.mui-grid-table .tabulator-col-title { font-weight: 700; }
.mui-grid-table .tabulator-row:hover,
.mui-grid-table .tabulator-row.tabulator-selected { background: rgba(209,32,39,.08); }
.mui-grid-table.tabulator .tabulator-footer { background: #fff; border-top: 1px solid #e0e0e0; padding: 8px 12px; }
.mui-grid-table.tabulator .tabulator-footer .tabulator-footer-contents { align-items: center; display: flex; gap: 16px; width: 100% !important; }
.mui-grid-table.tabulator .tabulator-page-counter { color: #111827; flex: 1 1 auto; font-size: 14px; }
.mui-grid-table .tabulator-paginator { align-items: center; display: inline-flex; gap: 4px; }
.mui-grid-table .tabulator-page { background: #fff; border: 1px solid #d1d5db; box-shadow: none; color: #111827; font-size: 14px; font-weight: 400; min-height: 28px; min-width: 34px; padding: 4px 8px; text-transform: none; }
.mui-grid-table .tabulator-page:hover:not(:disabled) { background: rgba(0,0,0,.04); }
.mui-grid-table .tabulator-page:disabled { background: #f5f5f5; color: #bdbdbd; opacity: 1; }
.mui-grid-table .tabulator-page.active { border-color: #d12027; color: #d12027; }
.status-pill { color: #166534; display: inline-flex; gap: 6px; align-items: center; }
.status-pill::before { content: "\2713"; background: #7bd88f; color: #fff; display: inline-grid; height: 14px; place-items: center; width: 14px; }
.status-pill.draft { color: #6b7280; }
.status-pill.draft::before { background: #d1d5db; }
.menu-grid { display: grid; gap: 24px; grid-template-columns: 360px 1fr; }
.menu-grid h2, .children-panel h2 { font-size: 16px; font-weight: 400; margin: 6px 0 12px; }
.mui-paper { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.22); }
.menu-card { padding: 8px; }
.menu-row { align-items: center; cursor: pointer; display: grid; grid-template-columns: 36px 1fr auto; min-height: 60px; padding: 0 8px; }
.menu-row:hover { background: rgba(0,0,0,.04); }
.menu-row.selected { background: rgba(209,32,39,.08); }
.drag-handle, .icon-button { background: transparent; border-radius: 50%; box-shadow: none; color: rgba(0,0,0,.54); height: 36px; padding: 8px; width: 36px; }
.drag-handle:hover, .icon-button:hover { background: rgba(0,0,0,.06); color: rgba(0,0,0,.72); }
.drag-handle svg, .icon-button svg { fill: currentColor; height: 20px; width: 20px; }
.menu-row-text { display: grid; line-height: 1.3; }
.menu-row-text strong { font-size: 14px; font-weight: 400; }
.menu-row-text small { color: #6b7280; font-size: 12px; }
.row-icons { display: inline-flex; gap: 4px; }
.mui-divider { border-top: 1px solid #e0e0e0; margin-bottom: 16px; }
.empty-box { border: 1px dashed #ccc; color: #6b7280; padding: 16px; }
.mui-dialog { border: 0; border-radius: 4px; box-shadow: 0 24px 60px rgba(0,0,0,.32); padding: 0; width: min(900px, calc(100vw - 32px)); }
.mui-dialog::backdrop { background: rgba(0,0,0,.32); }
.mui-dialog form { margin: 0; }
.mui-dialog h3 { font-size: 20px; font-weight: 600; margin: 0; padding: 24px 24px 12px; }
.mui-dialog .dialog-content { display: grid; gap: 16px; max-height: calc(100vh - 150px); overflow: auto; padding: 12px 24px 24px; }
.mui-dialog .dialog-content.compact { gap: 0; padding: 12px 24px 24px; }
.mui-dialog menu { border-top: 1px solid #eee; display: flex; gap: 8px; justify-content: flex-end; margin: 0; padding: 12px 10px; }
.page-dialog { max-height: calc(100vh - 16px); }
.small-modal { width: min(480px, calc(100vw - 32px)); }
.dialog-two { align-items: start; display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.quill-like h4, .page-dialog section h4 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.quill-toolbar { align-items: center; border: 1px solid #ccc; border-bottom: 0; display: flex; gap: 4px; min-height: 42px; padding: 6px 8px; }
.quill-toolbar select { border: 0; min-height: 30px; padding: 0 8px; }
.quill-toolbar button { background: transparent; box-shadow: none; color: #444; min-height: 30px; padding: 4px 8px; }
.quill-toolbar button:hover { background: rgba(0,0,0,.06); }
.quill-toolbar svg { height: 18px; width: 18px; }
.wysiwyg-editor { background: #fff; border: 1px solid #ccc; border-radius: 0; min-height: 300px; outline: none; overflow: auto; padding: 12px 16px; width: 100%; }
.wysiwyg-editor:focus { border-color: #d12027; box-shadow: 0 0 0 3px rgba(209, 32, 39, .12); }
.wysiwyg-editor p { margin: 0 0 12px; }
.wysiwyg-editor h1, .wysiwyg-editor h2, .wysiwyg-editor h3, .wysiwyg-editor h4 { line-height: 1.25; margin: 0 0 12px; }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 12px; padding-left: 24px; }
.upload-drop { align-items: center; border: 2px dashed #d1d5db; border-radius: 4px; cursor: pointer; display: grid; gap: 8px; justify-items: center; padding: 28px; text-align: center; }
.upload-drop:hover { background: #f8fafc; border-color: #d12027; }
.upload-drop input { display: none; }
.upload-drop svg { fill: #d12027; height: 48px; width: 48px; }
.upload-drop small { color: #6b7280; font-weight: 400; }
.link-editor { align-items: end; display: grid; gap: 10px; grid-template-columns: 1fr 1fr auto; }
.link-editor .mui-contained { height: 56px; }
.link-list { list-style: none; margin: 12px 0 0; padding: 0; }
.link-list li { align-items: center; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; padding: 8px 0; }
.link-list span { display: grid; }
.link-list small { color: #6b7280; font-size: 12px; }
.page-intro { color: #6b7280; margin: -8px 0 24px; }
.pdf-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.paper-section { display: grid; gap: 16px; padding: 24px; }
.paper-section h2 { font-size: 20px; font-weight: 500; margin: 0; }
.paper-section h3 { font-size: 14px; font-weight: 700; margin: 0; }
.homepage-editor { display: grid; gap: 24px; max-width: 980px; }
.editor-heading { align-items: center; display: flex; gap: 16px; justify-content: space-between; }
.upload-line { align-items: center; display: flex; gap: 16px; font-weight: 400; }
.upload-line input { display: none; }
.mui-outlined-button { align-items: center; background: #fff; border: 1px solid #d12027; border-radius: 4px; color: #d12027; display: inline-flex; font-weight: 600; gap: 8px; min-height: 36px; padding: 8px 14px; text-decoration: none; text-transform: uppercase; }
.mui-outlined-button:hover { background: rgba(209,32,39,.08); text-decoration: none; }
.mui-outlined-button svg { fill: currentColor; height: 20px; width: 20px; }
.date-field { max-width: 240px; }
.button-row { align-items: center; display: flex; gap: 12px; }
.linear-progress { animation: progress 1.1s infinite linear; background: linear-gradient(90deg, rgba(209,32,39,.15), #d12027, rgba(209,32,39,.15)); height: 4px; overflow: hidden; }
.info-alert { background: #e8f4fd; border-radius: 4px; color: #0f4c81; padding: 12px; }
.info-panel { background: #f6f6f6; align-content: start; }
.info-panel ul { margin: 0; padding-left: 20px; }
.muted { color: #6b7280; margin: 0; }
.result-section { margin-top: 24px; }
.result-section textarea { background: #fafafa; min-height: 260px; width: 100%; }
.media-panel { max-width: 760px; }
@keyframes progress { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; grid-template-rows: 64px 1fr; }
  .topbar, .panel { grid-column: 1; }
  .topbar { justify-content: flex-start; gap: 12px; }
  .top-actions { margin-left: auto; }
  .mobile-menu-toggle { display: inline-flex; }
  .sidebar { border-right: 1px solid #e5e7eb; box-shadow: 0 12px 30px rgba(0,0,0,.18); bottom: 0; grid-row: auto; left: -260px; position: fixed; top: 64px; transition: left .2s ease; width: 240px; z-index: 30; }
  .sidebar.open { left: 0; }
  .panel { grid-row: 2; }
  .split, .grid-form, .menu-grid, .dialog-two, .link-editor, .pdf-grid { grid-template-columns: 1fr; }
  .page-header, .page-toolbar, .toolbar-actions { align-items: stretch; flex-direction: column; }
}
