:root {
  --green: #143f82;
  --green-dark: #0b2d63;
  --gold: #8aa0bf;
  --ink: #17202a;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #f6f8fb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --info-soft: #eff8ff;
  --info: #143f82;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--green); }
.row { display: flex; flex-wrap: wrap; margin: -8px; }
.g-2, .g-3 { margin: -8px; }
.row > * { padding: 8px; width: 100%; }
.col-12 { width: 100%; }
.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9 { width: 100%; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.d-inline { display: inline; }
.w-100 { width: 100%; }
.text-muted { color: var(--muted); }
.text-end { text-align: right; }
.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table th {
  color: #475467;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f8fafc;
}
.form-label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: .9rem;
  font-weight: 700;
}
.form-control {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 94, 59, .12);
}
.form-check {
  display: flex;
  gap: 8px;
  align-items: center;
}
.form-check-input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(31, 94, 59, .22);
}
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-outline-primary {
  color: var(--green);
  border-color: rgba(31, 94, 59, .35);
  background: #fff;
}
.btn-outline-primary:hover { color: #fff; background: var(--green); }
.btn-outline-danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, .35);
  background: #fff;
}
.btn-outline-danger:hover { color: #fff; background: var(--danger); }
.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  font-size: .86rem;
}
.alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid #b2ddff;
  color: var(--info);
  background: var(--info-soft);
}
.alert-danger {
  color: var(--danger);
  border-color: #fecdca;
  background: var(--danger-soft);
}
.admin-body { background: var(--soft); }
.admin-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 28px; background: linear-gradient(180deg, #10281d, #173b2b); color: #fff; }
.brand { display: block; color: #fff; font-size: 1.05rem; font-weight: 900; text-decoration: none; margin-bottom: 34px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar a { color: rgba(255,255,255,.82); text-decoration: none; padding: 11px 12px; border-radius: 8px; }
.admin-sidebar a:hover { background: rgba(255,255,255,.09); color: #fff; }
.admin-sidebar i { width: 22px; }
.admin-main { padding: 36px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.admin-header h1 { margin: 4px 0 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.eyebrow { color: var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-panel {
  margin-bottom: 26px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .05);
}
.admin-panel h2 { font-size: 1.35rem; margin-bottom: 20px; }
.upload-box { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #fbfcfe; }
.order-input { max-width: 90px; }
.menu-list { display: grid; gap: 12px; }
.menu-row, .menu-edit-form { display: flex; align-items: center; gap: 10px; }
.menu-row { justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.menu-edit-form { flex: 1; }
.menu-visible { min-width: 92px; }
.page-create-form,
.page-edit-card {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.page-edit-card {
  background: #fff;
}
.page-edit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-edit-head span {
  color: var(--muted);
  font-size: .88rem;
}
.page-checks {
  display: grid;
  align-content: end;
  gap: 8px;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.page-delete-form {
  margin: -8px 0 20px;
  text-align: right;
}
.editor-form { padding: 18px 0 28px; border-bottom: 1px solid var(--line); }
.editor-form:last-child { border-bottom: 0; }
.section-upload-box {
  margin: 14px 0 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.section-upload-box > strong {
  display: block;
  margin-bottom: 4px;
}
.section-upload-action {
  display: flex;
  align-items: end;
}
.section-save-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: -12px 0 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-save-actions span {
  font-size: .9rem;
}
.section-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.section-media-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: .88rem;
  text-decoration: none;
}
.insert-file-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.insert-file-panel p { margin: 4px 0 10px; }
.insert-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.insert-media-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.insert-media-item > span {
  color: var(--muted);
  font-size: .88rem;
}
.local-editor {
  overflow: hidden;
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  background: #fff;
}
.local-editor.is-html-mode .editor-surface { display: none; }
.html-source {
  width: 100%;
  height: 520px;
  max-height: 65vh;
  padding: 16px;
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow: auto;
  resize: vertical;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.editor-btn,
.editor-select {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cfd6e1;
  border-radius: 6px;
  color: #344054;
  background: #fff;
  font-weight: 700;
}
.editor-btn {
  min-width: 34px;
  cursor: pointer;
}
.editor-btn:hover,
.editor-select:focus {
  border-color: var(--green);
  color: var(--green);
}
.editor-surface {
  height: 520px;
  max-height: 65vh;
  padding: 18px;
  overflow-y: auto;
  outline: none;
  color: #1f2933;
  font-size: 16px;
  line-height: 1.7;
}
.editor-surface:focus {
  box-shadow: inset 0 0 0 3px rgba(31, 94, 59, .1);
}
.editor-surface img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.editor-surface table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.editor-surface th,
.editor-surface td {
  min-width: 110px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}
.editor-surface th {
  color: var(--green-dark);
  background: #eef4fb;
  font-weight: 800;
}
.editor-surface tr:nth-child(even) td {
  background: #f9fbfd;
}
.editor-surface blockquote {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 4px solid var(--gold);
  color: var(--muted);
}
.editor-surface pre {
  padding: 14px;
  border-radius: 8px;
  background: #101828;
  color: #f9fafb;
  overflow: auto;
}
.download-upload-card {
  margin: 18px 0 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.download-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.download-upload-head strong,
.download-library-head h3 {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
}
.download-upload-head span,
.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .84rem;
}
.download-library-head {
  margin: 10px 0 14px;
}
.download-library-head p {
  margin: 4px 0 0;
}
.download-manager-list {
  display: grid;
  gap: 12px;
}
.download-manager-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.download-file-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eef4fb;
}
.download-file-icon i {
  color: var(--green);
  font-size: 1.45rem;
}
.download-edit-form {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) 100px 160px;
  gap: 10px;
}
.download-description-field,
.download-actions {
  grid-column: 1 / -1;
}
.download-actions {
  display: flex;
  gap: 8px;
}
.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}
@media (max-width: 900px) {
  .download-manager-item,
  .download-edit-form {
    grid-template-columns: 1fr;
  }
  .download-upload-head {
    align-items: stretch;
    flex-direction: column;
  }
}
.current-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.current-logo img {
  width: 76px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(182, 141, 64, .18), transparent 28%),
    linear-gradient(135deg, #f5f7fa, #e9eef2 58%, #edf5ef);
}
.auth-card {
  width: min(460px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .12);
}
.auth-card h1 {
  margin: 8px 0 8px;
  color: #101828;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.1;
}
.auth-card p { margin: 0; color: var(--muted); }
.auth-help {
  margin-top: 16px;
  text-align: center;
}
.auth-help a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}
.auth-card::before {
  content: "";
  display: block;
  width: 58px;
  height: 5px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--gold));
}
code {
  padding: 3px 6px;
  border-radius: 6px;
  color: #344054;
  background: #f2f4f7;
}

.content-list {
  display: grid;
  gap: 10px;
}

.content-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-list-item strong {
  display: block;
  color: #101828;
}

.content-list-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .9rem;
}

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

.block-item-row {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

@media (min-width: 768px) {
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.333333%; }
  .col-md-6 { width: 50%; }
  .col-md-8 { width: 66.666667%; }
  .col-md-9 { width: 75%; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-main { padding: 18px; }
  .admin-header { display: block; }
  .menu-row, .menu-edit-form { align-items: stretch; flex-direction: column; }
  .content-list-item { align-items: stretch; flex-direction: column; }
  .content-list-actions { justify-content: flex-start; }
  .editor-surface,
  .html-source {
    height: 420px;
    max-height: 58vh;
  }
  .order-input { max-width: none; }
}
