/*
 * Shared presentation for the GRC learning and workspace product.
 * Keep the utility classes in the templates; this layer gives them a calm,
 * consistent enterprise palette without changing page behavior.
 */
.grc-site {
    --page-max-width: 1440px;
    --page-gutter: 32px;
    --content-gap: 24px;
    --grc-ink: #172820;
    --grc-muted: #64736b;
    --grc-line: #dce4de;
    --grc-paper: #f4f6f3;
    --grc-surface: #ffffff;
    --grc-green: #176b54;
    --grc-green-soft: #e8f3ed;
    --grc-focus: #14795d;
    color: var(--grc-ink) !important;
    background: var(--grc-paper) !important;
    font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

.grc-page-container {
    width: min(calc(100% - var(--page-gutter) - var(--page-gutter)), var(--page-max-width));
    margin-inline: auto;
}

.grc-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
    gap: var(--content-gap);
    align-items: stretch;
}

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

.grc-home-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: var(--content-gap);
}

@media (max-width: 1100px) {
    .grc-site { --page-gutter: 24px; }

    .grc-home-hero,
    .grc-home-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }

    .grc-home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .grc-site { --page-gutter: 16px; }

    .grc-home-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

[data-theme="dark"] body.grc-site,
[data-theme="light"] body.grc-site {
    background: var(--grc-paper) !important;
    color: var(--grc-ink) !important;
}

.grc-site h1,
.grc-site h2,
.grc-site h3,
.grc-site h4,
.grc-site .font-heading {
    color: var(--grc-ink);
    font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.035em;
}

.grc-site h1 { line-height: 1.12; }
.grc-site h2 { line-height: 1.2; }
.grc-site p { text-wrap: pretty; }

/* Main navigation */
.grc-site nav {
    color: var(--grc-ink);
    background: rgba(255, 255, 255, .96) !important;
    border-color: var(--grc-line) !important;
    box-shadow: 0 1px 3px rgba(22, 40, 30, .035);
    backdrop-filter: blur(14px);
}
.grc-site nav .text-white { color: var(--grc-ink) !important; }
.grc-site nav .text-slate-300,
.grc-site nav .text-slate-200 { color: #52635a !important; }
.grc-site nav .text-slate-400 { color: #718078 !important; }
.grc-site nav .border-slate-700 { border-color: var(--grc-line) !important; }
.grc-site nav .border-slate-800 { border-color: #e8ede9 !important; }
.grc-site nav .bg-slate-800 { background: #f0f4f0 !important; }
.grc-site nav a:hover { color: var(--grc-green) !important; }
.grc-site nav .bg-emerald-300,
.grc-site nav .bg-emerald-400 { background: var(--grc-green) !important; color: #fff !important; }
.grc-site nav button { color: #34483d; }

/* Consistent color and surface tokens for the existing page templates */
.grc-site .text-white { color: var(--grc-ink) !important; }
.grc-site .text-slate-100 { color: #26382f !important; }
.grc-site .text-slate-200 { color: #3e5047 !important; }
.grc-site .text-slate-300 { color: #52635a !important; }
.grc-site .text-slate-400 { color: #68776f !important; }
.grc-site .text-slate-500 { color: #7a8881 !important; }
.grc-site .text-emerald-100,
.grc-site .text-emerald-200,
.grc-site .text-emerald-300 { color: var(--grc-green) !important; }
.grc-site .text-cyan-100,
.grc-site .text-cyan-200,
.grc-site .text-cyan-300 { color: #286c66 !important; }

/* Warning and error utilities need dark foregrounds on the light workspace surfaces. */
.grc-site :is([class^="text-amber-"], [class*=" text-amber-"],
              [class^="text-yellow-"], [class*=" text-yellow-"]) { color: #76500a !important; }
.grc-site :is([class^="text-red-"], [class*=" text-red-"],
              [class^="text-rose-"], [class*=" text-rose-"]) { color: #963747 !important; }

.grc-site .border-slate-800 { border-color: #e6ebe7 !important; }
.grc-site .border-slate-700 { border-color: var(--grc-line) !important; }
.grc-site .border-slate-600 { border-color: #cbd6cf !important; }
.grc-site .border-emerald-300\/10,
.grc-site .border-emerald-300\/20,
.grc-site .border-emerald-300\/25 { border-color: #d1e6d9 !important; }
.grc-site .border-cyan-300\/20,
.grc-site .border-cyan-300\/40 { border-color: #d0e5e1 !important; }

.grc-site main .bg-slate-950,
.grc-site main [class*="bg-slate-950/"] { background-color: #f7f9f7 !important; }
.grc-site main .bg-slate-900,
.grc-site main [class*="bg-slate-900/"] { background-color: var(--grc-surface) !important; }
.grc-site main .bg-slate-800 { background-color: #eef2ee !important; }
.grc-site main .bg-emerald-300\/10,
.grc-site main .bg-emerald-300\/15 { background-color: var(--grc-green-soft) !important; }
.grc-site main .bg-cyan-300\/10 { background-color: #e9f3f1 !important; }
.grc-site main .bg-amber-300\/5,
.grc-site main .bg-amber-300\/10,
.grc-site main .bg-yellow-300\/5,
.grc-site main .bg-yellow-300\/10 { background-color: #fff5df !important; }
.grc-site main .bg-red-300\/5,
.grc-site main .bg-red-300\/10,
.grc-site main .bg-rose-300\/5,
.grc-site main .bg-rose-300\/10 { background-color: #fff0f1 !important; }
.grc-site main .border-amber-300\/20,
.grc-site main .border-amber-300\/30,
.grc-site main .border-amber-300\/40,
.grc-site main .border-yellow-300\/20,
.grc-site main .border-yellow-300\/30,
.grc-site main .border-yellow-300\/40 { border-color: #e6ca8b !important; }
.grc-site main .border-red-300\/20,
.grc-site main .border-red-300\/30,
.grc-site main .border-red-300\/40,
.grc-site main .border-rose-300\/20,
.grc-site main .border-rose-300\/30,
.grc-site main .border-rose-300\/40 { border-color: #e3b7be !important; }
.grc-site main .bg-emerald-400 { background-color: var(--grc-green) !important; color: #fff !important; }
.grc-site main .bg-emerald-400:hover { background-color: #105640 !important; }
.grc-site main .bg-white { color: var(--grc-ink) !important; }

.grc-site main .rounded-xl,
.grc-site main .rounded-2xl,
.grc-site main .rounded-3xl {
    box-shadow: 0 1px 2px rgba(21, 42, 30, .035);
}
.grc-site main a,
.grc-site main button,
.grc-site main input,
.grc-site main select,
.grc-site main textarea {
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.grc-site main a:focus-visible,
.grc-site main button:focus-visible,
.grc-site main input:focus-visible,
.grc-site main select:focus-visible,
.grc-site main textarea:focus-visible,
.grc-site nav a:focus-visible,
.grc-site nav button:focus-visible {
    outline: 3px solid rgba(20, 121, 93, .45);
    outline-offset: 3px;
}

.grc-site main input,
.grc-site main select,
.grc-site main textarea {
    color: var(--grc-ink) !important;
    background-color: #fff !important;
    border-color: #cbd6cf !important;
}
.grc-site main input::placeholder,
.grc-site main textarea::placeholder { color: #8a9790 !important; }
.grc-site main input:focus,
.grc-site main select:focus,
.grc-site main textarea:focus {
    border-color: var(--grc-focus) !important;
    box-shadow: 0 0 0 3px rgba(20, 121, 93, .12);
}

/* The landing page keeps one deep, quiet brand surface; the rest stays light. */
.grc-site .grc-hero {
    color: #f7faf7 !important;
    background: linear-gradient(112deg, #172a24 0%, #1d3830 58%, #25483b 100%) !important;
    border-color: rgba(255, 255, 255, .12) !important;
}
.grc-site .grc-hero h1,
.grc-site .grc-hero h2,
.grc-site .grc-hero h3,
.grc-site .grc-hero .text-white { color: #f7faf7 !important; }
.grc-site .grc-hero .text-slate-300 { color: #c5d2ca !important; }
.grc-site .grc-hero .text-slate-200 { color: #d7e5dc !important; }
.grc-site .grc-hero .text-slate-400 { color: #aabbb0 !important; }
.grc-site .grc-hero .text-emerald-200 { color: #b8e1ca !important; }
.grc-site .grc-hero .border-white\/10 { border-color: rgba(255, 255, 255, .15) !important; }
.grc-site .grc-hero .bg-emerald-300\/10 {
    background: rgba(255, 255, 255, .08) !important;
}
.grc-site .grc-hero [class*="bg-slate-950/"] { background: rgba(8, 20, 15, .25) !important; }
.grc-site .grc-hero .bg-emerald-400 { background: #c4e2ce !important; color: #173a2d !important; }
.grc-site .grc-hero .bg-emerald-400:hover { background: #d8ecdf !important; }
.grc-site .grc-hero .border-cyan-300\/40 { border-color: rgba(217, 238, 228, .4) !important; }
.grc-site .grc-hero .text-cyan-100 { color: #e0eee6 !important; }
.grc-site .grc-hero .bg-slate-900\/30 { background: rgba(8, 20, 15, .2) !important; }

.grc-site main > section.border-y {
    background: #edf2ee !important;
    border-color: var(--grc-line) !important;
}
.grc-site main > section .bg-gradient-to-r {
    background: #e8f1eb !important;
}
.grc-site main .bg-gradient-to-br {
    background: linear-gradient(145deg, #eaf2ec, #f5f7f4) !important;
}

/* Workspace-specific panels and data tables */
.grc-site .health-panel {
    border-color: var(--grc-line);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(21, 42, 30, .035);
}
.grc-site .health-value { color: var(--grc-ink); }
.grc-site .health-copy { color: #52635a; }
.grc-site .health-muted { color: #75837b; }
.grc-site .health-link { color: #176b54; }
.grc-site .health-table th,
.grc-site .health-table td { border-color: #e5ebe6; }
.grc-site .health-table th { color: #46584e; }
.grc-site .risk-matrix th { color: #596a61; }
.grc-site .risk-matrix caption { color: var(--grc-ink); }
.grc-site .health-form label { color: #52635a; }
.grc-site .health-form input,
.grc-site .health-form select { color: var(--grc-ink); background: #fff; border-color: #cbd6cf; }
.grc-site .health-form button { background: var(--grc-green); color: #fff; }

.grc-site footer {
    color: var(--grc-ink);
    background: #fff !important;
    border-color: var(--grc-line) !important;
}
.grc-site footer .text-white { color: var(--grc-ink) !important; }
.grc-site footer .text-slate-400 { color: #68776f !important; }
.grc-site footer .text-slate-500 { color: #7a8881 !important; }
.grc-site footer .border-slate-800 { border-color: #e6ebe7 !important; }
.grc-site footer a:hover { color: var(--grc-green) !important; }
.grc-site footer .bg-emerald-300 { background: var(--grc-green) !important; color: #fff !important; }

@media (max-width: 640px) {
    .grc-site h1 { letter-spacing: -.03em; }
    .grc-site .grc-hero h1 { font-size: clamp(2.25rem, 10vw, 3.25rem); }
}

@media (prefers-reduced-motion: reduce) {
    .grc-site *,
    .grc-site *::before,
    .grc-site *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.grc-site .academy-primary-action { color: #fff !important; }

/* Connected workspace navigation: dense, structured and task-aware. */
.grc-site {
    --grc-nav-ink: #24372e;
    --grc-nav-muted: #64766c;
    --grc-nav-line: #dbe5de;
    --grc-nav-wash: #f2f6f2;
    --grc-nav-accent: #176b54;
}
.grc-workspace-experiences {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .85rem;
    padding: .5rem .7rem;
    border: 1px solid var(--grc-nav-line);
    border-radius: 10px;
    background: #edf3ee;
    color: var(--grc-nav-muted);
    font-size: .73rem;
}
.grc-workspace-experiences > span { padding-inline: .2rem; font-weight: 700; }
.grc-workspace-experiences a {
    padding: .35rem .55rem;
    border-radius: 6px;
    color: var(--grc-nav-ink);
    font-weight: 700;
    text-decoration: none;
}
.grc-workspace-experiences a:hover { background: #fff; color: var(--grc-nav-accent); }
.grc-workspace-sidebar {
    width: 320px;
    max-width: 100%;
    flex: 0 0 320px;
    color: var(--grc-nav-ink);
}
.grc-workspace-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.grc-workspace-content { min-width: 0; }
.grc-workspace-content > :first-child { margin-top: 0; }
.grc-workspace-sidebar__inner {
    position: sticky;
    top: 5.75rem;
    max-height: calc(100dvh - 6.5rem);
    overflow: auto;
    padding: .65rem;
    border: 1px solid var(--grc-nav-line);
    border-radius: 13px;
    background: #fbfdfb;
    box-shadow: 0 4px 14px rgba(28, 52, 37, .04);
}
.grc-workspace-search { padding: .55rem .45rem .75rem; border-bottom: 1px solid var(--grc-nav-line); }
.grc-workspace-search label { display: block; margin-bottom: .35rem; color: var(--grc-nav-muted); font-size: .68rem; font-weight: 800; }
.grc-workspace-search > div { display: flex; gap: .3rem; width: 100%; min-width: 0; }
.grc-workspace-search input {
    flex: 1 1 0; min-width: 0; width: 0; min-height: 38px; padding: .45rem .55rem;
    border: 1px solid #cbd8cf; border-radius: 6px; background: white; color: var(--grc-nav-ink);
    font-size: .75rem;
}
.grc-workspace-search button {
    flex: 0 0 auto; white-space: nowrap; min-height: 38px; padding: .35rem .55rem; border: 0; border-radius: 6px;
    background: var(--grc-nav-accent); color: white; font-size: .72rem; font-weight: 750; cursor: pointer;
}
.grc-workspace-menu { display: block; padding-top: .35rem; }
.grc-workspace-menu__group { border-bottom: 1px solid #e8eee9; }
.grc-workspace-menu__group > summary,
.grc-workspace-menu__advanced > summary {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    min-height: 42px; padding: .55rem .45rem; color: var(--grc-nav-ink);
    font-size: .77rem; font-weight: 800; cursor: pointer; list-style: none;
}
.grc-workspace-menu__group > summary::-webkit-details-marker,
.grc-workspace-menu__advanced > summary::-webkit-details-marker { display: none; }
.grc-workspace-menu__group > summary::before { content: "+"; width: 1rem; color: var(--grc-nav-accent); font-size: .95rem; }
.grc-workspace-menu__group[open] > summary::before { content: "−"; }
.grc-workspace-menu__group > summary > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; }
.grc-workspace-menu__count { color: #7b8b81; font: 700 .64rem ui-monospace, monospace; }
.grc-workspace-menu__links { padding: 0 .2rem .55rem 1.1rem; }
.grc-workspace-menu__link {
    display: block; min-height: 36px; padding: .5rem .55rem; border-radius: 6px;
    color: #51645a; font-size: .74rem; line-height: 1.3; text-decoration: none;
}
.grc-workspace-menu__link:hover { background: #edf4ef; color: var(--grc-nav-accent); }
.grc-workspace-menu__link[aria-current="page"] { background: #e3f0e8; color: #14563f; font-weight: 800; }
.grc-workspace-menu__advanced { margin: .2rem 0; }
.grc-workspace-menu__advanced > summary { min-height: 34px; padding-inline: .55rem; color: var(--grc-nav-muted); font-size: .69rem; }
.grc-workspace-menu__advanced > .grc-workspace-menu__link { margin-left: .45rem; }
.grc-workspace-global { padding: .75rem .3rem .25rem; }
.grc-workspace-eyebrow { margin: 0 0 .35rem; color: var(--grc-nav-muted); font-size: .62rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.grc-lab-context {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 0 .85rem; padding: .8rem 1rem; border: 1px solid #bbd8c6; border-left: 4px solid var(--grc-nav-accent);
    border-radius: 9px; background: #edf6ef; color: var(--grc-nav-ink);
}
.grc-lab-context strong { font-size: .9rem; }
.grc-lab-context__note { margin: .22rem 0 0; color: var(--grc-nav-muted); font-size: .73rem; }
.grc-workspace-action { flex: 0 0 auto; padding: .55rem .8rem; border-radius: 6px; background: var(--grc-nav-accent); color: white !important; font-size: .75rem; font-weight: 800; text-decoration: none; }
.grc-context-help { display: inline-block; margin: .2rem 0 .1rem .35rem; padding: .15rem .4rem; border-radius: 5px; background: #e9f3ed; color: #176b54 !important; font-size: .85em; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.grc-context-help:focus-visible { outline: 3px solid #22815e; outline-offset: 3px; }
.grc-workspace-mobile { display: none; }
.grc-workspace-mobile__close { min-height: 44px; width: 100%; margin-bottom: .7rem; border: 1px solid var(--grc-nav-line); border-radius: 7px; background: white; color: var(--grc-nav-ink); font-weight: 800; text-align: left; padding-inline: .8rem; }
.grc-workspace-menu :focus-visible,
.grc-workspace-mobile :focus-visible,
.grc-workspace-search :focus-visible,
.grc-workspace-experiences a:focus-visible,
.grc-workspace-action:focus-visible { outline: 3px solid rgba(23,107,84,.45); outline-offset: 2px; }
@media (max-width: 860px) {
    .grc-workspace-layout { display: block; }
    .grc-workspace-sidebar { display: none; }
    .grc-workspace-mobile { display: block; margin: 0 0 1rem; }
    .grc-workspace-mobile > summary {
        display: flex; justify-content: space-between; align-items: center; min-height: 48px;
        padding: .7rem .9rem; border: 1px solid var(--grc-nav-line); border-radius: 9px;
        background: #fbfdfb; color: var(--grc-nav-ink); font-weight: 800; cursor: pointer; list-style: none;
    }
    .grc-workspace-mobile > summary::-webkit-details-marker { display: none; }
    .grc-workspace-mobile[open] .grc-workspace-mobile__content {
        position: fixed; z-index: 120; inset: 0; display: block; overflow-y: auto;
        padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
        background: #f7faf7; color: var(--grc-nav-ink);
    }
    .grc-workspace-mobile__content .grc-workspace-menu__group > summary { min-height: 48px; }
    .grc-workspace-mobile__content .grc-workspace-menu__link { min-height: 44px; padding-top: .7rem; }
}
@media (max-width: 520px) {
    .grc-lab-context { align-items: flex-start; flex-direction: column; }
    .grc-workspace-experiences { gap: .15rem; }
    .grc-workspace-experiences > span { flex-basis: 100%; }
}
