
:root {
  --ink: #193238;
  --muted: #718187;
  --teal: #176b66;
  --teal2: #e5f3f0;
  --coral: #f18b72;
  --sun: #f4c85b;
  --paper: #f3f6fb;
  --line: #e7ecf3;
  --white: #fff;
  --shadow: 0 8px 28px #183b3510;
  --purple: #7657c8;
  --blue: #397bd5;
  --green: #239b78;
}

* {
  box-sizing: border-box;
}

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

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

.sidebar {
  width: 248px;
  background: linear-gradient(180deg, #123f49, #176b66 65%, #205e73);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  color: white;
  box-shadow: 5px 0 25px #163d4715;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 30px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4c85b, #f18b72);
  color: #193238;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 23px;
  box-shadow: 0 5px 15px #0002;
}

.brand strong {
  display: block;
  font-size: 16px;
  color: white;
}

.brand small {
  color: #c4e2e2;
  font-size: 11px;
}

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

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  color: #d4e9e9;
  font-size: 15px;
  cursor: pointer;
  transition: .2s ease;
}

.nav-item span {
  margin-left: 9px;
}

.nav-item:hover {
  background: #ffffff18;
  color: white;
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(110deg, #ffffff28, #ffffff12);
  color: white;
  border-color: #ffffff30;
  font-weight: 700;
  box-shadow: inset 3px 0 #f4c85b;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 0;
  color: #b9d7d8;
  font-size: 11px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 34px 18px;
}

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

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--teal);
  font-weight: 800;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 27px;
  font-weight: 800;
}

.top-actions {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 9px 13px;
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31a77d;
  box-shadow: 0 0 0 4px #31a77d20;
}

.welcome {
  background: linear-gradient(115deg, #176b66, #23877e, #397bd5);
  color: white;
  border-radius: 20px;
  padding: 27px 29px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 30px #176b6630;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.welcome:after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #ffffff12;
  right: 75px;
  top: -90px;
}

.welcome h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.welcome p {
  margin: 0;
  color: #d5eeea;
  font-size: 13px;
}

.welcome-art {
  font-size: 48px;
  opacity: .9;
  z-index: 1;
}

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

.stat,
.panel,
.form-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 19px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat:hover,
.panel:hover,
.form-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 13px 32px #183b3518;
}

.stat:nth-child(4n+1) {
  border-top: 3px solid var(--teal);
}

.stat:nth-child(4n+2) {
  border-top: 3px solid var(--blue);
}

.stat:nth-child(4n+3) {
  border-top: 3px solid var(--purple);
}

.stat:nth-child(4n+4) {
  border-top: 3px solid var(--coral);
}

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

.stat .value {
  font-size: 25px;
  font-weight: 800;
  margin-top: 9px;
}

.stat .hint {
  font-size: 11px;
  color: #9aa7a7;
  margin-top: 4px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}

.panel h3,
.form-card h3 {
  margin: 0 0 15px;
  font-size: 15px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  border: 1px dashed #d9e4df;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #f9fbfd;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-actions button,
.primary,
.secondary {
  border: 0;
  border-radius: 11px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.quick-actions button {
  background: linear-gradient(120deg, #edf7f5, #eef3ff);
  color: var(--teal);
  text-align: left;
}

.quick-actions button:hover {
  background: var(--teal);
  color: white;
  transform: translateY(-2px);
}

.primary {
  background: linear-gradient(120deg, #176b66, #238b80);
  color: white;
  box-shadow: 0 4px 12px #176b6630;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 17px #176b6640;
}

.secondary {
  background: #eef3ff;
  color: #3970b9;
}

.secondary:hover {
  background: #dfeaff;
}

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

.search {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 11px 12px;
  min-width: 220px;
  font: inherit;
  outline: none;
  transition: .2s;
}

.search:focus,
.field input:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px #176b6618;
}

.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

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

th {
  color: #526a75;
  font-size: 11px;
  background: #f0f5fa;
}

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

tbody tr:hover {
  background: #f5f9fc;
}

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

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  font: inherit;
  background: white;
  outline: none;
  transition: .2s;
}

.field.full {
  grid-column: 1/-1;
}

.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}

.pill {
  background: #fff3dd;
  color: #946b16;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 10px;
}

button:focus-visible {
  outline: 3px solid #f4c85b;
  outline-offset: 2px;
}

footer {
  padding: 24px 2px 0;
  color: #9aa7a7;
  font-size: 11px;
}

footer span {
  padding: 0 5px;
}

@media(max-width: 900px) {
  .sidebar {
    width: 205px;
  }

  .main {
    padding: 24px 20px;
  }

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

@media(max-width: 650px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 4px 7px 12px;
  }

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

  .nav-item {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 13px;
  }

  .nav-item span {
    margin-left: 5px;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 18px 13px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .welcome {
    padding: 20px;
  }

  .welcome-art {
    display: none;
  }

  .stats {
    gap: 9px;
  }

  .stat {
    padding: 13px;
  }

  .stat .value {
    font-size: 21px;
  }

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

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

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