.button {
  min-height: 32px;
  padding: 6px 12px;
  color: #233044;
  background: #f8fafc;
  border: 1px solid #aeb9c7;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(16,42,76,.04);
}
.button:hover { background: #edf2f7; border-color: #8d9aaa; }
.button-primary { color: white; background: var(--blue); border-color: #174fbd; font-weight: 600; }
.button-primary:hover { background: var(--blue-dark); }
.button-danger { color: white; background: #c5362a; border-color: #9c281f; }
.button-small { min-height: 27px; padding: 3px 8px; font-size: 12px; }
.button-large { min-height: 38px; padding: 8px 16px; }
.icon-button { min-width: 32px; min-height: 32px; background: transparent; border: 1px solid transparent; }
.panel, .filter-panel, .summary-card, .empty-state {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.panel-titlebar {
  display: flex;
  align-items: center;
  min-height: 35px;
  padding: 6px 10px;
  background: #edf2f7;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: #344054;
}
.panel-titlebar > :last-child { margin-left: auto; }
.panel-body { padding: 10px; }
.filter-panel { padding: 9px 10px; }
.filter-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field label { color: #475467; font-size: 11px; font-weight: 600; }
.field .required::after { content: " *"; color: var(--danger); }
.field-error { min-height: 13px; color: var(--danger); font-size: 10px; }
.span-2 { grid-column: span 2; }.span-3 { grid-column: span 3; }.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }.span-6 { grid-column: span 6; }.span-8 { grid-column: span 8; }.span-12 { grid-column: 1 / -1; }
.table-wrap { min-width: 0; max-width: 100%; overflow: auto; border: 1px solid var(--border); background: white; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 12px; }
.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 7px 8px;
  color: #344054;
  text-align: left;
  white-space: nowrap;
  background: #e9eef4;
  border-right: 1px solid #d3dae3;
  border-bottom: 1px solid #b9c3cf;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { background: #dde5ee; }
.data-table td { height: 31px; padding: 5px 8px; border-right: 1px solid #e5e9ef; border-bottom: 1px solid #e5e9ef; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #fafbfd; }
.data-table tbody tr:hover { background: #eaf2ff; }
.data-table tbody tr.is-selected { color: white; background: #1f5d99; }
.data-table .link-button { color: #1457a6; padding: 0; text-align: left; background: transparent; border: 0; text-decoration: underline; }
.data-table tr.is-selected .link-button { color: white; }
.table-footer { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 5px 8px; background: #f7f9fb; border: 1px solid var(--border); border-top: 0; color: var(--muted); font-size: 11px; }
.table-footer .footer-actions { margin-left: auto; display: flex; gap: 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.summary-card { padding: 10px 12px; min-height: 76px; }
.summary-label { color: var(--muted); font-size: 11px; }
.summary-value { margin-top: 4px; color: var(--navy); font-size: 24px; line-height: 1; font-weight: 700; }
.summary-detail { margin-top: 5px; color: var(--muted); font-size: 10px; }
.badge { display: inline-block; padding: 2px 7px; border: 1px solid #b8c3d1; border-radius: 9px; color: #344054; background: #eef2f6; white-space: nowrap; font-size: 10px; font-weight: 600; }
.badge-success { color: #116329; background: #e7f6ec; border-color: #9ed5ae; }
.badge-warning { color: #7a5200; background: #fff4d6; border-color: #e8cb78; }
.badge-danger { color: #922018; background: #fdecea; border-color: #e6aaa5; }
.badge-info { color: #134d96; background: #e7f0ff; border-color: #9cbbed; }
.tabs { display: flex; min-width: 0; max-width: 100%; gap: 2px; overflow-x: auto; overflow-y: hidden; padding: 7px 7px 0; background: #eef2f6; border: 1px solid var(--border); border-bottom: 0; }
.tab-button { padding: 7px 13px; color: #445164; background: #e2e8ef; border: 1px solid #c8d1dc; border-bottom: 0; border-radius: 3px 3px 0 0; }
.tab-button.is-active { position: relative; top: 1px; color: var(--navy); background: white; font-weight: 600; }
.tab-content { min-width: 0; min-height: 0; max-width: 100%; overflow: auto; padding: 13px; background: white; border: 1px solid var(--border); }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(5, 18, 35, .42); }
.modal-window { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(920px, 96vw); min-width: 0; min-height: 0; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); background: #f7f9fb; border: 1px solid #7d8b9e; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.modal-window.modal-large { width: min(1120px, 97vw); }
.modal-window.modal-small { width: min(520px, 94vw); }
.modal-titlebar { display: flex; align-items: center; min-height: 40px; padding: 8px 11px; color: white; background: var(--navy); font-weight: 600; }
.modal-close { margin-left: auto; color: white; background: transparent; border: 0; font-size: 20px; }
.modal-body { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px; }
.modal-body > * { min-width: 0; max-width: 100%; }
.modal-body .table-wrap { max-height: min(46vh, 380px); }
.modal-footer { display: flex; justify-content: flex-end; gap: 7px; padding: 9px 11px; background: #eef2f6; border-top: 1px solid #cbd4df; }
.toast-root { position: fixed; z-index: 200; right: 15px; bottom: 38px; display: grid; gap: 7px; width: min(360px, calc(100vw - 30px)); }
.toast { padding: 10px 12px; color: #fff; background: #344054; border-left: 5px solid #98a2b3; box-shadow: 0 5px 20px rgba(0,0,0,.18); }
.toast-success { background: #155f2d; border-color: #76c48b; }
.toast-error { background: #922018; border-color: #f5a8a2; }
.toast-warning { color: #342800; background: #f3d36a; border-color: #9a6700; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: #344054; }
.loading-overlay { position: fixed; z-index: 250; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: white; background: rgba(16,42,76,.48); }
.spinner { width: 31px; height: 31px; border: 4px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-gate { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; padding: 20px; background: #dfe6ee; }
.login-page { display: grid; place-items: center; min-height: 100vh; overflow: auto; padding: 20px; background: #dfe6ee; }
.login-window { display: grid; grid-template-columns: 290px minmax(340px, 470px); min-height: 410px; background: #fff; border: 1px solid #8391a3; box-shadow: 0 12px 36px rgba(16,42,76,.22); }
.login-banner { padding: 42px 28px; color: white; background: var(--navy); }
.login-mark { font-size: 38px; font-weight: 700; letter-spacing: 1px; }
.login-banner h1 { margin: 5px 0; font-size: 20px; }
.login-banner p { color: #cbd5e1; }
.login-banner-status { margin-top: 150px; color: #b9c7d8; font-size: 11px; }
.login-panel { padding: 38px; }
.login-panel h2 { color: var(--navy); font-size: 23px; }
.login-panel > p { color: var(--muted); font-size: 12px; }
.login-panel form { display: grid; gap: 7px; margin-top: 26px; }
.login-panel label { margin-top: 5px; font-size: 11px; font-weight: 600; }
.form-hint { color: var(--muted); font-size: 10px; }
.login-panel .button { margin-top: 14px; }
.alert { padding: 8px 10px; border: 1px solid #d1d8e2; border-left-width: 4px; background: white; }
.alert-info { border-left-color: var(--info); background: #f2f7ff; }
.alert-warning { border-left-color: var(--warning); background: #fff9e8; }
.split-pane { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .9fr); gap: 10px; min-height: 0; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
