:root {
    color-scheme: light;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --table-row-min-height: 48px;
    --table-row-max-height: 240px;
    --table-data-font-size: 0.88rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.page-shell {
    min-height: 100vh;
}

.tenant-login-page {
    min-height: 100vh;
    padding: clamp(20px, 4vw, 56px);
    display: grid;
    align-items: start;
    background:
        linear-gradient(135deg, rgba(33, 22, 15, 0.24), rgba(72, 47, 30, 0.1)),
        var(--tenant-login-background);
    background-size: min(100vw, 1400px) auto;
    background-position: center;
    background-repeat: no-repeat;
}

.tenant-login-shell {
    min-height: calc(100vh - clamp(40px, 8vw, 112px));
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: start;
    gap: 0;
}

.tenant-login-copy h1 {
    margin: 10px 0 0;
    font-size: clamp(1.7rem, 3.2vw, 2.6rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    max-width: 10ch;
}

.tenant-login-card {
    width: min(100%, 380px);
    margin: clamp(8px, 3vh, 28px) auto 0;
    padding: 24px;
    background: rgba(255, 250, 243, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(59, 35, 18, 0.2);
    backdrop-filter: blur(18px);
    font-size: 0.92rem;
}

.tenant-login-card h1 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    color: #3e2718;
}

.tenant-login-form {
    margin-top: 18px;
}

.tenant-login-card label span {
    font-size: 0.88rem;
}

.tenant-login-card input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(150, 114, 85, 0.28);
    border-radius: 14px;
    font-size: 0.92rem;
}

.tenant-login-card input:focus {
    outline: none;
    border-color: rgba(168, 109, 71, 0.64);
    box-shadow: 0 0 0 4px rgba(201, 153, 114, 0.18);
}

.tenant-login-button {
    box-shadow: 0 14px 24px rgba(59, 35, 18, 0.18);
    font-size: 0.95rem;
}

.tenant-login-button:hover {
    box-shadow: 0 16px 28px rgba(59, 35, 18, 0.22);
}

@media (max-width: 900px) {
    .tenant-login-page {
        padding: 20px;
        background-size: cover;
        background-position: center top;
    }

    .tenant-login-shell {
        min-height: calc(100vh - 40px);
    }

    .tenant-login-card {
        width: min(100%, 360px);
    }
}

.center-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.content-shell {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 24px;
}

.top-bar {
    background: var(--color-nav);
    color: var(--color-nav-text);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 20px var(--shadow-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tenant-top-bar {
    justify-content: center;
    padding-inline: 88px;
}

.tenant-top-bar-brand {
    width: 100%;
    display: flex;
    justify-content: center;
}

.tenant-top-bar .brand {
    display: block;
    max-width: 100%;
    text-align: center;
}

.tenant-top-bar .top-bar-actions {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
}

.tenant-menu-shell {
    position: relative;
}

.tenant-menu-toggle {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.28);
    display: grid;
    gap: 5px;
    place-content: center;
    cursor: pointer;
}

.tenant-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-nav-text);
}

.tenant-menu-toggle:hover {
    background: rgba(15, 23, 42, 0.4);
}

.tenant-menu-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-canvas);
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.18);
    z-index: 12;
}

.tenant-menu-popover[hidden] {
    display: none;
}

.tenant-menu-list {
    display: grid;
    gap: 4px;
}

.tenant-menu-form {
    margin: 0;
}

.tenant-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tenant-menu-item:hover {
    background: var(--color-surface-alt);
}

.tenant-menu-item-button {
    appearance: none;
}

.brand {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-nav-text);
}

.context-copy,
.eyebrow,
small,
.gallery-meta span {
    color: var(--color-muted);
}

.context-copy,
.eyebrow {
    margin: 4px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h1,
.auth-card h1 {
    margin: 0;
}

.card-panel,
.auth-card,
.gallery-card {
    background: var(--color-canvas);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 12px 28px var(--shadow-color);
}

.card-panel,
.auth-card {
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
}

.auth-card-wide {
    width: min(560px, 100%);
    text-align: center;
}

.lead-copy {
    margin: 12px 0 0;
    color: var(--color-muted);
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label,
.option-card {
    display: grid;
    gap: 8px;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: var(--color-text);
    background: var(--color-surface);
}

textarea {
    resize: vertical;
}

.button {
    border: 0;
    border-radius: 12px;
    background: var(--color-accent);
    color: var(--color-accent-text);
    padding: 11px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:hover {
    background: var(--color-accent-hover);
}

.button:disabled {
    cursor: wait;
    opacity: 0.8;
}

.button-secondary {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.button-danger {
    background: #B42318;
    color: #FFFFFF;
}

.button-small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.split-actions,
.inline-actions,
.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--color-nav-text);
    font-weight: 600;
}

.table-wrap {
    overflow: auto;
    scrollbar-gutter: stable;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.data-table tbody td {
    font-size: var(--table-data-font-size);
}

.table-cell {
    position: relative;
    max-width: 100%;
    min-height: var(--table-row-min-height);
    max-height: var(--table-row-max-height);
    padding-right: 40px;
    line-height: 1.4;
}

.table-cell-text {
    display: block;
    max-width: 100%;
    max-height: calc(var(--table-row-max-height) - 16px);
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.table-copy-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-alt);
    color: var(--color-text);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.table-cell:hover .table-copy-button,
.table-copy-button:focus-visible {
    opacity: 1;
}

.table-copy-button::before,
.table-copy-button::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.table-copy-button::before {
    top: 6px;
    left: 10px;
}

.table-copy-button::after {
    top: 10px;
    left: 6px;
    background: var(--color-surface-alt);
}

.table-copy-button:hover {
    background: var(--color-surface);
}

.table-copy-button-success {
    border-color: #067647;
    color: #067647;
}

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    text-transform: capitalize;
    background: var(--color-surface-alt);
}

.status-active {
    color: #067647;
}

.status-disabled {
    color: #B54708;
}

.status-deleted {
    color: #B42318;
}

.option-card {
    grid-template-columns: auto 1fr;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}

.option-card input {
    width: auto;
    margin-top: 4px;
}

.database-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.database-sidebar,
.database-content {
    min-height: 0;
}

.database-screen-shell {
    max-width: none;
    width: 100%;
    height: calc(100vh - 86px);
    margin: 0;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.database-sidebar h2,
.database-content h2 {
    margin-top: 0;
}

.database-table-list {
    display: grid;
    gap: 10px;
    overflow: auto;
}

.database-table-link {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
}

.database-table-link-active {
    border-color: var(--color-accent);
    background: var(--color-surface-alt);
}

.database-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.database-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.database-row-count {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.database-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}

.database-action-copy {
    display: grid;
    gap: 6px;
}

.database-action-copy strong {
    font-size: 1rem;
}

.database-export-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.database-export-field {
    display: grid;
    gap: 6px;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.database-export-field input {
    width: min(180px, 100%);
}

.database-action-empty {
    justify-content: flex-start;
}

.database-table-wrap {
    flex: 1;
    min-height: 0;
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: 14px;
}

.database-data-table {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.database-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
}

.database-data-table th,
.database-data-table td {
    min-width: 132px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.database-data-table col.database-column-compact,
.database-data-table th.database-column-compact,
.database-data-table td.database-column-compact {
    width: 132px;
}

.database-data-table col.database-column-regular,
.database-data-table th.database-column-regular,
.database-data-table td.database-column-regular {
    width: 184px;
}

.database-data-table col.database-column-wide,
.database-data-table th.database-column-wide,
.database-data-table td.database-column-wide {
    width: 320px;
}

.database-header-text {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.database-data-table col.database-column-actions,
.database-data-table thead th:last-child,
.database-actions-cell {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
}

.database-cell-field {
    display: grid;
    gap: 8px;
}

.database-cell-input,
.database-cell-select {
    width: 100%;
    min-width: 0;
    font: inherit;
}

.database-row-save-form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.database-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.database-row-actions [hidden],
.database-cell-field [hidden] {
    display: none !important;
}

.database-cell-editor {
    display: grid;
    gap: 8px;
}

.database-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
}

.database-pagination-summary {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.database-pagination-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.button-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-content: stretch;
    gap: 18px;
}

.gallery-grid-single {
    grid-template-columns: minmax(0, 420px);
}

.gallery-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.gallery-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 16px;
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.gallery-sidebar-header h2 {
    margin: 0;
}

.gallery-filter-form {
    display: grid;
    gap: 18px;
}

.gallery-filter-section {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.gallery-filter-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.gallery-filter-field-list {
    display: grid;
    gap: 14px;
}

.gallery-filter-field {
    display: grid;
    gap: 8px;
}

.gallery-filter-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.gallery-filter-options {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.gallery-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
}

.gallery-filter-option input {
    width: auto;
    margin: 0;
}

.gallery-filter-option span {
    flex: 1;
}

.gallery-filter-option small {
    color: var(--color-muted);
}

.gallery-filter-option-toggle {
    justify-content: flex-start;
}

.gallery-filter-actions,
.gallery-chip-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.gallery-content {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.gallery-section-header {
    margin-bottom: 0;
}

.gallery-active-filters {
    display: grid;
    gap: 12px;
}

.gallery-summary,
.gallery-pagination-summary {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.gallery-pagination-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gallery-card {
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px var(--shadow-color);
}

.gallery-image-button {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    display: block;
    border-radius: inherit;
    overflow: hidden;
}

.gallery-image-button:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: -3px;
}

.gallery-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: var(--color-surface-alt);
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gallery-modal[hidden] {
    display: none;
}

.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(6px);
}

.gallery-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    background: var(--color-canvas);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.gallery-modal-header {
    display: grid;
    gap: 10px;
    padding: 24px 80px 16px 24px;
}

.gallery-modal-header h2 {
    margin: 0;
}

.gallery-modal-copy {
    margin: 0;
    color: var(--color-muted);
}

.gallery-modal-stage {
    position: relative;
    padding: 0 24px 24px;
}

.gallery-modal-stage-shell {
    position: relative;
}

.gallery-modal-figure {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(70vh, 720px);
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.15), transparent 55%), var(--color-surface-alt);
    cursor: zoom-in;
    touch-action: none;
}

.gallery-modal-figure-active {
    cursor: none;
}

.gallery-modal-image {
    width: 100%;
    max-height: calc(100vh - 210px);
    object-fit: contain;
    user-select: none;
    touch-action: none;
    -webkit-user-drag: none;
}

.gallery-magnifier-lens {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    background-color: var(--color-surface);
    background-repeat: no-repeat;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.gallery-modal-menu-anchor {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    display: grid;
    gap: 12px;
    justify-items: end;
}

.gallery-modal-menu-button {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.32);
    display: grid;
    gap: 5px;
    place-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.gallery-modal-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #FFFFFF;
}

.gallery-modal-menu-button:hover {
    background: rgba(15, 23, 42, 0.9);
}

.gallery-attributes-popover {
    width: 100%;
    max-height: var(--gallery-attributes-popover-max-height, min(52vh, 480px));
    border: 1px solid var(--color-border);
    border-radius: 22px;
    background: color-mix(in srgb, var(--color-canvas) 92%, var(--color-surface-alt) 8%);
    box-shadow: 0 28px 48px rgba(15, 23, 42, 0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-attributes-popover[hidden] {
    display: none;
}

.gallery-attributes-popover-header {
    display: grid;
    gap: 6px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--color-border);
}

.gallery-attributes-popover-header h3,
.gallery-attributes-section-title {
    margin: 0;
}

.gallery-attributes-popover-body {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    align-content: start;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 16px 18px 18px;
}

.gallery-attributes-section {
    display: grid;
    gap: 10px;
    align-content: start;
}

.gallery-attributes-section-title {
    font-size: 0.94rem;
    font-weight: 700;
}

.gallery-attributes-grid {
    display: grid;
    gap: 10px;
}

.gallery-attributes-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}

.gallery-attributes-label {
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-attributes-value {
    font-weight: 600;
    line-height: 1.4;
}

.gallery-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.gallery-modal-close:hover {
    background: var(--color-surface-alt);
}

body.gallery-modal-open {
    overflow: hidden;
}

.gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-meta {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.form-panel {
    max-width: 720px;
}

.upload-camera-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-surface-alt) 72%, var(--color-canvas) 28%);
}

.upload-camera-copy,
.upload-camera-fields {
    display: grid;
    gap: 10px;
}

.upload-camera-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.upload-helper,
.upload-camera-status,
.upload-submit-status {
    margin: 0;
    color: var(--color-muted);
}

.upload-camera-actions,
.upload-submit-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-submit-row {
    min-height: 44px;
}

.upload-submit-status {
    font-weight: 600;
}

.upload-status-error {
    color: #B42318;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.empty-state {
    margin: 0;
    color: var(--color-muted);
}

.flash {
    margin: 16px auto 0;
    max-width: 1120px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.flash-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .top-bar,
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tenant-top-bar {
        align-items: center;
        flex-direction: row;
        padding-inline: 72px;
    }

    .content-shell {
        padding: 20px 16px 32px;
    }

    .upload-camera-actions,
    .upload-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-camera-actions .button,
    .upload-submit-row .button {
        width: 100%;
    }

    .top-bar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tenant-top-bar .top-bar-actions {
        width: auto;
        right: 16px;
    }

    .gallery-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-modal {
        padding: 16px;
    }

    .gallery-modal-header {
        padding: 20px 68px 12px 20px;
    }

    .gallery-modal-stage {
        padding: 0 12px 12px;
    }

    .gallery-modal-figure {
        min-height: min(58vh, 480px);
    }

    .gallery-modal-image {
        max-height: calc(100vh - 180px);
    }

    .gallery-modal-menu-anchor {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }

    .gallery-attributes-popover {
        width: 100%;
    }

    .gallery-magnifier-lens {
        width: 132px;
        height: 132px;
    }

    .database-content-header {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .database-action-bar,
    .database-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .database-screen-shell {
        height: auto;
        min-height: calc(100vh - 86px);
        padding: 16px;
        overflow: visible;
    }
}

@media (max-width: 1100px) {
    .database-layout {
        grid-template-columns: 1fr;
    }

    .database-sidebar {
        position: static;
        max-height: none;
    }

    .database-content {
        overflow: visible;
    }

    .database-screen-shell {
        height: auto;
        min-height: calc(100vh - 86px);
        overflow: visible;
    }

    .gallery-layout {
        grid-template-columns: 1fr;
    }

    .gallery-sidebar {
        position: static;
        max-height: none;
    }
}

@media (min-width: 681px) and (max-width: 900px) {
    .gallery-layout {
        grid-template-columns: minmax(176px, 214px) minmax(0, 1fr);
        gap: 14px;
    }

    .gallery-sidebar {
        top: 84px;
        gap: 14px;
        padding: 16px;
        max-height: calc(100vh - 104px);
    }

    .gallery-filter-form {
        gap: 16px;
    }

    .gallery-filter-section {
        gap: 10px;
        padding-top: 14px;
    }

    .gallery-filter-field-list {
        gap: 12px;
    }

    .gallery-filter-label {
        font-size: 0.9rem;
    }

    .gallery-filter-options {
        gap: 7px;
        max-height: 172px;
    }

    .gallery-content {
        gap: 14px;
        border-radius: 18px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--color-canvas) 58%, transparent) 0%, transparent 68%);
        padding: 2px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 14px;
    }

    .gallery-grid-single {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
    }

    .gallery-grid-single .gallery-card {
        width: min(100%, 420px);
    }

    .gallery-card {
        border-radius: 20px;
        box-shadow: 0 14px 30px var(--shadow-color);
    }

    .gallery-image {
        aspect-ratio: 3 / 4;
        object-position: center top;
    }

    .gallery-active-filters {
        border-radius: 18px;
        padding: 16px 18px;
        background: color-mix(in srgb, var(--color-canvas) 90%, var(--color-surface-alt) 10%);
    }

    .gallery-summary,
    .gallery-pagination-summary {
        font-size: 0.98rem;
    }
}

@media (max-width: 680px) {
    .gallery-layout {
        grid-template-columns: 1fr;
    }

    .gallery-sidebar {
        position: static;
        max-height: none;
    }
}