:root {
  --navy: #082b52;
  --navy-dark: #06192d;
  --blue: #155b86;
  --gold: #c9952e;
  --gold-light: #e0b956;
  --soft: #f4f7fb;
  --ink: #172235;
  --muted: #657489;
  --white: #ffffff;
  --border: #dde7f1;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 22px 70px rgba(8, 43, 82, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .12), transparent 28%),
    linear-gradient(135deg, #eef3f8, #f8fbff);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* PRELOADER */
.dashboard-preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at center, rgba(255, 248, 232, .98) 0, rgba(232, 238, 247, .96) 38%, rgba(6, 25, 45, .99) 100%),
    linear-gradient(135deg, var(--navy), var(--blue));
  transition: opacity .45s ease, visibility .45s ease;
}

.dashboard-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-card {
  width: min(420px, 92vw);
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  color: #fff;
}

.preloader-card img {
  width: clamp(135px, 34vw, 190px);
  background: #fff;
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

.preloader-card strong {
  font-family: "Cinzel", serif;
  font-size: clamp(1.45rem, 5vw, 2rem);
}

.preloader-card span {
  color: #e7eef8;
  font-weight: 600;
  line-height: 1.65;
}

.preloader-ring {
  width: 72px;
  height: 72px;
  border: 4px solid rgba(224, 185, 86, .32);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* LOGIN */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 248, 232, .96) 0, rgba(232, 238, 247, .92) 38%, rgba(6, 25, 45, .98) 100%),
    linear-gradient(135deg, var(--navy), var(--blue));
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.login-screen.hidden {
  display: none;
}

.login-card {
  position: relative;
  width: min(470px, 94vw);
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .16), transparent 36%),
    #fff;
  border-radius: 34px;
  padding: 36px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, .35);
  text-align: center;
  border: 1px solid rgba(201, 149, 46, .24);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%);
  animation: loginShine 4.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loginShine {
  0%, 45% { transform: translateX(-100%); }
  65%, 100% { transform: translateX(100%); }
}

.login-logo-wrap {
  width: 168px;
  height: 116px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 18px 42px rgba(8, 43, 82, .14);
  border: 1px solid rgba(201, 149, 46, .22);
}

.login-logo-wrap img {
  width: 145px;
  max-height: 96px;
  object-fit: contain;
}

.login-eyebrow,
.panel-eyebrow,
.dash-header span {
  display: block;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .76rem;
}

.login-card h1 {
  font-family: "Cinzel", serif;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 2.55rem);
  margin: 8px 0;
  line-height: 1.08;
}

.login-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.login-alert {
  margin-top: 18px;
  border-radius: 18px;
  padding: 13px 15px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, .22);
  font-weight: 800;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
}

.login-alert[hidden] {
  display: none;
}

.login-alert i {
  margin-top: 2px;
}

.login-form {
  display: grid;
  gap: 14px;
  text-align: left;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--navy);
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
}

.input-icon input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px 14px 46px;
  outline: none;
  transition: .25s ease;
  color: var(--ink);
  background: #fff;
}

.input-icon input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 149, 46, .14);
}

.login-card button,
.header-actions button,
#logoutBtn {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: .25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 14px 34px rgba(8, 43, 82, .18);
  min-height: 48px;
}

.login-card button:hover,
.header-actions button:hover,
#logoutBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(8, 43, 82, .26);
}

.login-card small {
  display: block;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.5;
}

/* LAYOUT */
.dashboard-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
}

.dashboard-app.locked {
  filter: blur(8px);
  pointer-events: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .18), transparent 36%),
    linear-gradient(180deg, #06192d, #082b52);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 18px 0 60px rgba(8, 43, 82, .18);
}

.sidebar-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-brand img {
  width: 152px;
  background: #fff;
  border-radius: 22px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .18);
}

.sidebar-brand span {
  color: #e8f0fb;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .76rem;
}

.sidebar nav {
  display: grid;
  gap: 9px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dce9f8;
  padding: 14px 15px;
  border-radius: 17px;
  font-weight: 800;
  transition: .22s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: translateX(4px);
}

.sidebar a i {
  color: var(--gold-light);
  width: 22px;
  text-align: center;
}

#logoutBtn {
  margin-top: auto;
  background: rgba(255, 255, 255, .13);
  box-shadow: none;
}

#logoutBtn:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
}

.content {
  padding: 28px;
  overflow: hidden;
  min-width: 0;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}

.dash-header h1 {
  font-family: "Cinzel", serif;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 4px 0;
  line-height: 1.08;
}

.dash-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions button:nth-child(2) {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8e8;
  border: 1px solid rgba(201, 149, 46, .36);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 22px;
  color: #6d5529;
  font-weight: 700;
  line-height: 1.65;
  box-shadow: 0 12px 34px rgba(201, 149, 46, .10);
}

.notice i {
  color: var(--gold);
  margin-top: 5px;
}

/* CARDS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.cards-grid article {
  background: #fff;
  border-radius: 26px;
  padding: 23px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  border: 1px solid rgba(221, 231, 241, .78);
  transition: .25s ease;
  min-width: 0;
}

.cards-grid article:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 80px rgba(8, 43, 82, .20);
}

.cards-grid i {
  width: 54px;
  height: 54px;
  border-radius: 19px;
  background: #fff3d8;
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.cards-grid span {
  color: var(--muted);
  font-weight: 800;
}

.cards-grid strong {
  font-size: clamp(1.55rem, 4vw, 2.05rem);
  color: var(--navy);
  line-height: 1.1;
}

/* PANELS */
.panel {
  background: #fff;
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid rgba(221, 231, 241, .78);
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: clamp(1.35rem, 3vw, 1.55rem);
  color: var(--navy);
  margin: 4px 0 0;
  line-height: 1.2;
}

.panel input {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  min-width: 300px;
  outline: none;
  transition: .22s ease;
}

.panel input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 149, 46, .12);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid #eef2f6;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 14px 13px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}

th {
  color: #516172;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: #f8fbff;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fbff;
}

td small {
  color: var(--muted);
}

.message-list {
  display: grid;
  gap: 14px;
}

.message-card {
  border: 1px solid #e7edf5;
  border-radius: 22px;
  padding: 17px;
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .08), transparent 30%),
    #fbfdff;
}

.message-card strong {
  color: var(--navy);
}

.message-card small {
  display: block;
  color: var(--muted);
  margin: 5px 0 8px;
}

.message-card p {
  margin: 0;
  line-height: 1.65;
}

.empty {
  color: var(--muted);
  padding: 18px;
  background: #f8fbff;
  border-radius: 18px;
  font-weight: 700;
}

/* FOOTER */
.dashboard-footer {
  margin-top: 24px;
  background:
    radial-gradient(circle at top left, rgba(201, 149, 46, .16), transparent 34%),
    linear-gradient(135deg, #06192d, #082b52);
  color: #fff;
  border-radius: 28px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 24px 70px rgba(8, 43, 82, .18);
}

.dashboard-footer strong {
  display: block;
  font-size: .94rem;
}

.dashboard-footer span {
  display: block;
  color: #d7e6f6;
  font-size: .82rem;
  margin-top: 4px;
}

.dashboard-developer {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #d7e6f6;
  font-weight: 800;
}

.dashboard-developer img {
  width: 112px;
  max-height: 54px;
  object-fit: contain;
  opacity: .58;
  filter: grayscale(1) brightness(.9);
  transition: .28s ease;
}

.dashboard-developer:hover img {
  opacity: 1;
  filter: grayscale(0) brightness(1.14);
  transform: scale(1.08);
}

/* TOAST */
.dashboard-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  max-width: min(430px, calc(100vw - 32px));
  background: #06192d;
  color: #fff;
  border: 1px solid rgba(224, 185, 86, .42);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: .25s ease;
}

.dashboard-toast.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dashboard-toast i {
  color: var(--gold-light);
  margin-right: 8px;
}

/* RESPONSIVE */
@media (max-width: 1180px) {
  .dashboard-app {
    grid-template-columns: 255px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-app {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-radius: 0 0 28px 28px;
  }

  .sidebar-brand {
    display: flex;
    justify-content: center;
  }

  .sidebar-brand img {
    width: 122px;
  }

  .sidebar nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sidebar a {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 6px;
    padding: 12px 8px;
    font-size: .82rem;
  }

  #logoutBtn {
    margin-top: 0;
  }

  .content {
    padding: 22px;
  }

  .dash-header {
    display: grid;
  }

  .header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    background: linear-gradient(180deg, #eef3f8, #f8fbff);
  }

  .content {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar a {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    font-size: .9rem;
  }

  .dash-header,
  .panel-head,
  .dashboard-footer {
    display: grid;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-actions button,
  #logoutBtn {
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid article {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .cards-grid article i {
    grid-row: span 2;
  }

  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .panel input {
    min-width: 0;
    width: 100%;
  }

  .notice {
    border-radius: 18px;
    padding: 13px;
    font-size: .92rem;
  }

  .dashboard-footer {
    text-align: center;
    justify-items: center;
  }

  .dashboard-developer {
    justify-content: center;
  }

  .dashboard-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tr {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(8, 43, 82, .08);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f6;
    font-size: .9rem;
    word-break: break-word;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .72rem;
  }

  .empty {
    display: block;
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 28px 22px;
    border-radius: 28px;
  }

  .login-logo-wrap {
    width: 142px;
    height: 100px;
  }

  .login-logo-wrap img {
    width: 122px;
  }

  .login-card h1 {
    font-size: 2rem;
  }

  .login-card p,
  .login-card small {
    font-size: .92rem;
  }

  .sidebar-brand {
    display: grid;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .dash-header h1 {
    font-size: 2.05rem;
  }

  .content {
    padding: 13px;
  }

  .panel {
    padding: 15px;
  }

  td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .dashboard-footer {
    padding: 18px;
    border-radius: 22px;
  }
}

@media (max-width: 380px) {
  .login-screen {
    padding: 12px;
  }

  .login-card {
    padding: 24px 18px;
  }

  .cards-grid article {
    grid-template-columns: 1fr;
  }

  .cards-grid article i {
    grid-row: auto;
  }

  .dash-header h1 {
    font-size: 1.82rem;
  }

  .panel h2 {
    font-size: 1.22rem;
  }
}