:root {
  --ink: #142d28;
  --muted: #62736e;
  --green: #0b7a5c;
  --green-dark: #075c47;
  --green-soft: #e5f3ed;
  --blue: #164c75;
  --gold: #f1bd42;
  --red: #b64242;
  --red-soft: #fff0ef;
  --paper: #ffffff;
  --canvas: #f2f5f3;
  --line: #dce5e1;
  --shadow: 0 18px 50px rgba(28, 63, 52, 0.1);
  --radius: 22px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 5%, rgba(11, 122, 92, 0.1), transparent 28rem),
    var(--canvas);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(22, 76, 117, 0.28);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.top-gap {
  margin-top: 1rem;
}

.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;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(5, 84, 64, 0.97), rgba(16, 65, 96, 0.96)),
    var(--green);
  color: white;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 34rem;
  height: 34rem;
  right: -18rem;
  bottom: -19rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgba(255, 255, 255, 0.035),
    0 0 0 8rem rgba(255, 255, 255, 0.025);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark img {
  width: 54px;
  height: 54px;
  padding: 5px;
  border-radius: 15px;
  background: white;
  object-fit: contain;
}

.brand-mark strong {
  display: block;
  font-size: 1.08rem;
  letter-spacing: 0.09em;
}

.brand-mark small {
  display: block;
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 500;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  margin: 5rem 0;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.login-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  max-width: 11ch;
}

.login-copy p {
  max-width: 35rem;
  margin: 1.5rem 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.79);
}

.login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.login-highlights span {
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  font-weight: 650;
}

.login-foot {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 6rem);
}

.login-card {
  width: min(100%, 30rem);
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 0.65rem 0 1.6rem;
  color: var(--muted);
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 1.05rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field > span,
.field > label {
  font-size: 0.83rem;
  font-weight: 750;
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 3rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #ccd8d3;
  border-radius: 13px;
  background: white;
  color: var(--ink);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

input,
select {
  min-height: 48px;
  padding: 0.72rem 0.85rem;
}

textarea {
  min-height: 112px;
  padding: 0.8rem 0.9rem;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(11, 122, 92, 0.1);
  outline: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}

.input-wrap .icon-button {
  position: absolute;
  top: 3px;
  right: 3px;
}

.button {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 780;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 8px 22px rgba(11, 122, 92, 0.2);
}

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button-danger {
  border-color: #f1c9c6;
  color: var(--red);
  background: var(--red-soft);
}

.button-wide {
  width: 100%;
}

.login-meta {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.notice {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #fff8e6;
  color: #745413;
  font-size: 0.82rem;
  line-height: 1.5;
}

.notice.error {
  background: var(--red-soft);
  color: var(--red);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.5rem 1rem 1.2rem;
  color: white;
  background:
    linear-gradient(180deg, rgba(8, 88, 67, 0.99), rgba(12, 61, 82, 0.98)),
    var(--green);
}

.sidebar .brand-mark {
  padding: 0 0.5rem;
}

.sidebar .brand-mark img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.nav {
  display: grid;
  gap: 0.25rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.nav-label {
  margin: 1rem 0.65rem 0.4rem;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.nav-button:hover,
.nav-button.active {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 1.5rem;
  text-align: center;
  font-size: 1.08rem;
}

.sidebar-account {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.account-name {
  display: block;
  font-weight: 760;
}

.account-user {
  display: block;
  margin-top: 0.18rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.76rem;
}

.logout-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  color: white;
  background: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.topbar-logout {
  white-space: nowrap;
}

.workspace {
  min-width: 0;
  padding-bottom: 5rem;
}

.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.2rem, 4vw, 3.5rem);
  border-bottom: 1px solid rgba(220, 229, 225, 0.9);
  background: rgba(242, 245, 243, 0.86);
  backdrop-filter: blur(15px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.03em;
}

.topbar-title p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.connection::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(11, 122, 92, 0.11);
}

.connection.local::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(241, 189, 66, 0.14);
}

.content {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 3rem) clamp(1.1rem, 4vw, 3.5rem);
}

.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.welcome h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3rem);
  letter-spacing: -0.055em;
}

.welcome p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.stat-card,
.panel,
.quick-card {
  border: 1px solid rgba(215, 225, 220, 0.95);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 25px rgba(34, 63, 54, 0.055);
}

.stat-card {
  min-height: 138px;
  padding: 1.2rem;
  border-radius: 18px;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin-top: 0.55rem;
  font-size: 2.15rem;
  line-height: 1;
  letter-spacing: -0.055em;
}

.stat-note {
  display: block;
  margin-top: 0.68rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.panel {
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.text-button {
  padding: 0.3rem 0;
  border: 0;
  color: var(--green);
  background: none;
  font-size: 0.78rem;
  font-weight: 750;
}

.content-list {
  display: grid;
}

.content-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.content-row:last-child {
  border-bottom: 0;
}

.content-type {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 850;
}

.content-type.urgent {
  background: var(--red-soft);
  color: var(--red);
}

.content-type.media {
  background: #eef0ff;
  color: #4b56a6;
}

.row-copy {
  min-width: 0;
}

.row-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.row-copy small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.32rem 0.52rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
}

.status.published {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status.draft {
  background: #fff6dc;
  color: #806018;
}

.quick-actions {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.quick-card {
  width: 100%;
  min-height: 94px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 16px;
  text-align: left;
}

.quick-card:hover {
  border-color: #bdd4ca;
  box-shadow: 0 9px 24px rgba(28, 63, 52, 0.09);
}

.quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 1.15rem;
}

.quick-card strong,
.quick-card small {
  display: block;
}

.quick-card strong {
  font-size: 0.85rem;
}

.quick-card small {
  margin-top: 0.24rem;
  color: var(--muted);
  line-height: 1.35;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.45rem);
  letter-spacing: -0.05em;
}

.section-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 170px;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1.2rem;
  align-items: start;
}

.editor-form {
  padding: clamp(1rem, 3vw, 1.4rem);
}

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

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.check-field {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfb;
  font-size: 0.82rem;
  font-weight: 680;
}

.check-field input {
  width: 18px;
  min-height: auto;
  height: 18px;
  accent-color: var(--green);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.preview-panel {
  position: sticky;
  top: 100px;
}

.preview-wrap {
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(11, 122, 92, 0.08), transparent 55%),
    #f5f8f6;
}

.website-preview {
  overflow: hidden;
  border: 1px solid #d4dfda;
  border-radius: 16px;
  background: white;
  box-shadow: 0 16px 34px rgba(28, 63, 52, 0.1);
}

.preview-browser {
  display: flex;
  gap: 5px;
  padding: 0.65rem;
  background: #edf1ef;
}

.preview-browser span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bdc8c3;
}

.preview-card {
  padding: 1.2rem;
}

.preview-card .preview-category {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-card h3 {
  margin: 0.5rem 0 0;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.preview-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.preview-card a {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}

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

.settings-card {
  padding: 1.25rem;
}

.settings-card h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-card > p {
  margin: 0.5rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.install-box {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  line-height: 1.5;
}

.mobile-nav {
  display: none;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.6rem;
}

.toast {
  width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #143c32;
  color: white;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease-out;
  font-size: 0.82rem;
  line-height: 1.45;
}

.toast.error {
  background: #8a3333;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 1040px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .login-page {
    display: block;
  }

  .login-brand {
    min-height: 300px;
    padding: 1.5rem;
  }

  .login-copy {
    margin: 3.4rem 0 2rem;
  }

  .login-copy h1 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .login-copy p {
    font-size: 0.92rem;
  }

  .login-foot {
    display: none;
  }

  .login-panel {
    margin-top: -1.4rem;
    padding: 0 1rem 3rem;
    position: relative;
    z-index: 2;
  }

  .login-card {
    border-radius: 23px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding-bottom: calc(5.7rem + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 66px;
    padding: 0.75rem 1rem;
  }

  .topbar-title p,
  .connection span,
  .topbar .button span {
    display: none;
  }

  .topbar-logout {
    display: inline-flex;
  }

  .topbar .button {
    min-width: 43px;
    padding: 0.65rem;
  }

  .content {
    padding: 1.2rem 1rem 2rem;
  }

  .welcome,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome .button {
    width: 100%;
  }

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

  .stat-card {
    min-height: 122px;
    padding: 1rem;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .content-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .content-row .row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .form-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .editor-actions {
    position: sticky;
    bottom: calc(4.7rem + env(safe-area-inset-bottom));
    z-index: 5;
    margin: 1.2rem -1rem -1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .editor-actions .button {
    flex: 1;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    min-height: calc(66px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.35rem 0.55rem calc(0.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    min-height: 54px;
    display: grid;
    place-items: center;
    gap: 0.15rem;
    padding: 0.28rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 720;
  }

  .mobile-nav button span:first-child {
    font-size: 1.15rem;
  }

  .mobile-nav button.active {
    color: var(--green);
    background: var(--green-soft);
  }

  .toast-region {
    bottom: calc(5.2rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
