:root {
  --ink: #172126;
  --muted: #637179;
  --line: #d9e1e5;
  --soft: #f5f7f8;
  --panel: #ffffff;
  --brand: #b78934;
  --brand-dark: #715019;
  --teal: #0f7c80;
  --green: #27834d;
  --red: #c94343;
  --blue: #286fb4;
  --amber: #c98224;
  --shadow: 0 18px 45px rgba(23, 33, 38, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #eef3f3;
}

body {
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  color: #fff;
  background: #172126;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1b2428;
  font-weight: 900;
  background: linear-gradient(135deg, #f3cf7a, #a46f1e);
}

.brand-name {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.brand-sub {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 42px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
}

.user-pill {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.5;
}

.ghost-dark {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  min-height: 38px;
  border-radius: 8px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0;
}

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

.grid {
  display: grid;
  gap: 16px;
}

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

.stat {
  min-height: 118px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.stat strong {
  font-size: 34px;
}

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

.workband {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.band-head {
  min-height: 62px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.band-body {
  padding: 18px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 124, 128, 0.12);
}

.check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.batch-list {
  display: grid;
  gap: 14px;
}

.batch-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

.btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  filter: brightness(0.96);
}

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

.btn.teal {
  background: var(--teal);
}

.btn.red {
  background: var(--red);
}

.btn.green {
  background: var(--green);
}

.btn.light {
  color: var(--ink);
  background: #edf2f3;
  border: 1px solid var(--line);
}

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

.table-actions {
  justify-content: flex-start;
  gap: 6px;
}

.table-actions .btn.small {
  min-width: 76px;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  background: #f7f9fa;
  white-space: nowrap;
}

.title-cell {
  min-width: 220px;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.s-open {
  color: #8b520e;
  background: #fff1d7;
}

.s-submitted {
  color: #1e5f88;
  background: #dff0fb;
}

.s-completed {
  color: #1f6d3f;
  background: #e0f3e6;
}

.s-rejected {
  color: #9e3434;
  background: #fae4e4;
}

.s-overdue {
  color: #9e3434;
  background: #fae4e4;
}

.s-extension {
  color: #744c9e;
  background: #efe5fa;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.thumb {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9fa;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 7px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.issue-list {
  display: grid;
  gap: 14px;
}

.issue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.issue-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 16px;
}

.issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.issue-side {
  background: #f8fafb;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  display: grid;
  gap: 10px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.log-row {
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
  background:
    linear-gradient(105deg, rgba(23, 33, 38, 0.88), rgba(23, 33, 38, 0.45)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect fill='%23dfe8e8' width='1400' height='900'/%3E%3Cg opacity='.5'%3E%3Crect x='120' y='110' width='520' height='300' fill='%23ffffff'/%3E%3Crect x='180' y='170' width='130' height='210' fill='%23a7b9ba'/%3E%3Crect x='340' y='170' width='240' height='70' fill='%23c79642'/%3E%3Crect x='340' y='265' width='240' height='115' fill='%230f7c80'/%3E%3Crect x='760' y='130' width='430' height='560' fill='%23ffffff'/%3E%3Ccircle cx='975' cy='390' r='178' fill='none' stroke='%23c79642' stroke-width='18'/%3E%3Cpath d='M802 390h346M975 214v352M854 282c73 53 167 53 242 0M854 498c73-53 167-53 242 0' stroke='%230f7c80' stroke-width='13' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.login-hero {
  color: #fff;
  padding: min(9vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.login-hero h1 {
  max-width: 620px;
  font-size: clamp(42px, 7vw, 76px);
}

.login-hero p {
  max-width: 620px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.8;
}

.login-panel {
  background: rgba(255, 255, 255, 0.94);
  padding: 44px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: #f8fafb;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(13, 22, 26, 0.56);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(860px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 18px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafb;
}

.report-block strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

  .stats,
  .filters,
  .form-grid,
  .report-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .issue-main {
    grid-template-columns: 1fr;
  }

  .issue-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }

  .login-hero {
    min-height: 48vh;
  }
}

@media (max-width: 620px) {
  body {
    background: #f4f7f8;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px 12px 10px;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(23, 33, 38, 0.18);
  }

  .sidebar .brand-lockup {
    padding: 0 0 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    font-size: 16px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
  }

  .user-pill {
    min-width: 0;
    font-size: 12px;
  }

  .ghost-dark {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .band-head {
    display: grid;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 19px;
  }

  .workband,
  .issue,
  .stat,
  .report-block,
  .empty {
    border-radius: 8px;
  }

  .band-body,
  .issue-main,
  .modal-body {
    padding: 14px;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn,
  .actions button {
    flex: 1 1 auto;
  }

  .issue-side .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .thumb {
    min-height: 82px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92svh;
    border-radius: 8px 8px 0 0;
  }

  .modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
  }

  .login-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #eef3f3;
  }

  .login-panel {
    order: 1;
    min-height: 100svh;
    padding: 24px 20px;
    align-content: center;
  }

  .login-hero {
    order: 2;
    min-height: auto;
    padding: 28px 22px;
    gap: 40px;
  }

  .login-hero h1 {
    font-size: 36px;
  }

  .login-hero p {
    font-size: 15px;
    line-height: 1.7;
  }

  input,
  select,
  textarea,
  .btn {
    min-height: 48px;
  }

  table {
    min-width: 760px;
  }
}
