/* Restaurant Inventory & True Cost — owner guide */

:root {
    --guide-green: #4caf50;
    --guide-green-deep: #2e7d32;
    --guide-green-dark: #1b5e20;
    --guide-green-soft: #e8f5e9;
    --guide-green-glow: rgba(76, 175, 80, 0.18);
    --guide-ink: #1a1f2e;
    --guide-muted: #5f6b7a;
    --guide-line: #e3e8ed;
    --guide-bg: #f4f7f5;
    --guide-card: #ffffff;
    --guide-radius: 16px;
    --guide-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    --guide-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--guide-font);
    color: var(--guide-ink);
    background: var(--guide-bg);
    line-height: 1.65;
    font-size: 16px;
}

.guide-shell {
    min-height: 100vh;
}

.guide-hero {
    position: relative;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12), transparent 42%),
        radial-gradient(circle at 10% 90%, rgba(0, 0, 0, 0.12), transparent 40%),
        linear-gradient(135deg, #0b3b36 0%, #1b5e20 45%, #388e3c 100%);
    color: #fff;
    padding: 2rem 1.25rem 3rem;
}

.guide-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--guide-bg));
    pointer-events: none;
}

.guide-hero-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 2rem;
    align-items: center;
}

.guide-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.25rem;
}

.guide-brand-row img.guide-wordmark {
    height: 48px;
    width: auto;
    max-width: min(220px, 52vw);
    display: block;
    filter: brightness(0) invert(1);
}

.guide-brand-row img.guide-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.guide-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-hero h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.85rem, 4vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.guide-hero-lead {
    margin: 0 0 1.25rem;
    max-width: 38rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
}

.guide-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

.guide-btn-primary {
    background: #fff;
    color: var(--guide-green-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.guide-btn-primary:hover {
    color: var(--guide-green-deep);
}

.guide-btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.guide-hero-panel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    backdrop-filter: blur(8px);
}

.guide-hero-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.guide-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.guide-stat {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.85rem;
}

.guide-stat strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.2;
}

.guide-stat span {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.35;
}

.guide-layout {
    position: relative;
    z-index: 2;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.guide-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.guide-toc {
    position: sticky;
    top: 1rem;
    background: var(--guide-card);
    border: 1px solid var(--guide-line);
    border-radius: var(--guide-radius);
    box-shadow: var(--guide-shadow);
    padding: 1.25rem 1.1rem 1.1rem;
}

.guide-toc-title {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--guide-green-deep);
}

.guide-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: calc(100vh - 4rem);
    overflow: auto;
}

.guide-toc li {
    margin-bottom: 2px;
}

.guide-toc a {
    display: block;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    color: var(--guide-muted);
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.35;
    transition: background 0.15s ease, color 0.15s ease;
}

.guide-toc a:hover {
    background: #f4f8f4;
    color: var(--guide-green-deep);
}

.guide-toc a.is-active {
    background: var(--guide-green-soft);
    color: var(--guide-green-deep);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--guide-green);
    padding-left: calc(0.55rem - 3px);
}

.guide-content {
    min-width: 0;
}

.guide-section {
    background: var(--guide-card);
    border: 1px solid var(--guide-line);
    border-radius: var(--guide-radius);
    padding: 1.6rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    scroll-margin-top: 1.5rem;
}

.guide-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--guide-line);
}

.guide-section-head h2 {
    padding-top: 2px;
}

.guide-step {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--guide-green-soft);
    color: var(--guide-green-deep);
    font-size: 0.82rem;
    font-weight: 800;
}

.guide-section h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--guide-green-dark);
}

.guide-section h3 {
    margin: 1.15rem 0 0.45rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.guide-section p {
    margin: 0 0 0.85rem;
    color: var(--guide-ink);
}

.guide-section ul,
.guide-section ol {
    margin: 0 0 0.85rem;
    padding-left: 1.25rem;
}

.guide-section li {
    margin-bottom: 0.35rem;
}

.guide-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: var(--guide-green-soft);
    color: var(--guide-green-deep);
    vertical-align: middle;
}

.guide-tag.optional {
    background: #f1f3f4;
    color: var(--guide-muted);
}

.guide-tag.advanced {
    background: #fff3e0;
    color: #e65100;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 1rem 0;
    align-items: stretch;
}

.guide-card {
    border: 1px solid var(--guide-line);
    border-radius: 14px;
    padding: 1rem;
    background: linear-gradient(180deg, #fafcfa 0%, #fff 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.guide-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--guide-green-soft);
    color: var(--guide-green-deep);
    margin-bottom: 0.65rem;
}

.guide-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
}

.guide-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--guide-muted);
    flex: 1;
}

.guide-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 1rem 0;
}

.guide-split-card {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--guide-line);
}

.guide-split-card.track-no {
    background: #f8faf8;
}

.guide-split-card.track-yes {
    background: #eef7ef;
    border-color: #c8e6c9;
}

.guide-split-card strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--guide-green-dark);
}

.guide-example {
    background: #f8fafc;
    border: 1px solid var(--guide-line);
    border-radius: 12px;
    padding: 0.95rem 1.05rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88rem;
    overflow-x: auto;
    margin: 0.85rem 0;
    white-space: pre-wrap;
}

.guide-callout {
    background: var(--guide-green-soft);
    border-left: 4px solid var(--guide-green);
    padding: 0.95rem 1.05rem;
    border-radius: 0 12px 12px 0;
    margin: 0.85rem 0;
    color: var(--guide-ink);
}

.guide-callout.warn {
    background: #fff8e1;
    border-left-color: #f9a825;
}

.guide-table-wrap {
    overflow-x: auto;
    margin: 0.85rem 0;
}

table.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.guide-table th,
table.guide-table td {
    border: 1px solid var(--guide-line);
    padding: 0.6rem 0.75rem;
    text-align: left;
}

table.guide-table th {
    background: var(--guide-green-soft);
    color: var(--guide-green-dark);
    font-weight: 700;
}

.guide-waterfall {
    border: 1px solid var(--guide-line);
    border-radius: 14px;
    overflow: hidden;
    margin: 0.85rem 0;
}

.guide-waterfall-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--guide-line);
}

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

.guide-waterfall-row.is-total {
    background: var(--guide-green-soft);
    font-weight: 800;
}

.guide-waterfall-row.is-deduct {
    color: #c62828;
}

.guide-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.guide-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--guide-line);
    border-radius: 12px;
    background: #fafcfa;
    margin: 0;
}

.guide-checklist li::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--guide-green);
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
    position: relative;
    z-index: 2;
}

.guide-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 1.25rem 1.5rem;
    border-radius: var(--guide-radius);
    background: var(--guide-card);
    border: 1px solid var(--guide-line);
    box-shadow: var(--guide-shadow);
}

.guide-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-footer-brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.guide-footer-brand strong {
    display: block;
    font-size: 0.95rem;
}

.guide-footer-brand span {
    display: block;
    font-size: 0.82rem;
    color: var(--guide-muted);
}

.guide-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guide-footer-links a {
    color: var(--guide-green-deep);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.88rem;
}

.guide-footer-links a:hover {
    text-decoration: underline;
}

.guide-mobile-toc-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--guide-line);
    background: var(--guide-card);
    font-weight: 700;
    color: var(--guide-green-deep);
    box-shadow: var(--guide-shadow);
    cursor: pointer;
}

@media (max-width: 960px) {
    .guide-hero-grid {
        grid-template-columns: 1fr;
    }

    .guide-layout {
        grid-template-columns: 1fr;
        padding-top: 1rem;
    }

    .guide-sidebar {
        order: -1;
    }

    .guide-toc {
        position: static;
        display: none;
    }

    .guide-toc.is-open {
        display: block;
    }

    .guide-mobile-toc-toggle {
        display: block;
    }

    .guide-cards,
    .guide-split {
        grid-template-columns: 1fr;
    }
}

@media print {
    .guide-toc,
    .guide-mobile-toc-toggle,
    .guide-hero-actions,
    .guide-footer-links {
        display: none !important;
    }

    .guide-layout {
        grid-template-columns: 1fr;
        margin-top: 0;
    }

    .guide-section {
        break-inside: avoid;
        box-shadow: none;
    }
}
