:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d8dee8;
  --primary: #e94716;
  --primary-dark: #bf3710;
  --brand-navy: #102a43;
  --brand-teal: #7e9499;
  --brand-cyan: #f05a24;
  --danger: #c2413b;
  --success: #16803c;
  --warning: #946200;
  --shadow: 0 10px 28px rgba(20, 31, 48, 0.08);
  --filing-footer-height: 44px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-page {
  min-height: calc(100vh - var(--filing-footer-height));
  display: grid;
  grid-template-columns: 1fr 420px;
}

.filing-footer {
  min-height: var(--filing-footer-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 16px;
  row-gap: 4px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.filing-footer a {
  color: var(--brand-navy);
}

.brand-side {
  padding: 64px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #151d26 0%, #263741 54%, #7e9499 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-side h1 {
  margin: 34px 0 0;
  font-size: 46px;
  letter-spacing: 0;
}

.brand-side p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

.brand-mark {
  display: grid;
  gap: 14px;
}

.brand-logo-img {
  width: min(540px, 100%);
  height: auto;
  display: block;
  border-radius: 8px;
  background: white;
  padding: 16px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

.brand-mark > span:last-child {
  color: rgba(255, 255, 255, 0.82);
}

.brand-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-signals span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.login-panel {
  background: var(--panel);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-company {
  display: grid;
  gap: 8px;
  margin-bottom: 30px;
}

.login-company .compact-logo-img,
.sidebar-brand .compact-logo-img {
  width: 248px;
  max-width: 100%;
  height: auto;
  display: block;
}

.login-company span {
  color: #344054;
  font-size: 14px;
}

.login-panel h2,
.section h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.hint {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  color: #344054;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 71, 22, 0.14);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.primary-btn {
  color: white;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  color: var(--primary);
  background: #fff0ea;
}

.danger-btn {
  color: white;
  background: var(--danger);
}

.ghost-btn {
  color: #344054;
  background: transparent;
  border: 1px solid var(--line);
}

a.secondary-btn,
a.ghost-btn {
  text-decoration: none;
}

.small-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.full-btn {
  width: 100%;
  margin: 8px 0 16px;
}

.error {
  min-height: 22px;
  color: var(--danger);
  font-size: 14px;
}

.test-accounts {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.shell {
  min-height: calc(100vh - var(--filing-footer-height));
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - var(--filing-footer-height));
  background: linear-gradient(180deg, #151d26 0%, #263741 62%, #6f858a 100%);
  color: white;
  padding: 20px 14px;
  overflow: auto;
}

.sidebar-brand {
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 16px;
}

.sidebar-brand h1 {
  margin: 4px 0 8px;
  font-size: 18px;
}

.sidebar-brand .compact-logo-img {
  width: 204px;
  padding: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
}

.sidebar-brand span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.main-area {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  background: white;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
}

.topbar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title img {
  width: 132px;
  height: auto;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  padding: 4px;
}

.topbar h2 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.message-btn {
  color: #0f4fa8;
  background: #eaf2ff;
  border: 1px solid #b8d4ff;
}

.message-btn span {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f6feb;
  color: white;
  padding: 0 7px;
  font-size: 12px;
}

.logout-btn {
  color: #1f2933;
  background: #ffffff;
  border: 1px solid #98a2b3;
}

.top-btn:hover {
  filter: brightness(0.97);
}

.content {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 24px;
}

.portal-head {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
}

.portal-head h2 {
  margin: 4px 0 6px;
  font-size: 26px;
}

.portal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.module-nav {
  display: grid;
  gap: 6px;
}

.module-nav-group {
  display: grid;
  gap: 5px;
}

.module-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  padding: 0 12px;
  text-align: left;
}

.module-nav button.active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.module-nav button.locked {
  color: rgba(255, 255, 255, 0.48);
}

.module-nav strong {
  display: block;
  font-size: 14px;
}

.submodule-nav {
  display: grid;
  gap: 4px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.submodule-nav button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.submodule-nav button.active {
  background: rgba(53, 182, 197, 0.2);
  border-color: rgba(53, 182, 197, 0.32);
}

.access-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.permission-panel {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.permission-panel h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--primary);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.module-workbench {
  display: block;
}

.admin-panel {
  margin-bottom: 18px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-actions div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.admin-actions strong,
.admin-actions span {
  display: block;
}

.admin-actions strong {
  margin-bottom: 7px;
}

.admin-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.module-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.module-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.module-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.module-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.permission-matrix h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wide-section {
  grid-column: 1 / -1;
}

.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-export-field {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 13px;
}

.archive-export-field input {
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  color: var(--text);
  background: white;
}

.toolbar select {
  width: 160px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
}

.form-actions,
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-inline {
  color: var(--muted);
  font-size: 13px;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.user-form .error {
  grid-column: 1 / -1;
}

.product-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.product-form .error {
  grid-column: 1 / -1;
}

.bom-head {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(2, minmax(150px, 0.5fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.bom-summary {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.bom-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.bom-summary strong {
  font-size: 18px;
}

.bom-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.bom-form .error {
  grid-column: 1 / -1;
}

.file-action {
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.module-role-grid {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.module-role-grid h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.module-role-block {
  margin-bottom: 8px;
}

.module-role-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(150px, 1fr) 180px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.module-role-row input {
  width: 16px;
  height: 16px;
}

.module-role-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.submodule-role-grid {
  display: grid;
  gap: 6px;
  margin: -2px 0 10px 34px;
}

.submodule-role-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px minmax(130px, 1fr) 180px;
  gap: 10px;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
}

.submodule-role-row input {
  width: 16px;
  height: 16px;
}

.submodule-role-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.notice-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.notice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.notice {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid #98a2b3;
  border-radius: 8px;
  background: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.notice.unread {
  border-left-color: var(--primary);
}

.notice span {
  color: var(--muted);
  font-size: 14px;
}

.invoice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}

.invoice-head b {
  color: var(--primary);
}

.invoice-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fbfcfe;
}

.line-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 118px;
  gap: 10px;
}

.field.compact {
  margin-bottom: 10px;
}

.drop-zone {
  min-height: 76px;
  border: 1.5px dashed #98a2b3;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--primary);
  background: #eaf2ff;
  color: var(--primary);
}

.drop-zone input {
  display: none;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.file-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: white;
}

.file-list button {
  color: var(--danger);
  background: transparent;
  padding: 0;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  word-break: break-word;
}

th {
  color: #475467;
  background: #f9fafb;
  font-weight: 600;
}

.todo-row {
  background: #fffdf4;
}

.todo-mark {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #fff3cf;
  color: var(--warning);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.archive-mark {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  padding: 0 8px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
}

.archive-mark.done {
  background: #dcfce7;
  color: var(--success);
}

.amount {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.badge.pending_manager,
.badge.pending_finance,
.badge.ready_to_pay {
  color: var(--warning);
  background: #fff3cf;
}

.badge.paid {
  color: var(--success);
  background: #dcfce7;
}

.badge.rejected {
  color: var(--danger);
  background: #fee2e2;
}

.badge.draft {
  color: #475467;
  background: #eef2f6;
}

.desc {
  max-width: 180px;
  color: #475467;
}

.logs {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.mini-lines {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.modal-backdrop,
.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 38, 63, 0.42);
}

.preview-backdrop {
  z-index: 30;
  background: rgba(15, 23, 42, 0.68);
}

.detail-modal {
  width: min(960px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 8px;
  background: white;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.preview-modal {
  width: min(1000px, 94vw);
  height: min(780px, 90vh);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
}

.pdf-preview-modal {
  width: 96vw;
  height: 94vh;
  padding: 12px;
}

.pdf-preview-modal .modal-head {
  margin-bottom: 10px;
}

.pdf-preview-modal .hint {
  margin-bottom: 0;
}

.message-modal {
  width: min(560px, 94vw);
  max-height: min(720px, 88vh);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.message-list {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding-right: 4px;
}

.message-group {
  display: grid;
  gap: 10px;
}

.message-group h3 {
  margin: 0;
  color: #344054;
  font-size: 15px;
}

.message-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px 14px;
}

.message-item.read {
  border-left-color: #cbd5e1;
  background: #ffffff;
}

.message-item.read strong,
.message-item.read p {
  color: #667085;
}

.message-item.unread strong {
  color: var(--text);
}

.message-item div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.message-item span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.message-item p {
  margin: 8px 0 0;
  color: #475467;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.compact-empty {
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0 0 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-grid div,
.detail-desc {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-grid strong {
  font-size: 14px;
}

.detail-desc {
  margin-bottom: 14px;
}

.detail-desc p {
  margin: 8px 0 0;
  color: #475467;
}

.detail-table {
  min-width: 680px;
}

.detail-logs {
  margin-top: 14px;
}

.invoice-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  min-width: 160px;
}

.invoice-thumb {
  width: 100%;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px;
  color: var(--text);
  display: grid;
  grid-template-rows: 94px auto;
  gap: 5px;
  text-align: left;
}

.invoice-thumb:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

.invoice-thumb img {
  width: 100%;
  height: 94px;
  display: block;
  object-fit: contain;
  background: #f8fafc;
  pointer-events: none;
}

.invoice-thumb iframe {
  width: 100%;
  height: 94px;
  display: block;
  border: 0;
  background: #f8fafc;
  pointer-events: none;
}

.invoice-thumb span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  word-break: break-all;
}

.file-thumb strong {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: var(--muted);
}

.preview-media {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pdf-preview {
  border: 1px solid var(--line);
  min-height: 0;
  background: #ffffff;
}

.preview-fallback {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-page,
  .shell,
  .layout,
  .stats,
  .permission-panel,
  .module-metrics,
  .admin-actions,
  .user-form,
  .product-form,
  .bom-head,
  .bom-form,
  .module-role-row,
  .line-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .module-nav {
    grid-template-columns: 1fr 1fr;
  }

  .brand-side {
    padding: 36px 28px;
  }

  .login-panel,
  .content {
    padding: 16px;
  }

  .topbar {
    height: auto;
    padding: 16px 20px;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .topbar-title {
    align-items: flex-start;
  }

  .topbar-title img {
    width: 108px;
  }

  .top-actions {
    width: 100%;
  }

  .top-btn {
    flex: 1;
  }

  .access-request {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .stats,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-modal {
    padding: 14px;
  }
}
