:root {
    color-scheme: light;
    --ink: #121826;
    --muted: #667085;
    --line: #d9e1ea;
    --panel: #ffffff;
    --soft: #f5f7fa;
    --accent: #0b7f73;
    --accent-strong: #075f56;
    --accent-soft: #e6f4f1;
    --gold: #bc8428;
    --danger: #b93838;
    --shadow: 0 18px 45px rgba(18, 24, 38, 0.08);
    --shadow-soft: 0 8px 24px rgba(18, 24, 38, 0.06);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 247, 250, 0.96)),
        radial-gradient(circle at top left, rgba(11, 127, 115, 0.1), transparent 34%),
        var(--soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
input,
textarea {
    border-radius: 6px;
}

.app-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0 16px;
}

.topbar.compact h1 {
    font-size: clamp(1.7rem, 5vw, 2.45rem);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1;
}

.status-pill {
    min-width: 76px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
    gap: 16px;
    align-items: start;
}

.control-panel,
.preview-panel,
.lock-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.control-panel,
.preview-panel {
    padding: 16px;
    border-radius: 10px;
}

fieldset {
    min-width: 0;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

legend,
label > span,
.idea-field > span {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
}

.segmented {
    display: grid;
    gap: 8px;
}

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

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

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: grid;
    min-height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    background: #fbfcfe;
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
}

.segmented input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

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

select,
textarea,
input[type="file"],
.lock-card input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select,
.lock-card input {
    min-height: 42px;
    padding: 0 10px;
}

select:focus,
textarea:focus,
input:focus {
    border-color: rgba(11, 127, 115, 0.75);
    box-shadow: 0 0 0 3px rgba(11, 127, 115, 0.12);
    outline: 0;
}

textarea {
    display: block;
    min-height: 118px;
    padding: 10px;
    resize: vertical;
}

.hint {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.upload-grid {
    display: grid;
    gap: 8px;
}

.upload-tile {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.upload-tile strong {
    font-size: 0.92rem;
}

.upload-tile input {
    min-height: 44px;
    padding: 9px;
}

.plate-tool {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #f0cf91;
    border-radius: 8px;
    background: #fff8ea;
}

.plate-tool h2 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.plate-tool p {
    margin-bottom: 0;
    color: #76531a;
    font-size: 0.9rem;
}

#plateCanvas {
    width: 100%;
    max-height: 360px;
    border-radius: 8px;
    background: #131821;
    touch-action: none;
}

.tool-row,
.action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.idea-field,
.logo-field {
    display: block;
    margin-bottom: 14px;
}

button {
    min-height: 42px;
    border: 0;
    cursor: pointer;
    font-weight: 850;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.generate-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(135deg, #121826, #20314d);
    color: #fff;
    box-shadow: 0 10px 22px rgba(18, 24, 38, 0.18);
}

.secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.secondary:hover:not(:disabled) {
    border-color: rgba(11, 127, 115, 0.45);
    box-shadow: var(--shadow-soft);
}

.preview-panel {
    position: sticky;
    top: 14px;
    display: grid;
    gap: 12px;
}

.brand-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfcfe, #f7fafc);
}

.logo-mark {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 900;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.logo-mark.has-logo {
    color: transparent;
    background-color: #fff;
    border: 1px solid var(--line);
}

.brand-card p {
    margin-bottom: 2px;
    font-weight: 900;
}

.brand-card span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.preview-frame {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.38), transparent),
        #edf1f6;
}

.preview-frame.portrait {
    aspect-ratio: 2 / 3;
}

.empty-preview {
    display: grid;
    width: 74%;
    aspect-ratio: 1 / 1;
    place-items: center;
    border: 1px dashed #aeb9c7;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 900;
}

#resultImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.message-log {
    min-height: 42px;
    padding: 10px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.92rem;
    font-weight: 700;
}

.message-log.error {
    background: #fff1f1;
    color: var(--danger);
}

.caption-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.caption-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.caption-head h2 {
    margin: 0;
    font-size: 1rem;
}

.compact-button {
    min-height: 34px;
    padding: 0 12px;
}

#captionText {
    min-height: 150px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-screen,
.lock-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 247, 250, 0.95)),
        radial-gradient(circle at 18% 18%, rgba(11, 127, 115, 0.12), transparent 30%),
        radial-gradient(circle at 82% 20%, rgba(188, 132, 40, 0.1), transparent 28%);
}

.auth-card,
.lock-card {
    width: min(430px, 100%);
    padding: 26px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-card label,
.lock-card h1 {
    display: block;
    margin-bottom: 14px;
}

.auth-card h1,
.lock-card h1 {
    margin-bottom: 18px;
    font-size: 2.35rem;
}

.auth-card button,
.lock-card button {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(135deg, #121826, #20314d);
    color: #fff;
}

.form-error {
    margin: 8px 0 0;
    color: var(--danger);
    font-weight: 700;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.password-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.password-control .compact-button {
    width: auto;
    min-width: 64px;
    margin: 0;
    padding: 0 12px;
}

.auth-option {
    margin-top: 2px;
}

.top-actions a {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
}

.brand-options {
    grid-template-columns: repeat(var(--option-count, 2), minmax(0, 1fr));
}

.notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 800;
}

.notice.error {
    background: #fff1f1;
    color: var(--danger);
}

.notice.admin-context {
    border: 1px solid rgba(8, 13, 25, 0.08);
    background: #fff;
    color: #4d5665;
    box-shadow: 0 8px 24px rgba(8, 13, 25, 0.04);
}

.admin-shell {
    width: min(1280px, 100%);
}

.portal-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    width: min(1360px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
}

.portal-sidebar,
.portal-main {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.portal-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
    display: grid;
    gap: 18px;
    min-height: calc(100vh - 36px);
    padding: 16px;
    border-radius: 14px;
}

.portal-main {
    min-width: 0;
    padding: 18px;
    border-radius: 14px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-mark,
.record-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #121826, #20314d);
    color: #fff;
    font-weight: 900;
}

.portal-mark {
    width: 44px;
    height: 44px;
}

.portal-brand p,
.record-head h3 {
    margin: 0;
    font-weight: 900;
}

.portal-brand span,
.record-head span,
.form-title span,
.section-head > span,
.portal-user strong {
    color: var(--muted);
    font-size: 0.88rem;
}

.portal-nav,
.portal-side-actions {
    display: grid;
    gap: 8px;
}

.portal-nav a,
.portal-side-actions a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 850;
}

.portal-nav a {
    background: #f8fafc;
}

.portal-nav a.is-active {
    border-color: rgba(11, 127, 115, 0.35);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.portal-nav strong {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff;
    text-align: center;
}

.portal-side-actions {
    align-self: end;
}

.portal-side-actions a {
    border-color: var(--line);
    background: #fff;
}

.portal-header,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-header {
    margin-bottom: 16px;
}

.portal-user {
    display: grid;
    justify-items: end;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.portal-user span {
    font-weight: 900;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.metric-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.metric-card strong {
    font-size: 1.7rem;
    line-height: 1;
}

.portal-section {
    display: none;
}

.portal-section.is-active {
    display: grid;
    gap: 14px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.55rem;
}

.portal-form {
    padding: 16px;
}

.form-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.form-title h3 {
    margin: 0;
}

.record-list {
    display: grid;
    gap: 12px;
}

.record-card {
    border-left: 4px solid rgba(11, 127, 115, 0.45);
}

.record-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-avatar {
    width: 42px;
    height: 42px;
}

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

.readonly-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.readonly-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.readonly-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.account-card {
    max-width: 760px;
}

.empty-state {
    padding: 22px;
    border: 1px dashed #b8c4d2;
    border-radius: 12px;
    background: #fbfcfe;
}

.empty-state h3 {
    margin-bottom: 4px;
}

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

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 14px;
    align-items: start;
}

.admin-panel {
    display: grid;
    gap: 10px;
}

.admin-panel h2,
.admin-form h3 {
    margin-bottom: 0;
}

.admin-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

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

.admin-form input,
.auth-card input {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: #fff;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

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

.check-line span {
    margin: 0;
    font-weight: 700;
}

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

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

    .portal-sidebar {
        position: static;
        min-height: 0;
    }

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

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

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
        order: -1;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .portal-shell,
    .app-shell {
        padding: 14px;
    }

    .portal-main,
    .portal-sidebar {
        padding: 14px;
    }

    .portal-header,
    .section-head,
    .form-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .control-panel,
    .preview-panel {
        padding: 14px;
    }

    .field-grid,
    .segmented.three,
    .admin-fields,
    .checkbox-grid,
    .readonly-grid,
    .brand-options {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.25rem;
    }
}

/* Commercial refresh */
:root {
    --ink: #0a0f1c;
    --muted: #687385;
    --line: #e0e6ef;
    --soft: #f6f7fb;
    --accent: #12a394;
    --accent-strong: #08766d;
    --accent-soft: #e7f7f5;
    --violet: #5b5cf6;
    --amber: #c88b28;
    --shadow: 0 24px 70px rgba(10, 15, 28, 0.12);
    --shadow-soft: 0 12px 34px rgba(10, 15, 28, 0.08);
}

body {
    background:
        radial-gradient(circle at 12% 0%, rgba(18, 163, 148, 0.14), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(91, 92, 246, 0.12), transparent 28%),
        linear-gradient(180deg, #fbfcff 0%, #f4f6fb 44%, #eef2f7 100%);
}

h1 {
    letter-spacing: 0;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.portal-shell {
    gap: 20px;
    width: min(1440px, 100%);
    padding: 20px;
}

.portal-sidebar {
    border: 0;
    background:
        linear-gradient(180deg, rgba(18, 24, 38, 0.98), rgba(9, 14, 25, 0.98)),
        radial-gradient(circle at 24% 0%, rgba(18, 163, 148, 0.35), transparent 34%);
    box-shadow: 0 30px 80px rgba(10, 15, 28, 0.24);
    color: #fff;
}

.portal-brand {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-brand p {
    color: #fff;
}

.portal-brand span,
.portal-sidebar .portal-side-actions a {
    color: rgba(255, 255, 255, 0.66);
}

.portal-mark,
.record-avatar,
.logo-mark {
    background:
        linear-gradient(135deg, rgba(18, 163, 148, 0.98), rgba(91, 92, 246, 0.92));
}

.portal-nav {
    gap: 10px;
}

.portal-nav a {
    min-height: 48px;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
}

.portal-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.portal-nav a.is-active {
    border-color: rgba(18, 163, 148, 0.65);
    background: linear-gradient(135deg, rgba(18, 163, 148, 0.22), rgba(91, 92, 246, 0.16));
    color: #fff;
}

.portal-nav strong {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-side-actions a {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.portal-main,
.control-panel,
.preview-panel,
.auth-card,
.lock-card {
    border: 1px solid rgba(224, 230, 239, 0.9);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.portal-main {
    padding: 22px;
}

.portal-header {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.portal-header h1,
.topbar h1 {
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 900;
}

.portal-user,
.status-pill,
.top-actions a {
    border-color: rgba(224, 230, 239, 0.95);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.metric-grid {
    gap: 12px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border-color: rgba(224, 230, 239, 0.95);
    background:
        linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: var(--shadow-soft);
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: rgba(18, 163, 148, 0.1);
}

.metric-card strong {
    font-size: 2rem;
}

.section-head {
    padding: 4px 0 2px;
}

.section-head h2 {
    font-size: 1.75rem;
}

.admin-form,
.caption-panel,
.brand-card,
.empty-state,
.readonly-grid div {
    border-color: rgba(224, 230, 239, 0.95);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.portal-form {
    padding: 18px;
    border-radius: 16px;
}

.record-card {
    border-left: 0;
}

.record-head {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

select,
textarea,
input[type="file"],
.lock-card input,
.admin-form input,
.auth-card input {
    min-height: 44px;
    border-color: #d8e1ec;
    background: #fbfcfe;
}

textarea {
    line-height: 1.45;
}

.segmented {
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7f9fc;
}

.segmented span {
    min-height: 42px;
    border-radius: 9px;
    border-color: transparent;
    background: transparent;
}

.segmented input:checked + span {
    border-color: rgba(18, 163, 148, 0.35);
    background: #fff;
    box-shadow: 0 8px 20px rgba(10, 15, 28, 0.08);
}

.generate-button,
.auth-card button,
.lock-card button,
.admin-form button[type="submit"] {
    min-height: 46px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, #0a0f1c 0%, #18243b 52%, #102f35 100%);
    box-shadow: 0 16px 30px rgba(10, 15, 28, 0.2);
}

.secondary {
    border-radius: 10px;
}

.preview-frame {
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(circle at 50% 0%, rgba(18, 163, 148, 0.08), transparent 40%),
        #edf1f6;
}

.message-log {
    border: 1px solid rgba(18, 163, 148, 0.18);
}

.auth-screen,
.lock-screen {
    background:
        radial-gradient(circle at 20% 14%, rgba(18, 163, 148, 0.2), transparent 28%),
        radial-gradient(circle at 80% 16%, rgba(91, 92, 246, 0.16), transparent 30%),
        linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
}

.auth-card,
.lock-card {
    width: min(460px, 100%);
    padding: 30px;
    border-radius: 18px;
}

.auth-card h1,
.lock-card h1 {
    font-size: 2.55rem;
}

@media (max-width: 860px) {
    .portal-sidebar {
        color: var(--ink);
        background: rgba(255, 255, 255, 0.94);
    }

    .portal-brand p {
        color: var(--ink);
    }

    .portal-brand span,
    .portal-sidebar .portal-side-actions a {
        color: var(--muted);
    }

    .portal-nav a {
        border-color: var(--line);
        background: #f8fafc;
        color: var(--ink);
    }

    .portal-nav a.is-active {
        background: var(--accent-soft);
        color: var(--accent-strong);
    }

    .portal-nav strong {
        background: #fff;
        color: var(--ink);
    }
}

/* Commercial refresh v2 */
:root {
    --ink: #080d19;
    --muted: #697386;
    --line: #dce4ef;
    --soft: #f5f7fb;
    --panel: #ffffff;
    --accent: #10a596;
    --accent-strong: #06776e;
    --accent-soft: #e8f8f5;
    --violet: #635bff;
    --night: #080d19;
    --night-2: #111827;
    --shadow: 0 28px 80px rgba(8, 13, 25, 0.13);
    --shadow-soft: 0 14px 38px rgba(8, 13, 25, 0.08);
}

body {
    background:
        linear-gradient(rgba(8, 13, 25, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 13, 25, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #fcfdff 0%, #f5f7fb 48%, #eef2f7 100%);
    background-size: 36px 36px, 36px 36px, auto;
}

.portal-shell {
    grid-template-columns: 276px minmax(0, 1fr);
    gap: 22px;
    width: min(1480px, 100%);
    padding: 22px;
}

.portal-sidebar {
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background:
        linear-gradient(180deg, #101728 0%, #090e19 100%);
    box-shadow: 0 28px 90px rgba(8, 13, 25, 0.28);
}

.portal-sidebar::before {
    content: "";
    display: block;
    height: 3px;
    margin: -18px -18px 18px;
    background: linear-gradient(90deg, var(--accent), var(--violet), #f0b86a);
}

.portal-brand {
    gap: 11px;
    padding-bottom: 16px;
}

.portal-brand p {
    font-size: 1rem;
    letter-spacing: 0;
}

.portal-mark,
.record-avatar,
.logo-mark {
    border-radius: 13px;
    background: linear-gradient(135deg, #15b8a7 0%, #635bff 100%);
    box-shadow: 0 12px 26px rgba(16, 165, 150, 0.24);
}

.portal-mark {
    width: 42px;
    height: 42px;
}

.portal-nav {
    gap: 9px;
}

.portal-nav a,
.portal-side-actions a {
    border-radius: 13px;
    font-size: 0.94rem;
}

.portal-nav a {
    min-height: 50px;
    padding: 0 13px;
}

.portal-nav a.is-active {
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(16, 165, 150, 0.26), rgba(99, 91, 255, 0.2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.portal-main {
    min-height: calc(100vh - 44px);
    padding: 26px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
}

.portal-header {
    margin-bottom: 22px;
    padding-bottom: 18px;
}

.portal-header h1,
.topbar h1 {
    font-size: clamp(2.2rem, 4vw, 3.65rem);
    letter-spacing: 0;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.portal-user,
.status-pill,
.top-actions a {
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(8, 13, 25, 0.07);
}

.workspace {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
    gap: 20px;
}

.control-panel,
.preview-panel,
.admin-form,
.brand-card,
.caption-panel,
.readonly-grid div,
.empty-state,
.auth-card,
.lock-card {
    border: 1px solid rgba(220, 228, 239, 0.95);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.control-panel,
.preview-panel,
.admin-form,
.auth-card,
.lock-card {
    border-radius: 22px;
}

.control-panel,
.preview-panel {
    padding: 22px;
}

.control-panel fieldset {
    margin-bottom: 18px;
}

legend,
label > span,
.idea-field > span {
    margin-bottom: 9px;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    text-transform: none;
}

.segmented {
    gap: 5px;
    padding: 5px;
    border-radius: 15px;
    background: #f4f7fb;
}

.segmented span {
    min-height: 46px;
    border-radius: 11px;
    font-size: 0.94rem;
}

.segmented input:checked + span {
    border-color: transparent;
    background: linear-gradient(135deg, #101728, #182337);
    color: #fff;
    box-shadow: 0 13px 26px rgba(8, 13, 25, 0.18);
}

select,
textarea,
input[type="file"],
.lock-card input,
.admin-form input,
.auth-card input {
    min-height: 50px;
    border-radius: 12px;
    background: #fbfcff;
}

select:focus,
textarea:focus,
input:focus {
    border-color: rgba(16, 165, 150, 0.65);
    box-shadow: 0 0 0 4px rgba(16, 165, 150, 0.12);
    outline: none;
}

textarea {
    min-height: 116px;
}

.idea-field textarea {
    min-height: 160px;
}

.upload-grid label,
.plate-tool {
    border-radius: 16px;
    background: #f8fafc;
}

.generate-button,
.auth-card button,
.lock-card button,
.admin-form button[type="submit"] {
    min-height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d1524 0%, #12383f 50%, #10a596 100%);
    box-shadow: 0 18px 34px rgba(8, 13, 25, 0.22);
}

.generate-button:hover,
.auth-card button:hover,
.lock-card button:hover,
.admin-form button[type="submit"]:hover {
    transform: translateY(-1px);
}

.secondary {
    min-height: 48px;
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
}

.brand-card {
    border-radius: 18px;
}

.preview-frame {
    min-height: 430px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(245, 248, 252, 0.9)),
        linear-gradient(135deg, rgba(16, 165, 150, 0.08), rgba(99, 91, 255, 0.08));
}

.empty-preview {
    border-radius: 18px;
    border-color: rgba(105, 115, 134, 0.34);
}

.message-log {
    border-radius: 15px;
    background: #eef9f6;
}

.caption-panel {
    border-radius: 18px;
}

.metric-grid {
    gap: 14px;
}

.metric-card {
    min-height: 110px;
    padding: 18px;
    border-radius: 18px;
}

.metric-card span {
    margin-bottom: 16px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric-card strong {
    font-size: 2.35rem;
}

.section-head {
    margin-bottom: 2px;
}

.section-head h2 {
    font-size: 1.9rem;
}

.portal-form {
    padding: 20px;
}

.admin-form {
    gap: 14px;
}

.record-card {
    border-left: 0;
}

.record-head {
    padding-bottom: 14px;
}

.admin-fields {
    gap: 12px;
}

.checkbox-grid {
    gap: 10px;
}

.check-line {
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.auth-screen,
.lock-screen {
    background:
        linear-gradient(rgba(8, 13, 25, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 13, 25, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #fcfdff 0%, #f3f6fb 100%);
    background-size: 36px 36px, 36px 36px, auto;
}

.auth-card,
.lock-card {
    padding: 34px;
}

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

    .preview-panel {
        position: static;
    }
}

@media (max-width: 860px) {
    .portal-shell {
        gap: 14px;
        padding: 14px;
    }

    .portal-sidebar {
        border-color: rgba(220, 228, 239, 0.95);
        color: var(--ink);
        background: rgba(255, 255, 255, 0.94);
    }

    .portal-sidebar::before {
        margin: -14px -14px 14px;
    }

    .portal-main {
        min-height: auto;
        padding: 18px;
        border-radius: 20px;
    }

    .portal-header h1,
    .topbar h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 560px) {
    .control-panel,
    .preview-panel,
    .portal-form {
        padding: 16px;
        border-radius: 18px;
    }

    .preview-frame {
        min-height: 320px;
    }
}

/* Premium login */
.auth-screen {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
    gap: 28px;
    width: min(1180px, calc(100% - 36px));
    min-height: 100vh;
    margin: 0 auto;
    place-items: center;
    padding: 32px 0;
    background: none;
}

body:has(.auth-screen) {
    background:
        radial-gradient(circle at 18% 12%, rgba(16, 165, 150, 0.16), transparent 30%),
        radial-gradient(circle at 86% 14%, rgba(99, 91, 255, 0.14), transparent 30%),
        linear-gradient(rgba(8, 13, 25, 0.032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 13, 25, 0.032) 1px, transparent 1px),
        #f7f9fc;
    background-size: auto, auto, 42px 42px, 42px 42px, auto;
}

.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 620px;
    padding: 30px;
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(12, 18, 32, 0.98), rgba(10, 38, 43, 0.96)),
        radial-gradient(circle at 20% 20%, rgba(16, 165, 150, 0.28), transparent 34%);
    color: #fff;
    box-shadow: 0 34px 100px rgba(8, 13, 25, 0.28);
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: auto -12% -24% 18%;
    height: 280px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16, 165, 150, 0.28), rgba(99, 91, 255, 0.22));
    filter: blur(34px);
}

.auth-brand-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}

.auth-logo {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, #17baa9, #635bff);
    color: #fff;
    font-size: 0.86rem;
    box-shadow: 0 14px 34px rgba(16, 165, 150, 0.26);
}

.auth-hero-copy {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    margin-top: 94px;
}

.auth-hero-copy .eyebrow {
    color: #71e4d7;
}

.auth-hero-copy h1 {
    margin-bottom: 18px;
    color: #fff;
    font-size: clamp(3rem, 5vw, 4.65rem);
    line-height: 0.94;
    letter-spacing: 0;
}

.auth-hero-copy p:last-child {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.03rem;
    line-height: 1.65;
}

.auth-preview-card {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    margin: auto 0 0 auto;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.auth-preview-top {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
}

.auth-preview-top span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
}

.auth-preview-grid {
    display: grid;
    grid-template-columns: 1fr 0.72fr;
    gap: 10px;
}

.auth-preview-grid div {
    min-height: 76px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-preview-grid div:first-child {
    grid-row: span 2;
    min-height: 162px;
    background: linear-gradient(135deg, rgba(16, 165, 150, 0.7), rgba(99, 91, 255, 0.62));
}

.auth-card {
    width: 100%;
    padding: 34px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 76px rgba(8, 13, 25, 0.16);
}

.auth-card .eyebrow {
    margin-bottom: 10px;
    color: var(--accent-strong);
}

.auth-card h1 {
    margin-bottom: 8px;
    font-size: 2.35rem;
    letter-spacing: 0;
}

.auth-subtitle {
    margin-bottom: 26px;
    color: var(--muted);
    line-height: 1.45;
}

.auth-card label {
    margin-bottom: 16px;
}

.auth-card label > span {
    margin-bottom: 8px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-card input {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 13px;
    background: #fff;
    font-size: 1rem;
}

.password-control {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 10px;
}

.password-control .compact-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: 13px;
    background: #101728;
    color: #fff;
    box-shadow: none;
    font-size: 0.94rem;
}

.auth-option.check-line {
    min-height: auto;
    display: flex;
    gap: 10px;
    margin: 2px 0 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.auth-option input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--accent);
}

.auth-option span {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.auth-card button[type="submit"] {
    min-height: 52px;
    margin-top: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #101728 0%, #0d4a51 54%, #13a896 100%);
    font-size: 1rem;
}

.form-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff1f1;
}

@media (max-width: 900px) {
    .auth-screen {
        grid-template-columns: 1fr;
        width: min(560px, calc(100% - 28px));
    }

    .auth-hero {
        min-height: auto;
        padding: 22px;
    }

    .auth-hero-copy {
        margin-top: 52px;
    }

    .auth-hero-copy h1 {
        font-size: 3.2rem;
    }

    .auth-preview-card {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        margin-top: 34px;
    }
}

@media (max-width: 520px) {
    .auth-screen {
        padding: 18px 0;
    }

    .auth-hero {
        min-height: auto;
        padding: 22px;
        border-radius: 24px;
    }

    .auth-hero-copy {
        margin-top: 46px;
    }

    .auth-hero-copy h1 {
        font-size: 2.35rem;
    }

    .auth-hero-copy p:last-child {
        font-size: 0.96rem;
        line-height: 1.55;
    }

    .auth-preview-card {
        display: none;
    }

    .auth-card {
        padding: 24px;
        border-radius: 22px;
    }

    .password-control {
        grid-template-columns: 1fr;
    }
}

/* Product sidebar and brand profile polish */
.portal-shell {
    grid-template-columns: 260px minmax(0, 1fr);
}

.portal-sidebar {
    padding: 20px 16px;
    border-radius: 0;
    border: 0;
    background: #121212;
    box-shadow: none;
}

.portal-sidebar::before {
    display: none;
}

.portal-brand {
    padding: 4px 10px 22px;
    border-bottom: 0;
}

.portal-brand p {
    color: #f4f4f5;
}

.portal-brand span {
    color: rgba(244, 244, 245, 0.58);
}

.portal-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    box-shadow: none;
}

.portal-nav,
.portal-side-actions {
    gap: 6px;
}

.portal-nav a,
.portal-side-actions a {
    min-height: 48px;
    justify-content: flex-start;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: rgba(244, 244, 245, 0.78);
    font-size: 1rem;
    font-weight: 650;
}

.portal-nav a:hover,
.portal-side-actions a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.portal-nav a.is-active {
    border: 0;
    background: #343434;
    color: #fff;
    box-shadow: none;
}

.portal-nav strong {
    display: none;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.nav-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    color: currentColor;
    font-size: 1.35rem;
    line-height: 1;
}

.portal-side-actions {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-main {
    border-radius: 0;
}

.admin-form button[type="submit"],
.generate-button,
.auth-card button[type="submit"],
.lock-card button {
    color: #fff;
}

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

.readonly-grid div,
.readonly-notes div {
    border-radius: 14px;
    background: #fbfcfe;
}

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

.readonly-notes div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
}

.readonly-notes span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.readonly-notes p {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.5;
    white-space: pre-wrap;
}

@media (max-width: 860px) {
    .portal-sidebar {
        border-radius: 20px;
        background: #121212;
        color: #fff;
    }

    .portal-brand p {
        color: #f4f4f5;
    }

    .portal-brand span,
    .portal-sidebar .portal-side-actions a {
        color: rgba(244, 244, 245, 0.68);
    }

    .portal-nav a {
        background: transparent;
        color: rgba(244, 244, 245, 0.78);
    }

    .portal-nav a.is-active {
        background: #343434;
        color: #fff;
    }

    .readonly-grid,
    .readonly-notes {
        grid-template-columns: 1fr;
    }
}

/* Sleek console redesign */
body:not(:has(.auth-screen)) {
    background: #f7f8fb;
}

.portal-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(1420px, 100%);
    min-height: 100vh;
    padding: 22px;
}

.portal-sidebar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(230px, auto) 1fr auto;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    padding: 10px;
    border: 1px solid rgba(8, 13, 25, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 50px rgba(8, 13, 25, 0.08);
    backdrop-filter: blur(18px);
    color: var(--ink);
}

.portal-brand {
    min-width: 0;
    padding: 0 8px;
    border: 0;
}

.portal-brand p {
    color: var(--ink);
    font-size: 0.96rem;
}

.portal-brand span {
    color: var(--muted);
}

.portal-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.portal-nav,
.portal-side-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-nav {
    justify-content: center;
}

.portal-side-actions {
    justify-content: flex-end;
    padding: 0;
    border: 0;
}

.portal-nav a,
.portal-side-actions a {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #4d5665;
    font-size: 0.92rem;
    font-weight: 760;
    white-space: nowrap;
}

.portal-nav a:hover,
.portal-side-actions a:hover {
    background: #f0f3f7;
    color: var(--ink);
}

.portal-nav a.is-active {
    border-color: rgba(8, 13, 25, 0.08);
    background: #10131a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(8, 13, 25, 0.16);
}

.nav-item {
    gap: 8px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    font-size: 1rem;
}

.portal-main {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portal-header {
    margin: 6px 0 18px;
    padding: 18px 4px 16px;
    border-bottom: 1px solid rgba(8, 13, 25, 0.08);
}

.portal-header h1,
.topbar h1 {
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 0.96;
}

.portal-user,
.status-pill {
    min-width: 0;
    padding: 8px 12px;
    border-color: rgba(8, 13, 25, 0.08);
    background: #fff;
    box-shadow: 0 8px 24px rgba(8, 13, 25, 0.05);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.action-pill {
    display: inline-grid;
    min-height: 38px;
    place-items: center;
    padding: 0 14px;
    border: 1px solid rgba(8, 13, 25, 0.1);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 820;
    box-shadow: 0 8px 24px rgba(8, 13, 25, 0.05);
}

.action-pill.primary {
    border-color: #10131a;
    background: #10131a;
    color: #fff;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 76px;
    padding: 14px 16px;
    border-radius: 16px;
    border-color: rgba(8, 13, 25, 0.08);
    background: #fff;
    box-shadow: 0 8px 26px rgba(8, 13, 25, 0.05);
}

.metric-card::after {
    display: none;
}

.metric-card span {
    margin-bottom: 10px;
    color: #7a8493;
    font-size: 0.7rem;
    letter-spacing: 0.07em;
}

.metric-card strong {
    font-size: 1.9rem;
}

.section-head {
    margin: 0 0 12px;
    padding: 0 4px;
}

.section-head h2 {
    font-size: 1.65rem;
}

.portal-section.is-active {
    gap: 12px;
}

.control-panel,
.preview-panel,
.admin-form,
.caption-panel,
.brand-card,
.empty-state,
.readonly-grid div,
.readonly-notes div,
.account-card {
    border-color: rgba(8, 13, 25, 0.08);
    background: #fff;
    box-shadow: 0 10px 30px rgba(8, 13, 25, 0.055);
}

.admin-form,
.control-panel,
.preview-panel {
    border-radius: 18px;
}

.portal-form {
    padding: 18px;
}

.form-title {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(8, 13, 25, 0.06);
}

.form-title h3 {
    font-size: 1.15rem;
}

.form-title span,
.section-head > span {
    font-size: 0.86rem;
}

.admin-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-form label,
.control-panel label {
    min-width: 0;
}

legend,
label > span,
.idea-field > span {
    margin-bottom: 6px;
    color: #1b2433;
    font-size: 0.73rem;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

select,
textarea,
input[type="file"],
.lock-card input,
.admin-form input,
.auth-card input {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border-color: #dfe5ee;
    background: #fff;
    font-size: 0.94rem;
}

textarea {
    min-height: 86px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.idea-field textarea {
    min-height: 126px;
}

input[type="file"] {
    display: flex;
    align-items: center;
    padding: 7px;
}

input[type="file"]::file-selector-button {
    min-height: 28px;
    margin-right: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: #f0f3f7;
    color: var(--ink);
    font-weight: 760;
}

.check-line {
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #fafbfc;
}

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

.admin-form button[type="submit"],
.generate-button {
    width: auto;
    min-height: 42px;
    justify-self: end;
    padding: 0 18px;
    border-radius: 999px;
    background: #10131a;
    box-shadow: 0 12px 24px rgba(8, 13, 25, 0.14);
    font-size: 0.92rem;
}

.generate-button {
    width: 100%;
    justify-content: center;
}

.record-list {
    gap: 10px;
}

.record-card {
    overflow: hidden;
}

.record-head {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(8, 13, 25, 0.06);
}

.record-avatar,
.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    box-shadow: none;
}

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

.readonly-grid div,
.readonly-notes div {
    padding: 12px;
    border-radius: 12px;
    background: #fafbfc;
    box-shadow: none;
}

.readonly-grid span,
.readonly-notes span {
    font-size: 0.7rem;
}

.readonly-grid strong,
.readonly-notes p {
    font-size: 0.92rem;
}

.workspace {
    grid-template-columns: minmax(0, 0.94fr) minmax(350px, 0.72fr);
    gap: 16px;
}

.segmented {
    border-radius: 12px;
    background: #f2f5f8;
}

.segmented span {
    min-height: 38px;
    border-radius: 9px;
}

.preview-frame {
    min-height: 390px;
    border-radius: 18px;
}

.message-log {
    border-radius: 12px;
}

@media (max-width: 1040px) {
    .portal-sidebar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-nav,
    .portal-side-actions {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .admin-fields,
    .checkbox-grid,
    .readonly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .portal-shell {
        padding: 12px;
    }

    .portal-sidebar {
        position: static;
        border-radius: 16px;
    }

    .portal-brand {
        padding: 2px 4px;
    }

    .portal-nav a,
    .portal-side-actions a {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.86rem;
    }

    .portal-header {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 10px;
    }

    .metric-grid,
    .admin-fields,
    .checkbox-grid,
    .readonly-grid,
    .readonly-notes {
        grid-template-columns: 1fr;
    }

    .admin-form button[type="submit"] {
        width: 100%;
        justify-self: stretch;
    }
}

/* Admin master-detail management */
.manager-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.manager-list {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(8, 13, 25, 0.08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(8, 13, 25, 0.045);
}

.manager-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--ink);
    text-decoration: none;
}

.manager-list-item:hover {
    background: #f6f8fb;
}

.manager-list-item.is-active {
    border-color: rgba(8, 13, 25, 0.1);
    background: #10131a;
    color: #fff;
}

.manager-list-item .record-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
}

.manager-list-item span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.manager-list-item strong,
.manager-list-item em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manager-list-item strong {
    font-size: 0.92rem;
}

.manager-list-item em {
    color: currentColor;
    opacity: 0.66;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 720;
}

.manager-detail {
    min-width: 0;
}

.empty-state.compact {
    padding: 14px;
    border-radius: 14px;
}

@media (max-width: 900px) {
    .manager-layout {
        grid-template-columns: 1fr;
    }

    .manager-list {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
}
