
* {
  box-sizing: border-box;
}

:root {
  --navy: #14243a;
  --blue: #2463eb;
  --background: #f4f7fb;
  --white: #ffffff;
  --text: #182230;
  --muted: #6b7788;
  --border: #e5eaf1;
  --green: #14804a;
  --amber: #a15c00;
  --red: #c43131;
}

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

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

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 13px;
  font-weight: 600;
}

button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 235px;
  background: var(--navy);
  color: white;
  padding: 24px 15px;
}

.sidebar h2 {
  font-size: 20px;
  margin: 0 5px;
}

.subtitle {
  color: #b9c7d9;
  font-size: 12px;
  margin: 10px 5px 30px;
}

.nav {
  display: block;
  width: 100%;
  text-align: left;
  color: #dce6f4;
  background: transparent;
  margin: 5px 0;
}

.nav:hover, .nav.active {
  background: #263c59;
  color: white;
}

.sidebar-note {
  margin-top: 35px;
  color: #b9c7d9;
  font-size: 12px;
  line-height: 1.7;
}

main {
  margin-left: 235px;
}

.topbar {
  min-height: 76px;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h3 {
  margin: 0 0 6px;
}

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

.user {
  background: #edf2ff;
  color: #214fc0;
  padding: 9px 13px;
  border-radius: 20px;
  font-size: 12px;
}

.content {
  max-width: 1500px;
  margin: auto;
  padding: 28px;
}

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

.page-head h1 {
  margin: 0 0 7px;
  font-size: 26px;
}

.page-head p, .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary {
  background: #edf2ff;
  color: #214fc0;
}

.quiet {
  background: #f0f3f7;
  color: #344054;
}

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

.stat, .panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 19px;
  margin-bottom: 18px;
  box-shadow: 0 5px 20px #17283f08;
}

.stat-label, .stat-foot {
  color: var(--muted);
  font-size: 12px;
}

.stat-num {
  font-size: 28px;
  font-weight: bold;
  margin: 12px 0 6px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

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

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

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f8fafc;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  padding: 12px 10px;
}

td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

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

.status {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.green {
  color: var(--green);
  background: #e7f7ed;
}

.amber {
  color: var(--amber);
  background: #fff3d8;
}

.red {
  color: var(--red);
  background: #ffebeb;
}

.gray {
  color: #586477;
  background: #eef1f5;
}

.toolbar, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 15px;
}

.actions {
  margin: 0;
}

.small {
  font-size: 11px;
  padding: 7px 9px;
}

input, select, textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: white;
  color: var(--text);
}

.toolbar input {
  max-width: 280px;
}

.toolbar select {
  width: auto;
  min-width: 145px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12px;
  font-weight: bold;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 13px;
}

.alert {
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0;
}

.info {
  background: #edf4ff;
  color: #254e9b;
}

.warning {
  background: #fff5df;
  color: #805000;
}

.bad {
  background: #fff0f0;
  color: #9f2828;
}

.progress {
  height: 9px;
  background: #e8edf4;
  border-radius: 10px;
  overflow: hidden;
  margin: 13px 0;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.rate {
  font-size: 32px;
  font-weight: bold;
}

.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 13px;
}

.footer-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0d1b2e80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  background: white;
  border-radius: 15px;
  padding: 24px;
  width: min(540px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: 9px;
  background: var(--navy);
  color: white;
  z-index: 20;
  font-size: 13px;
}

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

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

  .content {
    padding: 20px;
  }
}

@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 12px;
  }

  .sidebar h2 {
    margin-bottom: 12px;
  }

  .subtitle, .sidebar-note {
    display: none;
  }

  .sidebar nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .nav {
    width: auto;
    white-space: nowrap;
  }

  main {
    margin-left: 0;
  }

  .content {
    padding: 14px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

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