:root {
    --bg: #f5efe4;
    --bg-soft: #faf7f1;
    --ink: #1f2933;
    --muted: #607080;
    --line: rgba(31, 41, 51, 0.1);
    --panel: rgba(255, 250, 242, 0.9);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --primary: #d06831;
    --primary-strong: #a54819;
    --accent: #0f3f45;
    --accent-soft: #e2f2f0;
    --danger: #b24529;
    --danger-soft: #f8e0d8;
    --success-soft: #e4f2dd;
    --success: #356940;
    --shadow: 0 20px 50px rgba(31, 41, 51, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

html[data-theme="dark"] {
    --bg: #11161d;
    --bg-soft: #19212b;
    --ink: #eef3f8;
    --muted: #a7b6c6;
    --line: rgba(238, 243, 248, 0.12);
    --panel: rgba(24, 31, 40, 0.9);
    --surface: rgba(31, 40, 52, 0.82);
    --surface-strong: rgba(37, 48, 61, 0.94);
    --primary: #eb824a;
    --primary-strong: #ff9c62;
    --accent: #79b7c2;
    --accent-soft: rgba(44, 92, 99, 0.36);
    --danger-soft: rgba(125, 51, 31, 0.36);
    --success-soft: rgba(44, 89, 50, 0.34);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: radial-gradient(circle at top left, rgba(255, 205, 164, 0.7), transparent 30%),
        linear-gradient(135deg, #f9f4ea 0%, #ece1cf 100%);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

html[data-theme="dark"] body {
    background: radial-gradient(circle at top left, rgba(208, 104, 49, 0.18), transparent 28%),
        linear-gradient(135deg, #0f141b 0%, #18212b 100%);
}

.shell-background {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(208, 104, 49, 0.16), transparent 25%),
        radial-gradient(circle at 80% 10%, rgba(15, 63, 69, 0.12), transparent 22%),
        radial-gradient(circle at 85% 85%, rgba(161, 197, 167, 0.18), transparent 22%);
    pointer-events: none;
}

html[data-theme="dark"] .shell-background {
    background-image:
        radial-gradient(circle at 12% 18%, rgba(208, 104, 49, 0.18), transparent 24%),
        radial-gradient(circle at 82% 12%, rgba(28, 110, 120, 0.18), transparent 22%),
        radial-gradient(circle at 84% 86%, rgba(84, 124, 94, 0.18), transparent 22%);
}

.page-frame {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 28px 40px;
}

.topbar,
.panel,
.hero-panel {
    animation: rise-in 0.5s ease both;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--ink);
    font-family: "Bitter", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.page-content-layout {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.page-content-layout.without-back {
    grid-template-columns: minmax(0, 1fr);
}

.quick-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 72px;
    margin: 8px 0 18px;
}

.back-column {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 4px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
    transform: translateY(-1px);
    background: var(--surface-strong);
    box-shadow: 0 10px 22px rgba(31, 41, 51, 0.12);
}

.back-button img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

html[data-theme="dark"] .back-button img {
    filter: invert(1);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    background: var(--surface-strong);
    box-shadow: 0 10px 22px rgba(31, 41, 51, 0.12);
}

.icon-button img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.admin-shortcut-button img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

html[data-theme="dark"] .admin-shortcut-button img {
    filter: invert(1);
}

html[data-theme="dark"] .message-button img {
    filter: invert(1);
}

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

.order-detail-head {
    align-items: center;
}

.order-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.order-title-row > div {
    min-width: 0;
}

.order-title-row h1 {
    white-space: nowrap;
}

.topbar-side,
.topbar-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.notification-link:hover,
.notification-link.is-active {
    transform: translateY(-1px);
    background: var(--surface-strong);
    box-shadow: 0 10px 22px rgba(31, 41, 51, 0.12);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-strong);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(31, 41, 51, 0.12);
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: rgba(31, 41, 51, 0.16);
}

.theme-toggle-thumb {
    position: absolute;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    transition: transform 0.2s ease;
}

.theme-toggle.is-dark .theme-toggle-thumb {
    transform: translateX(14px);
}

.notification-link svg {
    width: 34px;
    height: 34px;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.notification-count.is-hidden {
    display: none;
}

.content-shell {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
}

.flash-danger {
    background: var(--danger-soft);
}

.flash-success {
    background: var(--success-soft);
}

.flash-warning {
    background: #f9efd6;
}

.push-permission-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.push-permission-card[hidden] {
    display: none;
}

.push-permission-card strong {
    display: block;
    margin-bottom: 4px;
}

.push-permission-card p {
    margin: 0;
    color: var(--muted);
}

.push-permission-card .btn {
    flex: 0 0 auto;
}

.panel,
.hero-panel {
    background: var(--panel);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

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

.panel-head.compact {
    margin-bottom: 14px;
}

.panel-head h1,
.panel-head h2,
.hero-copy h1 {
    margin: 0;
    font-family: "Bitter", Georgia, serif;
    line-height: 1.1;
}

.panel-head p,
.hero-copy p {
    margin: 10px 0 0;
    color: var(--muted);
}

.eyebrow {
    display: none;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 22px;
    padding: 36px;
}

.start-menu-panel {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    max-width: 420px;
    margin: 0 auto;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    max-width: none;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-grid {
    display: grid;
    gap: 16px;
}

.feature-card,
.action-card,
.list-card,
.notification-card,
.order-row-card,
.chat-thread-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
}

.feature-card {
    padding: 18px;
}

.feature-card h3 {
    margin: 0 0 8px;
    font-family: "Bitter", Georgia, serif;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(31, 41, 51, 0.12);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-secondary {
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #cd6340, var(--danger));
}

html[data-theme="dark"] .btn-primary {
    color: #0d1218;
    background: linear-gradient(135deg, #f39a5a, #8bd1db);
}

html[data-theme="dark"] .btn-secondary {
    color: var(--ink);
    background: rgba(58, 72, 88, 0.95);
    border-color: rgba(238, 243, 248, 0.14);
}

html[data-theme="dark"] .btn-danger {
    background: linear-gradient(135deg, #ef8b68, #bb5a43);
}

.btn-large {
    min-height: 54px;
    padding: 0 24px;
}

.muted-chip,
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.muted-chip {
    color: var(--accent);
    background: var(--accent-soft);
}

.badge-count {
    min-width: 30px;
    color: #fff;
    background: var(--primary);
}

.auth-layout {
    display: flex;
    justify-content: center;
}

.form-card {
    width: min(100%, 620px);
}

.inner-form {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field span {
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(31, 41, 51, 0.12);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font: inherit;
    color: var(--ink);
    background: var(--surface-strong);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: rgba(20, 27, 36, 0.92);
    border-color: rgba(238, 243, 248, 0.16);
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(208, 104, 49, 0.15);
    border-color: rgba(208, 104, 49, 0.45);
}

.helper-text {
    margin: 8px 0 0;
    color: var(--muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-grid,
.detail-layout,
.two-column-layout {
    display: grid;
    gap: 18px;
}

.dashboard-grid {
    grid-template-columns: 1.25fr 1fr;
}

.two-column-layout,
.detail-layout {
    grid-template-columns: 1.2fr 1fr;
}

.summary-panel {
    grid-column: 1 / -1;
}

.summary-line {
    color: var(--muted);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.action-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(208, 104, 49, 0.4);
}

.action-card span {
    color: var(--muted);
}

.admin-card {
    background: linear-gradient(180deg, rgba(15, 63, 69, 0.08), rgba(255, 255, 255, 0.84));
}

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

.list-card,
.order-row-card,
.chat-thread-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
}

.list-card.static {
    cursor: default;
}

.list-card.selected,
.chat-thread-card.selected {
    border-color: rgba(208, 104, 49, 0.5);
    background: rgba(255, 255, 255, 0.94);
}

.order-main p,
.thread-main p,
.notification-card p,
.list-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.order-side,
.thread-side {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.order-row-card {
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: lowercase;
}

.status-processing {
    background: #f5e7ce;
    color: #885d1b;
}

.status-transit {
    background: #dceaf7;
    color: #1c547f;
}

.status-pvz {
    background: #dff2e6;
    color: #1b6d40;
}

.status-deactivated {
    background: #f5e2d7;
    color: #965134;
}

.status-issued {
    background: #e1ecff;
    color: #294d96;
}

.status-deleted {
    background: #f0d8d2;
    color: #8b463a;
}

.status-neutral {
    background: #e5e7eb;
    color: #344454;
}

.media-panel .detail-image,
.compact-image {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    margin-bottom: 18px;
    background: var(--surface);
}

.compact-image {
    max-height: 280px;
}

.detail-image-link {
    display: block;
}

.image-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
}

.detail-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.88rem;
}

.detail-item strong {
    font-size: 1rem;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-item p {
    margin: 6px 0 0;
    color: var(--muted);
}

.notification-card {
    padding: 18px;
}

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

.notification-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.text-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.empty-state {
    padding: 26px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(31, 41, 51, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.42);
}

.chat-page,
.messenger-layout,
.split-layout {
    display: grid;
    gap: 18px;
}

.messenger-layout {
    grid-template-columns: 420px 1fr;
}

.split-layout {
    grid-template-columns: 420px 1fr;
}

.messenger-sidebar,
.split-sidebar {
    max-height: calc(100vh - 220px);
    overflow: hidden;
}

.chat-sidebar-list,
.split-sidebar .stack-list {
    overflow-y: auto;
    max-height: calc(100vh - 340px);
    padding-right: 4px;
}

.chat-thread {
    display: grid;
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 16px;
}

.chat-bubble {
    max-width: min(720px, 100%);
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
}

.bubble-own {
    margin-left: auto;
    background: #f3ead8;
}

.bubble-admin {
    margin-right: auto;
    background: #e0f0ee;
}

.bubble-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.bubble-order {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
}

.chat-compose {
    display: grid;
    gap: 12px;
}

.compose-order-select summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
}

.compose-order-select select {
    margin-top: 10px;
}

.search-form,
.filters-form,
.inline-form,
.inline-actions,
.action-columns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.compact-search {
    margin-bottom: 12px;
}

.filters-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 14px;
}

.grow {
    flex: 1;
}

.checkbox-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.checkbox-pill input {
    width: auto;
    margin: 0;
}

.pagination {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 18px;
}

.action-columns {
    align-items: stretch;
}

.action-columns > * {
    flex: 1 1 280px;
}

.today-order-panel {
    display: grid;
    gap: 12px;
}

.today-order-price-form {
    width: 100%;
}

.today-order-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

@media (min-width: 981px) {
    .panel-head h1,
    .panel-head h2,
    .summary-line,
    .list-card strong,
    .order-row-card strong,
    .thread-main strong {
        white-space: nowrap;
    }
}

.clean-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 12px;
    color: var(--muted);
}

.note-card h2 {
    margin-top: 0;
    font-family: "Bitter", Georgia, serif;
}

.destructive {
    margin-top: 18px;
}

.checkbox-line {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--ink);
}

.checkbox-line input {
    width: auto;
    margin: 0;
}

[data-specific-ids] {
    display: none;
}

[data-specific-ids].is-visible {
    display: grid;
}

html[data-theme="dark"] .flash {
    background: var(--surface-strong);
}

html[data-theme="dark"] .push-permission-card {
    background: var(--surface-strong);
    border-color: rgba(238, 243, 248, 0.14);
}

html[data-theme="dark"] .flash-warning {
    background: rgba(123, 96, 35, 0.46);
}

html[data-theme="dark"] .list-card.selected,
html[data-theme="dark"] .chat-thread-card.selected {
    background: rgba(45, 59, 75, 0.96);
}

html[data-theme="dark"] .detail-item,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .checkbox-pill {
    background: var(--surface);
}

html[data-theme="dark"] .action-card,
html[data-theme="dark"] .admin-card {
    background: rgba(34, 44, 56, 0.92);
}

html[data-theme="dark"] .admin-card {
    background: linear-gradient(180deg, rgba(39, 91, 100, 0.38), rgba(34, 44, 56, 0.92));
}

html[data-theme="dark"] .muted-chip {
    color: #d7eef2;
    background: rgba(56, 108, 117, 0.56);
}

html[data-theme="dark"] .text-link,
html[data-theme="dark"] .compose-order-select summary,
html[data-theme="dark"] .bubble-order {
    color: #9fd8df;
}

html[data-theme="dark"] .theme-toggle-track {
    background: rgba(238, 243, 248, 0.18);
}

html[data-theme="dark"] .bubble-own {
    background: rgba(73, 55, 36, 0.78);
}

html[data-theme="dark"] .bubble-admin {
    background: rgba(22, 72, 76, 0.72);
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.image-modal[hidden] {
    display: none;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(7, 10, 15, 0.82);
}

.image-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(92vw, 1100px);
    height: min(88vh, 900px);
    margin: 4vh auto;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: rgba(250, 247, 241, 0.98);
    box-shadow: var(--shadow);
}

.image-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(31, 41, 51, 0.12);
    color: var(--ink);
    font-size: 1.6rem;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

html[data-theme="dark"] .image-modal-content {
    background: rgba(18, 24, 32, 0.98);
}

html[data-theme="dark"] .image-modal-close {
    background: rgba(238, 243, 248, 0.14);
}

@media (max-width: 980px) {
    .hero-panel,
    .dashboard-grid,
    .detail-layout,
    .two-column-layout,
    .messenger-layout,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .page-content-layout {
        grid-template-columns: 1fr;
    }

    .back-column {
        padding-top: 0;
    }

    .messenger-sidebar,
    .split-sidebar {
        max-height: none;
    }

    .chat-sidebar-list,
    .split-sidebar .stack-list {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .page-frame {
        padding: 18px 14px 34px;
    }

    .panel,
    .hero-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .brand-subtitle {
        font-size: 0.92rem;
    }

    .nav-link {
        padding: 10px 14px;
    }

    .btn {
        width: 100%;
    }

    .topbar .btn,
    .topbar-links .btn {
        width: auto;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        margin-bottom: 4px;
    }

    .brand {
        min-width: 0;
        width: 100%;
        justify-content: center;
        justify-self: stretch;
        text-align: center;
        font-size: 1.05rem;
        line-height: 1.1;
    }

    .topbar-side {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .notification-link,
    .theme-toggle,
    .icon-button {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .notification-link svg {
        width: 28px;
        height: 28px;
    }

    .topbar form {
        flex: 0 0 auto;
    }

    .topbar form .btn {
        min-width: 78px;
        min-height: 44px;
        padding: 0 14px;
    }

    .quick-nav-row {
        min-height: 64px;
        margin: 10px 0 18px;
    }

    .back-button {
        width: 56px;
        height: 56px;
    }

    .back-button img {
        width: 28px;
        height: 28px;
    }

    .topbar-links,
    .form-actions,
    .inline-form,
    .inline-actions,
    .search-form,
    .push-permission-card {
        width: 100%;
    }

    .push-permission-card {
        flex-direction: column;
        align-items: stretch;
    }

    .order-row-card,
    .list-card,
    .chat-thread-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-side,
    .thread-side {
        justify-items: start;
    }

    .order-detail-head {
        display: grid;
        grid-template-columns: minmax(118px, 1fr) clamp(46px, 13vw, 58px) minmax(116px, clamp(126px, 34vw, 162px));
        align-items: center;
        gap: 10px;
    }

    .order-title-row {
        display: contents;
    }

    .order-title-row h1 {
        font-size: clamp(1.65rem, 7.4vw, 2.12rem);
        white-space: normal;
    }

    .order-title-row .message-button {
        width: 100%;
        height: clamp(46px, 13vw, 58px);
        border-radius: 16px;
        justify-self: stretch;
    }

    .order-title-row .message-button img {
        width: clamp(27px, 7.5vw, 34px);
        height: clamp(27px, 7.5vw, 34px);
    }

    .order-detail-head > .status-badge {
        justify-self: stretch;
        width: 100%;
        max-width: none;
        padding: 8px 12px;
        justify-content: center;
        text-align: center;
        font-size: clamp(0.78rem, 3vw, 0.9rem);
        line-height: 1.15;
    }
}

@media (max-width: 420px) {
    .order-detail-head {
        grid-template-columns: minmax(104px, 1fr) clamp(42px, 12.5vw, 52px) minmax(104px, clamp(112px, 32vw, 140px));
        gap: 8px;
    }

    .order-title-row h1 {
        font-size: clamp(1.45rem, 7.4vw, 1.8rem);
    }

    .order-title-row .message-button {
        width: 100%;
        height: clamp(42px, 12.5vw, 52px);
        border-radius: 14px;
    }

    .order-title-row .message-button img {
        width: clamp(24px, 7vw, 30px);
        height: clamp(24px, 7vw, 30px);
    }

    .order-detail-head > .status-badge {
        padding: 7px 10px;
        font-size: clamp(0.74rem, 3vw, 0.82rem);
    }
}
