:root {
    --bg: #f6f4ef;
    --bg-deep: #fbfaf7;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: #ffffff;
    --panel-soft: rgba(251, 250, 247, 0.96);
    --ink: #181715;
    --muted: #5f5a52;
    --line: rgba(41, 37, 36, 0.12);
    --line-strong: rgba(41, 37, 36, 0.18);
    --accent: #2f6fed;
    --accent-soft: #eaf1ff;
    --accent-strong: #2459c7;
    --shadow: 0 1px 2px rgba(24, 23, 21, 0.04), 0 10px 30px rgba(24, 23, 21, 0.06);
    --shadow-soft: 0 1px 2px rgba(24, 23, 21, 0.05), 0 8px 24px rgba(24, 23, 21, 0.07);
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --font-display: "Inter", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

button, input, select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-shell,
.admin-shell {
    min-height: 100vh;
    padding: 2rem;
}

.login-shell {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(47, 125, 106, 0.09), transparent 26%),
        linear-gradient(180deg, #f4f7f1 0%, #ece6db 100%);
}

.login-panel,
.admin-card,
.suite-sidebar,
.suite-main {
    backdrop-filter: blur(10px);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.login-panel {
    width: min(100%, 520px);
    padding: 2rem;
    border-radius: var(--radius-xl);
}

.login-panel-editorial {
    width: min(100%, 1080px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 388px);
    gap: 1.2rem;
    align-items: stretch;
    padding: 1.15rem;
    background:
        radial-gradient(circle at top right, rgba(47, 125, 106, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(246, 249, 243, 0.96), rgba(236, 230, 219, 0.92));
    border-color: rgba(37, 44, 34, 0.11);
}

.login-panel-editorial > * {
    height: 100%;
}

.login-editorial-copy,
.login-form-card,
.login-stage-head,
.login-stage-steps {
    display: grid;
    align-content: start;
}

.login-editorial-copy {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1rem 1rem 0.95rem;
    min-height: 100%;
}

.login-wordmark {
    display: inline-block;
    color: #2f7d6a;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-editorial-copy .eyebrow {
    margin-bottom: 0;
    color: #2f7d6a;
}

.login-editorial-copy h1 {
    max-width: 14ch;
    font-size: clamp(2rem, 3.5vw, 3.35rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.login-panel h1,
.admin-header h1,
.suite-header h2,
.brand-lockup h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.05em;
}

.login-copy,
.login-footnote,
.suite-sidebar-copy p,
.suite-header p,
.admin-header p,
.user-row p {
    color: var(--muted);
}

.login-copy {
    max-width: 46ch;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
}

.login-stage-mini {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 0.85rem;
    margin-top: auto;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: rgba(247, 251, 247, 0.7);
    border: 1px solid rgba(37, 44, 34, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.login-stage-head {
    gap: 0.2rem;
}

.login-stage-head span,
.login-form-head span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-stage-head strong,
.login-form-head strong {
    font-size: 1rem;
    line-height: 1.25;
}

.login-stage-steps {
    gap: 0.8rem;
}

.login-stage-step {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.login-stage-step span {
    width: 8px;
    height: 8px;
    margin-top: 0.38rem;
    border-radius: 999px;
    background: #2f7d6a;
    box-shadow: 0 0 0 4px rgba(47, 125, 106, 0.1);
}

.login-stage-step p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-stage-step p strong {
    color: var(--ink);
}

.login-form-card {
    height: 100%;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(242, 248, 243, 0.96), rgba(233, 241, 234, 0.92));
    border: 1px solid rgba(47, 125, 106, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.login-form-card label span {
    color: #335347;
}

.login-form-card input {
    border-color: rgba(47, 125, 106, 0.16);
    background: linear-gradient(180deg, rgba(250, 252, 248, 0.98), rgba(241, 247, 240, 0.96));
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.login-form-card input:focus {
    outline: none;
    border-color: rgba(47, 125, 106, 0.42);
    box-shadow: 0 0 0 4px rgba(47, 125, 106, 0.12);
}

.login-form-card input:-webkit-autofill,
.login-form-card input:-webkit-autofill:hover,
.login-form-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px rgba(241, 247, 240, 0.98) inset;
    transition: background-color 9999s ease-out 0s;
}

.login-form-card .primary-button {
    background: linear-gradient(180deg, #376f61 0%, #2f6658 100%);
    border-color: rgba(37, 44, 34, 0.08);
    box-shadow: 0 10px 24px rgba(47, 125, 106, 0.18);
}

.login-form-card .primary-button:hover {
    background: linear-gradient(180deg, #3b7667 0%, #315f54 100%);
}

.login-form-head {
    gap: 0.2rem;
}

.login-footnote {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-form,
.create-user-grid,
.user-form,
.password-form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.45rem;
}

label span {
    font-size: 0.88rem;
    font-weight: 600;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.98);
}

.primary-button,
.secondary-button,
.danger-button,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.secondary-link:hover,
.tool-chip:hover,
.hamburger:hover {
    transform: translateY(-1px);
}

.primary-button {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.secondary-button,
.secondary-link {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--ink);
}

.danger-button {
    background: #b0332c;
    color: white;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
}

.flash-error {
    background: #fff0ee;
    color: #b0332c;
}

.suite-shell {
    --suite-bg: #f4f7f1;
    --suite-bg-deep: #ece6db;
    --suite-panel: rgba(255, 252, 246, 0.82);
    --suite-panel-strong: rgba(255, 255, 255, 0.9);
    --suite-panel-soft: rgba(244, 248, 242, 0.9);
    --suite-ink: #191713;
    --suite-muted: #5d5f56;
    --suite-line: rgba(37, 44, 34, 0.11);
    --suite-line-strong: rgba(37, 44, 34, 0.16);
    --suite-accent: #2f7d6a;
    --suite-accent-soft: rgba(47, 125, 106, 0.12);
    --suite-accent-strong: #266a5a;
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    min-height: 100vh;
    gap: 0.8rem;
    padding: 0.8rem;
    background:
        radial-gradient(circle at top left, rgba(47, 125, 106, 0.09), transparent 28%),
        linear-gradient(180deg, var(--suite-bg) 0%, var(--suite-bg-deep) 100%);
}

.suite-shell[data-sidebar-open="false"] {
    grid-template-columns: 64px minmax(0, 1fr);
}

.suite-sidebar,
.suite-main {
    border-radius: var(--radius-xl);
}

.suite-sidebar {
    backdrop-filter: blur(10px);
    background: var(--suite-panel);
    border: 1px solid var(--suite-line);
    box-shadow: 0 1px 2px rgba(24, 23, 21, 0.04), 0 16px 40px rgba(24, 23, 21, 0.07);
    padding: 0.9rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.9rem;
    overflow: hidden;
}

.suite-sidebar-top {
    display: grid;
    gap: 0.75rem;
}

.suite-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hamburger {
    width: 34px;
    height: 34px;
    border: 1px solid var(--suite-line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.94);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    box-shadow: none;
    padding: 0;
    padding-left: 9px;
}

.hamburger-line {
    display: block;
    height: 2px;
    background: var(--suite-ink);
    border-radius: 999px;
    transition: width 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.line-one { width: 10px; }
.line-two { width: 14px; }
.line-three { width: 8px; }

.brand-lockup {
    display: grid;
    gap: 0.2rem;
}

.brand-lockup h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-lockup p {
    margin: 0;
    color: var(--suite-muted);
    font-size: 0.84rem;
}

.suite-sidebar-copy {
    padding: 0.1rem 0 0;
}

.suite-sidebar-copy p {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--suite-muted);
}

.suite-sidebar-section {
    display: grid;
    align-content: start;
    gap: 0.65rem;
}

.suite-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--suite-muted);
    letter-spacing: 0.01em;
}

.tool-nav {
    display: grid;
    gap: 0.45rem;
    align-content: start;
}

.tool-chip {
    width: 100%;
    text-align: left;
    display: block;
    padding: 0.75rem 0.82rem 0.75rem 0.92rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tool-chip-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.tool-chip strong {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--suite-ink);
}

.tool-chip-copy span {
    font-size: 0.82rem;
    line-height: 1.38;
    color: var(--suite-muted);
}

.tool-chip.is-active {
    border-color: rgba(47, 125, 106, 0.18);
    background: var(--suite-accent-soft);
    box-shadow: inset 0 0 0 1px rgba(47, 125, 106, 0.05);
}

.sidebar-footer {
    display: grid;
    gap: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--suite-line);
}

.sidebar-user {
    display: grid;
    gap: 0.2rem;
}

.sidebar-user strong {
    font-size: 0.9rem;
}

.sidebar-user span {
    color: var(--suite-muted);
    font-size: 0.84rem;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.suite-shell[data-sidebar-open="false"] .brand-lockup,
.suite-shell[data-sidebar-open="false"] .suite-sidebar-copy,
.suite-shell[data-sidebar-open="false"] .suite-section-label,
.suite-shell[data-sidebar-open="false"] .tool-nav,
.suite-shell[data-sidebar-open="false"] .tool-chip-copy,
.suite-shell[data-sidebar-open="false"] .sidebar-footer {
    display: none;
}

.suite-shell[data-sidebar-open="false"] .suite-sidebar {
    padding: 0.7rem 0.5rem;
    grid-template-rows: auto;
    justify-items: center;
    align-content: start;
}

.suite-shell[data-sidebar-open="false"] .suite-brand {
    width: 100%;
    justify-content: center;
}

.suite-main {
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.9) 0%, rgba(250, 248, 243, 0.86) 100%);
    border: 1px solid var(--suite-line);
    box-shadow: 0 1px 2px rgba(24, 23, 21, 0.04), 0 20px 52px rgba(24, 23, 21, 0.08);
    padding: 1rem 1.05rem 1.05rem;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.9rem;
    min-width: 0;
}

.suite-header,
.admin-header,
.user-row-top,
.user-secondary-actions,
.admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.suite-header-copy h2 {
    font-size: clamp(1.58rem, 2.1vw, 2rem);
}

.suite-header-copy p:last-child {
    margin-top: 0.35rem;
    max-width: 56ch;
    color: var(--suite-muted);
}

.suite-header-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-meta-card {
    min-width: 144px;
    padding: 0.62rem 0.78rem;
    border-radius: var(--radius-lg);
    background: var(--suite-panel-soft);
    border: 1px solid var(--suite-line);
    display: grid;
    gap: 0.18rem;
}

.header-meta-card span {
    color: var(--suite-muted);
    font-size: 0.78rem;
}

.header-meta-card strong {
    font-size: 0.92rem;
}

.tool-workspace,
.tool-empty {
    min-height: 0;
}

.tool-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.55rem;
}

.tool-frame-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.1rem 0.15rem 0;
}

.tool-frame-meta {
    display: grid;
    gap: 0.15rem;
}

.tool-frame-meta--right {
    text-align: right;
}

.tool-frame-label {
    color: var(--suite-muted);
    font-size: 0.74rem;
}

.tool-frame-meta strong {
    font-size: 0.88rem;
}

.tool-panel,
.tool-empty {
    border: 1px solid var(--suite-line);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--suite-panel-strong);
}

.tool-panel iframe {
    width: 100%;
    height: 100%;
    min-height: 72vh;
    border: 0;
    background: white;
}

.tool-empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2.4rem;
    color: var(--suite-muted);
}

.suite-shell .secondary-link {
    background: rgba(255, 255, 255, 0.84);
    border-color: var(--suite-line);
    color: var(--suite-ink);
}

.suite-shell .secondary-link:hover,
.suite-shell .tool-chip:hover,
.suite-shell .hamburger:hover {
    box-shadow: 0 10px 24px rgba(24, 23, 21, 0.06);
}

.suite-shell .eyebrow,
.suite-shell .header-meta-card strong,
.suite-shell .tool-frame-meta strong {
    color: var(--suite-ink);
}

.suite-shell .brand-lockup h1,
.suite-shell .suite-header h2,
.suite-shell .sidebar-user strong {
    color: var(--suite-ink);
}

.admin-shell {
    display: grid;
    gap: 1rem;
}

.admin-card {
    padding: 1.35rem;
    border-radius: var(--radius-xl);
}

.create-user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-checkbox input,
.tool-check input {
    width: auto;
}

.tool-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tool-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--line);
}

.user-list {
    display: grid;
    gap: 1rem;
}

.user-row {
    padding: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 1rem;
}

.pill-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-pill {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-active {
    background: #edf6ef;
    color: #4d7a57;
}

.status-suspended {
    background: #fff0ee;
    color: #b0332c;
}

.status-admin {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-strong);
}

.user-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.password-form {
    grid-template-columns: minmax(220px, 280px) auto;
    align-items: end;
}

@media (max-width: 960px) {
    .login-panel-editorial {
        grid-template-columns: 1fr;
    }

    .login-editorial-copy {
        padding: 0.4rem;
    }

    .login-editorial-copy h1 {
        max-width: 100%;
        font-size: clamp(1.85rem, 6vw, 2.5rem);
    }

    .suite-shell,
    .suite-shell[data-sidebar-open="false"] {
        grid-template-columns: 1fr;
    }

    .suite-sidebar {
        grid-template-rows: auto auto auto auto;
    }

    .suite-shell[data-sidebar-open="false"] .suite-sidebar {
        padding-bottom: 0.5rem;
    }

    .suite-shell[data-sidebar-open="false"] .tool-nav,
    .suite-shell[data-sidebar-open="false"] .sidebar-footer {
        display: none;
    }

    .create-user-grid,
    .user-form,
    .password-form {
        grid-template-columns: 1fr;
    }

    .suite-header,
    .admin-header,
    .user-row-top,
    .user-secondary-actions {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .login-shell {
        padding: 0.9rem;
    }

    .login-panel-editorial {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .login-form-card,
    .login-stage-mini {
        padding: 0.95rem;
    }

    .login-editorial-copy h1 {
        font-size: clamp(1.7rem, 8.2vw, 2.2rem);
    }

    .login-copy,
    .login-stage-step p,
    .login-footnote {
        font-size: 0.88rem;
    }
}
