:root {
  --admin-bg: #f6f7fb;
  --admin-card: rgba(255, 255, 255, .96);
  --admin-card-solid: #ffffff;
  --admin-border: rgba(15, 23, 42, .08);
  --admin-text: #111827;
  --admin-muted: #64748b;
  --admin-soft: #f8fafc;
  --admin-red: #dc2626;
  --admin-red-dark: #991b1b;
  --admin-red-soft: #fff1f2;
  --admin-green: #16a34a;
  --admin-shadow: 0 24px 70px rgba(15, 23, 42, .08);
  --admin-shadow-strong: 0 30px 90px rgba(15, 23, 42, .14);
}

/* MAIN LAYOUT */

.admin-shell,
.premium-admin {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-height: calc(100vh - 130px);
}

.glass-panel,
.admin-sidebar,
.admin-top,
.admin-form,
.asset-card,
.table-wrap,
.card,
.feature-card,
.stat {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  backdrop-filter: blur(18px);
}

/* SIDEBAR */

.admin-sidebar {
  position: sticky;
  top: 96px;
  overflow: hidden;
  padding: 18px;
  border-radius: 30px;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 18px;
  color: var(--admin-text);
  text-decoration: none;
  border-bottom: 1px solid var(--admin-border);
}

.admin-logo-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--admin-red), var(--admin-red-dark));
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(220, 38, 38, .24);
}

.admin-logo span:last-child {
  display: block;
  color: var(--admin-text);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.admin-sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.admin-sidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 16px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.admin-sidebar nav a:hover {
  transform: translateX(3px);
  color: var(--admin-red-dark);
  background: var(--admin-red-soft);
  border-color: rgba(220, 38, 38, .16);
}

/* MAIN */

.admin-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.admin-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 30px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 8%, rgba(220, 38, 38, .10), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,250,250,.94));
}

.admin-top h1 {
  margin: 8px 0;
  color: var(--admin-text);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  letter-spacing: -.05em;
}

.admin-top p {
  max-width: 760px;
  margin: 0;
  color: var(--admin-muted);
  line-height: 1.65;
}

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

/* DASHBOARD */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.stat {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border-radius: 26px;
  color: var(--admin-text);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.stat::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(220, 38, 38, .07);
}

.stat:hover {
  transform: translateY(-4px);
  border-color: rgba(220, 38, 38, .25);
  box-shadow: var(--admin-shadow-strong);
}

.stat i {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--admin-red-soft);
  color: var(--admin-red-dark);
  font-style: normal;
  font-size: 20px;
}

.stat b {
  display: block;
  color: var(--admin-text);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
}

.stat span {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 24px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(220, 38, 38, .07), transparent 34%),
    #fff;
}

.feature-card b {
  display: block;
  color: var(--admin-text);
  font-size: 17px;
  letter-spacing: -.02em;
}

.feature-card span {
  display: block;
  margin-top: 9px;
  color: var(--admin-muted);
  line-height: 1.6;
}

/* FORMS */

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
  border-radius: 30px;
}

.form-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.form-head b {
  display: block;
  color: var(--admin-text);
  font-size: 20px;
  letter-spacing: -.03em;
}

.form-head span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input:not([type]),
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .10);
  outline: none;
  background: #fff;
  color: var(--admin-text);
  font-size: 14px;
  font-weight: 700;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.admin-form textarea {
  min-height: 110px;
  padding: 14px 15px;
  resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(220, 38, 38, .42);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .09);
}

.admin-form label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--admin-soft);
  border: 1px solid rgba(15, 23, 42, .07);
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.admin-form label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-red);
}

.admin-form button,
.admin-form > button {
  min-height: 50px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--admin-red), var(--admin-red-dark));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(220, 38, 38, .23);
  transition: transform .16s ease, box-shadow .16s ease;
}

.admin-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(220, 38, 38, .28);
}

.file-drop {
  grid-column: 1 / -1;
  min-height: 88px !important;
  justify-content: center;
  text-align: center;
  border-style: dashed !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(220, 38, 38, .08), transparent 40%),
    #fff !important;
  cursor: pointer;
}

.file-drop input[type="file"] {
  display: none;
}

.file-drop span {
  color: var(--admin-red-dark);
  font-weight: 900;
}

/* CARDS / ASSETS */

.asset-board,
.admin-card-grid,
.room-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.asset-card,
.card {
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  padding: 18px;
}

.asset-card {
  display: grid;
  gap: 10px;
}

.asset-card img,
.asset-wide {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 22px;
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
}

.asset-card > img:not(.asset-wide) {
  width: 96px;
  height: 96px;
  margin: 0 auto 4px;
  border-radius: 26px;
}

.asset-placeholder {
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(135deg, #111827, #7f1d1d);
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}

.asset-card b {
  display: block;
  color: var(--admin-text);
  font-size: 17px;
  letter-spacing: -.02em;
}

.asset-card small {
  display: block;
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card p {
  margin: 0;
  color: var(--admin-muted);
  line-height: 1.55;
}

.icon-card {
  text-align: center;
}

.icon-card span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 26px;
  background: var(--admin-red-soft);
  color: var(--admin-red-dark);
  font-size: 38px;
  font-weight: 900;
}

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

.pill-row span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--admin-soft);
  border: 1px solid rgba(15, 23, 42, .07);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

/* TABLES */

.table-wrap {
  overflow: auto;
  border-radius: 28px;
  background: #fff;
}

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

.table-wrap th {
  padding: 15px 16px;
  text-align: left;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.table-wrap td {
  padding: 15px 16px;
  border-top: 1px solid rgba(15, 23, 42, .07);
  color: #334155;
  vertical-align: top;
}

.table-wrap td b {
  color: var(--admin-text);
}

.table-wrap td small {
  color: var(--admin-muted);
  font-weight: 800;
}

/* DELETE / DANGER */

.delete-form,
.inline-delete {
  margin: 0;
}

.danger {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.danger:hover {
  transform: translateY(-1px);
  background: #fecaca;
}

.tiny {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 12px;
  font-size: 12px;
}

/* BUTTON COMPAT */

.admin-main .button,
.admin-top-actions .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
}

.admin-main .button.secondary,
.admin-top-actions .button.secondary {
  background: #fff;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, .09);
}

/* EMPTY STATES */

.card {
  color: var(--admin-muted);
  font-weight: 800;
  text-align: center;
}

/* RESPONSIVE */

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

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .admin-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .admin-top,
  .admin-form,
  .asset-card,
  .card {
    border-radius: 24px;
  }

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

  .form-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .admin-feature-grid,
  .asset-board,
  .admin-card-grid,
  .room-admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }
}.admin-sidebar nav a.is-active,
.admin-nav a.is-active {
  background: #fff1f2;
  color: #991b1b;
  border-color: rgba(220, 38, 38, .22);
}

.file-drop.has-file {
  border-color: rgba(22, 163, 74, .28) !important;
  background: #f0fdf4 !important;
}

.file-preview {
  width: 92px;
  height: 92px;
  margin-top: 12px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, .10);
}

button.is-loading {
  opacity: .72;
  pointer-events: none;
}