:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #657083;
  --line: #dfe6ef;
  --brand: #cf2338;
  --brand-dark: #9e1728;
  --navy: #14324a;
  --green: #16865f;
  --shadow: 0 18px 45px rgba(20, 50, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
}

button:hover {
  background: var(--brand-dark);
}

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

textarea {
  resize: vertical;
}

label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 50, 74, 0.92), rgba(207, 35, 56, 0.84));
}

.login-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  margin-bottom: 22px;
}

.login-panel h1,
.topbar h1,
.content-panel h2,
.side-panel h2 {
  margin: 0;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 24px;
}

.login-form,
.stacked-form {
  display: grid;
  gap: 12px;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

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

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ghost-button {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: #eef3f8;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash.error {
  background: #fde8ec;
  color: #9e1728;
}

.flash.success {
  background: #e7f6ef;
  color: #0c6948;
}

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

.metric,
.side-panel,
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 50, 74, 0.06);
}

.metric {
  padding: 18px;
  min-height: 118px;
}

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

.metric strong {
  display: block;
  font-size: 36px;
  line-height: 1.1;
  margin-top: 8px;
}

.metric small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.os-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 14px;
}

.os-list em {
  color: var(--brand);
  font-style: normal;
  font-weight: 900;
}

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

.side-panel,
.content-panel {
  padding: 18px;
}

.side-panel {
  display: grid;
  gap: 24px;
}

.recent-box {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.recent-item {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.recent-item span,
.muted,
.section-head p {
  color: var(--muted);
  font-size: 13px;
}

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

.section-head p {
  margin: 6px 0 0;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  gap: 10px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  background: #eef3f8;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

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

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .login-panel {
    padding: 26px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
  }

  td {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    border-bottom: 0;
    padding: 8px 12px;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .empty {
    display: block;
  }

  .empty::before {
    content: "";
  }
}
