:root {
    --bg: #f4f1e8;
    --surface: #fffdf8;
    --surface-strong: #ffffff;
    --border: #d9d1c3;
    --text: #1c2a25;
    --muted: #66756e;
    --brand: #163a33;
    --brand-soft: #dbe7df;
    --accent: #c98f3b;
    --danger: #b14d45;
    --danger-soft: #f9e0dc;
    --success: #2f6b4f;
    --success-soft: #dcefe4;
    --shadow: 0 18px 45px rgba(28, 42, 37, 0.08);
    --radius: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(201, 143, 59, 0.18), transparent 26%),
        linear-gradient(180deg, #f8f3ea 0%, #f2eee5 100%);
}

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

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

img {
    max-width: 100%;
}

.guest-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px;
}

.guest-stack {
    width: min(1120px, 100%);
}

.install-hero h1 {
    margin: 0 0 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
}

.wizard-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 20px;
}

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

.check-list__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.field-error {
    display: inline-block;
    margin-top: 4px;
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--surface-strong);
}

.guest-panel {
    width: min(560px, 100%);
    padding: 48px;
    border-radius: 28px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.guest-panel-small {
    width: min(520px, 100%);
}

.guest-panel__copy h1 {
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 5vw, 2.7rem);
}

.login-panel {
    padding: 56px;
}

.login-panel--brand {
    color: #f9f7f1;
    background:
        radial-gradient(circle at top right, rgba(201, 143, 59, 0.42), transparent 28%),
        linear-gradient(145deg, #0f2722 0%, #1d433b 100%);
}

.login-panel--brand h1 {
    margin: 14px 0 18px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
    max-width: 11ch;
}

.login-panel--brand p,
.login-panel--brand li {
    color: rgba(249, 247, 241, 0.82);
}

.login-benefits {
    margin: 32px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 14px;
}

.login-panel--form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 30px 24px;
    background: rgba(22, 58, 51, 0.95);
    color: #f7f4ee;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.main-shell {
    min-width: 0;
}

.page-content {
    padding: 28px;
    display: grid;
    gap: 24px;
}

.brand-block {
    margin-bottom: 28px;
}

.brand-mark {
    display: inline-block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.brand-mark--large {
    margin-bottom: 14px;
    font-size: 2.25rem;
}

.brand-subtitle,
.muted,
.table-subline,
.empty-state,
.definition-list dt,
.list-row p,
.timeline-row p {
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    padding: 14px 16px;
    border-radius: 14px;
    color: rgba(247, 244, 238, 0.78);
    transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

.sidebar-user {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-user__name,
.sidebar-user__role {
    margin: 0;
}

.sidebar-user__name {
    font-weight: 700;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px 0;
}

.topbar__left,
.topbar__right,
.page-actions,
.button-row,
.panel__header,
.list-row,
.status-row,
.detail-header,
.channel-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--brand);
}

.topbar h1,
.panel__header h2,
.detail-header h2,
.login-panel--form h2 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.status-chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-chip,
.badge--concept,
.badge--lead,
.badge--draft {
    background: #f3e8cf;
    color: #73510f;
}

.badge--active,
.badge--accepted,
.badge--approved {
    background: var(--success-soft);
    color: var(--success);
}

.badge--internal_review,
.badge--client_review,
.badge--sent,
.badge--processing,
.badge--pending,
.badge--pending_review,
.badge--client {
    background: #e0eaf7;
    color: #31588f;
}

.badge--resolved {
    background: var(--success-soft);
    color: var(--success);
}

.badge--ok {
    background: var(--success-soft);
    color: var(--success);
}

.badge--warning {
    background: #f3e8cf;
    color: #73510f;
}

.badge--internal {
    background: rgba(22, 58, 51, 0.12);
    color: var(--brand);
}

.badge--meta {
    background: #dbe7ff;
    color: #355db8;
}

.badge--google {
    background: #fde8d7;
    color: #b45a11;
}

.badge--linkedin {
    background: #d9eef8;
    color: #0d5f84;
}

.badge--inactive,
.badge--cancelled,
.badge--rejected,
.badge--denied,
.badge--archived,
.badge--changes_requested,
.badge--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 160ms ease;
}

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

.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    color: #f8f6f0;
    background: linear-gradient(135deg, #163a33 0%, #225248 100%);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--border);
}

.text-link {
    color: var(--brand);
    font-weight: 700;
}

.panel,
.stat-card {
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid rgba(217, 209, 195, 0.65);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.panel--nested {
    padding: 20px;
    background: rgba(245, 240, 233, 0.9);
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 22px;
}

.stat-card__label {
    display: block;
    color: var(--muted);
    margin-bottom: 12px;
}

.stat-card__value {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-family: "Space Grotesk", sans-serif;
}

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

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

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

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

.form-field {
    display: grid;
    gap: 8px;
}

.form-field--checkbox {
    align-self: end;
}

.form-field label {
    font-size: 0.92rem;
    font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea,
.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    min-height: 48px;
    padding: 12px 14px;
    color: var(--text);
}

.form-field textarea {
    resize: vertical;
    min-height: 130px;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 12px;
    flex: 1;
}

.filter-bar--assets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack-lg,
.stack-md,
.list-stack,
.status-stack,
.simple-list,
.calc-preview {
    display: grid;
}

.stack-lg {
    gap: 24px;
}

.stack-md,
.list-stack,
.status-stack,
.simple-list {
    gap: 16px;
}

.calc-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
}

.calc-preview div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.calc-preview span {
    color: var(--muted);
}

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

.data-table th,
.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(217, 209, 195, 0.8);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.table-actions {
    display: flex;
    gap: 14px;
}

.definition-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.definition-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.definition-list dd,
.definition-list dt {
    margin: 0;
}

.definition-list dd {
    text-align: right;
}

.list-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.timeline-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.channel-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    background: rgba(255, 255, 255, 0.6);
}

.asset-card,
.feedback-card,
.version-row {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    background: rgba(255, 255, 255, 0.6);
}

.channel-card h3 {
    margin: 10px 0 0;
}

.asset-card h3,
.feedback-card strong {
    margin: 10px 0 0;
}

.feedback-card {
    display: grid;
    gap: 10px;
}

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

.contact-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    background: rgba(255, 255, 255, 0.72);
}

.contact-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.feedback-card__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.version-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.feedback-form {
    margin-bottom: 20px;
}

.definition-list--compact {
    gap: 10px;
}

.definition-list--compact div {
    padding-bottom: 10px;
}

.text-block {
    margin: 8px 0 0;
    line-height: 1.7;
}

.simple-list {
    margin: 0;
    padding-left: 20px;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-weight: 700;
    cursor: pointer;
}

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

.toggle-grid label {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid rgba(47, 107, 79, 0.2);
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(177, 77, 69, 0.18);
}

.share-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    background: rgba(255, 255, 255, 0.6);
}

.share-row strong {
    display: block;
    word-break: break-all;
}

.notification-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(217, 209, 195, 0.75);
    background: rgba(255, 255, 255, 0.65);
}

.notification-row.is-unread {
    background: rgba(224, 234, 247, 0.45);
    border-color: rgba(49, 88, 143, 0.22);
}

.notification-row__content {
    display: grid;
    gap: 10px;
    flex: 1;
}

.filter-bar--reports {
    grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(150px, 0.8fr)) auto;
}

.button-row--compact {
    justify-content: flex-start;
}

.report-channel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(217, 209, 195, 0.75);
}

.report-channel-row__totals {
    display: grid;
    gap: 4px;
    text-align: right;
}

.portal-grid {
    display: grid;
    gap: 24px;
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 24px;
    padding: 32px;
    background:
        radial-gradient(circle at top right, rgba(201, 143, 59, 0.18), transparent 30%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 233, 0.94));
}

.portal-hero__copy h1 {
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
}

.portal-hero__meta {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 20px;
    border-radius: 20px;
    background: rgba(22, 58, 51, 0.92);
    color: #f8f5ed;
}

.portal-hero__meta p {
    margin: 0;
    color: rgba(248, 245, 237, 0.82);
}

.print-body {
    min-height: 100vh;
    background: #f3efe6;
}

.print-shell {
    width: min(1100px, calc(100% - 48px));
    margin: 24px auto 48px;
    display: grid;
    gap: 20px;
}

.print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 32px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 233, 0.96));
    border: 1px solid rgba(217, 209, 195, 0.65);
    box-shadow: var(--shadow);
}

.print-header h1 {
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
}

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

.print-actions {
    display: flex;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
}

@media (max-width: 1080px) {
    .stats-grid,
    .dashboard-grid,
    .detail-grid,
    .channel-grid,
    .asset-grid,
    .form-grid,
    .wizard-grid,
    .login-shell {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 20;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .filter-bar--assets {
        grid-template-columns: 1fr;
    }

    .filter-bar--reports {
        grid-template-columns: 1fr;
    }

    .toggle-grid,
    .calc-preview,
    .portal-hero,
    .print-meta-grid {
        grid-template-columns: 1fr;
    }

    .page-actions,
    .topbar,
    .detail-header,
    .button-row,
    .feedback-card__meta,
    .version-row,
    .share-row,
    .notification-row,
    .print-header {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .page-content,
    .topbar,
    .login-panel {
        padding-left: 18px;
        padding-right: 18px;
    }

    .panel,
    .stat-card {
        padding: 18px;
    }

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

@media print {
    body {
        background: #ffffff;
    }

    .no-print {
        display: none !important;
    }

    .print-shell {
        width: 100%;
        margin: 0;
        gap: 16px;
    }

    .print-header,
    .panel,
    .stat-card,
    .channel-card,
    .asset-card {
        box-shadow: none;
        break-inside: avoid;
    }

    .panel,
    .stat-card,
    .print-header {
        border-color: #d0c8ba;
    }
}
