:root {
  --bg: #c8d0d6;
  --panel: #d7dee3;
  --card: #4a5258;
  --text: #e6e8ea;
  --text-soft: #8f979c;
  --line: #2c3438;
  --accent: #aeb6bd;
  --accent-2: #737c83;
  --shadow-soft: 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 18px 34px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(120deg, #dee4e8 0%, #cfd7dd 42%, #b8c2c9 100%),
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.52), transparent 36%),
    radial-gradient(circle at 88% 86%, rgba(120, 136, 146, 0.26), transparent 30%),
    var(--bg);
  background-size: 160% 160%, auto, auto, auto;
  animation: steelShift 16s ease-in-out infinite;
}

body.modal-open {
  overflow: hidden;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.36;
}

.portal-shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

.portal-wrap {
  min-width: 0;
  padding: 0;
}

.portal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.7rem;
}

.hero {
  margin-bottom: 1.4rem;
  padding: 1.2rem 1.1rem 1.15rem;
  position: relative;
  overflow: hidden;
  background: #1f2a33;
  border-radius: 14px;
  border: 1px solid rgba(86, 102, 114, 0.55);
}

.hero::before {
  content: none;
}

.hero::after {
  content: none;
}

.hero-kicker {
  margin: 0;
  color: #8f999f;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0.2rem 0 0;
  font-family: "Teko", "Rajdhani", sans-serif;
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #cfd4d8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

.star {
  font-size: 0.74em;
  color: #dee2e6;
  margin-right: 0.2em;
}

.title-accent {
  color: #7a868f;
}

.hero p {
  margin: 0.45rem 0 0;
  color: #818d95;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.95rem;
}

.status-sidebar {
  border: 1px solid rgba(83, 102, 115, 0.28);
  background: rgba(222, 231, 237, 0.28);
  padding: 0.9rem;
  margin-top: 16.2rem;
  margin-left: 20px;
}

.status-sidebar-title,
.portal-section-kicker {
  margin: 0 0 0.7rem;
  color: #435562;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-nav {
  display: grid;
  gap: 0.45rem;
}

.status-link {
  display: block;
  padding: 0.68rem 0.78rem;
  color: #4b5b67;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  background: rgba(255, 255, 255, 0.16);
}

.status-link:hover {
  background: rgba(255, 255, 255, 0.26);
}

.status-link.is-active {
  color: #1f2a33;
  border-left-color: #2f4558;
  background: rgba(255, 255, 255, 0.38);
}

.portal-section-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0.55rem;
}

.portal-section-kicker {
  margin: 0;
}

.app-card {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 1rem 0.85rem;
  min-height: 124px;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid transparent;
  opacity: 0;
}

.app-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(225, 234, 241, 0.22) inset;
  border-color: rgba(112, 126, 136, 0.7);
}

.app-logo {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  font-weight: 700;
  color: #eceff1;
  background: linear-gradient(145deg, #5d666d, #363d42);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.4);
}

.app-logo-transparent {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.app-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}

.app-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #51606b;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.empty-state {
  margin: 0;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #111416;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(24, 33, 40, 0.48);
  z-index: 20;
}

.modal-backdrop.is-visible {
  display: flex;
}

.login-modal {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid rgba(83, 102, 115, 0.4);
  border-radius: 14px;
  background: rgba(222, 231, 237, 0.95);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.26);
  padding: 1.05rem;
  color: #4f5f6c;
}

.login-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.login-modal-title {
  margin: 0.2rem 0 0;
  font-family: "Teko", "Rajdhani", sans-serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #1f2a33;
}

.login-modal-copy {
  margin: 0.45rem 0 1rem;
  color: #5a6975;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-modal-close {
  border: none;
  background: transparent;
  color: #435562;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.modal-link-button {
  border: none;
  background: transparent;
  color: #3c5568;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.modal-link-button:hover {
  text-decoration: underline;
}

.logo-preview-modal {
  width: min(520px, calc(100vw - 32px));
}

.logo-preview-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(83, 102, 115, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.logo-preview-frame img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

@media (max-width: 860px) {
  .portal-shell {
    width: 94vw;
    padding-top: 1.4rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .status-sidebar {
    margin-top: 0;
    margin-left: 0;
    padding: 0.75rem;
  }

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

  .portal-section-head {
    justify-content: flex-start;
  }

  .admin-wrap {
    width: 94vw;
  }
}

@media (max-width: 640px) {
  .portal-topbar {
    margin-bottom: 0.9rem;
  }

  .hero {
    padding: 1rem 0.85rem 1.05rem;
  }

  .hero h1 {
    font-size: clamp(1.95rem, 10vw, 2.8rem);
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .app-card {
    min-height: 112px;
    padding: 0.85rem 0.6rem;
  }
}

@keyframes steelShift {
  0% {
    background-position: 0% 50%, 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 100% 50%, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 0% 50%, 0 0, 0 0, 0 0;
  }
}

@keyframes heroFlow {
  0% {
    background-position: 0% 40%, 0% 50%, 0% 50%;
  }
  50% {
    background-position: 100% 60%, 100% 50%, 100% 50%;
  }
  100% {
    background-position: 0% 40%, 0% 50%, 0% 50%;
  }
}

@keyframes heroFlowSoft {
  0% {
    background-position: 0% 50%, 0% 50%;
  }
  50% {
    background-position: 100% 50%, 100% 50%;
  }
  100% {
    background-position: 0% 50%, 0% 50%;
  }
}

.portal-admin-link {
  margin: 0;
  text-align: right;
}

.portal-admin-link a {
  color: #4b5b67;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.portal-admin-link a:hover {
  text-decoration: underline;
}

.admin-wrap {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding-top: 1.2rem;
}

.admin-shell {
  border: 1px solid rgba(83, 102, 115, 0.35);
  border-radius: 12px;
  background: rgba(222, 231, 237, 0.34);
  padding: 1rem;
  overflow-x: hidden;
}

.admin-alert {
  border-radius: 10px;
  padding: 0.8rem;
  margin: 0 0 0.9rem;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.admin-alert.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.admin-alert p {
  margin: 0.2rem 0;
}

.admin-success {
  border: 1px solid rgba(52, 129, 82, 0.45);
  background: rgba(87, 168, 116, 0.18);
  color: #1f5837;
}

.admin-error {
  border: 1px solid rgba(160, 70, 70, 0.45);
  background: rgba(201, 89, 89, 0.16);
  color: #6f2727;
}

.admin-form {
  display: grid;
  gap: 0.9rem;
}

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

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.admin-table thead th {
  padding: 0.55rem 0.45rem;
  background: rgba(237, 243, 247, 0.44);
  border-top: 1px solid rgba(95, 114, 126, 0.3);
  border-bottom: 1px solid rgba(95, 114, 126, 0.3);
  color: #435562;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
}

.admin-table thead th + th {
  border-left: 1px solid rgba(95, 114, 126, 0.3);
}

.admin-table thead th:first-child {
  border-left: 1px solid rgba(95, 114, 126, 0.3);
}

.admin-table thead th:last-child {
  border-right: 1px solid rgba(95, 114, 126, 0.3);
}

.admin-table thead th:nth-child(1) {
  width: 60px;
}

.admin-table thead th:nth-child(2) {
  width: 18%;
}

.admin-table thead th:nth-child(3) {
  width: 29%;
}

.admin-table thead th:nth-child(4) {
  width: 14%;
}

.admin-table thead th:nth-child(5) {
  width: 18%;
}

.admin-table thead th:nth-child(6) {
  width: 15%;
}

.admin-table tbody tr {
  border: none;
  border-radius: 0;
  background: transparent;
}

.admin-table-new {
  background: transparent;
}

.admin-table tbody td {
  min-width: 0;
  overflow: visible;
  background: rgba(237, 243, 247, 0.44);
  border-top: 1px solid rgba(95, 114, 126, 0.3);
  border-bottom: 1px solid rgba(95, 114, 126, 0.3);
}

.admin-table tbody td + td {
  border-left: 1px solid rgba(95, 114, 126, 0.3);
}

.admin-table tbody td:first-child {
  border-left: 1px solid rgba(95, 114, 126, 0.3);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.admin-table tbody td:last-child {
  border-right: 1px solid rgba(95, 114, 126, 0.3);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.admin-mobile-label {
  display: grid;
  gap: 0.22rem;
  font-size: 0.88rem;
  color: #4f5f6c;
  font-weight: 700;
}

.admin-mobile-label span {
  display: none;
}

.admin-index-label {
  min-height: 48px;
  align-content: center;
  justify-items: center;
}

.admin-index-label strong {
  color: #435562;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.admin-mobile-label input[type="text"],
.admin-mobile-label input[type="file"],
.admin-mobile-label select {
  font: inherit;
  font-size: 0.92rem;
  border: 1px solid rgba(90, 108, 121, 0.35);
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
  min-width: 0;
}

.admin-logo-cell {
  display: grid;
  gap: 0.38rem;
}

.admin-logo-link {
  color: #4b5b67;
  text-decoration: underline;
  font-weight: 700;
  word-break: break-all;
}

.admin-logo-link:hover {
  color: #2f4558;
}

.admin-upload-slot.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.admin-checkbox {
  display: flex !important;
  align-items: center;
  gap: 0.48rem;
  font-weight: 600 !important;
  font-size: 0.84rem;
  color: #4f5f6c;
}

.admin-checkbox span {
  color: #4f5f6c;
}

.admin-current-logo {
  margin: 0;
  font-size: 0.82rem;
  color: #566774;
  word-break: break-all;
}

.admin-logo-note {
  margin: 0;
  font-size: 0.78rem;
  color: #6a7a86;
}

.admin-logo-note-delete {
  color: #875c2a;
  font-weight: 700;
}

.admin-cell-options {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.admin-remove-row {
  border: 1px solid rgba(121, 77, 77, 0.28);
  border-radius: 8px;
  background: rgba(177, 94, 94, 0.1);
  color: #724141;
  padding: 0.55rem 0.72rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.admin-actions button {
  border: 1px solid rgba(50, 78, 98, 0.45);
  border-radius: 8px;
  background: #2f4558;
  color: #eaf2f8;
  padding: 0.62rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-actions a {
  color: #3c5568;
  text-decoration: none;
  font-weight: 700;
}

.admin-actions a:hover {
  text-decoration: underline;
}

.portal-sep {
  margin: 0 0.35rem;
  color: #657582;
}

.admin-user {
  margin: 0 0 0.8rem;
  color: #4f5f6c;
  font-weight: 700;
  font-size: 0.9rem;
}

.admin-user a {
  color: #3c5568;
  text-decoration: none;
}

.admin-user a:hover {
  text-decoration: underline;
}

.auth-shell {
  max-width: 520px;
}

.auth-form {
  gap: 0.7rem;
}

.auth-form label {
  display: grid;
  gap: 0.32rem;
  color: #4f5f6c;
  font-weight: 700;
  font-size: 0.92rem;
}

.auth-form input {
  font: inherit;
  color: #1f2a33;
}

@media (max-width: 980px) {
  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tbody tr {
    margin-bottom: 0.7rem;
    border-radius: 0;
    overflow: hidden;
  }

  .admin-table tbody td {
    padding: 0.55rem 0.8rem;
  }

  .admin-mobile-label span {
    display: inline;
  }

  .admin-index-label {
    min-height: auto;
    justify-items: start;
  }

  .admin-cell-options {
    padding-top: 0;
  }
}
