:root {
  --bg: #eef1f0;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #65716d;
  --line: #d9e0dd;
  --accent: #087c68;
  --accent-dark: #05604f;
  --accent-soft: #dff2ed;
  --blue: #376cc4;
  --coral: #c8606c;
  --amber: #a66c08;
  --shadow: 0 18px 45px rgba(25, 45, 38, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button { cursor: pointer; }

h1, h2, p { margin: 0; }

svg { width: 18px; height: 18px; stroke-width: 2.2; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 28px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.brand,
.student-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.nav-item {
  justify-content: flex-start;
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: #46534f;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.student-link {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.admin-shell {
  min-width: 0;
  padding: 32px;
}

.admin-top,
.content-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-top {
  margin-bottom: 28px;
}

.admin-top p,
.content-head p,
.panel-head p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.admin-top h1 {
  margin-top: 4px;
  font-size: 32px;
  line-height: 1.08;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.section { display: none; }
.section.active { display: grid; gap: 22px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.entity-card,
.storage-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(25, 45, 38, 0.06);
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
}

.dashboard-grid,
.storage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.panel,
.storage-total {
  padding: 18px;
}

.panel-head h2,
.content-head h2 {
  margin-top: 4px;
  font-size: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.alert-list,
.card-list {
  display: grid;
  gap: 10px;
}

.alert-card,
.entity-card {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.alert-card {
  border-radius: 8px;
  background: #f7f9f8;
}

.alert-card strong,
.entity-card strong {
  font-size: 15px;
}

.alert-card small,
.entity-card small,
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-input {
  width: min(320px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.entity-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.feedback-body {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.danger-pill {
  background: #fbeaec;
  color: #b93e4d;
}

.storage-total {
  align-content: center;
  min-height: 260px;
}

.storage-total span {
  color: var(--accent);
  font-size: 54px;
  font-weight: 950;
}

.storage-total strong,
.storage-total small {
  display: block;
}

.storage-total strong {
  margin-top: 8px;
  font-size: 20px;
}

.storage-total small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress {
  height: 10px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e7e5;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.inline-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17201d;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}

.toast.hidden { display: none; }

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell {
    padding: 20px;
  }

  .admin-top,
  .content-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid,
  .dashboard-grid,
  .storage-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) and (min-width: 861px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}
