:root {
    --bg: #f5f6fa;
    --bg-accent: #fff2eb;
    --card: #ffffff;
    --card-soft: #fcfcfd;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --line: #edf2f7;
    --accent: #d72626;
    --accent-strong: #b91c1c;
    --accent-soft: rgba(215, 38, 38, 0.1);
    --orange: #ff7a00;
    --orange-soft: rgba(255, 122, 0, 0.12);
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.06);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(255, 122, 0, 0.08), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(215, 38, 38, 0.08), transparent 55%),
        linear-gradient(180deg, #fafbff 0%, var(--bg) 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-rtl {
    direction: rtl;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

body[data-theme="midnight"] {
    --bg: #0b1320;
    --bg-accent: #141e2d;
    --card: #101b2a;
    --card-soft: #152234;
    --text: #edf4f7;
    --muted: #9eb1c2;
    --border: #243446;
    --line: #1b2a3a;
    --accent-soft: rgba(240, 110, 72, 0.14);
    --orange-soft: rgba(255, 122, 0, 0.18);
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.24);
    color-scheme: dark;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(255, 122, 0, 0.14), transparent 58%),
        radial-gradient(900px 420px at 100% 0%, rgba(215, 38, 38, 0.12), transparent 58%),
        linear-gradient(180deg, #08111d 0%, #0b1320 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

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

.site-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 56px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.topbar > * {
    min-width: 0;
}

body[data-theme="midnight"] .topbar {
    background: rgba(16, 27, 42, 0.92);
    border-color: rgba(36, 52, 70, 0.9);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

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

.brand > div {
    min-width: 0;
}

.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
}

.brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.brand span,
.eyebrow,
.muted,
label,
.small {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

body.is-rtl .menu {
    margin-left: 0;
    margin-right: auto;
}

.menu a {
    padding: 10px 12px;
    border-radius: 999px;
    color: #334155;
    border: 1px solid transparent;
    transition: 0.18s ease;
    text-align: center;
    line-height: 1.25;
}

body[data-theme="midnight"] .menu a {
    color: #d6e5eb;
}

.menu a:hover,
.menu a.is-active {
    border-color: rgba(215, 38, 38, 0.2);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.toolbar-actions,
.hero-actions,
.inline-actions,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.toolbar-actions {
    min-width: 0;
}

.language-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

body[data-theme="midnight"] .language-switch,
body[data-theme="midnight"] .button-secondary,
body[data-theme="midnight"] input,
body[data-theme="midnight"] select,
body[data-theme="midnight"] textarea,
body[data-theme="midnight"] .table-scroll,
body[data-theme="midnight"] .empty-state,
body[data-theme="midnight"] th,
body[data-theme="midnight"] .admin-banner-meta .pill {
    background: var(--card);
}

.language-switch a {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.language-switch a.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 100%);
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.18s ease;
    min-width: 0;
    text-align: center;
    line-height: 1.25;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.button:disabled,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-primary,
button,
input[type="submit"] {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 100%);
}

.button-secondary {
    color: var(--text);
    background: #fff;
}

body[data-theme="midnight"] .button-secondary {
    color: var(--text);
    border-color: var(--border);
}

.button-ghost {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: transparent;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.hero-copy,
.hero-panel,
.page-card,
.stat-card,
.module-card,
.workflow-card,
.cta-band,
.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.page-card,
.login-card,
.cta-band,
.module-card,
.workflow-card,
.stat-card {
    padding: 22px;
}

.hero-copy {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(380px 180px at 100% 0%, rgba(255, 122, 0, 0.13), transparent 75%),
        radial-gradient(420px 220px at 0% 100%, rgba(215, 38, 38, 0.08), transparent 75%),
        #fff;
}

body[data-theme="midnight"] .hero-copy {
    background:
        radial-gradient(380px 180px at 100% 0%, rgba(255, 122, 0, 0.16), transparent 75%),
        radial-gradient(420px 220px at 0% 100%, rgba(215, 38, 38, 0.1), transparent 75%),
        var(--card);
}

body[data-theme="midnight"] .admin-banner,
body[data-theme="midnight"] .page-card,
body[data-theme="midnight"] .stat-card,
body[data-theme="midnight"] .login-card,
body[data-theme="midnight"] .table-scroll {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--card);
}

.hero-copy h1,
.login-card h1,
.page-title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.page-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.hero-copy p,
.hero-panel p,
.page-card p,
.module-card p,
.workflow-card p,
.stat-card p,
.cta-band p {
    margin-top: 0;
    line-height: 1.7;
    color: #334155;
}

body[data-theme="midnight"] .hero-copy p,
body[data-theme="midnight"] .hero-panel p,
body[data-theme="midnight"] .page-card p,
body[data-theme="midnight"] .module-card p,
body[data-theme="midnight"] .workflow-card p,
body[data-theme="midnight"] .stat-card p,
body[data-theme="midnight"] .cta-band p {
    color: var(--muted);
}

body[data-theme="midnight"] .brand strong,
body[data-theme="midnight"] .page-title,
body[data-theme="midnight"] .page-card h2,
body[data-theme="midnight"] .section-title,
body[data-theme="midnight"] .module-card h3,
body[data-theme="midnight"] .workflow-card h3,
body[data-theme="midnight"] .login-card h1,
body[data-theme="midnight"] .stat-card strong {
    color: var(--text);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-row span,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--muted);
    font-size: 12px;
}

.pill-accent {
    border-color: rgba(215, 38, 38, 0.18);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.hero-panel {
    display: grid;
    gap: 16px;
    align-content: start;
}

.hero-panel img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

body[data-theme="midnight"] .brand img,
body[data-theme="midnight"] .hero-panel img {
    background: rgba(255, 255, 255, 0.96);
}

.section {
    margin-top: 18px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-title,
.page-card h2,
.module-card h3,
.workflow-card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.metric-grid,
.module-grid,
.workflow-grid,
.page-grid,
.stats-grid {
    display: grid;
    gap: 14px;
}

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

.stat-card {
    padding: 18px;
}

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

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

.chart-card {
    display: grid;
    gap: 18px;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.chart-head .muted {
    max-width: 380px;
    margin: 0;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.legend-swatch-received {
    background: linear-gradient(180deg, var(--orange), #ffb547);
}

.legend-swatch-finished {
    background: linear-gradient(180deg, #157f8f, #3db2c4);
}

.flow-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 280px;
}

.flow-chart-item {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.flow-chart-columns {
    width: 100%;
    min-height: 190px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    padding: 12px 8px 0;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(15, 23, 42, 0.03)),
        var(--card-soft);
    border: 1px solid var(--border);
}

body[data-theme="midnight"] .flow-chart-columns {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--card-soft);
}

.flow-chart-bar {
    width: 100%;
    min-height: 0;
    border-radius: 14px 14px 6px 6px;
}

.flow-chart-bar-received {
    background: linear-gradient(180deg, var(--orange), #ffb547);
}

.flow-chart-bar-finished {
    background: linear-gradient(180deg, #157f8f, #3db2c4);
}

.flow-chart-item strong {
    font-size: 13px;
}

.flow-chart-item span {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}

.donut-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.donut-chart {
    --used-progress: 0%;
    width: min(220px, 100%);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        conic-gradient(
            var(--accent) 0 var(--used-progress),
            #1d8fa1 var(--used-progress) 100%
        );
    box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.08);
}

.donut-chart-hole {
    width: 68%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.donut-chart-hole strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
}

.donut-chart-hole span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.donut-stats {
    display: grid;
    gap: 12px;
}

.donut-stat-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-soft);
}

.donut-stat-line span {
    color: var(--muted);
}

.progress-strip {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.progress-strip-used,
.progress-strip-stock {
    display: block;
    height: 100%;
}

.progress-strip-used {
    background: linear-gradient(90deg, var(--accent), #f06148);
}

.progress-strip-stock {
    background: linear-gradient(90deg, #157f8f, #3db2c4);
}

.rank-chart {
    display: grid;
    gap: 14px;
}

.rank-chart-item {
    display: grid;
    gap: 8px;
}

.rank-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rank-chart-head strong {
    font-size: 14px;
}

.rank-chart-head span {
    color: var(--muted);
    font-size: 12px;
}

.rank-chart-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.rank-chart-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.rank-chart-fill-primary {
    background: linear-gradient(90deg, var(--orange), #ffb547);
}

.rank-chart-fill-secondary {
    background: linear-gradient(90deg, #157f8f, #4fc3d7);
}

.stat-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.75rem;
    line-height: 1;
}

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

.module-card,
.workflow-card {
    position: relative;
    overflow: hidden;
}

.module-card::before,
.workflow-card::before,
.admin-banner::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--orange));
}

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

.workflow-card span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--orange));
}

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

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

.list-item,
.status-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-soft);
}

.list-item strong,
.status-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.list-item span,
.status-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.status-card.is-ready {
    border-color: rgba(22, 163, 74, 0.16);
    background: rgba(22, 163, 74, 0.05);
}

.table-wrap {
    overflow: hidden;
}

.table-scroll {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

body[data-theme="midnight"] .page-card,
body[data-theme="midnight"] .stat-card,
body[data-theme="midnight"] .module-card,
body[data-theme="midnight"] .workflow-card,
body[data-theme="midnight"] .cta-band,
body[data-theme="midnight"] .login-card,
body[data-theme="midnight"] .hero-panel,
body[data-theme="midnight"] .hero-copy,
body[data-theme="midnight"] .table-scroll,
body[data-theme="midnight"] .empty-state,
body[data-theme="midnight"] .list-item,
body[data-theme="midnight"] .status-card,
body[data-theme="midnight"] .badge-row span,
body[data-theme="midnight"] .pill,
body[data-theme="midnight"] .theme-switcher {
    border-color: var(--border);
    box-shadow: var(--shadow);
}

body[data-theme="midnight"] td {
    background: transparent;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: start;
    vertical-align: top;
    font-size: 13px;
}

.cell-nowrap {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body[data-theme="midnight"] th {
    color: #d6e5eb;
}

tr:hover td {
    background: #fafcff;
}

body[data-theme="midnight"] tr:hover td {
    background: #122030;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

body[data-theme="midnight"] input,
body[data-theme="midnight"] select,
body[data-theme="midnight"] textarea {
    color: var(--text);
    border-color: var(--border);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(215, 38, 38, 0.35);
    box-shadow: 0 0 0 4px rgba(215, 38, 38, 0.08);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.field {
    display: grid;
    gap: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.flash {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 14px;
}

.flash-success {
    color: #166534;
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
}

.flash-error {
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(220, 38, 38, 0.08);
}

body[data-theme="midnight"] .flash-success {
    color: #dcfce7;
    border-color: rgba(34, 197, 94, 0.22);
    background: rgba(22, 163, 74, 0.14);
}

body[data-theme="midnight"] .flash-error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(220, 38, 38, 0.16);
}

.login-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(255, 122, 0, 0.11), transparent 60%),
        radial-gradient(900px 420px at 100% 0%, rgba(215, 38, 38, 0.11), transparent 60%),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

body[data-theme="midnight"] .login-screen,
body[data-theme="midnight"].admin-body {
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(255, 122, 0, 0.12), transparent 60%),
        radial-gradient(900px 420px at 100% 0%, rgba(215, 38, 38, 0.1), transparent 60%),
        linear-gradient(180deg, #0a1220 0%, var(--bg) 100%);
}

.login-card {
    width: min(500px, 100%);
}

.login-card .brand {
    margin-bottom: 18px;
}

.login-card h1 {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
}

.admin-body {
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(255, 122, 0, 0.08), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(215, 38, 38, 0.08), transparent 55%),
        linear-gradient(180deg, #fafbff 0%, var(--bg) 100%);
}

.admin-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    width: min(1240px, calc(100% - 32px));
    margin: 18px auto 0;
}

.admin-content {
    padding-top: 14px;
    flex: 1 0 auto;
}

.admin-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.admin-banner .page-title {
    margin-bottom: 6px;
}

.admin-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-banner-meta .pill {
    background: #fff;
}

body[data-theme="midnight"] .admin-banner,
body[data-theme="midnight"] .admin-banner-meta .pill {
    border-color: var(--border);
}

.role-client.page-receptions,
.role-client.page-productions {
    background:
        radial-gradient(860px 400px at 0% 0%, rgba(10, 132, 163, 0.12), transparent 58%),
        radial-gradient(820px 420px at 100% 0%, rgba(255, 122, 0, 0.11), transparent 58%),
        linear-gradient(180deg, #f3fbfe 0%, #eef6fb 54%, #f7fbff 100%);
}

body[data-theme="midnight"].role-client.page-receptions,
body[data-theme="midnight"].role-client.page-productions {
    background:
        radial-gradient(860px 400px at 0% 0%, rgba(16, 185, 216, 0.14), transparent 58%),
        radial-gradient(820px 420px at 100% 0%, rgba(249, 115, 22, 0.14), transparent 58%),
        linear-gradient(180deg, #07141f 0%, #0b1723 52%, #101b2a 100%);
}

.role-client.page-receptions .admin-banner,
.role-client.page-productions .admin-banner {
    background:
        linear-gradient(135deg, rgba(12, 125, 153, 0.12), rgba(255, 122, 0, 0.1)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.98));
    border-color: rgba(15, 118, 110, 0.14);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.role-client.page-receptions .admin-banner::before,
.role-client.page-productions .admin-banner::before {
    width: 100%;
    height: 5px;
    inset: 0 0 auto 0;
    background: linear-gradient(90deg, #0f766e 0%, #0891b2 45%, #fb923c 100%);
}

.role-client.page-receptions .admin-banner::after,
.role-client.page-productions .admin-banner::after {
    content: "";
    position: absolute;
    inset: auto 28px 18px auto;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.8), transparent 26%),
        radial-gradient(circle at 50% 50%, rgba(8, 145, 178, 0.18), transparent 62%);
    pointer-events: none;
    opacity: 0.72;
}

.role-client.page-receptions .admin-banner .page-title,
.role-client.page-productions .admin-banner .page-title {
    color: #0f172a;
}

.role-client.page-receptions .admin-banner .muted,
.role-client.page-productions .admin-banner .muted {
    color: #46627b;
}

.role-client.page-receptions .admin-banner-meta .pill,
.role-client.page-productions .admin-banner-meta .pill {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(8, 145, 178, 0.16);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.role-client.page-receptions .reception-register-card,
.role-client.page-productions .traceability-register-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 255, 0.98));
    border-color: rgba(125, 176, 199, 0.24);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.role-client.page-receptions .page-toolbar > h2,
.role-client.page-productions .page-toolbar > h2 {
    color: #0f2f45;
    font-size: clamp(1.4rem, 2vw, 1.7rem);
    letter-spacing: -0.02em;
}

.role-client.page-receptions .reception-search-form input,
.role-client.page-productions .reception-search-form input {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(125, 176, 199, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.role-client.page-receptions .reception-search-form button,
.role-client.page-productions .reception-search-form button {
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(14, 116, 144, 0.16);
}

.role-client.page-receptions .empty-state,
.role-client.page-productions .empty-state {
    border-style: solid;
    border-color: rgba(8, 145, 178, 0.2);
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(251, 146, 60, 0.08)),
        #fff;
}

.role-client.page-receptions .empty-state p,
.role-client.page-productions .empty-state p {
    color: #16425b;
    font-weight: 600;
}

.role-client.page-receptions .table-scroll,
.role-client.page-productions .table-scroll {
    border-color: rgba(125, 176, 199, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98));
}

.role-client.page-receptions th,
.role-client.page-productions th {
    background:
        linear-gradient(135deg, rgba(10, 132, 163, 0.12), rgba(255, 122, 0, 0.12)),
        #f7fbfd;
    color: #13415f;
    border-bottom-color: rgba(125, 176, 199, 0.3);
}

.role-client.page-receptions tbody tr:nth-child(odd) td,
.role-client.page-productions tbody tr:nth-child(odd) td {
    background: rgba(8, 145, 178, 0.024);
}

.role-client.page-receptions tbody tr:hover td,
.role-client.page-productions tbody tr:hover td {
    background: rgba(59, 130, 246, 0.07);
}

.role-client.page-receptions td,
.role-client.page-productions td {
    color: #16324a;
}

.role-client.page-receptions .selection-cell input[type="checkbox"],
.role-client.page-productions .selection-cell input[type="checkbox"] {
    accent-color: #0f766e;
}

.role-client.page-productions #open-production-declaration:not(:disabled),
.role-client.page-productions #toggle-productions-selection {
    border-color: rgba(8, 145, 178, 0.16);
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(251, 146, 60, 0.08)),
        #fff;
    color: #114464;
}

.role-client.page-receptions .table-footer-bar,
.role-client.page-productions .table-footer-bar {
    padding-top: 18px;
    border-top: 1px solid rgba(125, 176, 199, 0.2);
}

body[data-theme="midnight"].role-client.page-receptions .admin-banner,
body[data-theme="midnight"].role-client.page-productions .admin-banner,
body[data-theme="midnight"].role-client.page-receptions .reception-register-card,
body[data-theme="midnight"].role-client.page-productions .traceability-register-card,
body[data-theme="midnight"].role-client.page-receptions .table-scroll,
body[data-theme="midnight"].role-client.page-productions .table-scroll,
body[data-theme="midnight"].role-client.page-receptions .empty-state,
body[data-theme="midnight"].role-client.page-productions .empty-state,
body[data-theme="midnight"].role-client.page-receptions .admin-banner-meta .pill,
body[data-theme="midnight"].role-client.page-productions .admin-banner-meta .pill {
    border-color: rgba(74, 98, 123, 0.42);
}

body[data-theme="midnight"].role-client.page-receptions th,
body[data-theme="midnight"].role-client.page-productions th {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.18), rgba(249, 115, 22, 0.16)),
        var(--card);
    color: #ecf6fa;
}

body[data-theme="midnight"].role-client.page-receptions tbody tr:nth-child(odd) td,
body[data-theme="midnight"].role-client.page-productions tbody tr:nth-child(odd) td {
    background: rgba(8, 145, 178, 0.06);
}

body[data-theme="midnight"].role-client.page-receptions tbody tr:hover td,
body[data-theme="midnight"].role-client.page-productions tbody tr:hover td {
    background: rgba(59, 130, 246, 0.12);
}

.empty-state {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: #fff;
}

.app-footer,
.login-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-footer {
    padding-top: 8px;
    padding-bottom: 24px;
}

.login-footer {
    width: min(500px, 100%);
    margin-top: 14px;
}

.app-footer-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.theme-switcher {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

body[data-theme="midnight"] .theme-switcher {
    background: #0f1927;
}

.theme-option {
    border: 0;
    min-width: 78px;
    padding: 10px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.theme-option:hover {
    transform: translateY(-1px);
}

.theme-option.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 100%);
    box-shadow: var(--shadow-soft);
}

.app-credit {
    margin: 0;
    color: var(--accent-strong);
    font-weight: 800;
}

body[data-theme="midnight"] .app-credit {
    color: #ffd0bc;
}

.compact a {
    padding: 7px 10px;
}

.right {
    margin-left: auto;
}

body.is-rtl .right {
    margin-left: 0;
    margin-right: auto;
}

@media (max-width: 1120px) {
    .hero,
    .metric-grid,
    .module-grid,
    .workflow-grid,
    .page-grid.two-columns,
    .stats-grid,
    .dashboard-visual-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .topbar,
    .admin-banner,
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-topbar .admin-menu,
    .admin-topbar .toolbar-actions {
        width: 100%;
        margin-inline-start: 0;
    }

    .admin-topbar .admin-menu {
        justify-content: flex-start;
    }

    .admin-topbar .toolbar-actions {
        justify-content: space-between;
    }

    .reception-layout {
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    }

    .reception-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .site-shell,
    .admin-topbar {
        width: min(100% - 20px, 1240px);
    }

    .metric-grid,
    .module-grid,
    .workflow-grid,
    .page-grid.two-columns,
    .stats-grid,
    .dashboard-visual-grid,
    .form-grid,
    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }

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

    .menu {
        margin-left: 0;
        width: 100%;
    }

    .app-footer,
    .login-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    body.is-rtl .app-footer,
    body.is-rtl .login-footer {
        align-items: flex-end;
    }

    .app-footer-tools,
    .theme-switcher {
        width: 100%;
    }

    .theme-option {
        flex: 1 1 0;
    }

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

    .reception-toolbar-group {
        justify-content: flex-start;
        width: 100%;
    }

    .reception-search-form {
        width: 100%;
    }

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

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

    .donut-layout {
        grid-template-columns: 1fr;
    }
}
.button-danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.inline-actions form {
    margin: 0;
}

.page-toolbar,
.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.page-toolbar {
    justify-content: space-between;
    margin-bottom: 18px;
    align-items: flex-start;
}

.page-toolbar > h2 {
    flex: 1 1 220px;
    min-width: 0;
}

.page-toolbar > .toolbar-group {
    flex: 999 1 760px;
    min-width: 0;
}

.selection-cell {
    width: 44px;
    text-align: center;
}

.selection-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.reception-register-card {
    min-width: 0;
}

.reception-search-form,
.reception-search-form input {
    min-width: 0;
}

.reception-toolbar-group {
    justify-content: flex-end;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
}

.reception-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    width: 100%;
}

.reception-search-form button,
.reception-bulk-actions button {
    white-space: normal;
}

.reception-bulk-actions {
    flex-wrap: wrap;
    min-width: 0;
}

.reception-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.reception-bulk-actions .button {
    flex: 0 1 auto;
}

.admin-topbar .brand {
    flex: 0 1 290px;
}

.admin-topbar .admin-menu {
    flex: 1 1 420px;
    justify-content: center;
    min-width: 0;
}

.admin-topbar .toolbar-actions {
    flex: 0 1 auto;
    margin-inline-start: auto;
    justify-content: flex-end;
}

.trash-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 56px;
    padding-inline: 14px;
}

.trash-shortcut svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex: 0 0 auto;
}

.trash-shortcut__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.table-footer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
}

.pagination-summary {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.pagination-tools,
.pagination-links,
.page-size-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pagination-tools {
    justify-content: flex-end;
}

.page-size-form {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-soft);
}

.page-size-form label {
    margin: 0;
    white-space: nowrap;
}

.page-size-form select {
    width: auto;
    min-width: 80px;
    padding: 9px 12px;
}

.pagination-link {
    min-width: 46px;
    padding-inline: 14px;
}

.pagination-current {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 100%);
    cursor: default;
}

.pagination-link.is-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.pagination-ellipsis {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(12px);
}

.modal-overlay.is-open {
    display: flex;
}

.modal-panel {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24);
}

body[data-theme="midnight"] .modal-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--card);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.48);
}

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

.modal-heading {
    display: grid;
    gap: 6px;
}

.modal-title {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.04;
}

.modal-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--card-soft);
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
}

.modal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.modal-metric-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-soft);
}

.modal-metric-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.reception-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.reception-modal-form .field,
.reception-modal-form input,
.reception-modal-form select {
    min-width: 0;
}

.traceability-modal-panel {
    width: min(1120px, 100%);
}

.traceability-modal-form {
    gap: 16px 18px;
}

.traceability-modal-form .field,
.traceability-modal-form input,
.traceability-modal-form select {
    min-width: 0;
}

.declaration-config-panel {
    width: min(560px, 100%);
}

.declaration-config-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.declaration-preview-panel {
    width: min(1280px, 100%);
}

.packing-list-panel {
    width: min(1240px, 100%);
}

.declaration-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.declaration-table-scroll {
    max-height: calc(100vh - 260px);
}

.declaration-table {
    min-width: 1100px;
}

.declaration-table th,
.declaration-table td {
    text-align: center;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.declaration-table th {
    position: sticky;
    top: 0;
    background: var(--card);
}

.declaration-table td {
    background: transparent;
    font-size: 12px;
}

.declaration-table .lot-column,
.declaration-table .lot-cell {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    width: 18%;
}

.declaration-table .count-column,
.declaration-table .count-cell {
    width: 7%;
    font-size: 11px;
    line-height: 1.15;
}

.declaration-table .palette-column,
.declaration-table .palette-cell {
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}

.declaration-table .palette-column {
    width: 9%;
}

.packing-table .palette-cell--merged {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.05;
    background: var(--card-soft);
}

.stacked-heading {
    display: inline-block;
    line-height: 1.1;
    white-space: normal;
}

.declaration-table tfoot td {
    font-weight: 800;
    background: var(--card-soft);
}

.declaration-total-label {
    font-size: 13px;
}

.packing-table {
    min-width: 980px;
}

.packing-list-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.packing-total-card {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-soft);
}

.packing-total-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.packing-total-card strong {
    display: block;
    font-size: 1rem;
    line-height: 1.08;
}

.reception-date-field input[type="date"] {
    padding-inline-end: 40px;
}

.modal-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
}

.modal-actions .button,
.modal-actions input[type="submit"] {
    width: auto;
    min-width: 140px;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .dashboard-stats-grid,
    .reception-search-form {
        grid-template-columns: 1fr;
    }

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

    .chart-head,
    .rank-chart-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .reception-search-form {
        grid-template-columns: 1fr;
    }

    .reception-bulk-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .reception-bulk-actions .button {
        flex: 1 1 180px;
    }

    .admin-topbar .toolbar-actions,
    .admin-topbar .language-switch,
    .admin-topbar .button-secondary {
        width: 100%;
    }

    .admin-topbar .toolbar-actions {
        justify-content: stretch;
    }

    .admin-topbar .toolbar-actions > * {
        flex: 1 1 100%;
    }

    .modal-overlay {
        padding: 14px;
    }

    .modal-panel {
        padding: 18px;
    }

    .modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions {
        flex-direction: row;
        justify-content: stretch;
    }

    .modal-actions .button,
    .modal-actions input[type="submit"] {
        flex: 1 1 180px;
    }

    .modal-metrics,
    .reception-modal-form,
    .traceability-modal-form,
    .declaration-config-form {
        grid-template-columns: 1fr;
    }

    .table-footer-bar,
    .pagination-tools {
        align-items: stretch;
    }

    .pagination-links,
    .page-size-form {
        width: 100%;
    }

    .pagination-links .button,
    .page-size-form select {
        flex: 1 1 auto;
    }

    .packing-list-totals {
        grid-template-columns: 1fr;
    }
}

.import-preview-panel {
    width: min(1260px, 100%);
}

.import-notice-list,
.import-preview-sections {
    gap: 16px;
}

.import-upload-form {
    margin-top: 18px;
}

.preview-table-scroll {
    max-height: 320px;
}

.preview-subsection {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.preview-subsection.two-columns {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.preview-subsection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-subsection-head h4 {
    margin: 0;
    font-size: 1rem;
}

.import-confirm-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.import-confirm-text {
    margin: 6px 0 0;
}

.import-inline-error {
    margin: 10px 0 0;
}

@media (max-width: 820px) {
    .preview-subsection.two-columns {
        grid-template-columns: 1fr;
    }

    .role-client.page-receptions .page-toolbar,
    .role-client.page-productions .page-toolbar {
        gap: 14px;
    }

    .role-client.page-receptions .page-toolbar > h2,
    .role-client.page-productions .page-toolbar > h2,
    .role-client.page-receptions .page-toolbar > .toolbar-group,
    .role-client.page-productions .page-toolbar > .toolbar-group {
        flex-basis: 100%;
    }

    .role-client.page-receptions .reception-action-row > *,
    .role-client.page-productions .reception-action-row > * {
        flex: 1 1 220px;
        min-width: 0;
    }

    .role-client.page-receptions .admin-banner::after,
    .role-client.page-productions .admin-banner::after {
        width: 120px;
        height: 120px;
        inset: auto 16px 14px auto;
    }
}

@media (max-width: 640px) {
    .role-client.page-receptions .table-scroll,
    .role-client.page-productions .table-scroll {
        border-radius: 18px;
    }

    .role-client.page-receptions .reception-search-form,
    .role-client.page-productions .reception-search-form {
        grid-template-columns: 1fr;
    }

    .role-client.page-receptions .reception-search-form button,
    .role-client.page-productions .reception-search-form button,
    .role-client.page-receptions .reception-action-row .button,
    .role-client.page-productions .reception-action-row .button {
        width: 100%;
    }
}

@media (max-width: 1080px) {
    .page-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        align-items: stretch;
    }

    .page-toolbar > h2,
    .page-toolbar > .toolbar-group {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .page-toolbar > h2 {
        margin: 0;
        font-size: clamp(1.45rem, 3.6vw, 1.9rem);
        line-height: 1.12;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .reception-toolbar-group {
        justify-content: stretch;
    }

    .reception-search-form,
    .reception-action-row,
    .reception-bulk-actions {
        width: 100%;
    }

    .reception-action-row {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .page-toolbar > h2 {
        font-size: 1.32rem;
    }

    .reception-search-form {
        grid-template-columns: 1fr;
    }

    .reception-search-form button,
    .reception-action-row > *,
    .reception-bulk-actions > * {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-width: 900px) {
    .topbar {
        gap: 12px;
        padding: 12px;
    }

    .admin-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .admin-topbar .brand,
    .admin-topbar .admin-menu,
    .admin-topbar .toolbar-actions {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .topbar .menu,
    .admin-topbar .admin-menu {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .topbar .menu::-webkit-scrollbar,
    .admin-topbar .admin-menu::-webkit-scrollbar {
        height: 6px;
    }

    .topbar .menu a,
    .admin-topbar .admin-menu a {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }

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

    .admin-topbar .toolbar-actions > * {
        min-width: 0;
    }

    .admin-topbar .language-switch {
        justify-self: start;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .admin-topbar .button-secondary {
        justify-self: end;
        white-space: nowrap;
    }

    .page-card,
    .admin-banner,
    .login-card,
    .hero-copy,
    .hero-panel {
        padding: 18px;
    }

    .admin-banner {
        gap: 12px;
    }

    .page-title {
        font-size: clamp(1.55rem, 5vw, 2rem);
    }

    .page-toolbar {
        gap: 12px;
    }

    .page-toolbar > h2,
    .page-toolbar > .toolbar-group {
        flex-basis: 100%;
    }

    .reception-action-row > *,
    .toolbar-group > * {
        min-width: 0;
    }

    .table-scroll {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 680px;
    }
}

@media (max-width: 640px) {
    .topbar {
        border-radius: 16px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand span {
        font-size: 12px;
        line-height: 1.25;
    }

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

    .admin-topbar .language-switch,
    .admin-topbar .button-secondary {
        width: 100%;
        justify-self: stretch;
    }

    .admin-topbar .button-secondary {
        text-align: center;
    }

    .admin-banner-meta {
        width: 100%;
    }

    .admin-banner-meta .pill {
        flex: 1 1 auto;
        justify-content: center;
    }

    .page-card,
    .admin-banner,
    .login-card {
        padding: 16px;
    }

    .page-toolbar > h2 {
        font-size: 1.35rem;
    }

    .reception-action-row > * {
        flex: 1 1 100%;
    }

    .pagination-summary {
        width: 100%;
    }

    table {
        min-width: 620px;
    }
}

@media (max-width: 1240px) {
    .site-shell {
        width: min(100% - 24px, 1240px);
    }

    .page-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        align-items: stretch;
    }

    .page-toolbar > h2,
    .page-toolbar > .toolbar-group {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .page-toolbar > h2 {
        margin: 0;
        font-size: clamp(1.4rem, 2.8vw, 1.9rem);
        line-height: 1.12;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .reception-toolbar-group,
    .reception-search-form,
    .reception-action-row,
    .reception-bulk-actions {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .topbar,
    .admin-topbar {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .admin-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .admin-topbar .brand,
    .admin-topbar .admin-menu,
    .admin-topbar .toolbar-actions {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .admin-topbar .brand {
        gap: 10px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand span {
        font-size: 12px;
        line-height: 1.2;
    }

    .admin-topbar .admin-menu,
    .topbar .menu {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .admin-topbar .admin-menu a,
    .topbar .menu a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 9px 11px;
        font-size: 13px;
    }

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

    .admin-topbar .language-switch {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .admin-topbar .language-switch a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 11px;
    }

    .admin-topbar .button-secondary {
        white-space: nowrap;
        padding: 10px 14px;
    }

    .admin-banner {
        padding: 16px 18px;
        gap: 10px;
    }

    .admin-banner .eyebrow {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .page-title {
        font-size: clamp(1.45rem, 3.8vw, 2rem);
        line-height: 1.08;
    }

    .admin-banner .muted {
        font-size: 14px;
        line-height: 1.45;
    }

    .admin-banner-meta {
        width: 100%;
        gap: 8px;
    }

    .admin-banner-meta .pill {
        padding: 7px 11px;
        font-size: 12px;
    }

    .page-card,
    .login-card,
    .hero-copy,
    .hero-panel {
        padding: 18px;
    }

    .table-scroll {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 760px) {
    .site-shell,
    .admin-topbar {
        width: min(100% - 18px, 1240px);
    }

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

    .admin-topbar .language-switch,
    .admin-topbar .button-secondary {
        width: 100%;
        justify-self: stretch;
    }

    .admin-topbar .button-secondary {
        text-align: center;
    }

    .brand span {
        display: none;
    }

    .page-card,
    .admin-banner,
    .login-card {
        padding: 15px;
    }

    .page-toolbar > h2 {
        font-size: 1.28rem;
    }

    .reception-search-form {
        grid-template-columns: 1fr;
    }

    .reception-search-form button,
    .reception-action-row > *,
    .reception-bulk-actions > * {
        width: 100%;
        flex: 1 1 100%;
    }

    .app-footer,
    .login-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .app-footer-tools,
    .theme-switcher {
        width: 100%;
    }
}

.page-title,
.page-toolbar > h2,
.modal-title {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mobile-nav-toggle:hover {
    transform: none;
}

.admin-topbar-panels {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
}

body.is-rtl .admin-topbar-panels {
    margin-left: 0;
    margin-right: auto;
}

.admin-topbar .admin-menu {
    margin-left: 0;
    margin-right: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.admin-topbar .toolbar-actions {
    flex: 0 0 auto;
}

@media (max-width: 860px) {
    .site-shell,
    .admin-topbar {
        width: min(100% - 18px, 1240px);
    }

    .topbar,
    .admin-topbar {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .admin-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .admin-topbar .brand {
        min-width: 0;
        gap: 10px;
    }

    .admin-topbar .brand img {
        width: 42px;
        height: 42px;
    }

    .admin-topbar .brand strong {
        font-size: 14px;
        line-height: 1.18;
    }

    .admin-topbar .brand span {
        display: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        flex-direction: column;
    }

    .admin-topbar-panels {
        display: grid;
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        gap: 10px;
    }

    .js-ready .admin-topbar .admin-topbar-panels {
        display: none;
    }

    .js-ready .admin-topbar.is-open .admin-topbar-panels {
        display: grid;
    }

    .admin-topbar .admin-menu,
    .admin-topbar .toolbar-actions {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .admin-topbar .admin-menu {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .admin-topbar .admin-menu a {
        flex: 0 0 auto;
        padding: 8px 11px;
        font-size: 13px;
        white-space: nowrap;
    }

    .admin-topbar .toolbar-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    .admin-topbar .language-switch,
    .admin-topbar .button-secondary {
        width: 100%;
        min-width: 0;
    }

    .admin-topbar .language-switch {
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .admin-topbar .language-switch a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 12px;
    }

    .admin-topbar .button-secondary {
        justify-content: center;
        padding: 10px 14px;
        text-align: center;
    }

    .page-card,
    .admin-banner,
    .login-card,
    .hero-copy,
    .hero-panel,
    .module-card,
    .workflow-card,
    .stat-card {
        padding: 14px;
        border-radius: 18px;
    }

    .admin-banner {
        display: grid;
        gap: 12px;
    }

    .admin-banner > * {
        min-width: 0;
    }

    .admin-banner .page-title {
        margin-bottom: 4px;
        font-size: clamp(1.4rem, 5.8vw, 1.9rem);
        line-height: 1.06;
    }

    .admin-banner .muted {
        font-size: 13px;
        line-height: 1.45;
    }

    .admin-banner-meta {
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
    }

    .admin-banner-meta .pill {
        justify-content: center;
    }

    .page-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        align-items: stretch;
    }

    .page-toolbar > h2,
    .page-toolbar > .toolbar-group,
    .toolbar-group,
    .reception-toolbar-group,
    .reception-search-form,
    .reception-action-row,
    .reception-bulk-actions {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .page-toolbar > h2 {
        margin: 0;
        font-size: clamp(1.2rem, 5vw, 1.5rem);
        line-height: 1.15;
    }

    .reception-search-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .reception-search-form button,
    .reception-action-row > *,
    .reception-bulk-actions > * {
        width: 100%;
        flex: 1 1 100%;
    }

    .table-scroll {
        overflow: auto;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 620px;
    }
}

@media (max-width: 520px) {
    .topbar,
    .admin-topbar,
    .site-shell {
        width: min(100% - 14px, 1240px);
    }

    .topbar,
    .admin-topbar {
        padding: 9px 10px;
        gap: 8px;
        border-radius: 14px;
    }

    .admin-topbar .brand img {
        width: 38px;
        height: 38px;
    }

    .admin-topbar .brand strong {
        font-size: 13px;
    }

    .mobile-nav-toggle {
        width: 42px;
        min-width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .page-card,
    .admin-banner,
    .login-card,
    .hero-copy,
    .hero-panel,
    .module-card,
    .workflow-card,
    .stat-card {
        padding: 12px;
        border-radius: 16px;
    }

    .admin-banner .page-title,
    .page-toolbar > h2,
    .modal-title {
        font-size: clamp(1.12rem, 6vw, 1.35rem);
    }

    .pagination-links {
        gap: 8px;
    }

    table {
        min-width: 580px;
    }
}

/* Final admin header responsiveness pass */
.admin-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    row-gap: 12px;
}

.admin-topbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.admin-topbar-head .brand {
    min-width: 0;
}

.admin-topbar-panels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.admin-topbar-panels .admin-menu {
    flex: 1 1 auto;
}

.admin-topbar-panels .toolbar-actions {
    flex: 0 0 auto;
}

@media (max-width: 1160px) {
    .admin-topbar {
        column-gap: 12px;
        padding: 11px 13px;
    }

    .admin-topbar-panels {
        gap: 10px;
    }

    .admin-topbar .admin-menu {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .admin-topbar .admin-menu a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 13px;
    }

    .admin-topbar .toolbar-actions {
        gap: 8px;
    }

    .admin-topbar .language-switch a {
        padding: 7px 10px;
    }

    .admin-topbar .button-secondary {
        padding: 10px 13px;
    }

    .admin-banner {
        padding: 15px 16px;
    }

    .admin-banner .page-title {
        font-size: clamp(1.45rem, 3.4vw, 1.9rem);
    }

    .admin-banner .muted {
        font-size: 13px;
    }
}

@media (max-width: 920px) {
    .admin-topbar {
        grid-template-columns: minmax(0, 1fr);
        padding: 10px 12px;
    }

    .admin-topbar-head {
        width: 100%;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        flex-direction: column;
    }

    .admin-topbar-panels {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        margin: 0;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        gap: 10px;
    }

    .js-ready .admin-topbar .admin-topbar-panels {
        display: none;
    }

    .js-ready .admin-topbar.is-open .admin-topbar-panels {
        display: grid;
    }

    .admin-topbar .admin-menu,
    .admin-topbar .toolbar-actions {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .admin-topbar .toolbar-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .admin-topbar .language-switch,
    .admin-topbar .button-secondary {
        width: 100%;
    }

    .admin-topbar .button-secondary {
        justify-content: center;
    }

    .brand span {
        display: none;
    }
}

@media (max-width: 640px) {
    .topbar,
    .admin-topbar {
        padding: 9px 10px;
        border-radius: 14px;
    }

    .admin-topbar .brand {
        gap: 10px;
    }

    .admin-topbar .brand img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .admin-topbar .brand strong {
        font-size: 13px;
        line-height: 1.18;
    }

    .mobile-nav-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .admin-topbar .admin-menu a,
    .admin-topbar .language-switch a {
        padding: 8px 10px;
        font-size: 12px;
    }

    .admin-topbar .button-secondary {
        padding: 9px 12px;
        font-size: 13px;
    }

    .admin-banner {
        padding: 13px;
        gap: 10px;
    }

    .admin-banner .page-title {
        font-size: clamp(1.25rem, 5.8vw, 1.55rem);
        line-height: 1.08;
    }

    .admin-banner .muted {
        font-size: 12px;
        line-height: 1.4;
    }

    .admin-banner-meta .pill {
        padding: 6px 9px;
        font-size: 11px;
    }
}
