:root {
  --bg: #eef4f2;
  --surface: #ffffff;
  --surface-soft: #f7fbf9;
  --surface-2: #e7f1ee;
  --text: #172026;
  --muted: #697781;
  --line: #dce8e3;
  --primary: #0b7a75;
  --primary-dark: #075c58;
  --primary-soft: #dff5ef;
  --accent: #e08a3e;
  --accent-soft: #fff1e5;
  --danger: #b42318;
  --ok: #167849;
  --violet: #5964c9;
  --shadow: 0 18px 45px rgba(22, 44, 48, .10);
  --shadow-hover: 0 24px 58px rgba(22, 44, 48, .16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(224, 138, 62, .12), transparent 26%),
    linear-gradient(135deg, #f5f8f7 0%, #e8f1ee 45%, #f7f5ef 100%);
  color: var(--text);
  font-family: "Segoe UI", "Nunito Sans", Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 306px;
  background: linear-gradient(180deg, #0c2f2d 0%, #102724 52%, #152a35 100%);
  color: #fff;
  overflow-y: auto;
  padding: 20px 18px;
  z-index: 10;
  box-shadow: 10px 0 28px rgba(12, 47, 45, .18);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #f4b46e);
  box-shadow: 0 12px 25px rgba(224, 138, 62, .28);
}

.brand strong {
  display: block;
  line-height: 1.2;
}

.brand small,
.topbar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.sidebar .brand small {
  color: rgba(255, 255, 255, .68);
}

nav {
  padding: 16px 0 32px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .86);
  font-size: 14px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: translateX(4px);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .10);
  color: #9ee3d4;
}

.nav-title {
  margin: 20px 12px 8px;
  color: rgba(255, 255, 255, .48);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .10em;
}

.main {
  margin-left: 306px;
  min-height: 100vh;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, .76);
  border: 1px solid rgba(220, 232, 227, .92);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0;
}

.menu-button {
  display: none;
}

.button,
button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0b8f87);
  color: #fff;
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  box-shadow: 0 10px 20px rgba(11, 122, 117, .18);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover,
button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 14px 28px rgba(11, 122, 117, .26);
  transform: translateY(-1px);
}

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

.button.danger {
  background: linear-gradient(135deg, var(--danger), #d34135);
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(8, 79, 76, .96), rgba(11, 122, 117, .92)),
    linear-gradient(45deg, rgba(255,255,255,.1) 25%, transparent 25%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: riseIn .45s ease both;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -24px;
  width: 170px;
  height: 170px;
  border: 26px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
}

.dashboard-hero h2 {
  margin: 8px 0 8px;
  max-width: 720px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.dashboard-hero p {
  margin: 0;
  max-width: 650px;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .14);
  color: #dffaf2;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-badge {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 126px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .20);
}

.hero-badge .icon {
  width: 34px;
  height: 34px;
  color: #ffc98f;
}

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

.metric-grid {
  animation: riseIn .5s ease both;
}

.card,
.panel,
.module-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(220, 232, 227, .96);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.metric-card {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -34px -44px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--primary-soft);
}

.metric-card:hover,
.module-card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  margin-bottom: 14px;
}

.metric-card:nth-child(3n) .card-icon,
.module-card:nth-child(3n) .card-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-card:nth-child(4n) .card-icon,
.module-card:nth-child(4n) .card-icon {
  color: var(--violet);
  background: #eceefd;
}

.card small,
.module-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card strong {
  display: block;
  font-size: 32px;
  margin-top: 8px;
  letter-spacing: 0;
}

.card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.panel {
  margin-bottom: 18px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.panel-spaced {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 18px;
}

.panel-header h2 .icon {
  color: var(--primary);
}

.panel-body {
  padding: 18px;
}

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

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

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

th {
  background: #f1f7f5;
  color: #34433f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

tbody tr {
  transition: background .16s ease;
}

tbody tr:hover {
  background: #fbfdfc;
}

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

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

label {
  display: grid;
  gap: 7px;
  font-weight: 750;
  color: #273631;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(11, 122, 117, .55);
  box-shadow: 0 0 0 4px rgba(11, 122, 117, .10);
  background: #fff;
}

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

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

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #e8f6ef;
  color: var(--ok);
  margin-bottom: 16px;
  border: 1px solid #cdebdc;
  box-shadow: 0 10px 22px rgba(22, 120, 73, .08);
}

.error {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff0ee;
  color: var(--danger);
  margin-bottom: 16px;
  border: 1px solid #ffd2cc;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(224, 138, 62, .18), transparent 24%),
    linear-gradient(135deg, #f5f8f7 0%, #dff0ea 100%);
}

.login-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, .94);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hover);
  padding: 30px;
  animation: riseIn .45s ease both;
}

.login-card h1 {
  margin: 0 0 6px;
}

.login-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 16px 30px rgba(11, 122, 117, .20);
}

.login-mark .icon {
  width: 30px;
  height: 30px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-2);
  color: #31514d;
  font-size: 12px;
  font-weight: 750;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.module-card {
  display: grid;
  align-content: start;
  min-height: 134px;
  padding: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.module-card:hover {
  border-color: rgba(11, 122, 117, .34);
}

.module-card strong {
  margin-bottom: 8px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .menu-button {
    display: inline-flex;
    width: 42px;
    padding: 0;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .dashboard-hero h2 {
    font-size: 27px;
  }

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

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