:root {
  --ink: #242526;
  --muted: #a8aaad;
  --line: #4a4b4e;
  --surface: #353638;
  --canvas: #262729;
  --forest: #494a4d;
  --forest-dark: #242526;
  --lime: #f3c51d;
  --lime-soft: #fff2b4;
  --amber: #d89924;
  --amber-soft: #fff0cf;
  --red: #c92f2b;
  --red-soft: #fee7e4;
  --blue: #66696c;
  --blue-soft: #ececed;
  --shadow: 0 18px 55px rgba(28, 29, 30, 0.13);
  --font-brand: "Arial Black", "Helvetica Neue", Impact, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: #f2f2f2;
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body.auth-locked { overflow: hidden; }
.login-screen { position: fixed; inset: 0; z-index: 300; display: none; grid-template-columns: minmax(360px, .9fr) minmax(470px, 1.1fr); min-height: 100vh; background: #222325; }
.login-screen.open { display: grid; }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(38px, 6vw, 76px); background: radial-gradient(circle at 15% 0%, rgba(243,197,29,.22), transparent 29%), linear-gradient(145deg,#242526,#303133); }
.login-brand-panel::after { content: ""; position: absolute; width: 430px; height: 430px; right: -190px; bottom: -180px; border: 60px solid #171819; border-radius: 50%; box-shadow: inset 0 0 0 13px #57585b; opacity: .85; }
.login-brand-copy { position: relative; z-index: 1; max-width: 560px; }
.login-brand-copy img { width: min(280px, 72%); }
.login-brand-copy > span { display: block; margin-top: 8px; color: #aaa; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-brand-copy h1 { margin: clamp(48px, 10vh, 105px) 0 18px; font-family: var(--font-brand); font-style: italic; font-size: clamp(38px, 5vw, 67px); line-height: .98; letter-spacing: -.06em; }
.login-brand-copy p { max-width: 480px; color: #b8b9bb; font-size: 16px; line-height: 1.6; }
.login-feature-list { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px 22px; color: #d5d5d6; font-size: 12px; font-weight: 700; }
.login-feature-list span::first-letter { color: var(--lime); }
.login-form-panel { display: grid; place-items: center; padding: 34px; background: #292a2c; }
.login-card { width: min(100%, 470px); padding: 34px; border: 1px solid #494a4d; border-radius: 22px; background: #353638; box-shadow: 0 26px 80px rgba(0,0,0,.28); }
.demo-pill { display: inline-flex; min-height: 27px; align-items: center; padding: 0 10px; border-radius: 20px; background: #fff2b4; color: #61500d; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.login-heading { margin: 24px 0 27px; }
.login-heading h2 { margin: 5px 0 8px; font-size: 31px; letter-spacing: -.04em; }
.login-heading p { margin: 0; color: var(--muted); }
.login-field { display: grid; gap: 8px; margin-top: 15px; }
.login-field span { color: #d7d7d8; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.login-field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #56575a; border-radius: 10px; outline: none; color: #fff; background: #2a2b2d; }
.login-field input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(243,197,29,.13); }
.login-error { min-height: 20px; margin: 9px 0 3px; color: #ff8e88; font-size: 12px; }
.login-submit { width: 100%; min-height: 48px; }
.demo-accounts { display: grid; gap: 8px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo-accounts > span { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.demo-accounts button { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #505154; border-radius: 10px; color: #f4f4f4; background: #3d3e41; cursor: pointer; text-align: left; }
.demo-accounts button:hover { border-color: var(--lime); background: #444548; }
.demo-accounts small { color: var(--muted); text-align: right; }
.login-note { margin: 18px 0 0; color: #85878a; font-size: 10px; line-height: 1.5; text-align: center; }
.account-summary { display: grid; gap: 20px; }
.account-identity { display: flex; align-items: center; gap: 14px; }
.account-identity .avatar { width: 48px; height: 48px; font-size: 15px; }
.account-identity h2 { margin: 3px 0; }
.account-identity p { margin: 0; color: var(--muted); }
.account-role-row { display: flex; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  padding: 28px 18px 20px;
  color: #f3f3f3;
  background:
    radial-gradient(circle at 25% 0%, rgba(243,197,29,.1), transparent 27%),
    #222325;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-logo { display: block; width: 178px; height: auto; object-fit: contain; object-position: left center; }
.brand > span { color: #a8a9ab; font-size: 10px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.sidebar > .brand { flex-direction: column; align-items: flex-start; gap: 5px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; color: var(--red); background: var(--lime);
  font-weight: 900; font-style: italic; font-size: 21px;
  box-shadow: inset -5px 0 0 var(--red), 0 6px 14px rgba(0,0,0,.18);
}
.brand strong { display: block; letter-spacing: .14em; font-size: 15px; }
.brand span { display: block; margin-top: 2px; color: #a8a9ab; font-size: 11px; }
.nav { margin-top: 42px; display: grid; gap: 6px; }
.nav-item {
  border: 0; background: transparent; color: #b8b9bb; cursor: pointer;
  padding: 11px 13px; border-radius: 10px; display: flex; align-items: center;
  gap: 12px; text-align: left; font-weight: 600; transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--ink); background: var(--lime); }
.nav-icon { font-size: 18px; width: 20px; text-align: center; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(201,47,43,.15); margin-right: 7px; }
.user-card { width: 100%; border: 0; border-radius: 12px; background: #303133; color: #fff; padding: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.user-card:hover { background: #3a3b3d; }
.user-card small { display: block; color: #aaa; margin-top: 2px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: #dedede; font-weight: 800; font-size: 12px; }
.chevron { margin-left: auto; }

.main { min-height: 100vh; margin-left: 244px; padding: 34px 42px 60px; }
.view { display: none; max-width: 1400px; margin: 0 auto; animation: enter .25s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
.mobile-header, .mobile-nav { display: none; }

.page-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-header h1 { margin: 3px 0 0; font-family: var(--font-brand); font-style: italic; font-size: clamp(27px, 3vw, 38px); font-weight: 900; letter-spacing: -.055em; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.header-actions { display: flex; gap: 10px; }
.button { position: relative; min-height: 42px; border: 0; border-radius: 10px; padding: 0 16px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-weight: 750; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--forest); color: #fff; box-shadow: 0 8px 18px rgba(35,36,38,.2); }
.button.primary:hover { background: var(--forest-dark); }
.button.accent { background: var(--lime); color: var(--ink); }
.button.secondary { background: #fff; border: 1px solid var(--line); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-button { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 17px; }
.cart-count { position: absolute; right: -5px; top: -6px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 4px; border-radius: 10px; color: var(--ink); background: var(--lime); border: 2px solid #fff; font-size: 10px; font-weight: 900; }
.nav-item .cart-count { position: static; margin-left: auto; border: 0; background: var(--lime); color: var(--ink); }
.nav-item.active .cart-count { background: var(--ink); color: var(--lime); }
.text-button { border: 0; background: transparent; color: var(--lime); padding: 0; font-weight: 750; cursor: pointer; }

.hero-panel { position: relative; min-height: 238px; padding: 35px 38px; border-radius: 20px; overflow: hidden; color: #fff; background: var(--forest); display: grid; grid-template-columns: 1fr 310px; align-items: center; gap: 25px; }
.hero-panel::before, .hero-panel::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-panel::before { width: 330px; height: 330px; right: -80px; top: -115px; }
.hero-panel::after { width: 220px; height: 220px; right: -30px; top: -65px; }
.hero-panel h2 { position: relative; z-index: 1; margin: 8px 0 9px; font-family: var(--font-brand); font-style: italic; font-weight: 900; font-size: clamp(29px, 4vw, 43px); letter-spacing: -.055em; line-height: 1.03; }
.hero-panel p { position: relative; z-index: 1; color: #d0d0d1; max-width: 600px; margin: 0; line-height: 1.55; }
.hero-search { position: relative; z-index: 2; margin-top: 24px; max-width: 590px; height: 56px; border-radius: 13px; background: #fff; display: flex; align-items: center; padding: 0 8px 0 17px; box-shadow: var(--shadow); }
.hero-search input { min-width: 0; flex: 1; border: 0; outline: none; font-size: 16px; color: var(--ink); }
.hero-search button { height: 42px; border: 0; border-radius: 9px; padding: 0 17px; background: var(--lime); font-weight: 800; cursor: pointer; }
.hero-figure { position: relative; z-index: 1; justify-self: center; width: 220px; height: 220px; border: 32px solid #202123; border-radius: 50%; box-shadow: inset 0 0 0 7px #55575a, 0 30px 70px rgba(0,0,0,.22); }
.hero-figure::before { content: ""; position: absolute; inset: 33px; border: 10px dashed #dedede; border-radius: 50%; }
.hero-figure::after { content: "R"; position: absolute; inset: 61px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--red); font-size: 27px; font-weight: 900; font-style: italic; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat-card { padding: 19px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--lime-soft); color: var(--forest); }
.stat-card strong { display: block; margin-top: 16px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.stat-card small { color: var(--muted); }
.positive { color: var(--lime) !important; }
.warning { color: var(--amber) !important; }
.danger-text { color: var(--red) !important; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.card { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.card-pad { padding: 21px; }
.card-header, .section-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.card-header { padding: 20px 21px 15px; }
.card-header h3, .card h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.activity-list { padding: 0 21px 13px; }
.activity { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #edf0ed; }
.activity-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.activity-icon.out { background: var(--amber-soft); color: var(--amber); }
.activity-icon.sale { background: var(--lime-soft); color: var(--forest); }
.activity p { margin: 0; font-weight: 650; }
.activity small { color: var(--muted); display: block; margin-top: 3px; }
.activity time { color: var(--muted); font-size: 11px; }
.branch-bars { padding: 4px 21px 21px; }
.bar-row { margin-top: 18px; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.bar { height: 9px; background: #edf0ed; border-radius: 9px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.bar.alt span { background: var(--lime); }
.attention-list { margin-top: 19px; display: grid; gap: 10px; }
.attention-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 10px; background: var(--amber-soft); color: var(--ink); }
.attention-item strong { display: block; font-size: 12px; }
.attention-item small { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 9px; border-radius: 20px; background: #eef2ef; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.green { background: var(--lime-soft); color: var(--forest); }
.badge.amber { background: var(--amber-soft); color: #9b6819; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-field { height: 44px; flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: #f2f2f2; }
.search-field input::placeholder { color: #a8aaad; opacity: 1; }
.search-icon { width: 17px; height: 17px; flex: 0 0 auto; color: #d6d7d8; }
.select { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 35px 0 12px; outline: none; color: var(--ink); }
.table-card { border: 1px solid var(--line); background: #fff; border-radius: 15px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 15px; color: var(--muted); background: #f9faf8; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfa; }
.product-row { cursor: pointer; }
.product-row:focus-visible { outline-offset: -3px; }
.product-cell { display: flex; align-items: center; gap: 11px; }
.product-thumb { width: 40px; height: 40px; position: relative; flex: 0 0 auto; overflow: hidden; border: 9px solid #303133; border-radius: 50%; box-shadow: inset 0 0 0 2px #77787a; }
.product-thumb.has-image { border: 0; box-shadow: none; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-cell strong, .product-cell small { display: block; }
.product-cell small { margin-top: 3px; color: var(--muted); }
.stock-cell { min-width: 95px; }
.stock-cell strong { display: block; font-size: 16px; }
.stock-cell span { color: var(--muted); font-size: 10px; }
.price { font-weight: 800; white-space: nowrap; }
.table-footer { padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin: 8px 0 5px; }

.form-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 800; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(29,77,54,.08); }
.field textarea { padding-top: 11px; resize: vertical; }
.transfer-layout, .pricing-layout { display: grid; grid-template-columns: .78fr 1.22fr; gap: 18px; }
.route-visual { display: grid; grid-template-columns: 1fr 45px 1fr; align-items: center; gap: 10px; margin: 18px 0; }
.branch-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.branch-box span, .branch-box strong { display: block; }
.branch-box span { color: var(--muted); font-size: 10px; }
.branch-box strong { margin-top: 5px; }
.route-arrow { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 21px; font-weight: 900; box-shadow: 0 0 0 4px rgba(243,197,29,.13); }
.branch-box select { width: 100%; margin-top: 7px; padding: 0; border: 0; outline: none; color: #f2f2f2; background: transparent; font-weight: 750; }
.notice { margin: 15px 0; border-radius: 10px; padding: 12px 14px; background: var(--blue-soft); color: #56585b; font-size: 12px; line-height: 1.45; }
.price-preview { padding: 20px; border-radius: 15px; color: #fff; background: var(--ink); }
.price-preview h3 { font-family: var(--font-brand); font-style: italic; font-size: 24px; font-weight: 900; letter-spacing: -.04em; }
.price-line { display: grid; grid-template-columns: 1fr auto; gap: 15px; padding: 14px 0; border-top: 1px solid #4b4c4e; }
.price-line:first-of-type { margin-top: 16px; }
.price-line small { display: block; color: #9dac9f; margin-top: 3px; }
.old-price { color: #92a097; text-decoration: line-through; margin-right: 8px; }
.new-price { color: var(--lime); font-weight: 800; }

.document-filters { display: flex; gap: 8px; margin-bottom: 16px; }
.document-row { cursor: pointer; }
.document-row:hover .doc-number { color: var(--lime); }
.document-row:focus-visible { outline-offset: -3px; }
.document-detail-shell { max-width: 780px; margin: 0 auto; border-radius: 16px; overflow: hidden; box-shadow: 0 22px 65px rgba(0,0,0,.28); }
.document-record-card { margin-bottom: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.document-record-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.document-record-head h2 { margin: 4px 0 0; font-size: 17px; }
.document-record-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.document-record-grid div { min-width: 0; grid-column: span 3; padding: 13px; background: #303133; }
.document-record-grid div:nth-child(n+5) { grid-column: span 4; }
.document-record-grid span, .document-record-grid strong { display: block; }
.document-record-grid span { margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.document-record-grid strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.document-record-grid .record-total { color: var(--lime); font-size: 16px; }
.document-detail-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; padding: 14px 16px; border: 1px solid #5d5e61; border-radius: 12px; background: #303133; }
.document-detail-actions p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.document-detail-actions > div:last-child { display: flex; gap: 9px; }
.document-preview-heading { max-width: 780px; margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; }
.document-preview-heading h3 { margin: 4px 0 0; }
.chip { border: 1px solid #5a5b5e; border-radius: 20px; background: #353638; color: #f2f2f2; padding: 8px 13px; cursor: pointer; font-size: 12px; font-weight: 700; }
.chip.active { border-color: var(--lime); color: var(--ink); background: var(--lime); }
.doc-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; }

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.chart { height: 220px; display: flex; align-items: end; gap: 14px; padding: 25px 20px 12px; border-bottom: 1px solid var(--line); }
.chart-col { flex: 1; min-width: 18px; height: var(--height); position: relative; background: var(--forest); border-radius: 7px 7px 0 0; }
.chart-col.highlight { background: var(--lime); }
.chart-col span { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 10px; }
.chart-wrap { padding-bottom: 33px; }
.donut-wrap { min-height: 252px; display: grid; grid-template-columns: 150px 1fr; place-items: center; gap: 20px; padding: 22px; }
.donut { width: 142px; height: 142px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--forest) 0 57%, var(--lime) 57% 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 27px; background: #fff; border-radius: 50%; }
.donut strong { z-index: 1; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.legend { display: grid; gap: 16px; width: 100%; }
.legend-item { display: flex; align-items: center; gap: 9px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--forest); }
.legend-dot.alt { background: var(--lime); }
.legend-item span { color: var(--muted); flex: 1; }

.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 15px; }
.person-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.person-card.inactive { opacity: .62; }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-head > .badge { margin-left: auto; }
.person-head .avatar { width: 44px; height: 44px; }
.person-card h3 { margin: 0; }
.person-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.permissions { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.user-access { display: grid; gap: 10px; margin-top: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #303133; }
.user-access div { display: flex; justify-content: space-between; gap: 16px; }
.user-access span { color: var(--muted); font-size: 11px; }
.user-access strong { font-size: 11px; text-align: right; }
.user-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.branch-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.branch-fieldset legend { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.branch-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.branch-check { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #303133; cursor: pointer; }
.branch-check:has(input:checked) { border-color: var(--lime); background: rgba(243,197,29,.08); }
.branch-check input { width: 17px; height: 17px; accent-color: var(--lime); }
.branch-check span, .branch-check strong, .branch-check small { min-width: 0; display: block; }
.branch-check strong { font-size: 12px; }
.branch-check small, .field-help { margin-top: 3px; color: var(--muted); font-size: 10px; }
.permission-preview { margin-top: 17px; padding: 13px; border-radius: 10px; background: #303133; }
.permission-preview .permissions { margin: 10px 0 0; }
.branch-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.branch-admin-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: opacity .2s ease; }
.branch-admin-card.inactive { opacity: .66; }
.branch-admin-head { display: grid; grid-template-columns: 45px 1fr auto; gap: 12px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.branch-admin-head h2 { margin: 3px 0 0; font-family: var(--font-brand); font-style: italic; font-size: 22px; letter-spacing: -.04em; }
.branch-symbol { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--lime); font-family: var(--font-brand); font-style: italic; font-weight: 900; }
.branch-contact { display: grid; gap: 13px; padding: 18px 0; }
.branch-contact div { display: grid; grid-template-columns: 135px 1fr; gap: 12px; }
.branch-contact span, .branch-metrics span { color: var(--muted); font-size: 11px; }
.branch-contact strong { font-size: 12px; text-align: right; }
.branch-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.branch-metrics div { padding: 13px; background: #303133; }
.branch-metrics span, .branch-metrics strong { display: block; }
.branch-metrics strong { margin-top: 7px; font-size: 17px; }
.branch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.branch-policy { margin-top: 17px; }
.product-detail-layout { display: grid; grid-template-columns: 285px minmax(0, 1fr); align-items: start; gap: 18px; }
.product-media-card { position: sticky; top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.product-image-preview { min-height: 235px; margin: 14px 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; border: 1px dashed #626367; border-radius: 13px; background: #2e2f31; text-align: center; }
.product-image-preview.has-image { border-style: solid; }
.product-image-preview img { width: 100%; height: 250px; object-fit: contain; background: #fff; }
.product-image-preview small { max-width: 175px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.large-tire { width: 105px; height: 105px; position: relative; border: 24px solid #1c1d1f; border-radius: 50%; box-shadow: inset 0 0 0 5px #65676a, 0 13px 30px rgba(0,0,0,.2); }
.large-tire::after { content: "TG"; position: absolute; inset: 9px; display: grid; place-items: center; border-radius: 50%; color: var(--red); background: var(--lime); font-family: var(--font-brand); font-style: italic; font-weight: 900; }
.image-upload { width: 100%; }
.product-state { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 11px; }
.product-form-content { min-width: 0; display: grid; gap: 14px; }
.form-section { padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.form-section-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.form-section-head h3 { margin: 4px 0 0; }
.margin-pill { min-width: 125px; padding: 10px 12px; border-radius: 10px; color: var(--ink); background: var(--lime-soft); text-align: right; }
.margin-pill span, .margin-pill strong { display: block; }
.margin-pill span { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.margin-pill strong { margin-top: 3px; font-size: 19px; }
.stock-edit-list { display: grid; gap: 9px; }
.stock-edit-row { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #303133; }
.stock-edit-row > div strong, .stock-edit-row > div small { display: block; }
.stock-edit-row > div small { margin: 3px 0 0 18px; color: var(--muted); font-size: 10px; }
.stock-edit-row label { display: grid; gap: 5px; }
.stock-edit-row label span { color: var(--muted); font-size: 9px; font-weight: 800; }
.stock-edit-row input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: #f2f2f2; background: var(--surface); }
.product-save-bar { position: sticky; bottom: 12px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border: 1px solid #5a5b5e; border-radius: 12px; background: rgba(35,36,38,.94); box-shadow: 0 14px 35px rgba(0,0,0,.3); backdrop-filter: blur(10px); }
.product-save-bar span { color: var(--muted); font-size: 11px; }
.field input:disabled, .field select:disabled, .stock-edit-row input:disabled { opacity: 1; color: #dedee0; background: #303133; cursor: default; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(12,24,16,.42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: .2s ease; }
.drawer-backdrop.open, .modal-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(440px, 100%); background: #fff; box-shadow: -30px 0 70px rgba(0,0,0,.16); transform: translateX(105%); transition: .28s ease; display: flex; flex-direction: column; }
.cart-drawer.open { transform: translateX(0); }
.drawer-header { padding: 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer-header h2 { margin: 4px 0 0; font-family: var(--font-brand); font-style: italic; font-size: 28px; font-weight: 900; letter-spacing: -.04em; }
.cart-branch { margin: 16px 22px 0; padding: 11px 13px; border-radius: 10px; background: var(--lime-soft); display: flex; justify-content: space-between; font-size: 12px; }
.cart-client { margin: 12px 22px 0; display: grid; gap: 8px; }
.cart-client > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-client input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: #f2f2f2; background: #303133; outline: none; }
.cart-client input:focus { border-color: var(--lime); }
.cart-items { padding: 8px 22px; overflow: auto; flex: 1; }
.cart-item { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.cart-item p { margin: 0; font-weight: 750; }
.cart-item small { display: block; color: var(--muted); margin-top: 4px; }
.quantity { margin-top: 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.quantity button { width: 30px; height: 28px; border: 0; background: #f7f8f6; cursor: pointer; }
.quantity span { min-width: 30px; text-align: center; font-weight: 750; }
.remove-item { border: 0; background: transparent; color: var(--red); cursor: pointer; align-self: start; }
.services-block { padding: 15px 22px; border-top: 1px solid var(--line); }
.service-row { display: flex; justify-content: space-between; margin-top: 11px; font-size: 12px; }
.service-row button { border: 0; background: transparent; color: var(--red); cursor: pointer; }
.cart-summary { padding: 15px 22px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.cart-summary > div { display: flex; justify-content: space-between; }
.grand-total { font-size: 18px; margin-top: 6px; padding-top: 13px; border-top: 1px dashed var(--line); }
.drawer-actions { padding: 16px 22px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.modal-backdrop { display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; border-radius: 17px; background: #fff; box-shadow: var(--shadow); transform: translateY(10px) scale(.98); transition: .2s ease; }
.modal:has(.document-preview) { width: min(780px, 100%); }
.modal-backdrop.open .modal { transform: none; }
.modal-content { padding: 25px; }
.modal-content h2 { margin: 5px 0 8px; font-family: var(--font-brand); font-style: italic; font-size: 29px; font-weight: 900; letter-spacing: -.04em; }
.modal-content > p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 25px; border-top: 1px solid var(--line); }
.document-preview { padding: 30px; }
.doc-letterhead { display: flex; justify-content: space-between; align-items: start; border-bottom: 3px solid var(--ink); padding-bottom: 18px; }
.doc-brand { display: flex; align-items: center; gap: 10px; }
.document-logo { width: 138px; height: auto; display: block; }
.doc-letterhead address { text-align: right; color: var(--muted); font-size: 11px; font-style: normal; line-height: 1.5; }
.doc-title { display: flex; justify-content: space-between; align-items: end; margin: 25px 0 18px; }
.doc-title h2 { margin: 0; font-family: var(--font-brand); font-style: italic; font-size: 28px; }
.doc-number-block { text-align: right; }
.doc-number-block span { display: block; margin-bottom: 5px; color: #707174; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.doc-meta { padding: 12px; border-radius: 10px; background: #f5f7f4; font-size: 11px; line-height: 1.7; }
.document-info-grid { display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; margin-bottom: 12px; border: 1px solid #d7d8d9; border-radius: 9px; }
.document-info-grid div { padding: 10px; border-right: 1px solid #d7d8d9; }
.document-info-grid div:last-child { border: 0; }
.document-info-grid span, .client-preview p span { display: block; margin-bottom: 4px; color: #707174; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.document-info-grid strong { font-size: 10px; }
.client-preview { margin-bottom: 14px; padding: 12px; border-radius: 9px; background: #f0f0ef; }
.client-preview > div { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; margin-top: 9px; }
.client-preview p { margin: 0; }
.client-preview p strong { font-size: 10px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.preview-table th, .preview-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.preview-table th:last-child, .preview-table td:last-child { text-align: right; }
.doc-total { margin: 20px 0 0 auto; width: 220px; display: flex; justify-content: space-between; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 17px; }
.document-terms { display: grid; gap: 4px; margin-top: 22px; padding: 10px 12px; border-radius: 8px; background: #fff2b4; font-size: 9px; }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 45px; }
.signature-grid div { padding-top: 7px; border-top: 1px solid #707174; color: #707174; text-align: center; font-size: 9px; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 16px; border-radius: 10px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.role-banner { margin-bottom: 18px; padding: 11px 14px; border-radius: 10px; color: #56585b; background: var(--blue-soft); display: none; }
body.seller-mode .role-banner { display: block; }
body.seller-mode [data-admin] { display: none !important; }

.recent-activity-card { max-width: 920px; }
.dashboard-search-banner { margin-bottom: 18px; }
.row-cart-control { display: grid; grid-template-columns: 55px auto; justify-content: end; align-items: center; gap: 6px; min-width: 145px; }
.row-cart-control input { min-width: 0; width: 55px; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: #f2f2f2; background: #303133; text-align: center; }
.document-state-guide { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: -8px 0 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 11px; }
.document-state-guide span { display: inline-flex; align-items: center; gap: 7px; }
.document-state-guide strong { color: #f2f2f2; }
.status-key { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(243,197,29,.12); }
.status-key.pending { background: var(--amber); }
.document-confirm-note { display: grid; gap: 4px; margin: 0 25px 4px; padding: 12px 14px; border-radius: 9px; color: #ddd; background: #303133; font-size: 11px; }
.document-confirm-note span { color: var(--muted); }
.user-scope-explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.user-scope-explainer div { display: grid; gap: 5px; padding: 14px; background: var(--surface); }
.user-scope-explainer span { color: var(--muted); font-size: 11px; }
.report-amount { display: grid; justify-items: end; gap: 3px; }
.report-user-list { padding: 4px 21px 20px; }
.report-user-list .legend-item span { display: grid; gap: 3px; }
.report-user-list small { color: var(--muted); font-size: 10px; }
.letterhead-logo-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #303133; }
.letterhead-logo-row img { width: 150px; max-height: 65px; object-fit: contain; object-position: left center; }
.mobile-header-actions { display: flex; gap: 7px; }
.mobile-more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 18px; }
.mobile-more-item { min-height: 78px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: #f2f2f2; background: #303133; cursor: pointer; text-align: left; }
.mobile-more-item span { color: var(--lime); font-size: 20px; }
.muted-dash { color: var(--muted); }

/* Dark graphite brand theme */
.stat-card,
.card,
.table-card,
.form-card,
.person-card,
.search-field,
.select,
.field input,
.field select,
.field textarea,
.button.secondary,
.icon-button,
.cart-drawer,
.modal,
.mobile-nav { background: var(--surface); color: #f2f2f2; }
.data-table th { background: #2d2e30; color: var(--muted); border-color: var(--line); }
.data-table td,
.data-table th,
.activity,
.cart-item,
.services-block,
.cart-summary,
.drawer-header,
.modal-actions,
.table-footer { border-color: var(--line); }
.data-table tbody tr:hover { background: #3b3c3f; }
.bar,
.quantity button { background: #4a4b4e; color: #f2f2f2; }
.badge { background: #48494c; color: #d8d8d9; }
.hero-search { background: #fff; }
.hero-search input { color: var(--ink); }
.cart-branch { color: var(--ink); }
.price-preview { background: #1f2022; }
.donut::after { background: var(--surface); }
.doc-meta { color: var(--ink); }
.document-preview { background: #fff; color: var(--ink); }
.document-preview .eyebrow { color: #707174; }
.preview-table th,
.preview-table td { border-color: #d7d8d9; }
.role-banner,
.notice { background: #444548; color: #e0e0e1; }
.empty-state { color: var(--muted); }
.empty-state strong { color: #f2f2f2; }
.toast { background: #18191a; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .transfer-layout, .pricing-layout { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .hero-panel { grid-template-columns: 1fr 200px; }
  .hero-figure { width: 160px; height: 160px; border-width: 25px; }
  .hero-figure::before { inset: 23px; }
  .hero-figure::after { inset: 43px; }
  .permission-grid { grid-template-columns: 1fr 1fr; }
  .branch-admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; overflow-y: auto; }
  .login-brand-panel { min-height: 230px; padding: 30px 25px; }
  .login-brand-copy img { width: 190px; }
  .login-brand-copy h1 { margin: 35px 0 10px; font-size: 36px; }
  .login-brand-copy p, .login-feature-list { display: none; }
  .login-brand-panel::after { width: 250px; height: 250px; right: -115px; bottom: -150px; border-width: 38px; }
  .login-form-panel { padding: 18px 14px 32px; align-items: start; }
  .login-card { margin-top: -20px; padding: 24px 19px; border-radius: 18px; }
  .demo-accounts button { align-items: flex-start; flex-direction: column; }
  .demo-accounts small { text-align: left; }
  body { padding-bottom: 70px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 85px 15px 28px; }
  .mobile-header { position: fixed; inset: 0 0 auto; height: 66px; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #fff; background: var(--ink); }
  .mobile-header .brand { padding: 0; }
  .mobile-header .brand-logo { width: 116px; }
  .mobile-header .icon-button { color: #fff; background: #353638; border-color: #4b4c4e; }
  .mobile-nav { position: fixed; inset: auto 0 0; height: 68px; z-index: 50; display: flex; border-top: 1px solid var(--line); background: #fff; }
  .mobile-nav button { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; }
  .mobile-nav button span { display: block; margin-bottom: 4px; font-size: 18px; }
  .mobile-nav button.active { color: var(--forest); }
  .page-header { align-items: start; margin-bottom: 20px; }
  .page-header h1 { font-size: 29px; }
  .page-header p { font-size: 12px; }
  .header-actions .button.secondary { display: none; }
  #new-user { display: none; }
  .page-header .header-actions .open-cart { display: none; }
  #view-inventory .header-actions .button.secondary { width: 42px; min-height: 42px; display: inline-flex; flex: 0 0 42px; padding: 0; font-size: 0; }
  #view-inventory #new-product::before { content: "+"; font-size: 23px; line-height: 1; }
  #view-inventory .inventory-transfer::before { content: "⇄"; font-size: 19px; line-height: 1; }
  .hero-panel { min-height: 305px; padding: 27px 20px; display: block; }
  .hero-figure { position: absolute; opacity: .32; right: -30px; bottom: -35px; }
  .hero-search { margin-top: 20px; height: 53px; }
  .hero-search button { padding: 0 13px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 20px; margin-top: 11px; }
  .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-field { width: 100%; flex-basis: 100%; }
  .select { flex: 1; min-width: 0; }
  .table-card { border: 0; background: transparent; overflow: visible; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { display: none; }
  .data-table tr { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
  .data-table td { display: block; padding: 0; border: 0 !important; }
  .data-table td:nth-child(2), .data-table td:nth-child(3) { margin-left: 51px; }
  .data-table td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .data-table td:nth-child(5) { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
  .data-table td:nth-child(6) { grid-column: 1 / -1; }
  .data-table td:nth-child(6) .button { width: 100%; margin-top: 7px; }
  .row-cart-control { grid-template-columns: 62px minmax(0, 1fr); min-width: 0; margin-top: 8px; }
  .row-cart-control .button { grid-column: auto; margin: 0 !important; }
  .row-cart-control input { width: 62px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .route-visual { grid-template-columns: 1fr; }
  .route-arrow { margin: -5px auto; transform: rotate(90deg); }
  .permission-grid { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .product-media-card { position: static; }
  .product-image-preview { min-height: 205px; }
  .product-save-bar { flex-direction: column; align-items: stretch; }
  .stock-edit-row { grid-template-columns: 1fr 100px; }
  .branch-admin-head { grid-template-columns: 42px 1fr; }
  .branch-admin-head .badge { grid-column: 1 / -1; justify-self: start; }
  .branch-contact div { grid-template-columns: 1fr; gap: 4px; }
  .branch-contact strong { text-align: left; }
  .branch-metrics { grid-template-columns: 1fr; }
  .branch-actions { grid-template-columns: 1fr; }
  .branch-checkbox-grid, .user-card-actions { grid-template-columns: 1fr; }
  .user-scope-explainer { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
  .drawer-actions { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; }
  .document-preview { padding: 19px; }
  .doc-letterhead address { display: none; }
  .document-info-grid, .client-preview > div { grid-template-columns: 1fr; }
  .document-info-grid div { border-right: 0; border-bottom: 1px solid #d7d8d9; }
  .signature-grid { gap: 20px; }
  .document-record-grid { grid-template-columns: 1fr 1fr; }
  .document-record-grid div, .document-record-grid div:nth-child(n+5) { grid-column: auto; }
  .document-detail-actions { align-items: stretch; flex-direction: column; }
  .document-detail-actions > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
}

@media print {
  body * { visibility: hidden; }
  .modal, .modal *, .document-detail-shell, .document-detail-shell * { visibility: visible; }
  .modal, .document-detail-shell { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; box-shadow: none; }
  .modal-actions { display: none; }
  .document-preview { padding: 0; }
}
