:root {
    color-scheme: light;
    --background: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;
    --text: #17182c;
    --muted: #71758d;
    --border: #e4e6f0;
    --purple: #6c4cff;
    --purple-dark: #5035dc;
    --purple-soft: #eeeaff;
    --blue: #2879f6;
    --blue-soft: #eaf2ff;
    --green: #13966f;
    --green-soft: #e5f8f1;
    --orange: #db791a;
    --orange-soft: #fff1df;
    --red: #c53d4e;
    --red-soft: #fff0f2;
    --shadow:
        0 24px 70px rgba(35, 30, 82, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--background);
    color: var(--text);
    font-family:
        Tahoma,
        Arial,
        system-ui,
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
    background:
        linear-gradient(
            145deg,
            #846aff,
            #5335dc
        );
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    box-shadow:
        0 10px 24px rgba(108, 76, 255, 0.3);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--purple);
    font-size: 13px;
    font-weight: 800;
}

.admin-login-body {
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(108, 76, 255, 0.13),
            transparent 34%
        ),
        var(--background);
}

.login-shell {
    display: grid;
    grid-template-columns:
        minmax(320px, 0.95fr)
        minmax(420px, 1.05fr);
    min-height: 100vh;
}

.login-introduction {
    display: flex;
    flex-direction: column;
    padding: 48px clamp(35px, 6vw, 90px);
    background:
        linear-gradient(
            155deg,
            #17162d,
            #27204e 58%,
            #4b32b8
        );
    color: #fff;
}

.login-introduction .brand small {
    color: rgba(255, 255, 255, 0.64);
}

.introduction-content {
    width: min(520px, 100%);
    margin: auto 0;
    padding: 70px 0;
}

.introduction-content .eyebrow {
    color: #c7bbff;
}

.introduction-content h1 {
    margin: 0;
    font-size: clamp(34px, 4.4vw, 62px);
    line-height: 1.25;
}

.introduction-content p {
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 18px;
    line-height: 1.9;
}

.feature-list {
    display: grid;
    gap: 14px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-right: 30px;
    color: rgba(255, 255, 255, 0.88);
}

.feature-list li::before {
    position: absolute;
    top: 1px;
    right: 0;
    content: "✓";
    color: #a998ff;
    font-weight: 900;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.login-card {
    width: min(460px, 100%);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card-heading {
    margin-bottom: 28px;
}

.secure-badge,
.development-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-size: 12px;
    font-weight: 800;
}

.login-card h2 {
    margin: 18px 0 8px;
    font-size: 28px;
}

.login-card-heading p,
.security-note {
    color: var(--muted);
    line-height: 1.7;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 800;
}

.login-form input,
.login-form select {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: none;
    background: var(--surface-soft);
    color: var(--text);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.login-form input:focus,
.login-form select:focus {
    border-color: var(--purple);
    box-shadow:
        0 0 0 4px rgba(108, 76, 255, 0.12);
}

.login-form button {
    min-height: 54px;
    margin-top: 16px;
    border: 0;
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--purple-dark)
        );
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    box-shadow:
        0 13px 26px rgba(108, 76, 255, 0.24);
}

.login-form button:hover {
    filter: brightness(1.04);
}

.notice {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.notice-error {
    background: var(--red-soft);
    color: var(--red);
}

.notice-success {
    background: var(--green-soft);
    color: var(--green);
}

.security-note {
    margin: 22px 0 0;
    font-size: 12px;
    text-align: center;
}

.dashboard-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 18px;
}

.account-summary {
    text-align: left;
}

.account-summary strong,
.account-summary span {
    display: block;
}

.account-summary span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.logout-button {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100vh - 78px);
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 18px;
    border-left: 1px solid var(--border);
    background: var(--surface);
}

.dashboard-sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar-link {
    display: block;
    padding: 13px 15px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-weight: 800;
}

.sidebar-link.pending {
    cursor: default;
    opacity: 0.7;
}

.sidebar-status {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow:
        0 0 0 4px rgba(19, 150, 111, 0.12);
}

.dashboard-main {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px);
}

.dashboard-welcome {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.dashboard-welcome h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
}

.dashboard-welcome p {
    margin: 12px 0 0;
    color: var(--muted);
}

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

.stat-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface);
    box-shadow:
        0 10px 35px rgba(35, 30, 82, 0.05);
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 15px 0 8px;
    font-size: 36px;
}

.tone-purple {
    border-top: 4px solid var(--purple);
}

.tone-blue {
    border-top: 4px solid var(--blue);
}

.tone-green {
    border-top: 4px solid var(--green);
}

.tone-orange {
    border-top: 4px solid var(--orange);
}

.next-stage-card,
.security-summary {
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: var(--surface);
}

.next-stage-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 27px;
}

.next-stage-icon {
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: var(--purple-soft);
    color: var(--purple);
    font-size: 32px;
}

.next-stage-card h2,
.security-summary h2 {
    margin: 0;
    font-size: 21px;
}

.next-stage-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.security-summary {
    padding: 27px;
}

.security-items {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.security-items > div {
    padding: 15px;
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 14px;
}

.check-mark {
    margin-left: 7px;
    color: var(--green);
    font-weight: 900;
}

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

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-introduction {
        min-height: auto;
        padding: 28px 24px;
    }

    .introduction-content {
        padding: 60px 0 30px;
    }

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

    .dashboard-sidebar {
        display: none;
    }
}

@media (max-width: 620px) {
    .dashboard-header {
        align-items: flex-start;
        padding: 13px 16px;
    }

    .account-summary {
        display: none;
    }

    .brand small {
        display: none;
    }

    .dashboard-main {
        padding: 24px 16px;
    }

    .dashboard-welcome {
        display: block;
    }

    .development-badge {
        margin-top: 18px;
    }

    .statistics-grid,
    .security-items {
        grid-template-columns: 1fr;
    }

    .next-stage-card {
        align-items: flex-start;
    }

    .login-card {
        padding: 27px 21px;
        border-radius: 22px;
    }
}

/* WORKSPACE_ADMIN_COMPONENTS */
.dashboard-layout,
.dashboard-main {
    min-width: 0;
    max-width: 100%;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(29px, 4vw, 43px);
}

.page-heading p {
    margin: 11px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.workspace-total {
    padding: 10px 15px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.workspace-admin-grid {
    display: grid;
    grid-template-columns:
        minmax(300px, 390px)
        minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.workspace-form-card {
    position: sticky;
    top: 102px;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: var(--surface);
    box-shadow:
        0 10px 35px rgba(35, 30, 82, 0.05);
}

.workspace-form-card h2,
.section-heading h2 {
    margin: 0;
    font-size: 21px;
}

.workspace-form {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.workspace-form label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
}

.workspace-form input,
.workspace-form select,
.workspace-form textarea {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: var(--surface-soft);
    color: var(--text);
}

.workspace-form input:focus,
.workspace-form select:focus,
.workspace-form textarea:focus {
    border-color: var(--purple);
    box-shadow:
        0 0 0 4px rgba(108, 76, 255, 0.11);
}

.field-help {
    color: var(--muted);
    line-height: 1.6;
}

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

.form-columns > div {
    display: grid;
    gap: 9px;
}

.form-actions,
.workspace-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-actions {
    margin-top: 14px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 11px;
    text-decoration: none;
    font-weight: 800;
}

.primary-button {
    border: 0;
    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--purple-dark)
        );
    color: #fff;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.workspace-list {
    display: grid;
    gap: 15px;
    min-width: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface);
    box-shadow:
        0 10px 35px rgba(35, 30, 82, 0.045);
}

.workspace-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.workspace-card h3 {
    margin: 0 0 8px;
    font-size: 19px;
}

.workspace-card code {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.workspace-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-development {
    background: var(--orange-soft);
    color: var(--orange);
}

.status-active {
    background: var(--green-soft);
    color: var(--green);
}

.status-suspended {
    background: var(--red-soft);
    color: var(--red);
}

.status-archived {
    background: #eceef4;
    color: #686d7c;
}

.workspace-details {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.workspace-details > div {
    min-width: 0;
    padding: 12px;
    border-radius: 11px;
    background: var(--surface-soft);
}

.workspace-details dt {
    color: var(--muted);
    font-size: 11px;
}

.workspace-details dd {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.coming-soon {
    color: var(--muted);
    font-size: 12px;
}

.notice ul {
    margin: 8px 0 0;
    padding-right: 20px;
}

@media (max-width: 1080px) {
    .workspace-admin-grid {
        grid-template-columns: 1fr;
    }

    .workspace-form-card {
        position: static;
    }
}

@media (max-width: 620px) {
    .page-heading,
    .workspace-card-heading {
        display: block;
    }

    .workspace-total,
    .workspace-status {
        display: inline-flex;
        margin-top: 14px;
    }

    .form-columns,
    .workspace-details {
        grid-template-columns: 1fr;
    }
}

/* FLOW_ADMIN_COMPONENTS */
.flow-form textarea {
    width: 100%;
    min-width: 0;
    padding: 13px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    line-height: 1.7;
}

.flow-form textarea:focus {
    border-color: var(--purple);
    box-shadow:
        0 0 0 4px rgba(108, 76, 255, 0.11);
}

.flow-workspace-name {
    display: block;
    margin-bottom: 7px;
    color: var(--purple);
    font-size: 12px;
    font-weight: 800;
}

.flow-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.flow-status-draft {
    background: var(--orange-soft);
    color: var(--orange);
}

.flow-status-active {
    background: var(--green-soft);
    color: var(--green);
}

.flow-status-paused {
    background: var(--red-soft);
    color: var(--red);
}

.flow-status-archived {
    background: #eceef4;
    color: #686d7c;
}

.empty-state {
    padding: 42px 24px;
    border: 1px dashed var(--border);
    border-radius: 19px;
    background: var(--surface);
    text-align: center;
}

.empty-state strong {
    display: block;
    font-size: 18px;
}

.empty-state p {
    margin: 9px 0 0;
    color: var(--muted);
}


.security-note a {
    color: var(--purple-dark);
    font-weight: 800;
    text-decoration: none;
}

.security-note a:hover {
    text-decoration: underline;
}
