:root {
    --primary: #00546b;
    --primary-strong: #003f52;
    --primary-soft: #e9fbfd;
    --primary-tint: #c8f4f7;
    --teal: #22b8b4;
    --cyan: #17c6df;
    --green: #39b54a;
    --success: #39b54a;
    --warning: #c18a00;
    --danger: #b32121;
    --text: #1d2733;
    --muted: #64748b;
    --border: #d7dde5;
    --border-soft: #e8edf3;
    --panel: #ffffff;
    --body: #f7fbfc;
    --shadow: 0 14px 28px rgba(0, 84, 107, 0.12);
    --shadow-soft: 0 3px 10px rgba(0, 84, 107, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(23, 198, 223, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0, var(--body) 240px);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    overflow-x: hidden;
}

body.sg-page-enter main {
    animation: pageIn 180ms ease-out;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    grid-template-rows: 48px 3px minmax(0, 1fr);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px;
    border-bottom: 3px solid var(--green);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.theme-strip {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, var(--cyan) 0 32%, var(--green) 32% 68%, var(--primary) 68% 100%);
}

.brand,
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-actions {
    justify-content: flex-end;
    flex: 1;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border: 1px solid #b6edf1;
    background: #ffffff;
    object-fit: contain;
    padding: 3px;
    box-shadow: inset 0 -1px 0 rgba(23, 198, 223, 0.18);
}

.large-logo {
    width: 48px;
    height: 48px;
}

.brand strong {
    display: block;
    line-height: 1.1;
}

.brand span,
.page-heading p,
.section-title p {
    display: block;
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.user-chip {
    max-width: 180px;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid var(--border-soft);
    background: #f8fafc;
    color: var(--primary);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-switcher label {
    margin: 0;
    color: var(--muted);
    white-space: nowrap;
}

.child-switcher select {
    width: 190px;
    min-height: 34px;
}

.page-jump {
    width: min(360px, 34vw);
}

.app-sidebar {
    position: sticky;
    top: 51px;
    height: calc(100vh - 51px);
    overflow: auto;
    border-right: 1px solid #cdebef;
    background: linear-gradient(180deg, #ffffff 0, #f1fbfc 100%);
}

.nav-menu {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.nav-search {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
}

.nav-link {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-left: 5px solid transparent;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link:hover {
    border-left-color: var(--cyan);
    background: var(--primary-tint);
    color: var(--primary-strong);
    transform: translateX(2px);
}

.nav-section {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

.nav-section-title {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    background: #e4f7f8;
    color: var(--primary);
    font-weight: 800;
}

.app-body {
    min-width: 0;
    padding: 14px 16px 24px;
}

.page-heading {
    min-height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #cdebef;
    border-left: 6px solid var(--cyan);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.page-heading h1,
.panel h2 {
    margin: 0;
    font-size: 1.16rem;
    letter-spacing: 0;
    color: var(--primary);
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.grid {
    display: grid;
    gap: 14px;
}

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

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.metric-card {
    border: 1px solid #cdebef;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.panel {
    min-width: 0;
    padding: 12px;
}

.wide-panel {
    margin-top: 14px;
}

.metric-card {
    min-height: 92px;
    padding: 14px;
    border-left: 6px solid var(--green);
}

.metric-label {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    margin-top: 8px;
    font-size: 1.42rem;
    font-weight: 800;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.field {
    display: grid;
    gap: 4px;
    min-width: 180px;
}

.compact-field {
    min-width: 220px;
}

.stretch-field {
    min-width: min(100%, 440px);
}

label {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

input,
select,
textarea {
    min-height: 34px;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(23, 198, 223, 0.16);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

.passage-box {
    min-height: 128px;
    line-height: 1.55;
}

.button,
button {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.button:hover,
button:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    box-shadow: 0 7px 16px rgba(0, 84, 107, 0.22);
    transform: translateY(-1px);
}

.button:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.button.light,
button.light {
    border-color: var(--border);
    background: #ffffff;
    color: #1e293b;
}

.button.light:hover,
button.light:hover {
    background: #f8fafc;
    color: var(--primary);
}

.button.danger,
button.danger {
    border-color: var(--danger);
    background: var(--danger);
}

.table-frame {
    width: 100%;
    overflow: auto;
    border: 1px solid #b9e6eb;
    background: #ffffff;
    box-shadow: inset 0 1px 0 #ffffff;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 9px 10px;
    border-bottom: 2px solid var(--cyan);
    background: #e4f7f8;
    color: var(--primary);
    text-align: left;
    font-size: 0.78rem;
    font-weight: 800;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
    white-space: nowrap;
}

tbody tr:nth-child(even) td {
    background: #f8fafc;
}

tbody tr:hover td {
    background: #e9fbfd;
}

.login-page {
    max-width: 520px;
    margin: 8vh auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-top: 7px solid var(--cyan);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.public-shell {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(23, 198, 223, 0.12), transparent 36%),
        linear-gradient(180deg, #ffffff 0, #f7fbfc 58%, #eef9fb 100%);
}

.landing-page {
    min-height: 100vh;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 64px;
    padding: 12px clamp(18px, 4vw, 64px);
    border-bottom: 3px solid var(--green);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 1.12rem;
    font-weight: 900;
    text-decoration: none;
}

.landing-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.landing-header nav,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.landing-header nav a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    min-height: calc(100vh - 64px);
    padding: clamp(34px, 6vw, 86px) clamp(18px, 6vw, 88px) 40px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 6px solid var(--cyan);
    color: var(--primary);
    font-weight: 900;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(2.3rem, 5vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero-copy p,
.landing-section p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.hero-system {
    display: grid;
    gap: 16px;
}

.system-tier {
    padding: 24px;
    color: #ffffff;
    box-shadow: var(--shadow);
    clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
}

.system-tier strong,
.system-tier span {
    display: block;
    text-align: center;
}

.system-tier strong {
    font-size: 1.12rem;
}

.system-tier span {
    margin-top: 6px;
    opacity: 0.9;
}

.system-tier.primary {
    margin-inline: 54px;
    background: var(--primary);
}

.system-tier.green {
    margin-inline: 22px;
    background: var(--green);
}

.system-tier.cyan {
    background: var(--teal);
}

.landing-section {
    padding: 46px clamp(18px, 6vw, 88px);
}

.landing-section h2 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 1.75rem;
}

.landing-cards {
    display: grid;
    gap: 18px;
}

.landing-cards.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-cards article,
.module-list div,
.login-card {
    border: 1px solid #cdebef;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.landing-cards article {
    padding: 22px;
    border-bottom: 5px solid var(--teal);
}

.landing-cards article:nth-child(2) {
    border-bottom-color: var(--green);
}

.landing-cards article:nth-child(3) {
    border-bottom-color: var(--primary);
}

.landing-cards article span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
}

.landing-cards h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 28px;
    align-items: start;
}

.module-list {
    display: grid;
    gap: 10px;
}

.module-list div {
    display: grid;
    gap: 5px;
    padding: 16px;
    border-left: 6px solid var(--cyan);
}

.module-list div:nth-child(2) {
    border-left-color: var(--green);
}

.module-list div:nth-child(3) {
    border-left-color: var(--primary);
}

.module-list strong {
    color: var(--primary);
}

.module-list span {
    color: var(--muted);
}

.security-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #cdebef;
    border-bottom: 6px solid var(--green);
    background: #ffffff;
}

.login-stage {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-brand {
    position: absolute;
    top: 22px;
    left: 24px;
}

.login-card {
    width: min(100%, 480px);
    padding: 30px;
    border-top: 7px solid var(--cyan);
}

.login-card h1 {
    margin: 0;
    color: var(--primary);
    font-size: 1.75rem;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-check input {
    width: auto;
    min-height: auto;
}

.settings-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 16px;
}

.settings-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-soft);
}

.settings-list span {
    color: var(--muted);
    font-weight: 700;
}

.typing-editor {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.status {
    margin-top: 12px;
    color: var(--muted);
    font-weight: 650;
}

.error {
    color: var(--danger);
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 800;
}

.loading-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(247, 251, 252, 0.76);
    backdrop-filter: blur(2px);
}

.loading-backdrop::before {
    position: absolute;
    inset: -12vh -8vw;
    content: "";
    background: url("images/jimoskillgate-logo.png") center / min(82vw, 920px) no-repeat;
    filter: grayscale(1) opacity(0.08);
}

.loading-card {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 12px;
    min-width: 176px;
    padding: 26px 30px;
    border: 1px solid #dbe7ea;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(0, 84, 107, 0.16);
}

.loading-logo-frame {
    position: relative;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
}

.loading-ring {
    position: absolute;
    inset: 0;
    border: 4px solid #c8f4f7;
    border-top-color: var(--green);
    border-right-color: var(--cyan);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.loading-logo {
    position: relative;
    width: 44px;
    height: 44px;
    object-fit: contain;
    animation: logoPulse 1.3s ease-in-out infinite, logoColor 2.1s linear infinite;
}

.loading-card strong {
    color: var(--primary);
    font-size: 0.88rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pageIn {
    from {
        opacity: 0.75;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoPulse {
    0%,
    100% {
        transform: scale(0.94);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes logoColor {
    0% {
        filter: hue-rotate(0deg) saturate(1.1);
    }

    50% {
        filter: hue-rotate(80deg) saturate(1.45);
    }

    100% {
        filter: hue-rotate(0deg) saturate(1.1);
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .header-actions {
        gap: 8px;
    }

    .child-switcher label,
    .user-chip {
        display: none;
    }

    .page-jump {
        width: min(260px, 30vw);
    }

    .landing-hero,
    .split {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        min-height: auto;
    }

    .hero-system {
        max-width: 620px;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 3px auto minmax(0, 1fr);
    }

    .app-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        height: auto;
        padding: 12px;
    }

    .header-actions,
    .child-switcher {
        width: 100%;
    }

    .page-jump,
    .child-switcher select {
        width: 100%;
    }

    .app-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-search {
        grid-column: 1 / -1;
    }

    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }

    .section-title,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-header nav {
        width: 100%;
    }

    .landing-cards.three {
        grid-template-columns: 1fr;
    }

    .security-band {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .landing-header nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .landing-header nav .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .button,
    .security-band .button {
        width: 100%;
        text-align: center;
    }

    .system-tier,
    .system-tier.primary,
    .system-tier.green {
        margin-inline: 0;
        clip-path: none;
    }

    .login-brand {
        position: static;
        justify-self: start;
        margin-bottom: 20px;
    }
}
