:root {
    --bg: #f7efe4;
    --ink: #1f1813;
    --muted: #6d5a4d;
    --paper: #fffdf8;
    --line: rgba(31, 24, 19, 0.12);
    --accent: #d87036;
    --accent-2: #15616d;
    --shadow: 0 18px 50px rgba(41, 24, 14, 0.12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(216, 112, 54, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(21, 97, 109, 0.12), transparent 30%),
        linear-gradient(180deg, #fff7ef 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
    min-height: 100vh;
}

h1, h2, h3, .brand strong {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
main { padding: 0 24px 48px; }
label { display: grid; gap: 8px; font-size: 0.95rem; color: var(--muted); }
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    font: inherit;
    color: var(--ink);
}
textarea { resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.site-header, .hero, .section-grid, .page-head, .card-grid, .admin-grid, .crm-hero, .public-shell, .auth-shell, .flash-stack {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark, .graphic-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #f3c46d);
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.brand small, .subtle { color: var(--muted); display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--ink); }

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash {
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    padding: 38px 0 34px;
    align-items: center;
}

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

.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: 0.95; margin: 0 0 18px; }
.hero-text { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.hero-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}

.button-primary { background: var(--ink); color: #fff; }
.button-secondary { background: var(--accent); color: #fff; }
.button-ghost { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); color: var(--ink); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.hero-panel, .panel {
    position: relative;
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid rgba(31, 24, 19, 0.08);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-panel { min-height: 420px; overflow: hidden; padding: 28px; }
.hero-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(10px);
}
.hero-orb-a { width: 220px; height: 220px; background: rgba(216, 112, 54, 0.2); top: -20px; right: -40px; }
.hero-orb-b { width: 180px; height: 180px; background: rgba(21, 97, 109, 0.18); bottom: 10px; left: -40px; }
.demo-card { position: relative; z-index: 1; }
.feature-list { padding-left: 18px; color: var(--muted); line-height: 1.7; }

.stat-row, .section-grid, .card-grid, .admin-grid, .crm-summary-grid {
    display: grid;
    gap: 18px;
}

.stat-row { grid-template-columns: repeat(3, 1fr); margin-top: 26px; }
.stat-card, .crm-card { padding: 18px; }
.stat-card strong { display: block; font-size: 2rem; }
.section-grid { grid-template-columns: repeat(3, 1fr); padding-bottom: 28px; }
.panel { padding: 24px; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding: 20px 0;
}

.card-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.crm-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.status-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(21, 97, 109, 0.14);
    color: var(--accent-2);
    text-transform: capitalize;
}
.status-pill.paused { background: rgba(163, 123, 34, 0.15); color: #7a590f; }
.empty-card { text-align: center; }

.auth-shell { padding: 50px 0; }
.form-card { width: min(560px, 100%); margin: 0 auto; }
.form-grid, .compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.form-span { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.checkline input { width: auto; }

.crm-hero { padding: 16px 0 26px; }
.crm-brand-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: 28px;
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.crm-brand-card .graphic-mark { background: linear-gradient(135deg, var(--accent), #f3c46d); }
.crm-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }

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

.public-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    min-height: 100vh;
    align-items: center;
    padding: 28px 0;
}
.public-brand { padding: 20px 0; }
.public-brand h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 8px; }
.public-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); margin-top: 18px; }

@media (max-width: 900px) {
    .hero, .public-shell, .section-grid, .admin-grid, .crm-summary-grid, .stat-row {
        grid-template-columns: 1fr;
    }
    .page-head, .site-header { align-items: start; flex-direction: column; }
    .form-grid, .compact-grid { grid-template-columns: 1fr; }
}
