:root {
    --sidebar-bg: #121826;
    --surface: #ffffff;
    --page-bg: #f4f6f8;
    --border: #dde3ea;
    --text-soft: #667085;
}

body {
    background: var(--page-bg);
    color: #1f2937;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar-bg);
    padding: 24px 18px;
}

.sidebar-backdrop,
.mobile-menu-toggle {
    display: none;
}

.brand {
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 22px;
    padding-bottom: 22px;
    text-decoration: none;
}

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

.sidebar-section {
    display: grid;
    gap: 2px;
}

.sidebar-section + .sidebar-section {
    margin-top: 6px;
}

.sidebar-section-internal {
    border-top: 1px solid rgba(255, 255, 255, .14);
    margin-top: 16px;
    padding-top: 12px;
}

.sidebar-section-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #f4f7fb;
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    gap: 8px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.sidebar-section-toggle:hover {
    background: rgba(255, 255, 255, .08);
}

.sidebar-section-toggle::before {
    border-bottom: 2px solid #94a3b8;
    border-right: 2px solid #94a3b8;
    content: "";
    display: block;
    height: 10px;
    transform: rotate(45deg);
    transition: transform .18s ease;
    width: 10px;
}

.sidebar-section-toggle .bi {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1;
    width: 18px;
}

.sidebar-section-toggle.collapsed::before {
    transform: rotate(-45deg);
}

.sidebar-section-links {
    display: grid;
    gap: 2px;
    padding: 2px 0 6px 28px;
}

.sidebar .nav-link {
    align-items: center;
    border-radius: 8px;
    color: #c9d4e5;
    display: flex;
    gap: 9px;
    padding: 8px 10px;
}

.sidebar .nav-link .bi {
    color: #94a3b8;
    font-size: .95rem;
    line-height: 1;
    width: 18px;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar .nav-link:hover .bi {
    color: #fff;
}

.main {
    min-width: 0;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 28px;
}

.topbar-user {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.topbar-edit-link {
    display: inline-block;
    font-size: .85rem;
    margin-left: 8px;
}

.language-form {
    margin: 0;
}

.language-form select {
    width: 78px;
}

.content {
    padding: 28px;
}

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

.page-heading h1 {
    font-size: 1.65rem;
    margin: 0 0 4px;
}

.metric-card,
.table-card,
.form-card,
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .04);
}

.metric-card {
    padding: 22px;
}

.metric-link {
    color: inherit;
    display: block;
    text-decoration: none;
}

.metric-link:hover {
    border-color: #b7c6d8;
    box-shadow: 0 14px 34px rgba(16, 24, 40, .08);
    color: inherit;
}

.metric-card span {
    color: var(--text-soft);
    display: block;
    font-size: .9rem;
}

.metric-card strong {
    display: block;
    font-size: 2rem;
    margin-top: 6px;
}

.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .04);
    padding: 22px;
}

.dashboard-panel-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dashboard-panel-header h2 {
    font-size: 1.15rem;
    margin: 0 0 4px;
}

.vertical-bar-chart {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-auto-columns: minmax(72px, 1fr);
    grid-auto-flow: column;
    min-height: 220px;
    overflow-x: auto;
    padding: 8px 2px 2px;
}

.vertical-bar-item {
    align-items: center;
    color: inherit;
    display: grid;
    gap: 8px;
    grid-template-rows: 24px 150px minmax(36px, auto);
    justify-items: center;
    min-width: 72px;
    text-decoration: none;
}

.vertical-bar-item:hover .vertical-bar-fill {
    background: #2563eb;
}

.vertical-bar-value {
    color: #334155;
    font-size: .85rem;
    font-weight: 700;
}

.vertical-bar-track {
    align-items: end;
    background: #eef2f7;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    height: 150px;
    overflow: hidden;
    width: 34px;
}

.vertical-bar-fill {
    background: #0f766e;
    display: block;
    transition: background .18s ease;
    width: 100%;
}

.vertical-bar-label {
    color: var(--text-soft);
    font-size: .8rem;
    max-width: 92px;
    overflow-wrap: anywhere;
    text-align: center;
}

.expiring-content-list {
    display: grid;
    gap: 8px;
}

.expiring-content-item {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 12px;
    grid-template-columns: 90px minmax(180px, 1fr) 170px 120px;
    padding: 12px;
    text-decoration: none;
}

.expiring-content-item:hover {
    background: #f8fafc;
    color: inherit;
}

.expiring-content-days {
    color: #9a3412;
    font-size: .85rem;
    font-weight: 700;
    text-align: right;
}

.table-card {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-card > .table {
    min-width: 860px;
}

.table-card td:last-child,
.table-card th:last-child {
    white-space: nowrap;
}

.table-thumb {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: block;
    object-fit: cover;
    width: 96px;
}

.form-card {
    padding: 24px;
}

.form-actions {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
}

.form-section {
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    padding-bottom: 22px;
}

.form-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h2 {
    font-size: 1.05rem;
    margin: 0 0 16px;
}

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

.price-editor-group {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.price-editor-group + .price-editor-group {
    border-left: 1px solid var(--border);
    padding-left: 32px;
}

.price-editor-group legend {
    color: var(--text);
    float: none;
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 12px;
    width: auto;
}

.price-logo-preview {
    grid-template-columns: 96px minmax(0, 1fr);
}

.price-logo-preview img {
    aspect-ratio: 3 / 1;
    background: #fff;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .price-editor-grid {
        gap: 22px;
        grid-template-columns: 1fr;
    }

    .price-editor-group + .price-editor-group {
        border-left: 0;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 22px;
    }
}

.error-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: min(680px, calc(100vh - 124px));
    padding: 28px;
}

.error-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .08);
    max-width: 620px;
    padding: 36px;
    text-align: center;
    width: 100%;
}

.error-code {
    color: #0f766e;
    display: block;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .1em;
    margin-bottom: 12px;
}

.error-card h1 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.12;
    margin: 0 0 12px;
}

.error-subtitle {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 auto 14px;
    max-width: 42ch;
}

.error-body {
    color: var(--text-soft);
    line-height: 1.6;
    margin: 0 auto 22px;
    max-width: 48ch;
}

.error-meta {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-soft);
    display: grid;
    gap: 4px;
    margin: 0 0 22px;
    padding: 12px;
    text-align: left;
}

.error-meta code {
    color: #1f2937;
    overflow-wrap: anywhere;
}

.error-actions {
    display: flex;
    justify-content: center;
}

.selected-image {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 120px 1fr;
    min-height: 86px;
    padding: 10px;
}

.selected-image img {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.selected-image span,
.image-modal-card span {
    color: #344054;
    font-size: .88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-modal-filters {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    margin-bottom: 16px;
}

.image-modal-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.image-modal-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    padding: 8px;
    text-align: left;
}

.image-modal-card:hover {
    border-color: #0d6efd;
}

.image-modal-card img {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.image-modal-card small {
    color: var(--text-soft);
    font-size: .72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 0;
    margin-top: 12px;
    overflow: hidden;
}

.attachment-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
}

.attachment-row:last-child {
    border-bottom: 0;
}

.attachment-row span {
    overflow-wrap: anywhere;
}

.login-page {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(9, 13, 22, .96), rgba(19, 28, 34, .94)),
        linear-gradient(90deg, rgba(13, 148, 136, .2), rgba(59, 130, 246, .1));
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 56px;
    position: relative;
}

.login-page::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    inset: 0;
    mask-image: linear-gradient(90deg, #000 0, rgba(0, 0, 0, .9) 42%, transparent 100%);
    position: absolute;
}

.login-visual,
.login-card {
    position: relative;
    z-index: 1;
}

.login-shell {
    align-items: center;
    display: grid;
    gap: clamp(56px, 5vw, 72px);
    grid-template-columns: minmax(500px, 680px) minmax(360px, 430px);
    justify-content: center;
    max-width: 1220px;
    width: 100%;
}

.login-card {
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .72);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
    justify-self: stretch;
    max-width: 440px;
    padding: 34px;
    width: 100%;
}

.login-card-heading {
    display: grid;
    gap: 12px;
    margin-bottom: 34px;
}

.login-card h2 {
    font-size: 1.8rem;
    letter-spacing: 0;
    line-height: 1.16;
    margin: 0;
    max-width: 12em;
}

.login-card-heading p {
    color: var(--text-soft);
    line-height: 1.55;
    margin: 0;
    max-width: 31ch;
}

.login-product-badge {
    align-items: center;
    background: #0f172a;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    margin-bottom: 8px;
    min-width: 58px;
    padding: 0 12px;
}

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

.login-input-wrap {
    position: relative;
}

.login-input-wrap .bi {
    color: #64748b;
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.login-input-wrap .form-control {
    border-color: #cbd5e1;
    border-radius: 8px;
    min-height: 48px;
    padding-left: 42px;
}

.login-input-wrap .form-control:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 .25rem rgba(15, 118, 110, .14);
}

.login-submit {
    align-items: center;
    background: #0f766e;
    border: 0;
    border-radius: 8px;
    color: #fff;
    display: flex;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    min-height: 48px;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
    width: 100%;
}

.login-submit:hover {
    background: #115e59;
    box-shadow: 0 14px 30px rgba(15, 118, 110, .25);
    color: #fff;
    transform: translateY(-1px);
}

.login-forgot-link {
    color: #475569;
    font-size: .9rem;
    justify-self: center;
    text-decoration: none;
}

.login-forgot-link:hover {
    color: #0f766e;
}

.login-visual {
    align-self: center;
    color: #fff;
    display: grid;
    gap: 34px;
    justify-self: end;
    max-width: 680px;
    width: 100%;
}

.login-brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    width: 78px;
}

.login-brand-mark span {
    font-weight: 800;
}

.login-visual-copy {
    display: grid;
    gap: 18px;
    max-width: 660px;
}

.login-kicker {
    color: #5eead4;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0;
    text-transform: uppercase;
}

.login-visual-copy h1 {
    font-size: clamp(2.3rem, 5vw, 4.7rem);
    line-height: 1.06;
    margin: 0;
    max-width: 9.4em;
}

.login-visual-copy p:not(.login-kicker) {
    color: #cbd5e1;
    font-size: 1.08rem;
    line-height: 1.6;
    margin: 0;
    max-width: 44ch;
}

.login-preview {
    background: rgba(15, 23, 42, .72);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    overflow: hidden;
    width: 100%;
}

.login-preview-header {
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, .2);
    display: flex;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
}

.login-preview-header span {
    background: rgba(203, 213, 225, .45);
    border-radius: 999px;
    height: 8px;
    width: 8px;
}

.login-preview-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.2fr 1fr;
    padding: 14px;
}

.login-preview-card,
.login-preview-feed {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    padding: 14px;
}

.login-preview-card {
    display: grid;
    gap: 6px;
}

.login-preview-card--wide {
    grid-row: span 2;
}

.login-preview-card .bi {
    color: #5eead4;
}

.login-preview-card strong {
    font-size: 1.6rem;
    line-height: 1;
}

.login-preview-card span {
    color: #cbd5e1;
    font-size: .82rem;
}

.login-preview-feed {
    display: grid;
    gap: 9px;
    grid-column: 1 / -1;
}

.login-preview-feed span {
    background: linear-gradient(90deg, rgba(94, 234, 212, .55), rgba(148, 163, 184, .14));
    border-radius: 999px;
    height: 9px;
}

.login-preview-feed span:nth-child(2) {
    width: 82%;
}

.login-preview-feed span:nth-child(3) {
    width: 66%;
}

.login-page--ops {
    background:
        linear-gradient(145deg, rgba(27, 31, 29, .97), rgba(28, 40, 39, .95)),
        linear-gradient(90deg, rgba(234, 179, 8, .14), rgba(20, 184, 166, .12));
}

.login-page--ops .login-card {
    background: rgba(248, 250, 252, .96);
}

.login-page--ops .login-product-badge,
.login-page--ops .login-submit {
    background: #1f2937;
}

.login-page--ops .login-submit:hover {
    background: #111827;
    box-shadow: 0 14px 30px rgba(31, 41, 55, .22);
}

.login-page--ops .login-kicker,
.login-page--ops .login-preview-card .bi,
.login-page--ops .login-forgot-link:hover {
    color: #facc15;
}

.login-page--minimal {
    background:
        linear-gradient(135deg, rgba(245, 247, 250, .96), rgba(223, 230, 236, .98)),
        linear-gradient(90deg, rgba(15, 118, 110, .08), rgba(37, 99, 235, .07));
}

.login-page--minimal::before {
    mask-image: none;
}

.login-page--minimal .login-visual {
    display: none;
}

.login-page--minimal .login-shell {
    display: block;
    max-width: 460px;
}

.login-page--minimal .login-card {
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    max-width: 460px;
}

.demo-access {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-soft);
    display: grid;
    gap: 2px;
    margin-top: 20px;
    padding: 12px;
}

.media-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.media-filters {
    margin-bottom: 18px;
}

.media-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-rows: 180px 1fr auto;
    overflow: hidden;
}

.media-preview,
.media-detail-preview {
    align-items: center;
    background: #eef2f6;
    display: flex;
    justify-content: center;
}

.media-preview img,
.media-detail-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.media-preview a,
.media-detail-preview a {
    display: block;
    height: 100%;
    width: 100%;
}

.media-detail-preview {
    border-radius: 8px;
    min-height: 260px;
    overflow: hidden;
}

.media-card-body {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.media-card-body strong {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.media-card-body span {
    color: var(--text-soft);
    font-size: .85rem;
}

.media-client {
    display: block;
}

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

.media-meta-grid span {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #344054;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px;
}

.media-meta-grid small {
    color: var(--text-soft);
    font-size: .72rem;
}

.media-card-actions {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 12px;
}

.media-card-actions form {
    margin: 0;
}

.media-filetype {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #344054;
    font-weight: 700;
    padding: 10px 14px;
}

.settings-editor .form-card {
    padding: 20px;
}

.setting-meta {
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.setting-meta span:not(.badge) {
    font-size: .82rem;
}

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

    body.sidebar-open {
        overflow: hidden;
    }

    .login-page {
        padding: 28px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .login-visual {
        display: none;
    }

    .login-card {
        max-width: none;
        padding: 30px;
    }

    .login-card h2 {
        max-width: none;
    }

    .sidebar {
        bottom: 0;
        box-shadow: 16px 0 40px rgba(15, 23, 42, .28);
        left: 0;
        max-width: calc(100vw - 54px);
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        width: 292px;
        z-index: 1050;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        background: rgba(15, 23, 42, .48);
        border: 0;
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity .18s ease;
        z-index: 1040;
    }

    .app-shell.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-toggle {
        align-items: center;
        background: #111827;
        border: 0;
        border-radius: 8px;
        color: #fff;
        display: inline-flex;
        font-weight: 700;
        gap: 7px;
        min-height: 40px;
        padding: 0 12px;
    }

    .mobile-menu-toggle .bi {
        font-size: 1.2rem;
        line-height: 1;
    }

    .topbar {
        gap: 14px;
        padding: 12px 18px;
    }

    .topbar-user {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .topbar-actions {
        align-self: flex-start;
        flex-wrap: wrap;
    }

    .table-card > .table {
        min-width: 940px;
    }

    .table-card td:last-child,
    .table-card th:last-child {
        background: var(--surface);
        box-shadow: -10px 0 16px rgba(15, 23, 42, .08);
        position: sticky;
        right: 0;
        z-index: 1;
    }

    .table-card th:last-child {
        z-index: 2;
    }

    .content {
        padding: 18px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
