/* Triline Graphics — Client Portal */

:root {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1f;
  --color-text-muted: #6b6b76;
  --color-accent: #e85d3a;
  --color-accent-soft: rgba(232, 93, 58, 0.12);
  --color-border: #e8e6e3;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(300px, 72vw);
  object-fit: contain;
}

.auth-logo .logo-img {
  height: 52px;
  max-width: 320px;
}

.home-footer .logo-img {
  height: 38px;
  max-width: 260px;
}

/* —— Client portal —— */

.portal-page {
  --portal-teal: #2a8391;
  --portal-teal-dark: #1a5560;
  --portal-teal-soft: rgba(42, 131, 145, 0.14);
  --portal-cream: #f4f2ee;
  --font-serif: 'Instrument Serif', Georgia, serif;
  background: var(--portal-cream);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 0;
}

.portal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.portal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--portal-teal-dark);
  background: var(--portal-teal-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

.portal-page .btn-portal-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.portal-page .btn-portal-ghost:hover {
  border-color: var(--portal-teal);
  color: var(--portal-teal-dark);
}

.portal-page .btn-portal-primary {
  background: var(--portal-teal);
  border: 1px solid var(--portal-teal);
  color: #fff;
}

.portal-page .btn-portal-primary:hover {
  background: var(--portal-teal-dark);
  border-color: var(--portal-teal-dark);
}

.portal-hero {
  position: relative;
  padding: 56px 0 48px;
  overflow: hidden;
}

.portal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--portal-teal-dark) 0%, var(--portal-teal) 45%, #3a9aa8 100%);
  opacity: 1;
}

.portal-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.15), transparent);
}

.portal-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
}

.portal-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
  margin-bottom: 12px;
}

.portal-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.portal-hero-desc {
  font-size: 1.0625rem;
  opacity: 0.92;
  line-height: 1.55;
  max-width: 28rem;
  margin: 0 auto;
}

.portal-session {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.portal-main {
  padding: 0 0 72px;
  margin-top: -28px;
}

.portal-main-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.client-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(26, 85, 96, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.client-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(26, 85, 96, 0.14);
  border-color: rgba(42, 131, 145, 0.35);
}

.client-card-preview {
  position: relative;
  height: 168px;
  background-size: cover;
  background-position: center;
}

.client-card-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 55%);
}

.client-card-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--portal-teal-dark);
}

.client-card-status.is-live {
  background: #d4f4e4;
  color: #1a6b42;
}

.client-card-pages {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.client-card-preview-instram {
  background: linear-gradient(145deg, #2a2640 0%, #5c4fd4 50%, #9b8cff 100%);
}

.client-card-preview-amblerbev {
  background: linear-gradient(145deg, #383131 0%, #b5163a 45%, #e1af4d 100%);
}

.client-card-preview-empty {
  background: linear-gradient(145deg, var(--portal-teal-dark) 0%, var(--portal-teal) 100%);
}

.client-card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.client-card-body h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.client-card-desc {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  flex: 1;
}

.client-card-cta {
  width: 100%;
  margin-top: 8px;
  gap: 8px;
}

.client-card-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.client-card:hover .client-card-cta svg {
  transform: translateX(3px);
}

.portal-notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--portal-teal);
}

.portal-notice-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--portal-teal-soft);
  color: var(--portal-teal);
  border-radius: 10px;
}

.portal-notice-icon svg {
  width: 22px;
  height: 22px;
}

.portal-notice h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.portal-notice p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.portal-notice a {
  color: var(--portal-teal);
  font-weight: 600;
}

.portal-notice a:hover {
  text-decoration: underline;
}

.portal-footer {
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.portal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-footer p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.portal-footer a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--portal-teal);
}

.portal-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .portal-header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .portal-header .portal-logo {
    justify-content: center;
    width: 100%;
  }

  .portal-header-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .portal-hero {
    padding: 44px 0 40px;
  }

  .portal-main {
    margin-top: -20px;
  }

  .portal-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn-ghost:hover { color: var(--color-text); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn-full { width: 100%; }

/* Auth pages */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-page .auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-page .auth-logo {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 28px;
}

.login-page .auth-icon {
  margin-inline: auto;
}

.login-page .auth-card h1 {
  width: 100%;
}

.login-page .auth-desc {
  width: 100%;
  max-width: 32ch;
  margin-inline: auto;
  white-space: pre-line;
}

.login-page .auth-form {
  width: 100%;
  text-align: center;
}

.login-page .auth-form .form-group {
  text-align: center;
}

.login-page .auth-form label {
  text-align: center;
}

.login-page .form-message {
  text-align: center;
  white-space: pre-line;
}

.login-page .auth-footer-note {
  width: 100%;
  max-width: 32ch;
  margin-inline: auto;
}

.admin-page {
  min-height: 100vh;
  padding: 0;
}

.admin-page:has(#admin-login-view:not([hidden])) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  margin-bottom: 32px;
}

.auth-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  border-radius: 12px;
  color: var(--color-accent);
  margin-bottom: 20px;
}

.auth-icon svg { width: 24px; height: 24px; }

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auth-desc {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 28px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-message {
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.form-message.error { color: #c0392b; }
.form-message.success { color: #2d8a4e; }

.auth-footer-note {
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

.auth-footer-note code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Admin */

.admin-page #admin-dashboard {
  width: 100%;
}

.admin-login-card { margin: auto; }

.admin-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  margin-bottom: 32px;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-title {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.admin-header-actions {
  display: flex;
  gap: 10px;
}

.admin-main {
  padding-bottom: 64px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-card .stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.admin-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-section-head h2 {
  font-size: 1.25rem;
}

.editor-head-actions,
.editor-toolbar,
.editor-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-site-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

#editor-site,
#editor-site option {
  min-width: 220px;
  color: #1c191b;
  background: #fff;
}

#editor-site {
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 8px;
}

body.editor-page {
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

.editor-page #editor-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
}

.editor-topbar,
.editor-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-topbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.editor-page #site-editor {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.site-editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.site-editor-files,
.site-editor-stage,
.editor-inspector {
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.site-editor-files {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

#editor-search,
.editor-new-page input,
.editor-field textarea,
.editor-source {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
}

#editor-search,
.editor-new-page input {
  height: 34px;
  padding: 0 10px;
}

#editor-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}

.editor-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.editor-file:hover,
.editor-file.is-current {
  background: #f4f1ec;
}

.editor-file-kind {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.editor-new-page {
  display: grid;
  gap: 6px;
}

.editor-upload-label {
  text-align: center;
}

.site-editor-stage,
.editor-inspector {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.editor-viewport-label {
  margin-right: auto;
  margin-left: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.editor-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-radius: 10px;
  overflow: auto;
  padding: 28px 16px;
  background: #e7e2da;
}

.editor-canvas-scale {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 1440px);
  height: 900px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(28, 25, 27, 0.18);
}

.editor-canvas-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 900px;
  border: 0;
  background: #fff;
  transform-origin: top left;
}

.editor-inspector h3 {
  margin: 0;
  font-size: 0.95rem;
}

.editor-selected-tag {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.editor-style-row,
.editor-align {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-style-row label,
.editor-align button {
  font-size: 0.75rem;
}

.editor-align button {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.editor-inspector input[type="text"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 10px;
}

.editor-toolbar {
  justify-content: space-between;
}

.editor-toolbar .btn.is-active {
  background: #2a2628;
  color: #fff;
}

.editor-source,
.editor-content {
  flex: 1;
  min-height: 420px;
  overflow: auto;
}

.editor-source {
  padding: 12px;
  resize: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.editor-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-field {
  display: block;
}

.editor-field span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.editor-field textarea {
  padding: 8px 10px;
}

.editor-empty {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.editor-image-preview {
  max-width: 100%;
  height: auto;
}

.site-editor-preview iframe {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 1100px) {
  .site-editor-layout {
    grid-template-columns: 1fr;
  }

  .site-editor-preview iframe,
  .editor-canvas-wrap,
  .editor-source,
  .editor-content {
    min-height: 360px;
  }

  .editor-canvas-scale {
    width: min(100%, 1440px);
  }
}

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.table-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.code-badge,
.path-badge {
  font-size: 0.75rem;
  background: var(--color-bg);
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 6px;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-active {
  background: rgba(45, 138, 78, 0.12);
  color: #2d8a4e;
}

.status-inactive {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: transparent;
  border: none;
  padding: 0;
}

.admin-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.admin-panel h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.admin-panel-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.admin-panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input { flex: 1; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  margin: 12px 0 20px;
  cursor: pointer;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.modal-dialog h3 {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.import-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--color-accent-soft);
  border-radius: 8px;
  line-height: 1.5;
}

.import-hint-ok {
  background: rgba(45, 138, 78, 0.12);
  color: #2d6a3e;
}

.import-hint-warn {
  background: rgba(232, 93, 58, 0.12);
  color: #9a4a2e;
}

.import-hint code {
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.import-hint a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.import-server-connect {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.import-server-connect label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.import-panel h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.import-results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--color-accent);
  font-weight: 500;
}

.import-meta-row {
  margin-bottom: 20px;
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .import-meta-row {
    grid-template-columns: 1fr;
  }
}

.import-pages-title {
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.import-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.upload-name {
  display: block;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.pages-table input[type="text"],
.pages-table input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
}

.pages-table .page-file {
  background: #eee;
}

@media (max-width: 768px) {
  .import-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-stats,
  .admin-section-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   Home Page
   ============================================ */

.home-page {
  --font-serif: 'Instrument Serif', Georgia, serif;
  overflow-x: hidden;
}

.home-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 249, 247, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: 0.3s;
  overflow-x: clip;
}

.home-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.home-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.home-nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.home-nav-links a:hover {
  color: var(--color-text);
}

.home-portal-btn {
  margin-left: 8px;
}

.home-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin: 0;
  z-index: 1102;
}

.home-nav-backdrop {
  display: none;
}

.home-nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: 0.3s;
}

.home-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  max-width: 100%;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 93, 58, 0.08) 0%, transparent 60%),
    var(--color-bg);
}

.home-hero-content {
  position: relative;
}

.home-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 20px;
}

.home-hero h1 {
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.home-hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.home-hero-desc {
  max-width: 520px;
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}

.home-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.section {
  padding: 96px 0;
}

.home-section-muted {
  background: #f3f1ee;
}

.home-section-head {
  margin-bottom: 48px;
  max-width: 520px;
}

.home-section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
}

.home-section-head p {
  color: var(--color-text-muted);
  margin-top: 12px;
}

.home-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.home-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.home-service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.home-service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.home-service-card h3 {
  font-size: 1.125rem;
  margin-bottom: 10px;
}

.home-service-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.home-work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.home-work-card {
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
}

.home-work-ambler {
  background: linear-gradient(135deg, #383131 0%, #B5163A 50%, #E1AF4D 100%);
}

.home-work-instram {
  background: linear-gradient(135deg, #2a2640 0%, #7c6cff 100%);
}

.home-work-more {
  background: linear-gradient(135deg, #d4d2cf 0%, #a0a0ab 100%);
  color: var(--color-text);
}

.home-work-cta {
  text-align: center;
}

.home-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.home-about-grid h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 16px;
}

.home-about-grid p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.home-about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.home-triline-art {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 180px;
}

.home-triline-art span {
  display: block;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.home-triline-art span:nth-child(1) { width: 100%; }
.home-triline-art span:nth-child(2) { width: 75%; }
.home-triline-art span:nth-child(3) { width: 50%; }

.home-contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.home-contact-inner h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 12px;
}

.home-contact-inner > div > p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.home-contact-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-contact-details a {
  color: var(--color-accent);
  font-weight: 500;
}

.home-contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.home-contact-form input,
.home-contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}

.home-contact-form input:focus,
.home-contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.home-footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
}

.home-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.home-footer-inner p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.home-footer-portal {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
}

.home-footer-portal:hover {
  text-decoration: underline;
}

html.home-menu-open,
body.home-menu-open {
  overflow: hidden;
  height: 100%;
}

@media (max-width: 768px) {
  .home-header {
    z-index: 1101;
  }

  .home-nav {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 80px;
    padding: 14px 48px 14px 0;
  }

  .home-nav .portal-logo {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .home-nav .logo-img {
    max-width: min(260px, 85vw);
    height: 50px;
    margin: 0 auto;
  }

  .home-nav-toggle {
    display: flex;
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    margin: 0;
    flex-shrink: 0;
    order: 2;
    z-index: 2;
  }

  .home-nav-toggle.active {
    transform: translateY(-50%);
  }

  .home-nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .home-nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .home-nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .home-nav-backdrop[hidden] {
    display: none !important;
  }

  .home-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1098;
    background: rgba(26, 26, 31, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s;
  }

  .home-nav-backdrop.open {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .home-nav-links {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: var(--color-bg);
    border-top: 0 solid var(--color-border);
    box-shadow: none;
    transition:
      max-height 0.4s ease,
      opacity 0.3s ease,
      padding 0.3s ease,
      border-top-width 0.2s ease,
      box-shadow 0.3s ease,
      visibility 0.3s;
  }

  .home-nav-links.open {
    max-height: min(70vh, 520px);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 4px 0 20px;
    border-top-width: 1px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .home-nav-links li {
    width: 100%;
    list-style: none;
  }

  .home-nav-links a {
    display: block;
    padding: 16px 12px;
    font-size: 1.0625rem;
    text-align: center;
    border-radius: 8px;
  }

  .home-nav-links a:hover {
    background: rgba(0, 0, 0, 0.04);
  }

  .home-portal-btn {
    margin: 16px 0 0;
    width: 100%;
    padding: 14px 20px;
    text-align: center;
  }

  .home-services-grid,
  .home-work-grid,
  .home-about-grid,
  .home-contact-inner {
    grid-template-columns: 1fr;
  }

  .home-hero-actions {
    flex-direction: column;
  }

  .home-hero-actions .btn {
    width: 100%;
  }

  .home-footer-portal {
    display: none;
  }

  .home-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .home-footer .logo-img {
    max-width: min(260px, 85vw);
    height: 44px;
  }

  .container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-page main,
  .home-page .home-hero,
  .home-page .section {
    max-width: 100%;
    overflow-x: clip;
  }

  .home-hero {
    min-height: auto;
    padding: 96px 0 56px;
  }

  .home-hero h1 {
    font-size: clamp(2.25rem, 9vw, 2.75rem);
    overflow-wrap: anywhere;
  }

  html,
  body.home-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  html::-webkit-scrollbar,
  body.home-page::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}
