.admin-body {
  min-height: 100vh;
  background: #f4f6f9;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px 1fr;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 24px 18px;
  color: #d7dde7;
  background: #111827;
  border-right: 1px solid rgba(255,255,255,.08);
}

.admin-brand {
  padding: 0 8px 26px;
  color: #fff;
}

.admin-brand .brand-mark {
  color: #111827;
  background: #fff;
}

.admin-brand .brand-copy small {
  color: #8f9aab;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.09);
}

.admin-nav a,
.admin-sidebar-bottom a,
.admin-sidebar-bottom button {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: #96a2b4;
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-size: .83rem;
  font-weight: 700;
  text-align: left;
}

.admin-nav a:hover,
.admin-nav a.active,
.admin-sidebar-bottom a:hover,
.admin-sidebar-bottom button:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

.admin-nav a.active {
  background: #315fdc;
}

.admin-nav a > span,
.admin-sidebar-bottom span {
  width: 20px;
  text-align: center;
}

.admin-nav a strong {
  display: grid;
  width: 21px;
  height: 21px;
  margin-left: auto;
  place-items: center;
  color: #111827;
  background: #fff;
  border-radius: 50%;
  font-size: .63rem;
}

.admin-sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.09);
}

.admin-sidebar-bottom form,
.admin-sidebar-bottom button {
  width: 100%;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 0 34px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid #e0e5ec;
  backdrop-filter: blur(14px);
}

.admin-topbar > div {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.35;
}

.admin-topbar small {
  color: #8791a1;
  font-size: .62rem;
}

.admin-topbar strong {
  font-size: .75rem;
}

.admin-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: auto;
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 10px;
}

.admin-content {
  padding: 42px 36px 70px;
}

.admin-content > .flash-wrap {
  width: 100%;
}

.admin-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 32px;
}

.admin-page-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(2.15rem, 4vw, 3.5rem);
}

.admin-page-heading p {
  margin: 0;
  color: #768193;
}

.admin-page-heading .eyebrow {
  margin-bottom: 10px;
}

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

.admin-stats article {
  display: flex;
  min-height: 165px;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 17px;
  box-shadow: 0 8px 28px rgba(17,24,39,.04);
}

.admin-stats span {
  color: #6d7788;
  font-size: .72rem;
  font-weight: 750;
}

.admin-stats strong {
  margin: 8px 0;
  font-size: 2.45rem;
  letter-spacing: -.05em;
}

.admin-stats small {
  color: #929cab;
  font-size: .66rem;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-card {
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(17,24,39,.04);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px;
  border-bottom: 1px solid #e8ebf0;
}

.admin-card-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}

.admin-card-head p {
  margin: 0;
  color: #8b95a5;
  font-size: .68rem;
}

.admin-card-head a {
  color: #315fdc;
  font-size: .7rem;
  font-weight: 750;
}

.admin-list {
  padding: 6px 14px 14px;
}

.admin-list > a {
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid #eef1f4;
  border-radius: 9px;
}

.admin-list > a:last-child {
  border-bottom: 0;
}

.admin-list > a:hover {
  background: #f7f9fb;
}

.admin-list-icon {
  --project-accent: #3569f3;
  --project-soft: #eaf0ff;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--project-accent);
  background: var(--project-soft);
  border-radius: 11px;
  font-size: .78rem;
  font-weight: 850;
}

.admin-list > a div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-list strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list small {
  overflow: hidden;
  color: #8d97a6;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-new {
  color: #1f55d4;
  background: #eaf0ff;
}

.status-read {
  color: #8a5a13;
  background: #fff2db;
}

.status-closed {
  color: #4f5b6e;
  background: #edf0f4;
}

.admin-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #8c96a5;
  text-align: center;
}

.admin-empty > span {
  font-size: 2rem;
}

.admin-empty p {
  margin: 10px 0 0;
  color: inherit;
  font-size: .78rem;
}

.admin-empty-large {
  min-height: 420px;
}

.admin-table-card {
  overflow: hidden;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: 15px 18px;
  color: #818b9a;
  background: #f8f9fb;
  border-bottom: 1px solid #e1e5eb;
  font-size: .65rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf0f4;
  font-size: .75rem;
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fafbfd;
}

.table-project {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-project > div {
  display: flex;
  flex-direction: column;
}

.table-project strong {
  font-size: .78rem;
}

.table-project small {
  color: #8e98a7;
  font-size: .61rem;
}

.status-pill {
  display: inline-flex;
  padding: 6px 9px;
  color: #4f5a6c;
  background: #f0f2f5;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 750;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.table-actions a,
.table-actions button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: #f7f8fa;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
}

.table-actions button {
  color: #c83d50;
}

.table-actions a:hover,
.table-actions button:hover {
  background: #fff;
  border-color: #bfc7d3;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr);
  gap: 18px;
  align-items: start;
}

.form-section {
  padding: 26px;
}

.form-section-head {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6e9ee;
}

.form-section-head > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: #315fdc;
  background: #eaf0ff;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 850;
}

.form-section-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.form-section-head p {
  margin: 0;
  color: #8a94a4;
  font-size: .66rem;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section-side {
  position: sticky;
  top: 20px;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.login-form input:focus {
  background: #fff;
  border-color: #85a4ff;
  box-shadow: 0 0 0 4px rgba(53,105,243,.1);
  outline: none;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  flex-direction: row !important;
  gap: 10px !important;
  padding: 12px;
  background: #f7f9fb;
  border: 1px solid #e0e5ec;
  border-radius: 11px;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding: 18px 0;
}

.message-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 18px;
}

.message-card {
  padding: 24px;
}

.message-new {
  border-color: #9bb2f5;
  box-shadow: 0 10px 30px rgba(53,105,243,.08);
}

.message-card-head,
.message-card-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-card-head > div {
  justify-content: flex-start;
}

.message-card-head h2 {
  margin: 0 0 2px;
  font-size: .95rem;
}

.message-card-head a {
  color: #70809a;
  font-size: .67rem;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
  color: #818b9a;
  font-size: .64rem;
}

.message-meta i {
  width: 3px;
  height: 3px;
  background: #bac2cd;
  border-radius: 50%;
}

.message-body {
  min-height: 140px;
  margin: 0;
  padding: 16px;
  color: #4f5a6c;
  background: #f7f8fa;
  border-radius: 12px;
  font-size: .78rem;
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.message-actions select {
  height: 39px;
  padding: 0 30px 0 10px;
  background: #fff;
  border: 1px solid #dfe4eb;
  border-radius: 9px;
  font-size: .68rem;
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: .85fr 1.15fr;
}

.login-panel {
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: clamp(30px,7vw,90px);
  background: #fff;
}

.login-panel > .brand {
  position: absolute;
  top: 30px;
  left: clamp(30px,7vw,90px);
}

.login-copy {
  margin-bottom: 30px;
}

.login-copy h1 {
  margin-bottom: 13px;
  font-size: clamp(2.2rem,4vw,3.5rem);
}

.login-copy p {
  margin: 0;
}

.login-form {
  max-width: 480px;
}

.login-panel .back-link {
  margin-top: 28px;
}

.login-visual {
  display: flex;
  align-items: flex-end;
  padding: 70px;
  color: #fff;
  background:
    radial-gradient(circle at 76% 20%, rgba(91,132,255,.45), transparent 22rem),
    radial-gradient(circle at 10% 90%, rgba(123,79,237,.23), transparent 20rem),
    #111827;
}

.login-visual > div {
  max-width: 650px;
}

.login-visual h2 {
  font-size: clamp(2.4rem,5vw,5.2rem);
}

.login-visual ul {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.login-visual li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #bec7d4;
}

.login-visual li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #111827;
  background: #fff;
  border-radius: 50%;
  font-size: .65rem;
}

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

  .admin-dashboard-grid,
  .message-grid {
    grid-template-columns: 1fr;
  }

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

  .form-section-side {
    position: static;
  }
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    width: 250px;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%);
    transition: transform .18s ease, opacity .18s ease, visibility .18s ease;
  }

  .admin-sidebar.open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  .admin-menu-button {
    display: block;
  }

  .admin-topbar {
    padding: 0 18px;
  }

  .admin-content {
    padding: 30px 18px 60px;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 600px) {
  .admin-page-heading,
  .message-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-page-heading .button {
    width: 100%;
  }

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

  .form-section {
    padding: 20px;
  }

  .message-card {
    padding: 18px;
  }
}
