
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f7ff;
  --surface: #ffffff;
  --surface-soft: #f8f9ff;
  --text: #202747;
  --muted: #7c85a3;
  --border: #e7eaf5;
  --blue: #4776f5;
  --blue-dark: #315de0;
  --blue-soft: #edf2ff;
  --purple: #8061ee;
  --purple-soft: #f1edff;
  --green: #168a65;
  --green-soft: #e5f8f0;
  --orange: #bd7418;
  --orange-soft: #fff3df;
  --red: #d84b65;
  --red-soft: #fff0f3;
  --shadow: 0 10px 32px rgba(49, 68, 130, .055);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.hidden {
  display: none !important;
}

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

.tiny,
small {
  font-size: 11px;
}

.full {
  width: 100%;
}

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

.notice {
  margin: 16px;
  padding: 13px 16px;
  color: #76531b;
  background: #fff5d9;
  border: 1px solid #f3dfaa;
  border-radius: 12px;
}

/* Login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 10% 10%, #e1eaff 0, transparent 38%),
    radial-gradient(ellipse at 90% 85%, #eee5ff 0, transparent 40%),
    #f8f9ff;
}

.login-card {
  width: min(100%, 410px);
  padding: 38px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 25px;
  box-shadow: 0 24px 80px rgba(61, 76, 143, .12);
}

.brand-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  color: white;
  font-size: 27px;
  font-weight: 800;
  border-radius: 17px;
  background: linear-gradient(135deg, #4b83ff, #8762ed);
  box-shadow: 0 9px 22px rgba(94, 105, 235, .24);
}

.brand-icon.small-icon {
  width: 41px;
  height: 41px;
  margin: 0;
  border-radius: 13px;
  font-size: 21px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-name span {
  margin-left: 5px;
  color: var(--purple);
}

.login-card > p {
  margin: 5px 0 27px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #47516f;
}

input,
select {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid #dfe4f1;
  border-radius: 11px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input::placeholder {
  color: #a6aec3;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(71, 118, 245, .12);
}

#loginForm label:not(:first-child) {
  margin-top: 17px;
}

#loginForm .button {
  margin-top: 23px;
}

.login-footer {
  margin-top: 25px;
  padding-top: 17px;
  color: #929bb4;
  font-size: 11px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Buttons */

.button {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  color: #46516f;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  transition: transform .16s, box-shadow .16s, background .16s;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(53, 72, 135, .09);
}

.button.primary {
  color: white;
  background: linear-gradient(120deg, #4b7df5, #5c6feb);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(71, 118, 245, .17);
}

.button.primary:hover {
  background: linear-gradient(120deg, #3d6fe9, #6855e6);
}

.purple-button {
  background: linear-gradient(120deg, #7960ee, #9472f4) !important;
}

.light-button {
  color: #526080;
  background: #fff;
}

.logout-button {
  color: #c5425c;
  background: var(--red-soft);
  border-color: #ffdae2;
}

.danger-button {
  color: #c83c58;
  background: var(--red-soft);
  border-color: #ffdae2;
}

.table-action {
  min-height: 30px;
  padding: 6px 9px;
  margin: 2px;
  white-space: nowrap;
  font-size: 10px;
}

/* Header */

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.topbar-brand,
.topbar-right,
.admin-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand-name {
  font-size: 18px;
}

.topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-account {
  max-width: 250px;
  overflow: hidden;
  color: #596482;
  font-size: 12px;
  font-weight: 600;
}

.admin-account span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21b889;
  box-shadow: 0 0 0 4px #e3f8f0;
}

/* Main layout */

.dashboard-layout {
  width: 100%;
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar-heading {
  margin: 0 12px 14px;
  color: #a0a8bf;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 12px 13px;
  color: #737d9a;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 650;
  transition: .18s;
}

.nav-item:hover {
  color: var(--blue);
  background: #f6f8ff;
}

.nav-item.active {
  color: #4167dc;
  background: linear-gradient(100deg, #edf2ff, #f2efff);
  border-color: #e6eaff;
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 17px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 15px 12px 4px;
  color: #53617f;
  font-size: 11px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .online-dot {
  margin-right: 8px;
}

.sidebar-footer .tiny {
  margin-top: 7px;
}

.main-content {
  min-width: 0;
  padding: 30px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}

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

h1 {
  margin: 5px 0;
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
}

h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.3px;
}

p {
  margin-top: 6px;
}

.version-pill {
  padding: 8px 12px;
  color: #6d59ce;
  background: var(--purple-soft);
  border: 1px solid #e5ddff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Stats */

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

.stat-card {
  min-width: 0;
  padding: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #7c85a2;
  font-size: 11px;
  font-weight: 650;
}

.stat-icon,
.section-icon,
.quick-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  font-weight: 800;
}

.stat-icon {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.blue {
  color: #3e6fe8;
  background: var(--blue-soft);
}

.purple {
  color: #7c5ce0;
  background: var(--purple-soft);
}

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

.orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.stat-number {
  margin-top: 16px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -1px;
}

.stat-caption {
  margin-top: 3px;
  color: #9aa2b8;
  font-size: 10px;
}

/* Cards */

.content-card {
  min-width: 0;
  margin-bottom: 20px;
  padding: 23px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 21px;
}

.card-heading p {
  margin-bottom: 0;
  font-size: 12px;
}

.welcome-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #4d80f6, #8b65ee);
  border-radius: 19px;
  font-size: 29px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(100, 105, 230, .2);
}

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

.quick-action {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  color: var(--text);
  text-align: left;
  background: #fbfcff;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.quick-action:hover {
  background: #f5f7ff;
  border-color: #cfd9ff;
}

.quick-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 12px;
}

.quick-action small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.quick-arrow {
  margin-left: auto;
  color: #8792b0;
}

/* Forms */

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

.field {
  min-width: 0;
}

.field small {
  display: block;
  margin-top: 6px;
  color: #929bb2;
}

.form-actions {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.form-message {
  min-height: 0;
  margin: 10px 0 0;
  color: #168363;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.form-message:empty {
  display: none;
}

.form-message.error {
  color: #ce3d58;
}

.search-input {
  width: min(100%, 240px);
  min-height: 39px;
  font-size: 12px;
}

.list-heading {
  flex-wrap: wrap;
}

/* Tables */

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 12px;
  color: #858eaa;
  background: #f8f9fe;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid #eff1f8;
  vertical-align: middle;
  font-size: 11px;
}

tbody tr:hover {
  background: #fbfcff;
}

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

.user-title {
  color: #313b5c;
  font-weight: 750;
  font-size: 12px;
}

.user-sub {
  margin-top: 4px;
  color: #939bb2;
  font-size: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  color: #64708e;
  background: #f0f2f8;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.active {
  color: #16845f;
  background: #e3f8ef;
}

.pill.inactive {
  color: #b77920;
  background: #fff3dc;
}

.pill.expired {
  color: #c83d58;
  background: #ffedf1;
}

/* Admin list */

.admins-list {
  display: grid;
  gap: 11px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  background: #fbfcff;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.admin-info {
  min-width: 0;
  flex: 1;
}

.admin-email {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 750;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.protected-label {
  color: #7656d9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
}

.security-note {
  margin-top: 18px;
  padding: 14px 16px;
  color: #625493;
  background: #f5f1ff;
  border: 1px solid #e9e0ff;
  border-radius: 12px;
  font-size: 11px;
}

.security-note p {
  margin-bottom: 0;
}

/* Footer */

.page-footer {
  padding: 20px 0 5px;
  color: #9aa2b8;
  text-align: center;
  font-size: 10px;
}

.page-footer span {
  margin: 0 5px;
  color: var(--purple);
}

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

  .dashboard-layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .main-content {
    padding: 22px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 13px 16px;
  }

  .topbar-right {
    gap: 7px;
  }

  .admin-account {
    width: 100%;
    justify-content: flex-end;
    max-width: 100%;
  }

  .dashboard-layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 15;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-heading,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .main-content {
    padding: 19px 13px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .version-pill {
    display: none;
  }

  .content-card {
    padding: 17px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 27px 22px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-number {
    font-size: 25px;
  }

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

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

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-account {
    justify-content: flex-start;
  }

  .admin-item {
    align-items: flex-start;
  }

  .admin-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .list-heading {
    align-items: flex-start;
  }

  .search-input {
    width: 100%;
  }
}
