:root {
  --navy: #06204a;
  --navy-2: #0a316d;
  --yellow: #ffc400;
  --ink: #10203f;
  --muted: #65748b;
  --line: #e4e9f2;
  --soft: #f6f8fc;
  --white: #ffffff;
  --danger: #c83333;
  --success: #177245;
  --shadow: 0 16px 34px rgba(6, 32, 74, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--soft);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--navy);
  color: var(--white);
  overflow-y: auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.admin-brand span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 900;
}

.admin-brand strong {
  font-size: 18px;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav a {
  padding: 11px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--yellow);
  color: var(--navy);
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 3px 0 0;
  color: var(--navy);
  font-size: 30px;
}

.topbar-actions,
.actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-card,
.metric-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.panel-card {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0;
  color: var(--navy);
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 34px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.primary-btn {
  background: var(--yellow);
  color: var(--navy);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
}

.ghost-btn.danger {
  color: var(--danger);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 6px;
  font-weight: 700;
}

.alert ul {
  margin: 8px 0 0;
}

.alert.success {
  background: #eaf8f0;
  color: var(--success);
}

.alert.error {
  background: #fff0f0;
  color: var(--danger);
}

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

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

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--navy);
  font-size: 13px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.actions-col {
  width: 180px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.on {
  background: #eaf8f0;
  color: var(--success);
}

.status-badge.off {
  background: #fff0f0;
  color: var(--danger);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.content-form {
  display: grid;
  gap: 22px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-group,
label.full {
  grid-column: 1 / -1;
}

.field-group {
  display: grid;
  gap: 10px;
  color: var(--navy);
  font-weight: 800;
}

.field-label {
  display: block;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-row {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.radio-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--yellow);
}

.menu-link-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.menu-link-field [hidden] {
  display: none !important;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

input[type="color"] {
  width: 78px;
  padding: 4px;
  cursor: pointer;
}

textarea {
  padding: 12px;
  resize: vertical;
}

.note-editor {
  border-color: var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.note-editor.note-frame .note-editing-area .note-editable {
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.note-editor .note-toolbar {
  background: var(--soft);
  border-color: var(--line);
}

.note-editor .note-btn {
  border-radius: 4px;
}

.upload-preview {
  display: block;
  width: min(260px, 100%);
  max-height: 170px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  background: var(--soft);
}

.gallery-photo-manager {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.resource-item-manager {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.gallery-photo-list {
  display: grid;
  gap: 14px;
}

.resource-item-list {
  display: grid;
  gap: 14px;
}

.gallery-photo-list.existing {
  margin-bottom: 6px;
}

.resource-item-list.existing {
  margin-bottom: 6px;
}

.resource-item-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.resource-item-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.resource-item-table th,
.resource-item-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.resource-item-table th {
  background: var(--soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.resource-item-table tr:last-child td {
  border-bottom: 0;
}

.resource-item-table th:nth-child(1),
.resource-item-table td:nth-child(1) {
  width: 22%;
}

.resource-item-table th:nth-child(2),
.resource-item-table td:nth-child(2) {
  width: 30%;
}

.resource-item-table th:nth-child(3),
.resource-item-table td:nth-child(3) {
  width: 28%;
}

.resource-item-table th:nth-child(4),
.resource-item-table td:nth-child(4) {
  width: 100px;
}

.resource-item-table th:nth-child(5),
.resource-item-table td:nth-child(5) {
  width: 96px;
}

.resource-item-table .resource-item-row {
  display: table-row;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.resource-item-image-cell {
  display: grid;
  gap: 8px;
}

.resource-item-thumb,
.resource-item-empty-image {
  display: grid;
  place-items: center;
  width: 82px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  object-fit: contain;
  text-align: center;
}

.table-action-btn {
  width: 100%;
  justify-content: center;
}

.resource-item-remove {
  align-items: center;
  min-height: 42px;
}

.gallery-photo-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.resource-item-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.gallery-photo-row img,
.new-photo-placeholder {
  width: 150px;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  object-fit: cover;
  background: var(--soft);
}

.resource-item-preview {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.resource-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}

.new-photo-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.gallery-photo-fields {
  display: grid;
  gap: 10px;
}

.resource-item-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-item-fields .full {
  grid-column: 1 / -1;
}

.cover-choice {
  justify-self: start;
}

.remove-photo {
  color: var(--danger);
}

.add-photo-btn {
  justify-self: start;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--navy);
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
}

.login-brand {
  color: var(--navy);
}

.login-card h1 {
  margin: 0 0 8px;
  color: var(--navy);
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 16px;
}

.settings-module-section {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.footer-checklist-section {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.settings-module-section h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 20px;
}

.settings-module-section p,
.footer-checklist-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.footer-checklist-section h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 20px;
}

.footer-menu-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.footer-menu-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.footer-menu-table th,
.footer-menu-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.footer-menu-table th {
  background: var(--soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.footer-menu-table tr:last-child td {
  border-bottom: 0;
}

.footer-menu-table th:first-child,
.footer-menu-table td:first-child {
  width: 92px;
  text-align: center;
}

.footer-menu-check {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  cursor: pointer;
}

.footer-menu-check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--yellow);
  cursor: pointer;
}

.footer-menu-name {
  display: inline-block;
  color: var(--navy);
}

.footer-menu-name.is-child {
  padding-left: 18px;
}

.footer-menu-url {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.settings-module-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.settings-module-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.settings-module-table th,
.settings-module-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.settings-module-table th {
  background: var(--soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.settings-module-table tr:last-child td {
  border-bottom: 0;
}

.settings-module-table td:first-child {
  width: 140px;
  color: var(--navy);
}

nav[role="navigation"] {
  margin-top: 18px;
}

.app-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.app-pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app-pagination-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.app-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.app-pagination-btn.is-active {
  border-color: var(--yellow);
  background: var(--yellow);
}

.app-pagination-btn.is-disabled {
  color: var(--muted);
  opacity: 0.55;
}

nav[role="navigation"] svg {
  display: block;
  width: 18px;
  height: 18px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-main {
    padding: 18px;
  }

  .admin-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .app-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-photo-row {
    grid-template-columns: 1fr;
  }

  .resource-item-row,
  .resource-item-fields {
    grid-template-columns: 1fr;
  }

  .gallery-photo-row img,
  .new-photo-placeholder,
  .resource-item-preview {
    width: 100%;
    max-width: 240px;
  }
}
