:root {
    color-scheme: light;
    --app-ease: 280ms cubic-bezier(0.22, 1, 0.36, 1);
    --studio-ink: #111111;
    --studio-forest: #006b00;
    --studio-sand: #ecfdd8;
    --studio-cream: #f6f6f6;
    --studio-coral: #00b60c;
    --studio-gold: #fec822;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.app-gradient {
    background:
        radial-gradient(circle at top left, rgba(194, 253, 106, 0.28), transparent 30%),
        radial-gradient(circle at top right, rgba(254, 200, 34, 0.24), transparent 26%),
        linear-gradient(135deg, #00b60c 0%, #008d00 58%, #053b10 100%);
}

.tv-gradient {
    background:
        radial-gradient(circle at top left, rgba(0, 182, 12, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(194, 253, 106, 0.18), transparent 24%),
        linear-gradient(135deg, #fec822 0%, #f8c313 48%, #e5ad00 100%);
}

.result-gradient {
    background:
        radial-gradient(circle at top left, rgba(0, 182, 12, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(254, 200, 34, 0.18), transparent 24%),
        linear-gradient(140deg, #f6f6f6 0%, #ecfdd8 48%, #ffffff 100%);
}

.panel-blur,
.stage-shell,
.result-shell {
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(22px);
}

.stage-shell {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.55);
    overflow: hidden;
}

.stage-shell::before,
.result-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
        radial-gradient(circle at top right, rgba(245, 184, 65, 0.08), transparent 28%);
    pointer-events: none;
}

.tv-stage-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
        rgba(9, 20, 20, 0.42);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.24);
}

.tv-stage-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(244, 108, 82, 0.16), transparent 25%),
        radial-gradient(circle at bottom left, rgba(245, 184, 65, 0.12), transparent 22%);
    pointer-events: none;
}

.result-hero {
    background:
        linear-gradient(135deg, rgba(0, 107, 0, 0.96), rgba(0, 141, 0, 0.94) 48%, rgba(17, 17, 17, 0.9) 100%);
}

.screen-fade {
    transition: opacity var(--app-ease), transform var(--app-ease), filter var(--app-ease);
}

.screen-hidden {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(8px);
}

.screen-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.soft-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.soft-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(20, 51, 48, 0.18);
    border-radius: 999px;
}

.soft-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.36);
    border-radius: 999px;
}

.admin-body {
    background: #f4f6f8;
    color: #111827;
}

.admin-shell {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid #d7dde5;
    background: #fff;
    padding: 22px;
}

.admin-brand {
    border-bottom: 1px solid #e3e8ef;
    padding-bottom: 20px;
}

.admin-brand-kicker,
.admin-page-kicker {
    margin: 0;
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.admin-brand h1,
.admin-page-title {
    margin: 8px 0 0;
    color: #0b1220;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

.admin-brand p:last-child,
.admin-page-subtitle,
.admin-muted {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.admin-brand p:last-child {
    margin: 10px 0 0;
}

.admin-nav {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.admin-tab-button {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid #d7dde5;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    padding: 13px 14px;
    text-align: left;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.admin-tab-button span {
    display: block;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
}

.admin-tab-button small {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.admin-tab-button.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.admin-tab-button.is-active small {
    color: #cbd5e1;
}

.admin-sidebar-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    border-top: 1px solid #e3e8ef;
    padding-top: 18px;
}

.admin-status-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d7dde5;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.admin-status-box span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-status-box strong,
.is-ok,
.is-danger,
.is-warn {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.is-ok {
    color: #047857;
}

.is-danger {
    color: #b91c1c;
}

.is-warn {
    color: #b45309;
}

.admin-main {
    min-width: 0;
    padding: 28px;
}

.admin-page {
    display: grid;
    gap: 18px;
    max-width: 1380px;
    margin: 0 auto;
}

.admin-tab-panel.hidden,
.admin-modal.hidden {
    display: none;
}

.admin-page-header,
.admin-section-heading,
.admin-status-line,
.admin-toolbar,
.admin-action-row,
.admin-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-page-header {
    justify-content: space-between;
    border-bottom: 1px solid #d7dde5;
    padding-bottom: 20px;
}

.admin-page-header > div:first-child {
    min-width: 0;
}

.admin-page-subtitle {
    margin: 8px 0 0;
}

.admin-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-status-line {
    justify-content: flex-end;
}

.admin-section-heading {
    justify-content: space-between;
    border-bottom: 1px solid #e3e8ef;
    padding-bottom: 14px;
}

.admin-section-heading h3 {
    margin: 0;
    color: #0b1220;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
}

.admin-grid {
    display: grid;
    gap: 18px;
}

.admin-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-section-card,
.admin-kpi-card,
.admin-alert,
.admin-message {
    border: 1px solid #d7dde5;
    border-radius: 10px;
    background: #fff;
}

.admin-section-card {
    padding: 18px;
}

.admin-alert {
    margin: 0 auto 18px;
    max-width: 1380px;
    border-color: #f2c94c;
    background: #fff8db;
    color: #7c4a03;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
}

.admin-message {
    padding: 13px 14px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.admin-message pre {
    margin: 10px 0 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px;
    white-space: pre-wrap;
}

.admin-message.ok {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.admin-message.warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.admin-message.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-message.info {
    background: #f8fafc;
    color: #475569;
}

.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid #c8d0da;
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.admin-button,
.admin-tab-button,
.admin-gallery-preview {
    cursor: pointer;
}

.admin-button:hover {
    border-color: #64748b;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.admin-button.primary {
    border-color: #0f766e;
    background: #0f766e;
    color: #fff;
}

.admin-button.secondary {
    background: #fff;
}

.admin-button.danger {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}

.admin-button.ghost {
    border-color: transparent;
    background: transparent;
}

.admin-button.full {
    width: 100%;
}

.admin-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.admin-field,
.admin-field-inline {
    display: grid;
    gap: 7px;
}

.admin-field-inline {
    grid-template-columns: auto auto;
    align-items: center;
    min-height: 40px;
    border: 1px solid #c8d0da;
    border-radius: 8px;
    background: #fff;
    padding: 0 10px;
}

.admin-field span,
.admin-field-inline span {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.admin-field.grow {
    flex: 1 1 280px;
}

.admin-input,
.admin-textarea,
.admin-file-input,
.admin-select-control {
    width: 100%;
    border: 1px solid #c8d0da;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.admin-input,
.admin-file-input,
.admin-select-control {
    min-height: 42px;
    padding: 0 12px;
}

.admin-input.compact {
    width: min(360px, 100%);
}

.admin-textarea {
    min-height: 116px;
    padding: 11px 12px;
    resize: vertical;
}

.admin-input:focus,
.admin-textarea:focus,
.admin-file-input:focus,
.admin-select-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-select-control {
    width: auto;
    min-height: 30px;
    border: 0;
    padding: 0;
}

.admin-form-row {
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-action-row {
    flex-wrap: wrap;
}

.admin-action-row.bottom {
    align-items: flex-end;
}

.admin-import-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-kpi-grid.small {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi-card {
    display: grid;
    gap: 8px;
    min-height: 96px;
    padding: 15px;
}

.admin-kpi-card span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.35;
    text-transform: uppercase;
}

.admin-kpi-card strong {
    color: #0b1220;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

.admin-kpi-card strong.break {
    font-family: "Consolas", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.admin-status-pill,
.admin-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid #d7dde5;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-pill.ok,
.admin-status-pill.ok {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.admin-pill.warn,
.admin-status-pill.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.admin-report-chart {
    min-height: 232px;
    margin-top: 14px;
}

.admin-chart-svg {
    width: 100%;
    min-height: 230px;
    overflow: visible;
}

.admin-chart-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
    border: 1px dashed #c8d0da;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
}

.admin-scroll-x {
    max-width: 100%;
    overflow-x: auto;
}

.admin-stack {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.admin-table-gap {
    margin-top: 14px;
}

.admin-data-table {
    width: 100%;
    min-width: 650px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.admin-data-table th {
    border-bottom: 1px solid #d7dde5;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 11px 12px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-data-table td {
    border-bottom: 1px solid #eef2f6;
    color: #1f2937;
    font-weight: 700;
    line-height: 1.45;
    padding: 14px 12px;
    vertical-align: top;
}

.admin-table-title {
    display: grid;
    gap: 4px;
}

.admin-table-title strong {
    color: #0b1220;
    font-size: 14px;
    font-weight: 900;
}

.admin-table-title span {
    color: #64748b;
    font-size: 12px;
}

.admin-meter {
    display: grid;
    gap: 7px;
}

.admin-meter-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.admin-meter-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eaf0;
}

.admin-meter-fill {
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
}

.admin-heat-grid {
    display: grid;
    grid-template-columns: 56px repeat(24, minmax(24px, 1fr));
    gap: 5px;
    min-width: 820px;
    margin-top: 14px;
}

.admin-heat-cell,
.admin-heat-label {
    min-height: 26px;
    border-radius: 5px;
    font-size: 10px;
}

.admin-heat-label {
    display: flex;
    align-items: center;
    color: #64748b;
    font-weight: 900;
}

.admin-heat-label.center {
    justify-content: center;
}

.admin-heat-cell {
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: #e2e8f0;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-gallery-card {
    overflow: hidden;
    border: 1px solid #d7dde5;
    border-radius: 10px;
    background: #fff;
}

.admin-gallery-preview {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    text-align: left;
}

.admin-gallery-thumb,
.admin-gallery-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111827;
    object-fit: cover;
}

.admin-gallery-placeholder {
    display: grid;
    place-items: center;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-gallery-body {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.admin-gallery-body h3 {
    margin: 0;
    color: #0b1220;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.15;
}

.admin-gallery-body p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.admin-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #e3e8ef;
    padding: 12px;
}

.admin-empty {
    border: 1px dashed #c8d0da;
    border-radius: 10px;
    background: #fff;
    padding: 28px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
}

.admin-modal-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1100px, 100%);
    max-height: calc(100vh - 44px);
    overflow: hidden;
    border: 1px solid #c8d0da;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 26px 90px rgba(15, 23, 42, 0.34);
}

.admin-confirm-panel {
    width: min(560px, 100%);
}

.admin-modal-panel.is-wide {
    width: min(1280px, 100%);
}

.admin-modal-header,
.admin-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e3e8ef;
    padding: 16px 18px;
}

.admin-modal-header h2 {
    margin: 6px 0 0;
    color: #0b1220;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
}

.admin-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.admin-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid #e3e8ef;
    border-bottom: 0;
    background: #f8fafc;
}

.admin-video-frame {
    display: block;
    width: 100%;
    max-height: 58vh;
    border-radius: 10px;
    background: #020617;
}

.admin-detail-grid,
.admin-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.admin-detail-panel {
    display: grid;
    gap: 12px;
}

.admin-definition-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.admin-definition-list div,
.admin-folder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 11px 12px;
}

.admin-definition-list dt,
.admin-definition-list dd {
    margin: 0;
    font-size: 13px;
    font-weight: 900;
}

.admin-definition-list dt {
    color: #64748b;
}

.admin-folder-row code {
    color: #1f2937;
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.admin-form-section {
    display: grid;
    gap: 14px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}

.admin-form-section h3 {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-confirm-copy {
    display: grid;
    gap: 12px;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
}

.admin-confirm-copy strong {
    color: #0b1220;
}

.admin-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    font-size: 13px;
    font-weight: 800;
}

.admin-thumbnail-options {
    display: grid;
    gap: 10px;
}

.admin-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-thumbnail-option {
    position: relative;
    display: grid;
    gap: 8px;
    cursor: pointer;
}

.admin-thumbnail-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-thumbnail-option img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 3px solid transparent;
    border-radius: 8px;
    background: #111827;
    object-fit: cover;
}

.admin-thumbnail-option span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.admin-thumbnail-option.is-selected img {
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.14);
}

@media (max-width: 1100px) {
    .admin-grid.two,
    .admin-detail-grid,
    .admin-editor-grid,
    .admin-gallery-grid {
        grid-template-columns: 1fr;
    }

    .admin-kpi-grid,
    .admin-kpi-grid.small {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-thumbnail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #d7dde5;
    }

    .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main {
        padding: 18px;
    }

    .admin-page-header,
    .admin-section-heading,
    .admin-status-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-toolbar {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .admin-nav,
    .admin-kpi-grid,
    .admin-kpi-grid.small,
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-input.compact {
        width: 100%;
    }

    .admin-modal {
        padding: 10px;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .admin-no-print,
    .admin-sidebar,
    [data-admin-panel="gallery"],
    [data-admin-panel="content"],
    [data-admin-panel="sync"],
    .admin-modal {
        display: none !important;
    }

    .admin-shell {
        display: block !important;
    }

    .admin-main {
        padding: 0 !important;
    }

    [data-admin-panel="report"] {
        display: block !important;
        max-width: none !important;
    }

    .admin-section-card,
    .admin-kpi-card {
        box-shadow: none !important;
        break-inside: avoid;
    }
}
