:root {
    --bg: #f4f7fc;
    --surface: #ffffff;
    --surface-alt: #f8fafd;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e3e9f2;
    --line-strong: #cfd9e8;

    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-900: #172554;

    --navy-900: #0b1730;
    --navy-800: #122043;
    --navy-700: #172a56;

    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --ok: #059669;
    --ok-soft: #ecfdf5;
    --warn: #b45309;

    --ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--brand-700);
}

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--brand-50);
    color: var(--brand-700);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

/* ---------- Shell ---------- */

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

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
    color: #e2e8f4;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.5rem;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-icon {
    flex: none;
    width: 36px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(4, 10, 28, 0.55));
}

.brand-sm {
    gap: 0.55rem;
    margin-bottom: -1.1rem;
}

.brand-sm .brand-icon {
    width: 28px;
}

.brand-sm .brand-name {
    font-size: 0.95rem;
}

.brand-text {
    display: grid;
    line-height: 1.2;
}

.brand-name {
    font-weight: 650;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.72rem;
    color: #93a2bd;
    letter-spacing: 0.02em;
}

.nav-label {
    padding: 0 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #8494b0;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.4rem;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.6rem;
    border-radius: var(--radius-sm);
    color: #c3cddf;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.side-nav a svg {
    width: 18px;
    height: 18px;
    flex: none;
    opacity: 0.75;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.side-nav a.is-active {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.side-nav a.is-active svg {
    opacity: 1;
}

.sidebar-foot {
    margin-top: auto;
    display: grid;
    gap: 0.6rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
}

.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    background: var(--brand-600);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.user-meta {
    display: grid;
    min-width: 0;
}

.user-name {
    font-weight: 550;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.78rem;
    color: #93a2bd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-signout {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #c3cddf;
}

.btn-signout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.main {
    min-width: 0;
    padding: 2rem 2.5rem 3rem;
}

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

.page-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

/* ---------- Panels ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.25rem 1.4rem 1.4rem;
}

.panel.narrow {
    max-width: 600px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 620;
    letter-spacing: -0.01em;
}

.panel-foot {
    margin: 1.1rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---------- Stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 1100px;
}

.stat {
    display: grid;
    gap: 0.3rem;
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
}

.stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    font-weight: 680;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--brand-900);
}

/* ---------- Table ---------- */

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

.table th,
.table td {
    text-align: left;
    padding: 0.8rem 0.75rem;
    vertical-align: middle;
}

.table thead th {
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-left: 1px solid var(--line);
}

.table thead th:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-right: 1px solid var(--line);
}

.table tbody td {
    border-bottom: 1px solid var(--line);
}

.table tbody tr {
    transition: background 0.12s ease;
}

.table tbody tr:hover {
    background: var(--brand-50);
}

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

.right {
    text-align: right;
}

.actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.inline {
    display: inline;
}

.empty {
    margin: 0;
    padding: 2.25rem 1rem;
    text-align: center;
    color: var(--muted);
    background: var(--surface-alt);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    border: 1px solid transparent;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-draft {
    background: var(--surface-alt);
    border-color: var(--line-strong);
    color: var(--muted);
}

.badge-published {
    background: var(--ok-soft);
    border-color: #a7f3d0;
    color: var(--ok);
}

.badge-archived {
    background: #fffbeb;
    border-color: #fde68a;
    color: var(--warn);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.95rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 560;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.btn-primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--brand-700);
    color: #fff;
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    background: var(--surface-alt);
    border-color: var(--muted);
    color: var(--ink);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    border-radius: 7px;
}

.link-danger {
    background: none;
    border: 0;
    padding: 0;
    color: var(--danger);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.link-danger:hover {
    text-decoration: underline;
}

/* ---------- Forms ---------- */

.stack {
    display: grid;
    gap: 1.1rem;
}

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

.field > span {
    font-weight: 570;
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.field em {
    font-style: normal;
    color: var(--muted);
    font-weight: 400;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    font: inherit;
    font-size: 0.925rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
    resize: vertical;
    min-height: 180px;
    line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #a3aec1;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.2rem;
}

.hint {
    color: var(--muted);
    font-size: 0.82rem;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-error {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: var(--ok-soft);
    border-color: #a7f3d0;
    color: #047857;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.muted {
    color: var(--muted);
}

/* ---------- Auth ---------- */

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    background:
        radial-gradient(1000px 500px at 50% -15%, rgba(37, 99, 235, 0.16), transparent 70%),
        linear-gradient(180deg, #f4f7fc, #e8eefa);
}

.auth-shell {
    width: min(100%, 400px);
    display: grid;
    gap: 1.5rem;
}

.auth-brand {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    text-align: center;
}

.auth-logo {
    width: min(300px, 82%);
    height: auto;
    filter: drop-shadow(0 10px 24px rgba(23, 37, 84, 0.16));
}

.auth-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
}

.auth-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.auth-foot {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Site CMS ---------- */

.level-up {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-sm);
    color: #93a2bd;
    font-size: 0.85rem;
    font-weight: 550;
    transition: background 0.15s ease, color 0.15s ease;
}

.level-up svg {
    width: 16px;
    height: 16px;
}

.level-up:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.site-context {
    display: grid;
    gap: 0.35rem;
    margin: 0 0.25rem;
    padding: 0.9rem 0.85rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.site-context-label {
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8494b0;
}

.site-context-name {
    font-size: 1.05rem;
    font-weight: 650;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.25;
    word-break: break-word;
}

.site-context-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.15rem;
}

.site-context-meta code {
    background: rgba(255, 255, 255, 0.1);
    color: #c3cddf;
}

.page-eyebrow {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.cms-summary {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.cms-summary-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    align-items: center;
}

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

.cms-summary-row:nth-child(odd) {
    background: var(--surface-alt);
}

.cms-summary-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.cms-note {
    margin: 1.25rem 0 0;
    line-height: 1.55;
}

.panel.narrow-lg {
    max-width: 760px;
}

.panel.page-editor {
    max-width: 920px;
}

.editor-meta {
    display: grid;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.builder {
    display: grid;
    gap: 1rem;
}

.builder-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.builder-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
}

.builder-add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.builder-list {
    display: grid;
    gap: 0.85rem;
}

.builder-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.builder-block.is-dragging {
    opacity: 0.55;
}

.builder-block.is-drop-target {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.builder-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.builder-block-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.builder-handle {
    color: #94a3b8;
    cursor: grab;
    letter-spacing: -0.12em;
    user-select: none;
    font-size: 0.85rem;
}

.builder-type {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

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

.builder-block-body {
    padding: 0.95rem;
}

.builder-fields {
    display: grid;
    gap: 0.85rem;
}

.builder-divider-preview {
    margin: 0;
    padding: 0.85rem 0;
    border-top: 1px dashed var(--line-strong);
    border-bottom: 1px dashed var(--line-strong);
    text-align: center;
}

.cms-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 1.25rem;
    align-items: start;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 550;
    color: var(--ink-soft);
    cursor: pointer;
}

.check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-600);
}

.field-label {
    font-weight: 570;
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.check-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    max-height: 260px;
    overflow: auto;
}

.site-rights .hint {
    margin: 0.35rem 0 0;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Front-end site ---------- */

.front-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--ink);
}

.preview-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: #1e3a8a;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 550;
}

.preview-banner a {
    color: #bfdbfe;
    text-decoration: underline;
}

.front-wrap {
    width: min(100% - 2.5rem, 920px);
    margin-inline: auto;
}

.front-header {
    border-bottom: 1px solid var(--line);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.front-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.front-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.front-brand:hover {
    color: var(--brand-700);
}

.front-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
}

.front-nav a {
    color: var(--muted);
    font-weight: 550;
    font-size: 0.92rem;
}

.front-nav a:hover,
.front-nav a.is-active {
    color: var(--brand-700);
}

.front-main {
    flex: 1;
    padding: 2.5rem 0 3.5rem;
}

.front-article h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.front-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink-soft);
    display: grid;
    gap: 1.15rem;
}

.front-content > :first-child {
    margin-top: 0;
}

.front-content > :last-child {
    margin-bottom: 0;
}

.front-content p,
.block-text {
    margin: 0;
}

.block-heading {
    margin: 0.4rem 0 0;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1.block-heading { font-size: 1.85rem; }
h2.block-heading { font-size: 1.45rem; }
h3.block-heading { font-size: 1.2rem; }

.block-image {
    margin: 0;
}

.block-image img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.block-image figcaption {
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.block-quote {
    margin: 0;
    padding: 1rem 1.15rem;
    border-left: 3px solid var(--brand-600);
    background: var(--brand-50);
    border-radius: 0 12px 12px 0;
    color: var(--ink);
}

.block-quote p {
    margin: 0;
}

.block-quote cite {
    display: block;
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: normal;
}

.block-list {
    margin: 0;
    padding-left: 1.25rem;
}

.block-list li + li {
    margin-top: 0.35rem;
}

.block-divider {
    border: 0;
    border-top: 1px solid var(--line-strong);
    margin: 0.4rem 0;
}

.block-button {
    margin: 0.2rem 0 0;
}

.front-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}

.front-btn-primary {
    background: var(--brand-600);
    color: #fff;
}

.front-btn-primary:hover {
    background: var(--brand-700);
    color: #fff;
}

.front-btn-secondary {
    background: #fff;
    color: var(--brand-700);
    border: 1px solid var(--brand-200);
}

.front-btn-secondary:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

.front-draft-note {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #fffbeb;
    color: var(--warn);
    font-size: 0.8rem;
    font-weight: 600;
}

.front-footer {
    border-top: 1px solid var(--line);
    padding: 1.25rem 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ---------- Responsive ---------- */

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

    .sidebar {
        position: static;
        height: auto;
        gap: 1rem;
    }

    .sidebar-foot {
        margin-top: 0.5rem;
    }

    .nav-label {
        display: none;
    }

    .side-nav {
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 0;
    }

    .main {
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: grid;
        gap: 0.3rem;
        padding: 0.9rem 0;
        border-bottom: 1px solid var(--line);
    }

    .table tbody td {
        border: 0;
        padding: 0;
    }

    .actions {
        justify-content: flex-start;
        margin-top: 0.4rem;
    }

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

    .front-header-inner {
        align-items: flex-start;
    }
}


/* ---------- Business catalog ---------- */

.filter-bar {
    margin-bottom: 1rem;
}

.inline-field {
    max-width: 280px;
}

.business-admin-grid,
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.business-admin-card,
.catalog-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.catalog-card:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: inherit;
}

.business-admin-media,
.catalog-card-media {
    aspect-ratio: 16 / 10;
    background: var(--surface-alt);
    overflow: hidden;
}

.business-admin-media img,
.catalog-card-media img,
.business-hero img,
.business-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.business-admin-placeholder,
.catalog-card-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand-700);
    background: linear-gradient(135deg, var(--brand-50), #e2e8f0);
}

.business-admin-body,
.catalog-card-body {
    padding: 0.9rem 1rem 1rem;
    display: grid;
    gap: 0.35rem;
}

.business-admin-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}

.business-image-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1rem;
    align-items: start;
}

.business-image-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--surface-alt);
}

.store-fields[hidden],
#refresh-shot-wrap[hidden] {
    display: none !important;
}

.catalog-header {
    margin-bottom: 1.25rem;
}

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
}

.catalog-filters a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 550;
}

.catalog-filters a:hover,
.catalog-filters a.is-active {
    background: var(--brand-50);
    border-color: var(--brand-200);
    color: var(--brand-700);
}

.business-hero {
    margin: 1.25rem 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    aspect-ratio: 16 / 9;
    background: var(--surface-alt);
}

.business-meta {
    margin: 1.5rem 0 0;
    display: grid;
    gap: 0.85rem;
}

.business-meta > div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
}

.business-meta dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.business-meta dd {
    margin: 0;
}

.contact-form-wrap {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
    max-width: 36rem;
}

.contact-form-wrap h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.contact-form .field textarea {
    min-height: 140px;
}

.contact-form .form-actions {
    border-top: 0;
    padding-top: 0;
}

.hp {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

.contact-form {
    position: relative;
}

.message-meta {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.message-meta > div {
    display: grid;
    gap: 0.15rem;
}

.message-meta dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.message-meta dd {
    margin: 0;
}

.message-body {
    padding: 1rem 1.1rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    line-height: 1.65;
    white-space: normal;
}

.field input[readonly] {
    background: var(--surface-alt);
    color: var(--ink-soft);
}

@media (max-width: 900px) {
    .business-image-panel {
        grid-template-columns: 1fr;
    }

    .business-meta > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

