@charset "UTF-8";
:root {
  --ink: #25233c;
  --muted: #72728a;
  --line: #e5e3ef;
  --bg: #f6f6fb;
  --accent: #5146c8;
  --nav: #1f1838;
  --accent-light: #c8b8ff;
  --danger: #bf494d;
  --shadow: 0 18px 55px #21173c14;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  padding: 10px 15px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
button:hover {
  background: #f0edfa;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #9478f0;
  outline-offset: 3px;
}
input,
select,
textarea {
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  max-width: 100%;
  min-width: 0;
  font-size: 13px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #c3b5f5;
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 110px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
svg.icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  flex-shrink: 0;
}
.primary {
  background: linear-gradient(115deg, #2963d8, #6942cf);
  color: #fff;
  border-color: var(--accent);
}
.primary:hover {
  background: linear-gradient(115deg, #214fb7, #5533af);
}
.danger {
  color: var(--danger);
  border-color: #efced0;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 5px;
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.initial-loading {
  margin: 20vh auto;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
}
.initial-loading img {
  width: min(320px, 78vw);
  height: auto;
}
.initial-loading p {
  font-size: 14px;
  font-weight: 400;
}
.login {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100dvh;
}
.login-brand {
  background:
    radial-gradient(ellipse at 5% 85%, #235f9b55, transparent 55%),
    linear-gradient(145deg, #21183a, #322057 65%, #201b40);
  color: white;
  padding: 60px 9%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: white;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand-logo {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #fff;
  padding: 5px 0;
  box-shadow: 0 4px 24px #160c3214;
}
.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.login-brand .brand {
  width: min(300px, 100%);
  margin-bottom: 30px;
}
.login-eyebrow {
  color: #bcb1e0;
}
.brand small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: #b4afcf;
  margin-top: 0;
  letter-spacing: 1.3px;
}
.login-brand h1 {
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1.3;
  letter-spacing: -2px;
  margin: 30px 0;
}
.login-brand h1 em {
  font-style: normal;
  color: var(--accent-light);
}
.login-brand p {
  font-size: 14px;
  line-height: 1.9;
  color: #c4bed8;
  max-width: 410px;
}
.login-pattern {
  width: 360px;
  height: 240px;
  position: relative;
  margin: 40px 0;
  background: linear-gradient(135deg, #51468c80, #29234b);
  border: 1px solid #554673;
  border-radius: 18px;
  transform: rotate(-5deg);
  box-shadow: 25px 25px 0 #54408b55;
}
.login-pattern:before {
  content: "";
  position: absolute;
  inset: 30px;
  background: repeating-linear-gradient(
    to bottom,
    #a092dc55 0,
    #a092dc55 12px,
    transparent 12px,
    transparent 48px
  );
  border-radius: 8px;
}
.login-pattern:after {
  content: "";
  position: absolute;
  right: -20px;
  top: 75px;
  background: #fff url("/icon.svg?v=20261008-snova") center / 100% no-repeat;
  color: var(--nav);
  font-size: 52px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  transform: rotate(5deg);
}
.login-foot {
  font-size: 10px;
  letter-spacing: 1px;
  color: #aca4c4;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form {
  width: 350px;
}
.login-form h2 {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 16px 0 10px;
}
.login-form > p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 36px;
}
.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin: 22px 0 8px;
}
.login-form input {
  width: 100%;
  padding: 14px;
}
.login-form .primary {
  width: 100%;
  padding: 14px;
  margin-top: 28px;
}
.error-message {
  background: #fff1f0;
  color: #a2383e;
  font-size: 13px;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.6;
}
.login-note {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding-top: 22px;
  line-height: 1.8;
  font-size: 11px;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #261b40, #19172c);
  color: #b9b2cf;
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.sidebar .brand {
  padding: 24px 18px 20px;
}
.sidebar .brand small {
  align-self: center;
  font-size: 8px;
}
.workspace-tag {
  margin: 0 18px 18px;
  background: #302548;
  border: 1px solid #514263;
  border-radius: 8px;
  font-size: 11px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e5ddf3;
}
.workspace-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
}
.nav-scroll {
  overflow: auto;
  flex: 1;
  padding: 0 14px 22px;
  scrollbar-width: thin;
  scrollbar-color: #645576 transparent;
}
.nav-group {
  font-size: 10px;
  letter-spacing: 1px;
  color: #a79ebc;
  margin: 23px 12px 9px;
}
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  font-size: 12px;
  color: #ccc5dd;
  border-radius: 7px;
  margin-bottom: 3px;
}
.nav-link:hover {
  color: white;
  background: #312548;
}
.nav-link.active {
  background: #44326e;
  color: var(--accent-light);
  box-shadow: inset 3px 0 var(--accent-light);
}
.nav-link .icon {
  width: 17px;
  height: 17px;
}
.sidebar-foot {
  font-size: 10px;
  padding: 18px 25px;
  border-top: 1px solid #403451;
  display: flex;
  justify-content: space-between;
  color: #aaa0be;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 20px;
}
.mobile-brand {
  display: none;
}
.mobile-brand img {
  display: block;
  width: 130px;
  height: auto;
}
.breadcrumbs {
  font-size: 12px;
  color: #77728b;
}
.breadcrumbs b {
  font-weight: 500;
  color: var(--ink);
  margin-left: 9px;
}
.topbar-right {
  display: flex;
  gap: 15px;
  align-items: center;
}
.today {
  font-size: 11px;
  color: #77728b;
}
.avatar {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  background: #eeebfb;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}
.user-button {
  padding: 0;
  border: 0;
  gap: 9px;
}
.user-button small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  text-align: left;
  margin-top: 3px;
}
.user-button strong {
  font-size: 12px;
}
.mobile-toggle {
  display: none;
  padding: 8px;
}
.content {
  padding: 32px 36px 45px;
  max-width: 1800px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.page-heading h1 {
  font-size: 25px;
  letter-spacing: -1px;
  margin: 8px 0;
}
.page-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.heading-actions {
  display: flex;
  gap: 8px;
}
.welcome-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--accent);
  font-size: 11px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  position: relative;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #716b83;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f0fa;
  display: grid;
  place-items: center;
  color: #8270b4;
}
.stat-value {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 12px 0;
}
.stat-value small {
  font-size: 12px;
  margin-left: 5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.stat-card p {
  font-size: 10px;
  color: var(--muted);
  margin: 10px 0 0;
}
.stat-card.accent {
  background: linear-gradient(125deg, #352061, #3c52b9);
  color: white;
  border-color: var(--accent);
}
.stat-card.accent .stat-top,
.stat-card.accent .stat-value small,
.stat-card.accent p {
  color: #e0ddff;
}
.stat-card.accent .stat-icon {
  background: #ffffff20;
  color: var(--accent-light);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 20px;
}
.dashboard-grid > * {
  min-width: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 23px;
  border-bottom: 1px solid #eef2f2;
  gap: 12px;
}
.panel-head h2 {
  font-size: 14px;
  margin: 0;
  letter-spacing: -0.4px;
}
.panel-head small {
  font-size: 10px;
  color: var(--muted);
}
.panel-body {
  padding: 22px;
}
.chart {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 15px 5px 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.bar-group {
  flex: 1 0 44px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  gap: 3px;
  min-width: 44px;
}
.bar {
  width: 40%;
  max-width: 20px;
  background: #dad2f8;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar.done {
  background: var(--accent);
}
.bar-group label {
  position: absolute;
  bottom: -20px;
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}
.chart-legend {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin: 15px 0 0;
  font-size: 10px;
  color: var(--muted);
}
.legend-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
  margin-right: 5px;
}
.legend-dot.pale {
  background: #dad2f8;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-action {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
.quick-action:hover {
  border-color: #ab99dd;
  background: #faf8ff;
}
.quick-action .icon {
  color: var(--accent);
  width: 22px;
  height: 22px;
}
.quick-action small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.notice-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #edf1f1;
}
.notice-item:last-child {
  border: 0;
}
.notice-dot {
  width: 7px;
  height: 7px;
  background: #a391d7;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.notice-item b {
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  display: block;
}
.notice-item small {
  font-size: 10px;
  color: var(--muted);
}
.recent-panel {
  margin-top: 20px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  background: #eef2f4;
  color: #67808b;
}
.badge.green {
  background: #e5f4ed;
  color: #278161;
}
.badge.blue {
  background: #e8f0fd;
  color: #5273b5;
}
.badge.orange {
  background: #fff1db;
  color: #a0772b;
}
.badge.red {
  background: #fbe9e8;
  color: #b45752;
}
.priority-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a5b5bd;
  margin-right: 6px;
}
.priority-dot.high {
  background: #d37268;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  font-size: 10px;
  color: #7c8c92;
  text-align: left;
  font-weight: 600;
  background: #fafcfc;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf1f1;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
.data-row {
  cursor: pointer;
}
.data-row:hover td {
  background: #f8f6fd;
}
.table-title {
  font-weight: 600;
  color: var(--ink);
}
.table-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  max-width: 360px;
  color: var(--muted);
}
.searchbox input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar select {
  max-width: 165px;
  padding: 10px;
}
.result-label {
  font-size: 11px;
  color: var(--muted);
  padding: 15px 20px;
  border-bottom: 1px solid #eef2f2;
  display: flex;
  justify-content: space-between;
}
.result-label strong {
  color: var(--accent);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pagination button {
  padding: 7px 11px;
}
.empty-state {
  text-align: center;
  padding: 65px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state .icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 18px;
  display: block;
}
.loading-bar {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1s infinite;
}
@keyframes loading {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}
.mobile-cards {
  display: none;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: #21173c55;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  background: var(--bg);
  width: min(740px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: white;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.drawer-head h2 {
  font-size: 19px;
  margin: 5px 0;
  letter-spacing: -0.6px;
}
.drawer-head p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0;
}
.drawer-body {
  padding: 25px 28px;
  overflow-y: auto;
  flex: 1;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}
.field.full {
  grid-column: 1/-1;
}
.field small {
  color: var(--muted);
  font-weight: 400;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-weight: 400;
}
.required {
  color: var(--accent);
}
.drawer-foot {
  padding: 17px 28px;
  background: white;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.drawer-section {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.system-workers {
  min-width: 0;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
}
.system-workers legend {
  padding: 0 7px;
  font-size: 14px;
  font-weight: 700;
}
.system-workers p {
  margin: 0 0 12px;
  line-height: 1.6;
}
.worker-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.worker-toolbar input {
  flex: 1 1 200px;
}
.worker-toolbar .badge {
  white-space: nowrap;
}
.worker-list {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.worker-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.worker-option[hidden] {
  display: none;
}
.worker-option:has(input:checked) {
  background: #f2eefb;
}
.worker-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  margin: 2px 0;
  accent-color: var(--accent);
}
.worker-person {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.worker-person small {
  font-weight: 400;
  color: var(--muted);
}
.worker-person > span {
  color: var(--muted);
}
.worker-person .worker-inactive {
  color: var(--danger);
}
.drawer-section h3 {
  font-size: 13px;
  margin: 0 0 15px;
}
.action-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-info {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  font-size: 12px;
}
.file-row a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row small {
  margin-left: auto;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--nav);
  color: white;
  padding: 14px 22px;
  z-index: 100;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  transition: transform 0.2s;
  max-width: 90%;
  line-height: 1.6;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
}
#toast.error {
  background: #8d3940;
}
.overlay-close {
  width: 34px;
  height: 34px;
  padding: 7px;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.report-grid .panel {
  min-width: 0;
}
.report-grid .table-wrap {
  max-height: 440px;
  overflow: auto;
}
.inline-error {
  padding: 18px;
  background: #fff4ed;
  color: #9f6a40;
  border: 1px solid #f0dac8;
  border-radius: 10px;
  font-size: 13px;
}
.print-area {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.advanced-filter {
  padding: 14px 20px;
  background: #fafcfc;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.advanced-filter label {
  font-size: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.advanced-filter input {
  padding: 9px;
}
.view-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 15px;
}
.view-links a {
  font-size: 11px;
  padding: 8px 12px;
  background: #eeeaf9;
  border-radius: 7px;
}
.work-footer {
  font-size: 10px;
  color: #98a5aa;
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
}
.mini-value {
  font-variant-numeric: tabular-nums;
}
.drawer .panel {
  margin-top: 14px;
}
.section-spacer {
  margin-top: 20px;
}
@media (min-width: 1600px) {
  .content {
    padding: 42px 50px;
  }
  .stats-grid {
    gap: 22px;
  }
  .stat-card {
    padding: 27px;
  }
  .dashboard-grid {
    gap: 25px;
  }
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .sidebar {
    width: 205px;
  }
  .content {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .dashboard-side .section-spacer {
    margin-top: 0;
  }
  .stat-card {
    padding: 17px;
  }
  .stat-value {
    font-size: 29px;
  }
  .today {
    display: none;
  }
}
@media (max-width: 760px) {
  .layout {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 260px;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .nav-shade {
    position: fixed;
    inset: 0;
    background: #21173c55;
    z-index: 29;
  }
  .main {
    width: 100%;
  }
  .topbar {
    height: 64px;
    padding: 0 17px;
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
  }
  .mobile-brand {
    display: block;
    flex-shrink: 0;
  }
  .topbar .user-button > span:not(.avatar) {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .breadcrumbs {
    display: none;
  }
  .topbar-right {
    gap: 9px;
    margin-left: auto;
  }
  .user-button strong {
    font-size: 11px;
  }
  .content {
    padding: 22px 16px 30px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 10px;
  }
  .page-heading h1 {
    font-size: 22px;
  }
  .page-heading p {
    font-size: 11px;
    max-width: 230px;
    line-height: 1.6;
  }
  .heading-actions button {
    font-size: 11px;
    padding: 10px;
  }
  .heading-actions .optional {
    display: none;
  }
  .eyebrow {
    font-size: 9px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-top {
    font-size: 11px;
  }
  .stat-icon {
    width: 26px;
    height: 26px;
  }
  .stat-icon .icon {
    width: 16px;
    height: 16px;
  }
  .stat-value {
    font-size: 29px;
    margin: 11px 0 8px;
  }
  .stat-card p {
    font-size: 9px;
    line-height: 1.5;
  }
  .dashboard-grid {
    gap: 18px;
  }
  .dashboard-side {
    display: block;
  }
  .dashboard-side .section-spacer {
    margin-top: 18px;
  }
  .panel-head {
    padding: 18px;
  }
  .panel-body {
    padding: 18px;
  }
  .chart {
    gap: 8px;
    height: 160px;
  }
  .table-desktop {
    display: none;
  }
  .mobile-cards {
    display: block;
  }
  .record-card {
    padding: 17px 18px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
  }
  .record-card:last-child {
    border-bottom: 0;
  }
  .record-card h3 {
    font-size: 13px;
    margin: 10px 0 13px;
    line-height: 1.7;
  }
  .card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    color: var(--muted);
  }
  .card-tags {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }
  .toolbar {
    padding: 14px;
    gap: 9px;
  }
  .searchbox {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }
  .filter-bar {
    width: 100%;
  }
  .filter-bar select {
    flex: 1;
    max-width: none;
  }
  .pagination {
    padding: 14px;
    font-size: 10px;
  }
  .pagination > div {
    gap: 8px;
  }
  .pagination select {
    padding: 6px;
  }
  .result-label {
    padding: 12px 15px;
    font-size: 10px;
  }
  .drawer-head {
    padding: 19px;
  }
  .drawer-body {
    padding: 20px;
  }
  .drawer-foot {
    padding: 14px 18px;
  }
  .form-grid {
    gap: 15px;
  }
  .field {
    font-size: 11px;
  }
  .field.full-mobile {
    grid-column: 1/-1;
  }
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    font-size: 16px;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .login {
    display: block;
  }
  .login-brand {
    padding: 28px 28px 30px;
    min-height: 260px;
  }
  .login-brand h1 {
    font-size: 30px;
    letter-spacing: -1px;
    margin: 28px 0 10px;
  }
  .login-brand p,
  .login-pattern,
  .login-foot {
    display: none;
  }
  .login-brand .brand {
    width: 230px;
    margin-bottom: 25px;
  }
  .login-panel {
    padding: 32px 26px 40px;
  }
  .login-form {
    width: 100%;
    max-width: 400px;
  }
  .login-form h2 {
    font-size: 24px;
  }
  .login-form > p {
    margin-bottom: 24px;
  }
  .login-form input {
    font-size: 16px;
  }
  .login-note {
    margin-top: 25px;
  }
  .quick-action {
    min-height: 120px;
  }
  .work-footer {
    line-height: 1.6;
  }
  .drawer-backdrop {
    padding-top: 15px;
  }
  .drawer {
    border-radius: 18px 18px 0 0;
  }
  .drawer-head {
    border-radius: 18px 18px 0 0;
  }
  .heading-actions {
    gap: 5px;
  }
  .advanced-filter label {
    flex: 1;
    min-width: 120px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field {
  min-width: 0;
}
.bar-group label {
  white-space: nowrap;
}
@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .chart {
    gap: 4px;
  }
  .bar-group label {
    font-size: 8px;
  }
  .file-row {
    flex-wrap: wrap;
  }
  .file-row a {
    max-width: 65%;
  }
}
#toast {
  visibility: hidden;
  opacity: 0;
}
#toast.show {
  visibility: visible;
  opacity: 1;
}
.mobile-toggle {
  flex-shrink: 0;
}
.file-picker {
  margin: 16px 0;
}
.file-drop-zone {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 27px 18px;
  gap: 9px;
  border: 2px dashed #b6a4e7;
  border-radius: 12px;
  background: #faf8ff;
  text-align: center;
  white-space: normal;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.file-drop-zone:hover,
.is-dragover .file-drop-zone {
  border-color: var(--accent);
  background: #eee8ff;
}
.is-dragover .file-drop-zone {
  box-shadow: 0 0 0 4px #5146c812;
}
.file-drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
  border-radius: 50%;
  background: #eae3fb;
  color: var(--accent);
}
.file-drop-icon .icon {
  width: 23px;
  height: 23px;
}
.file-drop-zone strong {
  font-size: 14px;
  line-height: 1.6;
}
.file-drop-select {
  font-size: 12px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-drop-zone small {
  font-size: 11px;
  font-weight: 400;
  color: #776889;
  line-height: 1.7;
}
.file-picker-message {
  font-size: 12px;
  line-height: 1.7;
  color: var(--accent);
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.file-picker-message:empty {
  display: none;
}
.is-error,
.file-picker-message.is-error {
  color: #a2383e;
}
.upload-queue {
  padding: 0;
  margin: 0;
  list-style: none;
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.upload-item > .icon {
  color: var(--accent);
}
.upload-file {
  min-width: 0;
  flex: 1;
}
.upload-file b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.upload-file small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.upload-item.is-error small {
  color: #a2383e;
}
.upload-status {
  flex-shrink: 0;
  font-size: 11px;
}
.is-busy .file-drop-zone {
  cursor: progress;
  opacity: 0.65;
}
.drop-touch {
  display: none;
}
@media (hover: none) and (pointer: coarse) {
  .drop-touch {
    display: inline;
  }
  .drop-desktop,
  .file-drop-select {
    display: none;
  }
}

/* The scanner opens above an existing edit drawer without replacing its form. */
.scan-input { display: flex; gap: 8px; min-width: 0; }
.scan-input input { flex: 1; width: 0; }
.scan-input button { flex-shrink: 0; min-height: 44px; color: var(--accent); }
.scan-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: #f4f0fc; font-size: 13px; overflow-wrap: anywhere; }
.scan-filter button { flex-shrink: 0; }
.scan-dialog { width: min(560px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid #dcd5ed; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 24px 90px #150e4166; overscroll-behavior: contain; }
.scan-dialog::backdrop { background: #171229b8; backdrop-filter: blur(4px); }
.scan-dialog [hidden] { display: none !important; }
.scan-head, .scan-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; }
.scan-head { border-bottom: 1px solid var(--line); }
.scan-head h2 { margin: 5px 0 0; font-size: 21px; }
.scan-head .eyebrow { color: var(--accent); }
.scan-head button { min-height: 44px; }
.scan-body { padding: 0 22px 8px; }
.scan-purpose { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 15px 0; }
.scan-mode, .scan-camera { display: flex; align-items: center; gap: 12px; font-size: 13px; margin: 12px 0; }
.scan-mode select, .scan-camera select { flex: 1; min-width: 0; font-size: 16px; }
.scan-preview { position: relative; background: #1f1838; border-radius: 12px; aspect-ratio: 16 / 10; overflow: hidden; }
.scan-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.scan-preview p { position: absolute; bottom: 6px; left: 10px; right: 10px; margin: 0; padding: 8px; border-radius: 6px; background: #171229c9; color: #f5f1ff; font-size: 12px; line-height: 1.5; text-align: center; }
.scan-guide { position: absolute; inset: 18% 10% 26%; border: 2px solid #c6b3ff; border-radius: 12px; opacity: .35; pointer-events: none; }
.is-scanning .scan-guide { opacity: .9; }
.scan-dialog.has-result .scan-preview { display: none; }
.scan-status { margin: 13px 0; font-size: 14px; line-height: 1.65; min-height: 44px; overflow-wrap: anywhere; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-actions button { flex: 1; min-height: 44px; }
.scan-result { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--accent); background: #f4f0fc; border-radius: 6px; }
.scan-result > span, .scan-result small { font-size: 12px; color: var(--muted); }
.scan-result output { display: block; margin: 8px 0; font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.scan-help { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 16px 0 8px; }
.scan-foot { position: sticky; bottom: 0; background: white; border-top: 1px solid var(--line); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.scan-foot button { min-height: 46px; }
.scan-foot .primary { flex: 1; }
@media (max-width: 560px) {
  .scan-dialog { border-radius: 16px; }
  .scan-head, .scan-foot { padding-left: 16px; padding-right: 16px; }
  .scan-body { padding-left: 16px; padding-right: 16px; }
  .scan-head h2 { font-size: 19px; }
  .scan-input input { font-size: 16px; }
  .scan-filter { padding: 10px 14px; align-items: flex-start; }
  #search-form .filter-bar { flex-wrap: wrap; }
}
