:root {
  --bg: #eef3f8;
  --line: #cdd9e5;
  --ink: #17324d;
  --muted: #536b81;
  --navy: #0e467c;
  --primary: #0874d1;
  --primary-weak: #edf6ff;
  --radius: 5px;
  --sidebar: 226px;
  --top-height: 45px;
}
[hidden] { display: none !important; }
body { font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid #4ea1ef;
  outline-offset: 2px;
}
.topbar { height: var(--top-height); padding: 0 11px; gap: 8px; color: white; background: var(--navy); border: 0; box-shadow: 0 1px 3px #102c4e30; z-index: 24; }
.topbar .grow { min-width: 0; }
.top-brand, .top-icon, .top-nav button { background: transparent; color: inherit; border: 0; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.top-icon { min-width: 31px; height: 32px; padding: 5px; justify-content: center; border-radius: 4px; font-size: 17px; }
.top-icon:hover, .top-brand:hover, .top-nav button:hover { background: #ffffff18; }
.top-brand { padding: 4px 6px; height: 34px; border-right: 1px solid #ffffff25; border-radius: 3px 0 0 3px; white-space: nowrap; }
.top-brand span { background: white; border-radius: 3px; font-size: 11px; font-weight: 800; color: var(--navy); padding: 2px 4px; }
.top-nav { display: flex; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #467da9 transparent; min-width: 0; height: 100%; }
.top-nav button { padding: 0 10px; white-space: nowrap; font-size: 12px; font-weight: 650; height: 100%; }
.top-nav button.active { box-shadow: inset 0 -3px #8bceff; background: #ffffff16; }
.top-nav .icon, .top-icon .icon { width: 14px; height: 14px; }
.demo-label { color: #d8eaff; font-size: 10px; letter-spacing: .06em; flex: none; }
.role-select { flex: none; max-width: 165px; height: 29px; padding: 3px 6px; border-color: #75a0c5; border-radius: 4px; background: #245d91; color: white; font-size: 12px; }
.sidebar { top: var(--top-height); transform: translateX(-100%); transition: transform .18s ease; z-index: 23; }
.sidebar.open { transform: translateX(0); box-shadow: 8px 9px 22px #17324d20; }
.sidebar .nav { padding: 7px 9px; border-radius: 4px; }
.sidebar .brand { height: 54px; }
.sidebar-body { padding: 7px; }
.section-label { color: #576f84; }
.main { max-width: none; padding: 9px 12px 30px; }
.page-head { margin: 0 0 8px; padding: 7px 10px; align-items: center; background: #edf6ff; border: 1px solid #cbdff2; border-radius: 4px; gap: 8px; }
.page-head h1 { font-size: 18px; color: #194f7f; letter-spacing: 0; line-height: 1.2; margin-bottom: 2px; }
.page-head p { font-size: 12px; }
.page-head .buttons { gap: 5px; }
.searchbar { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 0 6px; }
.global-search { min-width: min(200px, 60vw); width: min(320px, 70vw); max-width: none; height: 30px; padding: 4px 8px; background: #fff; border-radius: 4px; }
.btn { min-height: 29px; padding: 4px 9px; border-radius: 4px; font-size: 12px; gap: 5px; }
.btn.sm { min-height: 26px; padding: 3px 7px; font-size: 12px; }
.btn .icon { width: 14px; height: 14px; }
.btn.icon-btn { padding: 3px 5px; min-width: 26px; }
.btn.text { color: #0f62a6; }
.btn.text.danger { color: var(--red); }
.stats { gap: 7px; margin-bottom: 8px; }
.stat { padding: 7px 11px; min-height: 67px; }
.stat .value { font-size: 22px; }
.stat .name { color: var(--ink); }
.stat .foot { margin-top: 1px; }
.columns { grid-template-columns: minmax(0, 2fr) minmax(245px, 1fr); gap: 8px; }
.panel { min-width: 0; }
.panel-title { padding: 7px 10px; min-height: 35px; color: #175589; background: #f8fbfe; gap: 6px; }
.panel-title strong { font-size: 13px; }
.panel-inner, .panel.pad { padding: 9px 10px; }
.toolbar { padding: 6px 9px; }
.toolbar .left, .toolbar .buttons { gap: 6px; }
.data-table th, .data-table td { padding: 5px 8px; border-right: 1px solid #e4edf5; }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table th { background: #f2f6fa; color: #345573; font-size: 11px; letter-spacing: 0; }
.data-table td { line-height: 1.28; min-height: 28px; }
.data-table tbody tr:nth-child(even) { background: #f8fbfd; }
.data-table tbody tr:hover { background: #eaf5ff; }
.table-scroll { overflow-x: auto; }
.field, .select, .textarea { border-color: #bbccdd; border-radius: 4px; padding: 5px 7px; }
.select, .field { min-height: 29px; }
.notice { padding: 6px 8px; border-radius: 4px; }
.catalog-grid { min-height: 320px; gap: 7px; }
.catalog-head, .catalog-item { padding: 7px 9px; }
.catalog-item.selected { padding-left: 6px; }
.catalog-column, .guide-list, .guide-body { border-radius: 5px; }
.mini-list li { padding: 6px 0; align-items: center; }
.empty { padding: 20px 10px; }
.drawer-head, .drawer-body { padding: 10px 14px; }
.drawer-footer { padding: 8px 12px; flex-wrap: wrap; }
.modal { border-radius: 6px; border: 1px solid #a0b4c6; }
.modal-head { padding: 8px 10px; background: #f6f9fc; align-items: center; }
.modal-content { padding: 12px; }
.modal-footer { padding: 7px 10px; }
.form-group { margin-bottom: 8px; }
.form-group label { font-size: 12px; margin-bottom: 3px; }
.checkline { padding: 6px 8px; border-radius: 4px; }
.cal-day { min-height: 75px; padding: 5px 6px; }
.calendar-head > div { padding: 6px; }
.guide-step { padding: 8px 9px; }
.guide-body { padding: 13px; }
.toast { max-width: min(500px, 88vw); }

.login-screen { display: grid; place-content: center; min-height: 100svh; padding: 24px 14px; background: linear-gradient(165deg, #dceefe, #f3f7fc 53%, #edf3fa); }
.login-panel { width: min(430px, calc(100vw - 28px)); border: 1px solid #b6cadf; border-radius: 7px; background: white; box-shadow: 0 14px 45px #16416b23; overflow: hidden; }
.login-brand { display: flex; align-items: center; gap: 10px; padding: 12px 17px; color: white; background: var(--navy); }
.login-brand .brand-mark { background: #fff; color: var(--navy); border-radius: 5px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 15px; }
.login-brand small { color: #d9eaff; }
.login-body { padding: 18px; }
.login-body label { display: block; font-weight: 650; margin: 9px 0 4px; }
.login-body .field { min-height: 35px; }
.password-field { display: flex; position: relative; }
.password-field .field { padding-right: 70px; }
.password-field .btn { position: absolute; top: 4px; right: 4px; }
.login-submit { margin-top: 12px; width: 100%; min-height: 35px; }
.login-error { margin: 8px 0 0; color: #9d2633; }
.demo-access { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.demo-access .row { flex-wrap: wrap; }
.demo-access code { color: #164f81; background: #edf6ff; padding: 2px 4px; border-radius: 3px; }
.demo-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.demo-accounts button { justify-content: flex-start; }
.login-note { color: var(--muted); margin: 8px 0 0; text-align: center; font-size: 12px; }

.desk-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.desk-action { background: transparent; border: 0; color: #1162a7; min-width: 27px; min-height: 26px; border-radius: 4px; }
.desk-action:hover { color: #084e88; background: #e3f1ff; }
.desk-action.danger { color: #a6343d; }
.desk-action .icon { width: 14px; height: 14px; }
.table-actions { white-space: nowrap; width: 1%; text-align: center; }
.sort-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; text-align: left; white-space: nowrap; }
.pager { padding: 6px 9px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pager .row { gap: 4px; }
.day-chip { display: inline-block; padding: 2px 7px; border-radius: 3px; color: #9a3b31; background: #fce6e2; font-weight: 700; }
.client-grid, .editor-grid { display: grid; grid-template-columns: minmax(290px, 35%) minmax(0, 1fr); gap: 8px; align-items: start; }
.editor-grid { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); }
.ruc-title { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; color: white; background: #0d64ad; font-weight: 700; }
.ruc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.ruc-grid > div { padding: 7px 8px; min-height: 48px; border-bottom: 1px solid #e1e8ef; border-right: 1px solid #e1e8ef; overflow-wrap: anywhere; }
.ruc-grid dt { color: var(--muted); font-size: 11px; }
.ruc-grid dd { margin: 2px 0 0; font-weight: 650; }
.desk-tabs { display: flex; gap: 2px; overflow-x: auto; background: #f1f6fb; border-bottom: 1px solid var(--line); padding: 3px 5px 0; }
.desk-tabs button { padding: 5px 9px; white-space: nowrap; color: #365b79; border: 1px solid transparent; border-bottom: 2px solid transparent; background: transparent; font-size: 12px; font-weight: 650; }
.desk-tabs button[aria-current="true"] { background: white; color: #0e61ac; border-color: #cbdcee; border-bottom-color: #0e73c6; border-radius: 3px 3px 0 0; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 9px; padding: 9px; }
.fields-grid > label { display: grid; align-content: start; gap: 3px; font-size: 12px; font-weight: 600; }
.fields-grid .span-all { grid-column: 1 / -1; }
.fields-grid input, .fields-grid select, .fields-grid textarea { min-width: 0; font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 0; }
.inline-filter { display: inline-flex; gap: 5px; align-items: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.quick-actions .btn { justify-content: flex-start; padding: 7px; }
.workspace-stack { display: grid; gap: 8px; }
.kv-inline { display: grid; gap: 4px; }
.studio-table td { vertical-align: middle; }
.studio-table .field { min-width: 120px; }
.studio-table label { white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.formula-summary { margin: 0; padding: 8px; }
.formula-summary > div { display: flex; gap: 10px; justify-content: space-between; padding: 6px; border-bottom: 1px solid var(--line); }
.formula-summary dd { font-weight: 650; margin: 0; white-space: nowrap; }
.formula-summary > div:last-child { border: 0; color: #0f5d9d; font-weight: 700; }
@media (max-width: 1050px) {
  .top-brand b { display: none; }
  .top-nav button { padding: 0 7px; }
}
@media (max-width: 760px) {
  .main { padding: 7px 8px 20px; }
  .topbar { padding: 0 5px; gap: 4px; }
  .top-nav button { padding: 0 6px; }
  .top-nav button span { display: none; }
  .top-nav button.active span { display: inline; }
  .demo-label { display: none; }
  .role-select { max-width: 112px; }
  .global-search { display: inline-block; }
  .columns, .client-grid, .editor-grid { grid-template-columns: 1fr; }
  .page-head { flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-day { min-height: 48px; }
}
@media (max-width: 440px) {
  .top-brand { display: none; }
  .fields-grid { grid-template-columns: 1fr; }
  .demo-accounts { grid-template-columns: 1fr; }
}
