:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --text: #1d2733;
  --muted: #64748b;
  --line: #dce3ea;
  --blue: #1d5fd1;
  --green: #13795b;
  --amber: #a16207;
  --red: #b42318;
  --teal: #0f766e;
  --ink: #14213d;
  --shadow: 0 10px 28px rgba(20, 33, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 276px;
  background: #101828;
  color: #eef4ff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #243145;
}

.brand {
  min-height: 72px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #243145;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f7c948;
  color: #1f2937;
  font-weight: 800;
}

.brand small,
.eyebrow,
.module-nav small,
.metric-card small,
.screen-block small,
.status-meta,
.phone small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.brand small {
  color: #b8c5d8;
  margin-top: 2px;
}

.module-nav {
  padding: 12px;
  overflow-y: auto;
}

.module-nav button {
  width: 100%;
  border: 0;
  color: #d7e0ef;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
}

.module-nav button:hover,
.module-nav button.active {
  background: #22314a;
  color: #ffffff;
}

.nav-index {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.72rem;
}

.app-shell {
  margin-left: 276px;
  min-height: 100vh;
}

.topbar {
  min-height: 72px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar h1,
.workspace h2,
.hero-band h2,
.system-detail h2,
.screen-block h3 {
  margin: 0;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

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

.search-box {
  min-width: 280px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.search-box span {
  font-size: 0.78rem;
  font-weight: 700;
}

.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  color: var(--text);
}

.icon-btn,
.profile-btn,
.actions button,
.filter-grid select,
.filter-grid input,
.form-grid input,
.form-grid select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.icon-btn,
.profile-btn,
.actions button {
  min-height: 38px;
  padding: 8px 12px;
  font-weight: 700;
}

.profile-btn,
.actions button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

main {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.hero-band {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-band h2 {
  font-size: 1.55rem;
  line-height: 1.2;
}

.hero-band p {
  max-width: 760px;
  color: #344054;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.role-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.role-strip span {
  background: var(--ink);
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  text-align: center;
}

.overview-grid,
.kpi-grid,
.detail-grid,
.module-grid,
.mobile-grid {
  display: grid;
  gap: 14px;
}

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

.metric-card,
.workspace,
.screen-block,
.system-detail,
.phone,
.mobile-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.metric-card strong {
  font-size: 2rem;
  color: var(--ink);
}

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

.workspace,
.system-detail {
  padding: 20px;
}

.module-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

#moduleSubtitle {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 780px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.module-grid {
  margin-top: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 14px;
}

.screen-block {
  padding: 16px;
}

.screen-block h3 {
  font-size: 1rem;
}

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

.kpi {
  border-left: 4px solid var(--blue);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

.kpi.green {
  border-left-color: var(--green);
}

.kpi.amber {
  border-left-color: var(--amber);
}

.kpi.red {
  border-left-color: var(--red);
}

.kpi.teal {
  border-left-color: var(--teal);
}

.kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 1.5rem;
}

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

.filter-grid label,
.form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-grid select,
.filter-grid input,
.form-grid input,
.form-grid select {
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  background: #eef3f8;
  color: #334155;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #075985;
}

.status.approved,
.status.active,
.status.completed,
.status.filed,
.status.selected,
.status.uploaded {
  background: #dcfce7;
  color: #166534;
}

.status.pending,
.status.upcoming,
.status.notice,
.status.missing {
  background: #fef3c7;
  color: #92400e;
}

.status.closed,
.status.rejected,
.status.leave {
  background: #fee2e2;
  color: #991b1b;
}

.list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #334155;
}

.list li {
  margin: 7px 0;
}

.stage-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: var(--surface-soft);
}

.stage b {
  color: var(--ink);
}

.system-detail {
  display: grid;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
}

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

.detail-grid article {
  border-top: 4px solid var(--teal);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.detail-grid h3 {
  margin: 0 0 8px;
}

.detail-grid ul {
  margin: 0;
  padding-left: 18px;
}

.detail-grid li {
  margin: 6px 0;
  color: #334155;
}

.mobile-grid {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: start;
}

.phone {
  padding: 12px;
  background: #1f2937;
}

.phone-screen {
  min-height: 500px;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.phone-header {
  padding: 14px;
  color: #ffffff;
  background: #1d5fd1;
}

.phone-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.phone-row {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
}

.phone-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.phone-nav span {
  padding: 10px 4px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.mobile-tile {
  padding: 14px;
}

@media (max-width: 1160px) {
  .overview-grid,
  .detail-grid,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: 280px;
  }

  .app-shell {
    margin-left: 0;
  }

  .topbar,
  .module-toolbar,
  .hero-band {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-actions,
  .actions {
    justify-content: stretch;
  }

  .search-box {
    min-width: 0;
  }

  .overview-grid,
  .detail-grid,
  .kpi-grid,
  .filter-grid,
  .form-grid,
  .mobile-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 14px;
  }
}
