:root {
    color-scheme: light;
    --ink: #202a3b;
    --muted: #778196;
    --line: #e8ebf1;
    --paper: #f6f7fb;
    --purple: #6848c7;
    --purple-light: #f0edfb;
    --white: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
code { color: #6245b8; background: #f1eefb; border-radius: 5px; padding: 2px 6px; font-size: .88em; }
:focus-visible { outline: 3px solid #927bdd88; outline-offset: 2px; }
.skip-link { position: fixed; z-index: 10; top: -60px; left: 14px; padding: 10px 14px; border-radius: 7px; color: #fff; background: var(--purple); font-weight: 700; }
.skip-link:focus { top: 12px; }

.topbar { height: 68px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 2; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user { color: #7b8495; font-size: 11px; font-weight: 600; padding: 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 800 17px "Segoe UI", Arial, sans-serif; letter-spacing: -.4px; }
.brand-light { color: var(--muted); font-weight: 500; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #765bd4, #4f36a9); display: inline-grid; place-items: center; color: white; font: 800 18px "Segoe UI", Arial, sans-serif; box-shadow: 0 5px 12px #6848c733; flex: 0 0 auto; }
.logout-form { margin: 0; }
.shell { min-height: calc(100vh - 68px); display: flex; }
.sidebar { width: 238px; padding: 30px 16px; background: #fff; border-right: 1px solid var(--line); flex: 0 0 auto; }
.side-label { color: #9aa2b1; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; margin: 5px 11px 12px; }
.side-label:not(:first-child) { margin-top: 33px; }
.side-link { color: #667187; display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 3px 0; border-radius: 8px; font-size: 13px; font-weight: 500; transition: .15s ease; }
.side-link:hover, .side-link:focus-visible { color: var(--purple); background: var(--purple-light); outline: none; }
.side-link.active { color: var(--purple); background: var(--purple-light); }
.main { width: min(100% - 238px, 1440px); padding: 38px clamp(22px, 4vw, 58px) 60px; margin: 0 auto; }
.eyebrow { color: var(--purple); font-weight: 700; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; margin-bottom: 8px; }
h1, h2, p { margin-top: 0; }
h1 { font: 800 29px/1.2 "Segoe UI", Arial, sans-serif; letter-spacing: -.8px; margin-bottom: 8px; }
h2 { font: 700 17px "Segoe UI", Arial, sans-serif; letter-spacing: -.35px; margin-bottom: 5px; }
.muted { color: var(--muted); margin-bottom: 0; line-height: 1.55; }
.welcome-banner { min-height: 176px; background: linear-gradient(112deg, #463285, #6449b4 67%, #7760c6); border-radius: 14px; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 30px 38px; overflow: hidden; position: relative; }
.welcome-banner .eyebrow { color: #d7cafa; }
.welcome-banner h1 { font-size: 27px; margin-bottom: 10px; }
.welcome-banner p { color: #e7e0fa; margin: 0; }
.welcome-mark { height: 210px; width: 210px; position: absolute; right: 55px; top: -17px; border-radius: 50%; border: 1px solid #ffffff24; color: #ffffff13; font: 800 142px "Segoe UI", Arial, sans-serif; display: grid; place-items: center; transform: rotate(-12deg); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; }
.section-heading p { font-size: 12px; }
.text-link { color: var(--purple); font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-link span { font-size: 15px; margin-left: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 170px; background: var(--white); border: 1px solid var(--line); border-radius: 11px; padding: 17px; display: flex; flex-direction: column; box-shadow: 0 2px 8px #2c36500a; transition: .17s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: #c9bdef; box-shadow: 0 8px 20px #392b7114; }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--purple); background: var(--purple-light); font-size: 17px; margin-bottom: 13px; }
.stat-label { color: #697489; font-size: 11px; font-weight: 600; }
.stat-card strong { font: 800 25px "Segoe UI", Arial, sans-serif; letter-spacing: -.7px; margin-top: 3px; }
.stat-hint { color: #a0a7b4; font-size: 10px; margin-top: auto; padding-top: 10px; }
.info-strip { display: flex; align-items: center; gap: 13px; background: #f0faf6; border: 1px solid #dbeee5; border-radius: 10px; margin-top: 23px; padding: 15px 18px; }
.info-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #d9f0e5; color: #21805a; font-weight: 700; }
.info-strip strong { font-size: 12px; }
.info-strip p { color: #688174; font-size: 11px; margin: 3px 0 0; }
.version-tag { margin-left: auto; color: #39765c; background: #dff3e8; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.models-heading { margin-top: 33px; }
.button { min-height: 37px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12px; font-weight: 700; transition: .15s ease; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-primary { background: var(--purple); color: #fff; }
.button-primary:hover:not(:disabled) { background: #5539ae; }
.button-secondary { background: #fff; border-color: var(--line); color: #687387; }
.button-secondary:hover:not(:disabled), .button-quiet:hover:not(:disabled) { border-color: #c7b8ee; color: var(--purple); }
.button-quiet { background: #fff; border-color: var(--line); color: #6f7889; min-height: 34px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.breadcrumbs { display: flex; gap: 9px; align-items: center; color: #a0a7b4; font-size: 11px; margin-bottom: 20px; }
.breadcrumbs a:hover { color: var(--purple); }
.search-form { display: flex; gap: 9px; margin-bottom: 16px; }
.search-form input, .login-form input { min-width: 0; border: 1px solid #e1e5ec; border-radius: 7px; background: #fff; color: var(--ink); outline: none; }
.search-form input { max-width: 440px; width: 100%; height: 39px; padding: 0 13px; }
.search-form input:focus, .login-form input:focus { border-color: #927bdd; box-shadow: 0 0 0 3px #6848c71c; }
.list-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.list-controls > .search-form { flex: 1; }
.column-picker { position: relative; z-index: 1; flex: 0 0 auto; }
.column-picker > summary { list-style: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-count { min-width: 19px; height: 19px; display: inline-grid; place-items: center; border-radius: 10px; padding: 0 5px; background: var(--purple-light); color: var(--purple); font-size: 10px; }
.column-picker-form { position: absolute; top: calc(100% + 7px); right: 0; width: min(390px, calc(100vw - 32px)); padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 36px #25304a24; }
.column-picker-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.column-picker-heading strong { font-size: 13px; }
.column-picker-heading span, .column-limit { color: #858fa0; font-size: 10px; }
.column-search-label { display: block; color: #6c778a; font-size: 10px; font-weight: 600; margin-bottom: 5px; }
.column-filter { width: 100%; height: 34px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; }
.column-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 7px; max-height: 240px; overflow: auto; padding: 3px; border: 1px solid #eff1f5; border-radius: 6px; }
.column-option { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 6px 5px; border-radius: 4px; color: #586477; font-size: 10px; cursor: pointer; }
.column-option:hover { background: #f7f5fc; }
.column-option[hidden] { display: none; }
.column-option input { flex: 0 0 auto; accent-color: var(--purple); }
.column-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-option small { color: #929aaa; font-size: 9px; }
.column-limit { margin: 8px 0; }
.column-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.column-picker-actions form { margin: 0; }
.column-picker-actions .button { padding: 0 9px; font-size: 10px; }
.keyboard-hint { display: flex; align-items: center; gap: 4px; }
kbd { min-width: 19px; padding: 3px 5px; border: 1px solid #e0e3ea; border-bottom-width: 2px; border-radius: 4px; background: #fff; color: #647086; text-align: center; font: 600 10px "Segoe UI", Arial, sans-serif; }
.table-card, .detail-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px #2c365008; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
table.resizable-table.widths-applied { table-layout: fixed; }
th { position: relative; background: #fafbfc; padding: 12px 14px; border-bottom: 1px solid var(--line); color: #8b94a4; font-size: 10px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.column-resize-handle { position: absolute; z-index: 1; top: 0; right: -4px; width: 9px; height: 100%; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.column-resize-handle::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 2px; border-radius: 2px; background: transparent; }
.column-resize-handle:hover::after, .column-resize-handle:focus-visible::after { background: #927bdd; }
body.resizing-columns, body.resizing-columns * { cursor: col-resize !important; user-select: none !important; }
.sort-link { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.sort-link:hover, .sort-link.sorted { color: var(--purple); }
.sort-link span { min-width: 8px; color: var(--purple); }
td { padding: 12px 14px; border-bottom: 1px solid #eff1f5; color: #586477; font-size: 11px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.id-chip { display: inline-block; background: #f1eefb; color: var(--purple); border-radius: 5px; padding: 4px 7px; font-weight: 700; }
.id-chip:hover { background: #e6e0f8; text-decoration: underline; }
.empty-cell { text-align: center; padding: 45px 15px; color: var(--muted); }
.table-toolbar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 11px; color: #8a93a3; font-size: 11px; }
.page-size-form { display: flex; align-items: center; gap: 8px; }
.page-size-form select { height: 31px; padding: 0 25px 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #586477; font-size: 11px; }
.table-footer { min-height: 57px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; color: #929aaa; font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination .button { min-height: 31px; padding: 0 10px; font-size: 10px; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.model-card { min-width: 0; display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 14px; transition: .15s ease; }
.model-card:hover { border-color: #c9bdef; box-shadow: 0 5px 15px #392b710f; }
.model-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: var(--purple-light); color: var(--purple); font-size: 17px; }
.model-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.model-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.model-card-copy small { color: #9aa2b1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.arrow { margin-left: auto; color: #a6adba; }
.catalog-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 18px; color: #929aaa; font-size: 11px; }
.catalog-footer .pagination { justify-content: flex-end; }
.empty-state { grid-column: 1 / -1; background: #fff; border: 1px dashed #dce0e9; border-radius: 10px; padding: 42px 20px; text-align: center; color: #788296; }
.empty-state-icon { display: block; color: #a393d4; font-size: 30px; margin-bottom: 8px; }
.empty-state strong { display: block; color: #354054; font-size: 13px; }
.empty-state p { margin: 6px 0 0; font-size: 11px; }
.detail-card { padding: 0 22px; }
.detail-header { min-height: 59px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-header h2 { font-size: 13px; margin: 0; }
.record-id { color: var(--purple); background: var(--purple-light); border-radius: 5px; padding: 5px 8px; font-weight: 700; font-size: 10px; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(160px, 25%) minmax(0, 1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid #f0f2f5; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: #8a93a3; font-size: 11px; }
.detail-row dd { margin: 0; color: #354054; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 7px 22px 15px; }
.detail-grid .detail-row { display: block; min-width: 0; padding: 13px 0; }
.detail-grid .detail-row dt { margin-bottom: 6px; font-size: 10px; font-weight: 600; }
.detail-grid .detail-row dd { font-size: 13px; line-height: 1.5; }
.extra-fields { border-top: 1px solid var(--line); }
.extra-fields summary { padding: 14px 22px; color: var(--purple); cursor: pointer; font-size: 11px; font-weight: 700; }
.extra-fields[open] summary { border-bottom: 1px solid #f0f2f5; }
.technical-fields summary { color: #788296; }
.view-switch { display: flex; flex: 0 0 auto; gap: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.view-switch .button { min-height: 32px; }
.cards-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -3px 0 13px; color: #8a93a3; font-size: 11px; }
.cards-sort-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.cards-sort-form label { color: #687387; font-weight: 600; }
.cards-sort-form select { min-height: 34px; max-width: 210px; padding: 0 27px 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #586477; font-size: 11px; }
.record-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.record-card { min-width: 0; padding: 17px 18px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 2px 8px #2c365008; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.record-card:hover { transform: translateY(-1px); border-color: #d6ccef; box-shadow: 0 7px 18px #392b7110; }
.record-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record-card-heading > div { min-width: 0; }
.record-card-type { color: #8a93a3; font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; }
.invoice-available { display: inline-flex; align-items: center; width: fit-content; margin: 5px 0 0; padding: 3px 7px; border: 1px solid #d9eee2; border-radius: 12px; background: #eff9f2; color: #347653; font-size: 9px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.id-chip + .invoice-available { margin-left: 6px; vertical-align: middle; }
.record-card-heading h2 { margin: 5px 0 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.record-card-heading h2 a:hover { color: var(--purple); }
.record-card-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 17px 0; padding: 14px 0; border-top: 1px solid #f0f2f5; border-bottom: 1px solid #f0f2f5; }
.record-card-field { min-width: 0; }
.record-card-field dt { margin-bottom: 5px; color: #929aaa; font-size: 10px; }
.record-card-field dd { margin: 0; color: #354054; font-size: 12px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.record-card-field .record-card-total { color: #3b2b78; font-size: 15px; }
.record-card-status .state-badge { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #f0edfb; color: #6244b0; font-size: 10px; }
.record-card-empty { margin: 17px 0; color: var(--muted); font-size: 11px; }
.record-card-open { display: inline-flex; align-items: center; gap: 6px; color: var(--purple); font-size: 11px; font-weight: 700; }
.record-card-open:hover { text-decoration: underline; }
.related-device-card { margin-top: 20px; }
.related-device-card .detail-header { padding: 0 22px; }
.related-device-faults { padding: 12px 22px 18px; border-top: 1px solid #f0f2f5; }
.related-device-faults strong { color: #8a93a3; font-size: 10px; }
.related-device-faults ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 0; padding: 0; list-style: none; }
.related-device-faults li a { display: inline-block; padding: 5px 9px; border: 1px solid #e6e0f8; border-radius: 16px; background: #f8f6fd; font-size: 10px; }
.repair-parts { margin-top: 20px; }
.pos-lines-card { margin-top: 20px; }
.pos-lines-table { min-width: 620px; }
.pos-lines-table th, .pos-lines-table td { padding: 12px 16px; }
.pos-lines-table .numeric-cell { text-align: right; white-space: nowrap; }
.pos-lines-table .pos-line-total { color: #354054; font-weight: 700; }
.pos-serial-cell { min-width: 170px; white-space: normal; }
.pos-serial-value { display: block; width: fit-content; margin: 2px 0; padding: 4px 7px; border: 1px solid #e6e0f8; border-radius: 5px; background: #f8f6fd; color: #47347e; font: 600 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.pos-serial-missing { color: #8a6370; font-size: 10px; }
.pos-line-note { display: block; margin-top: 4px; color: #929aaa; font-size: 10px; white-space: normal; }
.record-link { color: var(--purple); font-weight: 600; text-decoration: underline; text-decoration-color: #d8cff2; text-underline-offset: 2px; }
.record-link:hover { color: #4f36a9; text-decoration-color: currentColor; }
.related-card { margin-top: 20px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px #2c365008; }
.related-heading { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.related-heading h2 { margin: 0 0 4px; font-size: 13px; }
.related-heading .muted { font-size: 10px; }
.related-empty { margin: 0; padding: 20px 18px; color: var(--muted); font-size: 11px; }
.related-table-scroll { overflow-x: auto; }
.related-table { min-width: 500px; }
.related-table th { padding: 10px 14px; font-size: 9px; }
.related-table td { padding: 10px 14px; font-size: 10px; }
.related-table td:first-child a { color: var(--purple); font-weight: 600; }
.related-table td:first-child a:hover { text-decoration: underline; }
.attachment-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.attachment-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f0f2f5; }
.attachment-list-item:last-child { border-bottom: 0; }
.attachment-type { flex: 0 0 auto; padding: 5px 7px; border: 1px solid #f0d8d8; border-radius: 5px; background: #fff5f4; color: #9b4e4e; font-size: 9px; font-weight: 800; }
.attachment-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.attachment-copy a { width: fit-content; max-width: 100%; color: var(--purple); font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.attachment-copy a:hover { text-decoration: underline; }
.attachment-copy small { color: var(--muted); font-size: 9px; }
.related-context { margin: -7px 0 18px; padding: 10px 13px; border: 1px solid #e6e0f8; border-radius: 7px; background: #f8f6fd; color: #687387; font-size: 11px; }
.model-search { margin-bottom: 19px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(ellipse at top right, #eeeafb, transparent 40%), var(--paper); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 45px #32235c12; width: min(100%, 410px); padding: 35px; }
.auth-card > .brand-mark { margin-bottom: 23px; }
.auth-card h1 { font-size: 25px; }
.auth-card .muted { font-size: 12px; margin-bottom: 23px; }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.login-form label { color: #515d72; font-weight: 600; font-size: 11px; margin-top: 6px; }
.login-form input { width: 100%; height: 41px; padding: 0 11px; }
.login-form button { width: 100%; margin-top: 12px; min-height: 42px; }
.login-form button span { font-size: 15px; }
.auth-foot { color: #9aa2b1; border-top: 1px solid var(--line); margin: 24px 0 0; padding-top: 17px; font-size: 10px; text-align: center; }
.alert { border-radius: 7px; padding: 11px 12px; margin: 16px 0; line-height: 1.55; font-size: 11px; }
.alert-warning { background: #fff8e7; border: 1px solid #f4e4b7; color: #795a17; }
.alert-error { background: #fff0ef; border: 1px solid #f4d4d1; color: #9e423a; }
.alert-success { background: #edf9f2; border: 1px solid #d7efdf; color: #26714d; }
.users-card { padding: 0 22px 22px; margin-bottom: 22px; }
.users-card .detail-header, .password-card .detail-header { padding: 14px 0; }
.users-card .detail-header .muted, .password-card .detail-header .muted { margin-top: 5px; font-size: 11px; }
.user-create-form { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.5fr) minmax(150px, 1fr) auto; align-items: end; gap: 10px; padding-top: 17px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.user-create-form label { color: #515d72; font-weight: 600; font-size: 11px; }
.user-create-form input, .user-create-form select { width: 100%; height: 39px; min-width: 0; padding: 0 10px; border: 1px solid #e1e5ec; border-radius: 7px; background: #fff; color: var(--ink); outline: none; }
.user-create-form input:focus, .user-create-form select:focus { border-color: #927bdd; box-shadow: 0 0 0 3px #6848c71c; }
.users-table-card { margin-bottom: 22px; }
.users-table-title { display: flex; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.users-table-title h2 { margin-bottom: 3px; }
.users-table-title p { font-size: 11px; }
.activity-table-card { margin-bottom: 22px; }
.activity-event { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #f0edfb; color: #6244b0; font-size: 10px; font-weight: 700; }
.activity-event.failed { background: #fff0ef; color: #9e423a; }
.you-tag { color: #7b66bd; background: #f0edfb; padding: 3px 6px; border-radius: 9px; font-size: 9px; font-weight: 700; }
.role-tag { display: inline-block; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 700; }
.role-tag.admin { color: #6244b0; background: #f0edfb; }
.role-tag.viewer { color: #35795b; background: #eaf6ef; }
.inline-form { margin: 0; }
.button-danger { min-height: 29px; padding: 0 9px; color: #a8423d; background: #fff; border-color: #efd8d6; font-size: 10px; }
.button-danger:hover { background: #fff2f1; border-color: #e6bdb9; }
.password-card { padding: 0 22px 22px; }
.password-card .user-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.password-card .user-create-form button { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .topbar { height: 58px; padding: 0 16px; }
    .topbar-actions { gap: 5px; }
    .topbar-user { display: none; }
    .topbar-actions .button { padding: 0 8px; font-size: 10px; }
    .topbar-actions a[href="index.php?view=users"], .topbar-actions a[href="index.php?view=activity"] { display: none; }
    .brand-light { display: none; }
    .list-controls { align-items: stretch; flex-direction: column; }
    .list-controls > .search-form { width: 100%; }
    .column-picker { align-self: flex-end; }
    .column-picker-form { position: fixed; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: min(390px, calc(100vw - 28px)); }
    .column-picker[open]::before { content: ""; position: fixed; z-index: -1; inset: 0; background: #18203366; }
    .column-picker-actions { align-items: stretch; flex-direction: column; }
    .column-picker-actions .button { width: 100%; min-height: 40px; }
    .column-picker-actions form { display: contents; }
    .keyboard-hint { display: none; }
    .welcome-banner { min-height: 150px; padding: 24px; }
    .welcome-mark { right: -22px; }
    .welcome-banner h1 { max-width: 245px; font-size: 23px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .stat-card { min-height: 155px; padding: 13px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .view-switch { align-self: stretch; }
    .view-switch .button { flex: 1; }
    .cards-toolbar { align-items: flex-start; flex-direction: column; }
    .cards-sort-form { width: 100%; }
    .cards-sort-form select { flex: 1; max-width: none; min-width: 0; }
    .record-cards { grid-template-columns: 1fr; gap: 10px; }
    .model-grid { grid-template-columns: 1fr; }
    .table-footer { align-items: flex-start; flex-direction: column; }
    .pagination { width: 100%; justify-content: space-between; }
    .table-toolbar { align-items: flex-start; flex-direction: column; }
    .page-size-form { align-self: flex-end; }
    .catalog-footer { align-items: flex-start; flex-direction: column; }
    .catalog-footer .pagination { justify-content: space-between; }
    .detail-row { grid-template-columns: minmax(100px, 32%) minmax(0, 1fr); gap: 10px; }
    .detail-grid { grid-template-columns: 1fr; gap: 0; padding: 5px 16px 10px; }
    .detail-grid .detail-row dd { font-size: 12px; }
    .extra-fields summary { padding: 13px 16px; }
    .record-card { padding: 15px; }
    .user-create-form, .password-card .user-create-form { grid-template-columns: 1fr; }
    .user-create-form button, .password-card .user-create-form button { grid-column: auto; }
}
@media (max-width: 720px) and (min-width: 601px) {
    .sidebar { width: 190px; padding: 26px 10px; }
    .side-link { gap: 8px; padding: 9px 8px; font-size: 12px; }
    .main { width: calc(100% - 190px); padding: 28px 20px 48px; }
}
@media (max-width: 600px) {
    .shell { display: block; }
    .shell { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .sidebar {
        position: fixed;
        z-index: 5;
        inset: auto 0 0;
        width: 100%;
        height: calc(66px + env(safe-area-inset-bottom));
        display: flex;
        gap: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        border: 0;
        border-top: 1px solid #e8ebf1;
        background: #ffffffed;
        box-shadow: 0 -8px 24px #25304a0d;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .side-label { display: none; }
    .side-link {
        flex: 0 0 68px;
        min-width: 0;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 5px 4px;
        margin: 0;
        border-radius: 11px;
        font-size: 9px;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
        scroll-snap-align: center;
    }
    .side-link span { display: block; }
    .side-link .nav-icon { font-size: 16px; line-height: 1; }
    .main { width: 100%; padding: 22px 16px 32px; }
    .topbar {
        height: calc(58px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 14px 0;
    }
    .topbar-actions .button { min-height: 36px; }
    .search-form { flex-wrap: wrap; gap: 8px; }
    .search-form input { flex: 1 1 100%; max-width: none; height: 44px; font-size: 16px; }
    .button { min-height: 42px; }
    input, select, textarea { font-size: 16px; }
    .page-size-form select, .cards-sort-form select { min-height: 42px; }
    .table-scroll, .related-table-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    .auth-wrap { min-height: 100svh; padding: 16px; }
    .auth-card { padding: 28px 22px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
