:root {
    --app-primary: #1768dc;
    --app-primary-dark: #0b4eb7;
    --app-primary-soft: #eef6ff;
    --app-surface: #ffffff;
    --app-background: #f5f7fb;
    --app-border: #e1e7f0;
    --app-text: #111c32;
    --app-muted: #68758a;
    --app-success: #087a52;
    --app-warning: #946200;
    --app-danger: #b42318;
    --app-shadow:
        0 10px 28px rgba(15, 23, 42, 0.07),
        0 2px 8px rgba(15, 23, 42, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--app-background);
    color: var(--app-text);
}

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

.marcus-app {
    display: flex;
    min-height: 100vh;
}

.marcus-app-main {
    min-width: 0;
    flex: 1;
    margin-left: 286px;
}

.marcus-app-topbar-slot {
    position: sticky;
    z-index: 40;
    top: 0;
}

.marcus-app-content {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 28px;
}

.module-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.module-page-heading-copy {
    min-width: 0;
}

.module-page-eyebrow,
.module-section-kicker {
    display: block;
    margin: 0 0 7px;
    color: #3277df;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.module-page-heading h1 {
    margin: 0;
    color: #111c32;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.module-page-heading p {
    max-width: 760px;
    margin: 9px 0 0;
    color: var(--app-muted);
    line-height: 1.6;
}

.module-heading-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.module-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 45px;
    padding: 10px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.module-button:hover {
    transform: translateY(-2px);
}

.module-button-primary {
    border: 0;
    background: linear-gradient(135deg, #0b4eb7 0%, #2576ef 100%);
    box-shadow: 0 10px 22px rgba(26, 104, 224, 0.22);
    color: #ffffff;
}

.module-button-secondary {
    border: 1px solid var(--app-border);
    background: #ffffff;
    color: #344054;
}

.module-button-secondary:hover {
    border-color: #b9d6ff;
    background: #f6faff;
    color: #1768dc;
}

.module-button-danger {
    border: 1px solid #f2c7c3;
    background: #fff4f2;
    color: var(--app-danger);
}

.module-button[disabled] {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.module-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    min-height: 260px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(77, 138, 234, 0.22);
    border-radius: 28px;
    background:
        radial-gradient(
            circle at 82% 18%,
            rgba(118, 170, 255, 0.44),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #092b72 0%,
            #1358c8 55%,
            #46a1ff 100%
        );
    box-shadow:
        0 24px 55px rgba(9, 43, 114, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.module-hero::before,
.module-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.module-hero::before {
    width: 260px;
    height: 260px;
    top: -145px;
    right: -40px;
    border: 1px solid rgba(255, 255, 255, 0.17);
}

.module-hero::after {
    width: 150px;
    height: 150px;
    right: 110px;
    bottom: -105px;
    background: rgba(255, 255, 255, 0.08);
}

.module-hero-copy {
    position: relative;
    z-index: 2;
    align-self: center;
    padding: 42px;
}

.module-hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    backdrop-filter: blur(9px);
}

.module-hero h2 {
    max-width: 780px;
    margin: 18px 0 12px;
    color: #ffffff;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.module-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.65;
}

.module-hero-visual {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    min-height: 250px;
}

.module-hero-icon {
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 22px 45px rgba(2, 20, 60, 0.22);
    color: #ffffff;
    font-size: 3.4rem;
    backdrop-filter: blur(15px);
}

.module-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.module-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--app-shadow);
}

.module-stat-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 15px;
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    color: #1768dc;
    font-size: 1.35rem;
}

.module-stat strong,
.module-stat span {
    display: block;
}

.module-stat strong {
    overflow: hidden;
    color: #15213a;
    font-size: 1.18rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-stat span {
    margin-top: 4px;
    color: #8792a5;
    font-size: 0.72rem;
    font-weight: 700;
}

.module-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.module-stack {
    display: grid;
    gap: 24px;
}

.module-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(218, 226, 238, 0.96);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: var(--app-shadow);
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid #e8edf4;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfcff 100%
        );
}

.module-card-heading {
    min-width: 0;
}

.module-card-heading h2,
.module-card-heading h3 {
    margin: 0;
    color: #111c32;
    line-height: 1.25;
}

.module-card-heading h2 {
    font-size: 1.25rem;
}

.module-card-heading h3 {
    font-size: 1.05rem;
}

.module-card-heading p {
    margin: 7px 0 0;
    color: #7b879a;
    font-size: 0.82rem;
    line-height: 1.5;
}

.module-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 29px;
    padding: 5px 10px;
    border: 1px solid #d6e8ff;
    border-radius: 999px;
    background: #eef6ff;
    color: #1768dc;
    font-size: 0.68rem;
    font-weight: 850;
    white-space: nowrap;
}

.module-card-body {
    padding: 24px;
}

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

.module-field {
    min-width: 0;
}

.module-field-full {
    grid-column: 1 / -1;
}

.module-field label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 800;
}

.module-input,
.module-select,
.module-textarea {
    width: 100%;
    border: 1px solid #dfe5ee;
    border-radius: 14px;
    outline: 0;
    background: #ffffff;
    color: #172033;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.module-input,
.module-select {
    height: 47px;
    padding: 0 14px;
}

.module-textarea {
    min-height: 190px;
    padding: 14px;
    resize: vertical;
    line-height: 1.6;
}

.module-input:focus,
.module-select:focus,
.module-textarea:focus {
    border-color: #83b6ff;
    box-shadow: 0 0 0 4px rgba(37, 118, 239, 0.10);
    background: #ffffff;
}

.module-field-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    color: #98a2b3;
    font-size: 0.7rem;
}

.module-dropzone {
    position: relative;
    display: grid;
    min-height: 168px;
    padding: 24px;
    place-items: center;
    border: 1.5px dashed #b9c9df;
    border-radius: 20px;
    background:
        linear-gradient(
            180deg,
            #fbfdff 0%,
            #f6f9fd 100%
        );
    text-align: center;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.module-dropzone:hover,
.module-dropzone.is-dragging {
    transform: translateY(-2px);
    border-color: #5c9af5;
    background: #f1f7ff;
}

.module-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.module-dropzone-icon {
    display: grid;
    width: 55px;
    height: 55px;
    margin: 0 auto 12px;
    place-items: center;
    border-radius: 17px;
    background: #eaf3ff;
    color: #1768dc;
    font-size: 1.55rem;
}

.module-dropzone strong {
    display: block;
    color: #23314d;
}

.module-dropzone span {
    display: block;
    margin-top: 7px;
    color: #8490a4;
    font-size: 0.78rem;
    line-height: 1.5;
}

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

.module-action-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e1e7f0;
    border-radius: 17px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.module-action-card:hover,
.module-action-card.is-active {
    transform: translateY(-2px);
    border-color: #a8cdfc;
    background: #f6faff;
    box-shadow: 0 10px 22px rgba(37, 118, 239, 0.09);
}

.module-action-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: #edf5ff;
    color: #1768dc;
    font-size: 1.15rem;
}

.module-action-card strong,
.module-action-card span {
    display: block;
}

.module-action-card strong {
    color: #24304a;
    font-size: 0.82rem;
}

.module-action-card span {
    margin-top: 4px;
    color: #8994a7;
    font-size: 0.68rem;
    line-height: 1.4;
}

.module-workspace {
    min-height: 360px;
    border: 1px solid #e0e6ef;
    border-radius: 19px;
    background:
        linear-gradient(
            180deg,
            #fbfcfe 0%,
            #f6f9fc 100%
        );
}

.module-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e4e9f1;
}

.module-editor-dots {
    display: flex;
    gap: 6px;
}

.module-editor-dots i {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #cbd5e1;
}

.module-editor-status {
    color: #8490a4;
    font-size: 0.68rem;
    font-weight: 800;
}

.module-editor-area {
    width: 100%;
    min-height: 305px;
    padding: 20px;
    border: 0;
    outline: 0;
    resize: vertical;
    background: transparent;
    color: #24304a;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.84rem;
    line-height: 1.65;
}

.module-preview {
    min-height: 300px;
    padding: 20px;
    border: 1px solid #e0e6ef;
    border-radius: 19px;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f8fafe 100%
        );
}

.module-preview-empty {
    display: grid;
    min-height: 258px;
    place-items: center;
    color: #8994a7;
    text-align: center;
}

.module-preview-empty-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 20px;
    background: #edf5ff;
    color: #1768dc;
    font-size: 1.8rem;
}

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

.module-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    border: 1px solid #e6ebf2;
    border-radius: 15px;
    background: #fbfcfe;
}

.module-list-item-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.module-list-item-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    background: #edf5ff;
    color: #1768dc;
}

.module-list-item strong,
.module-list-item span {
    display: block;
    min-width: 0;
}

.module-list-item strong {
    overflow: hidden;
    color: #27334d;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-list-item span {
    margin-top: 4px;
    color: #929caf;
    font-size: 0.66rem;
}

.module-list-item-status {
    flex: 0 0 auto;
    color: #1768dc;
    font-size: 0.68rem;
    font-weight: 850;
}

.module-empty {
    padding: 28px 20px;
    color: #8994a7;
    text-align: center;
}

.module-empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 13px;
    place-items: center;
    border-radius: 18px;
    background: #edf5ff;
    color: #1768dc;
    font-size: 1.55rem;
}

.module-empty strong {
    display: block;
    color: #344054;
}

.module-empty p {
    max-width: 360px;
    margin: 8px auto 0;
    font-size: 0.76rem;
    line-height: 1.55;
}

.module-tip {
    display: flex;
    gap: 13px;
    padding: 15px;
    border: 1px solid #dbeaff;
    border-radius: 17px;
    background: #f4f9ff;
}

.module-tip-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 12px;
    background: #ffffff;
    color: #1768dc;
    box-shadow: 0 5px 14px rgba(37, 118, 239, 0.10);
}

.module-tip strong {
    display: block;
    color: #24426f;
    font-size: 0.79rem;
}

.module-tip p {
    margin: 5px 0 0;
    color: #667d9f;
    font-size: 0.72rem;
    line-height: 1.5;
}

.module-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.module-toast {
    position: fixed;
    z-index: 200;
    right: 24px;
    bottom: 24px;
    max-width: min(380px, calc(100vw - 48px));
    padding: 14px 17px;
    border: 1px solid #cfe3ff;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    color: #24304a;
    font-size: 0.8rem;
    font-weight: 750;
    transform: translateY(25px);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.module-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.module-development-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 15px;
    border: 1px solid #f2dfab;
    border-radius: 16px;
    background: #fff9e8;
    color: #795b0c;
    font-size: 0.76rem;
    font-weight: 750;
}

@media (max-width: 1180px) {
    .module-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .marcus-app-main {
        margin-left: 0;
    }

    .module-hero {
        grid-template-columns: 1fr;
    }

    .module-hero-visual {
        display: none;
    }
}

@media (max-width: 760px) {
    .marcus-app-content {
        padding: 18px;
    }

    .module-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-heading-actions {
        width: 100%;
    }

    .module-heading-actions .module-button {
        flex: 1;
    }

    .module-hero {
        border-radius: 23px;
    }

    .module-hero-copy {
        padding: 28px 23px;
    }

    .module-stats {
        grid-template-columns: 1fr;
    }

    .module-form-grid,
    .module-actions-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        border-radius: 22px;
    }

    .module-card-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 19px;
    }

    .module-card-body {
        padding: 19px;
    }
}

@media (max-width: 480px) {
    .module-heading-actions {
        flex-direction: column;
    }

    .module-heading-actions .module-button {
        width: 100%;
    }

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

    .module-footer-actions .module-button {
        width: 100%;
    }
}
