:root {
  --navy: #102f56;
  --navy-2: #0b5aa8;
  --teal: #0057b8;
  --teal-soft: #edf5fe;
  --teal-light: #f4f8fd;
  --blue-soft: #edf4fc;
  --ink: #172b4d;
  --slate: #49617d;
  --muted: #74859a;
  --line: #dce5ef;
  --surface: #ffffff;
  --white: #ffffff;
  --red: #d71920;
  --red-soft: #fff0f1;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --green: #166534;
  --green-soft: #dcfce7;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
  --shadow: 0 18px 45px rgba(0, 87, 184, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 20px;
}

h3 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 15px;
}

.muted {
  color: var(--muted);
}

.small-copy {
  font-size: 12px;
  line-height: 1.7;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.eyebrow.dark {
  margin-bottom: 8px;
  color: var(--teal);
}

.brand-english {
  color: var(--teal);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-family: "STSong", "SimSun", serif;
  font-size: 27px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  margin: 0;
  border: 0;
  border-radius: 11px;
  background: var(--teal);
  font-size: 20px;
}

.logo-panel {
  display: flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid #e1e9f2;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(0, 87, 184, 0.09);
}

.logo-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-logo {
  width: 190px;
  height: 126px;
  margin-bottom: 30px;
  padding: 8px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.15fr) minmax(420px, 0.85fr);
  background: var(--white);
}

.login-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: clamp(50px, 8vw, 110px);
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(0, 87, 184, 0.08);
  background:
    radial-gradient(circle at 90% 12%, rgba(0, 87, 184, 0.1), transparent 34%),
    radial-gradient(circle at 22% 105%, rgba(215, 25, 32, 0.06), transparent 32%),
    var(--white);
  color: var(--ink);
}

.login-brand::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  background: linear-gradient(180deg, var(--red) 0 34%, var(--teal) 34% 100%);
  content: "";
}

.login-brand::after {
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 350px;
  height: 350px;
  border: 1px solid rgba(0, 87, 184, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(0, 87, 184, 0.025),
    0 0 0 140px rgba(215, 25, 32, 0.018);
  content: "";
}

.login-brand h1 {
  max-width: 560px;
  margin-bottom: 26px;
  color: var(--navy);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.login-intro {
  max-width: 520px;
  color: var(--slate);
  font-size: 16px;
  line-height: 1.9;
}

.login-features {
  display: flex;
  margin-top: 42px;
  flex-wrap: wrap;
  gap: 10px;
}

.login-features span {
  padding: 8px 14px;
  border: 1px solid #d8e7f7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--teal);
  font-size: 12px;
}

.login-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  padding: 36px;
  place-items: center;
  background: var(--white);
}

.login-panel::before {
  position: absolute;
  right: -36px;
  bottom: -90px;
  color: rgba(0, 87, 184, 0.035);
  content: "INNO";
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: clamp(130px, 18vw, 220px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.login-panel::after {
  position: absolute;
  top: 42px;
  right: 42px;
  width: 90px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0 62%, var(--red) 62% 100%);
  content: "";
}

.login-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(420px, 100%);
  padding: 42px;
  flex-direction: column;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card-brand {
  display: flex;
  padding-bottom: 20px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e5edf5;
}

.login-card-brand img {
  width: 72px;
  height: 48px;
  object-fit: contain;
}

.login-card-brand span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 0.13em;
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.login-card p {
  margin-bottom: 0;
}

.security-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #526173;
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfd9e4;
  border-radius: 9px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

button:disabled,
a:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 40px;
  padding: 9px 17px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: var(--white);
}

.primary-button:hover {
  background: #004994;
  transform: translateY(-1px);
}

.danger-button {
  border: 1px solid #e3b8b8;
  background: var(--red-soft);
  color: var(--red);
}

.danger-button:hover {
  border-color: #d89c9c;
  background: #fecaca;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
}

.secondary-button:hover {
  border-color: #9fc1e6;
  background: var(--teal-light);
}

.secondary-button.small {
  min-height: 34px;
  padding: 6px 12px;
}

.primary-button.wide {
  width: 100%;
}

.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 650;
}

.text-button:hover {
  color: #004994;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--slate);
  font-size: 24px;
}

.icon-button:hover {
  background: var(--surface);
}

.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 228px;
  padding: 24px 16px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  box-shadow: 8px 0 28px rgba(0, 87, 184, 0.035);
}

.sidebar-brand {
  display: flex;
  padding: 0 8px 26px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand > div:last-child {
  width: 100%;
  min-width: 0;
}

.sidebar-logo {
  width: 148px;
  max-width: 100%;
  height: 92px;
  flex: 0 0 auto;
  padding: 5px;
  box-shadow: none;
}

.sidebar-brand strong {
  display: block;
  margin-bottom: 3px;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}

.sidebar-brand span {
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

#main-nav {
  display: flex;
  padding-top: 20px;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  display: flex;
  width: 100%;
  padding: 11px 13px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #435a73;
  font-size: 13px;
  text-align: left;
}

.nav-item:hover {
  background: var(--teal-light);
  color: var(--teal);
}

.nav-item.active {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--red);
}

.nav-icon {
  width: 20px;
  color: var(--teal);
  font-size: 16px;
  text-align: center;
}

.nav-item.active .nav-icon {
  color: var(--red);
}

.sidebar-foot {
  display: flex;
  padding: 16px 10px 2px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.online {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

.workspace {
  width: calc(100% - 228px);
  min-width: 0;
  margin-left: 228px;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 78px;
  padding: 14px clamp(24px, 3vw, 46px);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 87, 184, 0.25) 22%,
    var(--teal) 62%,
    var(--red) 100%
  );
  content: "";
  opacity: 0.5;
}

.breadcrumb {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.topbar h2 {
  margin: 0;
  font-size: 17px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu strong,
.user-menu span {
  display: block;
}

.user-menu strong {
  color: var(--navy);
  font-size: 12px;
}

.user-menu span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #d7e7f8;
}

.content {
  max-width: 1540px;
  padding: 32px clamp(24px, 3vw, 46px) 60px;
}

.page-section {
  display: none;
  animation: fade-in 0.2s ease-out;
}

.page-section.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-row,
.section-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.hero-row h1,
.section-heading h1 {
  margin-bottom: 8px;
}

.hero-row p,
.section-heading p {
  margin-bottom: 0;
}

.metrics-grid {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 134px;
  overflow: hidden;
  padding: 20px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.metric-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--teal);
  content: "";
}

.metric-card.danger::after {
  background: var(--red);
}

.metric-card.warning::after {
  background: var(--amber);
}

.metric-card.success::after {
  background: var(--green);
}

.metric-card span {
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  margin: auto 0 9px;
  color: var(--navy);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1;
}

.metric-card.danger strong {
  color: var(--red);
}

.metric-card.warning strong {
  color: var(--amber);
}

.metric-card.success strong {
  color: var(--green);
}

.metric-card small {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

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

.panel-heading h3,
.panel h3 {
  margin-bottom: 4px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.guidance-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(90deg, var(--teal-soft), var(--white));
}

.guidance-panel p {
  margin: 0;
  color: var(--slate);
  line-height: 1.8;
}

.guide-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-family: Georgia, serif;
  font-size: 20px;
}

.owner-bars {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
}

.owner-bar-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
}

.owner-bar-row label {
  display: block;
  overflow: hidden;
  color: var(--slate);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 10px;
  background: #e9eef3;
}

.owner-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  appearance: none;
}

.owner-progress::-webkit-progress-bar {
  border-radius: inherit;
  background: #e9eef3;
}

.owner-progress::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #439b93);
}

.owner-progress::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #439b93);
}

.owner-bar-row strong {
  color: var(--navy);
  font-size: 11px;
  text-align: right;
}

.filter-bar {
  display: grid;
  margin-bottom: 16px;
  padding: 16px;
  grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.5fr) minmax(150px, 0.5fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.filter-bar.consumption-filter {
  grid-template-columns: minmax(260px, 1fr);
}

.search-field span {
  display: block;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #6b7c8f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  color: var(--slate);
  font-size: 12px;
}

tbody tr:hover td {
  background: #fbfdfe;
}

td strong {
  color: var(--navy);
}

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.actions-column {
  width: 90px;
  text-align: right;
}

.selection-column {
  width: 46px;
  padding-right: 4px;
  padding-left: 12px;
  text-align: center;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

tr.selected-row td {
  background: #f1f8f7;
}

.inventory-table .actions-column {
  width: 205px;
}

.product-cell {
  display: flex;
  min-width: 180px;
  flex-direction: column;
  gap: 3px;
}

.product-cell strong {
  font-size: 12px;
}

.product-cell span {
  color: var(--muted);
  font-size: 10px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 8px;
  align-items: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-danger {
  background: var(--red-soft);
  color: var(--red);
}

.status-warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pending {
  background: var(--violet-soft);
  color: var(--violet);
}

.status-info {
  background: var(--blue-soft);
  color: var(--navy-2);
}

.status-success {
  background: var(--green-soft);
  color: var(--green);
}

.status-neutral {
  background: #f1f5f9;
  color: var(--muted);
}

.cell-action {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.cell-action.danger {
  background: var(--red-soft);
  color: var(--red);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.import-notes {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--slate);
  font-size: 12px;
  line-height: 1.8;
}

.file-drop {
  padding: 24px;
  border: 1px dashed #b8c8d8;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.file-drop input {
  max-width: 440px;
  padding: 8px;
  background: var(--white);
}

.consumption-current {
  display: flex;
  margin-bottom: 18px;
  padding: 15px 17px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--slate);
}

.consumption-current strong {
  color: var(--teal);
  font-size: 20px;
}

.consumption-history {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.consumption-history h3 {
  margin-top: 18px;
}

.consumption-history table {
  font-size: 11px;
}

.cell-action:hover {
  background: #d5eeeb;
}

.compact-table table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  padding: 10px 8px;
}

.pagination {
  display: flex;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--slate);
  font-size: 12px;
}

.notice-banner.warning {
  border-color: #f2d9a8;
  background: var(--amber-soft);
  color: #7c4a08;
}

.notice-banner.success {
  border-color: #b9e7c8;
  background: var(--green-soft);
  color: var(--green);
}

.reminder-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.reminder-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.reminder-card header {
  display: flex;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.reminder-card header strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
}

.reminder-card header span {
  color: var(--muted);
  font-size: 10px;
}

.reminder-card .reminder-meta {
  display: flex;
  padding: 12px 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.reminder-products {
  display: flex;
  padding: 0 20px 12px;
  flex-direction: column;
  gap: 8px;
}

.reminder-product {
  display: grid;
  padding: 9px 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
}

.reminder-product span {
  overflow: hidden;
  color: var(--slate);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-email {
  display: flex;
  padding: 8px 20px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.reminder-body {
  display: none;
  margin: 0 20px 18px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--slate);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.reminder-body.open {
  display: block;
}

.role-guide {
  display: flex;
  margin-bottom: 16px;
  padding: 12px 16px;
  flex-wrap: wrap;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}

.role-guide strong {
  color: var(--navy);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.doc-card {
  display: grid;
  padding: 24px;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(0, 87, 184, 0.055);
}

.doc-type {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 15px;
  background: var(--teal);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 18px rgba(0, 87, 184, 0.18);
}

.doc-type.workflow {
  background: var(--red);
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.16);
}

.doc-copy .eyebrow {
  margin-bottom: 7px;
}

.doc-copy h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.45;
}

.doc-copy p {
  margin-bottom: 10px;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.75;
}

.doc-copy > span {
  color: var(--muted);
  font-size: 10px;
}

.doc-card > .primary-button {
  grid-column: 2;
  justify-self: start;
}

.docs-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #dbe9f8;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--slate);
  font-size: 11px;
  line-height: 1.7;
}

.permission-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.permission-panel-heading {
  display: flex;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.permission-panel-heading h3 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 16px;
}

.permission-panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.permission-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.permission-table th,
.permission-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.permission-table thead th {
  background: var(--surface);
  color: var(--navy);
  text-align: center;
}

.permission-table thead th:first-child,
.permission-table tbody th {
  text-align: left;
}

.permission-table tbody th {
  font-weight: 500;
}

.permission-table td {
  text-align: center;
}

.permission-table .permission-group th {
  padding: 7px 14px;
  background: #eef3f7;
  color: var(--navy);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.permission-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.permission-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
  gap: 18px;
}

.form-grid {
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.smtp-status {
  display: flex;
  margin: 18px 0;
  padding: 16px;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--slate);
  font-size: 12px;
}

.smtp-status .smtp-ok {
  color: var(--green);
  font-weight: 700;
}

.smtp-status .smtp-off {
  color: var(--amber);
  font-weight: 700;
}

.config-snippet {
  padding: 15px;
  overflow: auto;
  border-radius: 10px;
  background: var(--navy);
  color: #d7e7f2;
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
}

.smtp-form {
  margin-top: 16px;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.smtp-test-area {
  display: flex;
  margin-top: 18px;
  padding-top: 16px;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.smtp-test-area label {
  flex: 1;
}

.reminder-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.reminder-switch span {
  color: var(--slate);
  font-size: 10px;
}

.reminder-toggle-cell {
  min-width: 78px;
}

.status-control {
  display: flex;
  min-width: 138px;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.status-control select {
  width: 138px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 10px;
}

.status-control small {
  color: var(--muted);
  font-size: 9px;
}

.backup-guide {
  display: flex;
  margin-bottom: 18px;
  padding: 17px 20px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(100deg, var(--teal-light), var(--white));
}

.backup-guide-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--teal);
  color: var(--white);
  font-size: 22px;
}

.backup-guide strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.backup-guide p {
  margin: 0;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.65;
}

.backup-summary-row {
  display: flex;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.backup-summary-row span:first-child {
  color: var(--navy);
  font-weight: 700;
}

.backup-file-name {
  display: inline-block;
  max-width: 390px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.backup-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.batch-filter {
  grid-template-columns: minmax(280px, 1fr);
}

.batch-guide {
  display: flex;
  margin-bottom: 16px;
  padding: 12px 16px;
  align-items: center;
  gap: 14px;
  border: 1px solid #cfe4e0;
  border-radius: 10px;
  background: var(--teal-light);
  color: var(--slate);
  font-size: 11px;
}

.batch-guide strong {
  flex: 0 0 auto;
  color: var(--teal);
}

.batch-table {
  min-width: 980px;
}

.batch-table .actions-column {
  width: 150px;
}

.quality-select {
  width: 92px;
  min-height: 32px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 10px;
}

.batch-form-note {
  margin-bottom: 17px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--teal-light);
  color: var(--slate);
  font-size: 11px;
  line-height: 1.7;
}

.sku-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sku-suggestions {
  display: flex;
  max-height: 250px;
  overflow-y: auto;
  flex-direction: column;
  gap: 5px;
}

.sku-suggestions:empty {
  display: none;
}

.sku-suggestions button {
  display: grid;
  width: 100%;
  padding: 10px 12px;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate);
  text-align: left;
  cursor: pointer;
}

.sku-suggestions button:hover {
  border-color: var(--teal);
  background: var(--teal-light);
}

.sku-suggestions strong {
  color: var(--navy);
}

.sku-suggestions span,
.sku-suggestions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-suggestions small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.sku-empty,
.sku-match {
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.sku-match.is-selected {
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 600;
}

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

.batch-detail-summary > div {
  display: flex;
  min-height: 75px;
  padding: 12px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.batch-detail-summary span,
.batch-detail-summary small {
  color: var(--muted);
  font-size: 9px;
}

.batch-detail-summary strong {
  color: var(--navy);
  font-size: 14px;
}

.batch-detail-actions {
  display: flex;
  margin-bottom: 18px;
  justify-content: flex-end;
}

.batch-files-table {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.batch-files-table td {
  font-size: 11px;
}

.batch-upload-row {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: 145px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.batch-allocation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.batch-allocation-list > div {
  display: grid;
  padding: 9px 11px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.7fr);
  gap: 10px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--slate);
  font-size: 11px;
}

.batch-allocation-list strong {
  color: var(--teal);
}

@media (max-width: 760px) {
  .batch-detail-summary {
    grid-template-columns: 1fr;
  }

  .batch-upload-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .smtp-test-area {
    align-items: stretch;
    flex-direction: column;
  }
}

.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 50px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(13, 35, 53, 0.3);
}

.modal::backdrop {
  background: rgba(10, 31, 47, 0.55);
  backdrop-filter: blur(3px);
}

.modal-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  padding: 20px 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 24px;
}

.modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.modal-form .full {
  grid-column: 1 / -1;
}

.modal-form .modal-actions {
  display: flex;
  padding-top: 8px;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.modal-form .modal-actions .danger-button {
  margin-right: auto;
}

.form-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 26px;
  bottom: 26px;
  max-width: 420px;
  padding: 13px 17px;
  transform: translateY(15px);
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--red);
}

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

.loading-row {
  padding: 38px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 340px;
    padding: 54px 34px;
  }

  .login-brand h1 {
    font-size: 42px;
  }

  .login-features {
    margin-top: 20px;
  }

  .sidebar {
    width: 74px;
    padding: 20px 10px;
  }

  .sidebar-brand {
    justify-content: center;
  }

  .sidebar-brand > div:last-child,
  .nav-item:not(.active) .nav-icon,
  .nav-item.active {
    font-size: 0;
  }

  .sidebar-logo {
    width: 50px;
    height: 42px;
    padding: 3px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .nav-icon {
    font-size: 19px;
  }

  .sidebar-foot span:last-child {
    display: none;
  }

  .workspace {
    width: calc(100% - 74px);
    margin-left: 74px;
  }

  .dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .reminder-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }

  .content {
    padding: 22px 16px 50px;
  }

  .breadcrumb,
  .user-menu > div:not(.avatar) {
    display: none;
  }

  .hero-row,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 120px;
    padding: 16px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .modal-form .full,
  .modal-form .modal-actions {
    grid-column: 1;
  }

  .login-panel {
    padding: 20px;
  }

  .login-card {
    padding: 28px 22px;
  }
}
