:root {
    --bg: #f4efe7;
    --bg-strong: #e8ddcf;
    --panel: rgba(255, 251, 246, 0.88);
    --panel-strong: #fffdf9;
    --ink: #1b1f1d;
    --muted: #647067;
    --teal: #448bff;
    --teal-deep: #2f6fe0;
    --sand: #d8b98e;
    --line: rgba(27, 31, 29, 0.08);
    --shadow: 0 18px 50px rgba(20, 24, 22, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

:root[data-theme='dark'] {
    --bg: #0f141b;
    --bg-strong: #17212d;
    --panel: rgba(18, 26, 36, 0.88);
    --panel-strong: #17212d;
    --ink: #edf3f9;
    --muted: #9aabbe;
    --line: rgba(158, 171, 190, 0.16);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(216, 185, 142, 0.35), transparent 28%),
        radial-gradient(circle at right 10%, rgba(68, 139, 255, 0.16), transparent 22%),
        linear-gradient(145deg, #f7f2eb 0%, #efe6da 42%, #f3eee8 100%);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
}

:root[data-theme='dark'] body {
    background:
        radial-gradient(circle at top left, rgba(68, 139, 255, 0.16), transparent 26%),
        radial-gradient(circle at right 8%, rgba(216, 185, 142, 0.1), transparent 20%),
        linear-gradient(145deg, #0c1117 0%, #121a23 40%, #18222d 100%);
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

p {
    margin: 0;
    color: var(--muted);
}

button,
input,
select,
textarea {
    font: inherit;
}

.btn-teal {
    color: #fff;
    background: linear-gradient(135deg, var(--teal), #76aaff);
    border: 0;
    box-shadow: 0 10px 24px rgba(68, 139, 255, 0.28);
}

.btn-teal:hover,
.btn-teal:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--teal-deep), var(--teal));
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    color: var(--teal-deep);
}

.app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
    gap: 1.5rem;
    padding: 1.5rem;
}

.app-shell > * {
    min-width: 0;
}

.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}

.mobile-brand-copy {
    min-width: 0;
}

.mobile-brand small {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.1;
}

.mobile-brand strong,
.mobile-brand small {
    overflow-wrap: anywhere;
}

.mobile-brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
}

.mobile-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #1f2732;
    padding: 0 11px;
    flex: 0 0 auto;
}

.mobile-nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.mobile-offcanvas {
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(244, 239, 231, 0.98));
}

:root[data-theme='dark'] .mobile-offcanvas {
    background: linear-gradient(180deg, rgba(16, 23, 31, 0.98), rgba(12, 18, 25, 0.98));
}

:root[data-theme='dark'] .mobile-offcanvas .offcanvas-title,
:root[data-theme='dark'] .mobile-offcanvas .brand-kicker,
:root[data-theme='dark'] .mobile-offcanvas .user-chip,
:root[data-theme='dark'] .mobile-offcanvas .user-chip strong,
:root[data-theme='dark'] .mobile-offcanvas .user-chip small {
    color: #edf3f9;
}

.mobile-offcanvas .offcanvas-title,
.mobile-offcanvas .brand-kicker,
.mobile-offcanvas .user-chip,
.mobile-offcanvas .user-chip strong,
.mobile-offcanvas .user-chip small {
    color: var(--ink);
}

.mobile-offcanvas .nav-link-panel {
    color: rgba(27, 31, 29, 0.86);
    background: rgba(68, 139, 255, 0.06);
    appearance: none;
}

.mobile-offcanvas .nav-link-panel span {
    color: var(--muted);
}

.mobile-offcanvas .nav-link-panel:hover {
    transform: none;
    background: rgba(68, 139, 255, 0.1);
}

.mobile-offcanvas .nav-link-panel.is-active {
    background: linear-gradient(135deg, rgba(68, 139, 255, 0.16), rgba(216, 185, 142, 0.22));
    color: var(--ink);
}

:root[data-theme='dark'] .mobile-offcanvas .nav-link-panel {
    background: rgba(68, 139, 255, 0.12);
    color: #edf3f9;
    border-color: rgba(158, 171, 190, 0.14);
}

:root[data-theme='dark'] .mobile-offcanvas .nav-link-panel:hover {
    background: rgba(68, 139, 255, 0.18);
}

:root[data-theme='dark'] .mobile-offcanvas .nav-link-panel span {
    color: #a9bfd6;
}

:root[data-theme='dark'] .mobile-offcanvas .nav-link-panel.is-active {
    background: linear-gradient(135deg, rgba(68, 139, 255, 0.3), rgba(216, 185, 142, 0.2));
    color: #ffffff;
}

:root[data-theme='dark'] .mobile-offcanvas .nav-link-panel.is-active span {
    color: #d8e6f6;
}

:root[data-theme='dark'] .mobile-user-chip {
    background: rgba(68, 139, 255, 0.14);
}

:root[data-theme='dark'] .brand-kicker {
    background: rgba(255, 255, 255, 0.08);
    color: #d8e6f6;
}

.mobile-user-chip {
    background: rgba(68, 139, 255, 0.08);
}

.mobile-user-chip small {
    color: var(--muted);
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(47, 111, 224, 0.98), rgba(38, 90, 186, 0.94));
    color: #eef8f6;
    box-shadow: var(--shadow);
}

.brand-kicker {
    display: inline-flex;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-block {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.15rem;
    font-weight: 800;
}

.brand-block h1 {
    font-size: 1.5rem;
    line-height: 1.1;
}

.brand-block p {
    margin-top: 0.35rem;
    color: rgba(238, 248, 246, 0.7);
}

.nav-stack {
    display: grid;
    gap: 0.75rem;
}

.nav-link-panel {
    display: grid;
    gap: 0.18rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    color: rgba(238, 248, 246, 0.82);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-link-panel span {
    font-size: 0.84rem;
    color: rgba(238, 248, 246, 0.62);
}

.nav-link-panel:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.09);
}

.nav-link-panel.is-active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(216, 185, 142, 0.24));
    color: #fff;
}

.sidebar-foot {
    padding-top: 1.25rem;
}

.sidebar-controls {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sidebar-controls .theme-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #eef8f6;
}

.sidebar-controls .theme-select option {
    color: #1b1f1d;
}

.sidebar-controls .btn-dark {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1b1f1d;
}

.sidebar-controls .btn-dark:hover,
.sidebar-controls .btn-dark:focus {
    background: #ffffff;
    border-color: #ffffff;
    color: #1b1f1d;
}

.user-chip {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.user-chip span {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 800;
}

.user-chip small {
    color: rgba(238, 248, 246, 0.68);
}

.main-panel {
    padding: 0.35rem 0.35rem 0.35rem 0;
    min-width: 0;
}

.topbar-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    min-width: 0;
}

.topbar-panel > div,
.topbar-actions,
.panel-head > div,
.order-card-head > div {
    min-width: 0;
}

.topbar-panel h2 {
    font-size: clamp(1.8rem, 2vw, 2.3rem);
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.status-pill {
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

:root[data-theme='dark'] .status-pill {
    background: rgba(16, 23, 31, 0.82);
    border-color: rgba(158, 171, 190, 0.2);
    color: var(--ink);
}

.view-grid,
.content-grid,
.stats-grid {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.content-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-grid {
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-card,
.panel-card,
.metric-card,
.loading-card,
.empty-card {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    min-width: 0;
    max-width: 100%;
}

:root[data-theme='dark'] .hero-card,
:root[data-theme='dark'] .panel-card,
:root[data-theme='dark'] .metric-card,
:root[data-theme='dark'] .loading-card,
:root[data-theme='dark'] .empty-card {
    border-color: rgba(158, 171, 190, 0.12);
}

.hero-card {
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 1.8rem;
}

.hero-card h3 {
    max-width: 14ch;
    font-size: clamp(2.1rem, 3vw, 3.1rem);
    line-height: 0.95;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

.hero-card p {
    margin-top: 0.7rem;
    max-width: 56ch;
}

.hero-orb {
    width: 220px;
    min-width: 220px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 251, 246, 0.92), transparent 25%),
        linear-gradient(140deg, rgba(216, 185, 142, 0.75), rgba(68, 139, 255, 0.78));
    filter: blur(0.2px);
}

.panel-card,
.loading-card,
.empty-card {
    padding: 1.4rem;
}

.metric-card {
    padding: 1.2rem 1.25rem;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-card strong {
    display: block;
    margin-top: 0.55rem;
    font-size: clamp(1.55rem, 2vw, 2.2rem);
}

.panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h4 {
    font-size: 1.12rem;
}

.panel-head small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.stack-form,
.stack-list,
.metric-stack,
.insight-list,
.bar-chart {
    display: grid;
    gap: 1rem;
}

.form-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-control,
.form-select,
.readonly-field {
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

:root[data-theme='dark'] .form-control,
:root[data-theme='dark'] .form-select,
:root[data-theme='dark'] .readonly-field {
    background: rgba(13, 20, 28, 0.9);
    color: var(--ink);
    border-color: rgba(158, 171, 190, 0.18);
}

:root[data-theme='dark'] .form-control::placeholder,
:root[data-theme='dark'] textarea::placeholder {
    color: #7f91a6;
}

.readonly-field {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(68, 139, 255, 0.42);
    box-shadow: 0 0 0 0.2rem rgba(68, 139, 255, 0.08);
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.permission-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(27, 31, 29, 0.08);
}

:root[data-theme='dark'] .permission-chip,
:root[data-theme='dark'] .list-card,
:root[data-theme='dark'] .order-card,
:root[data-theme='dark'] .production-summary-item,
:root[data-theme='dark'] .metric-stack > div,
:root[data-theme='dark'] .feature-grid article {
    background: rgba(17, 24, 33, 0.76);
    border-color: rgba(158, 171, 190, 0.12);
}

.list-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(27, 31, 29, 0.06);
}

.list-card p {
    margin-top: 0.2rem;
}

.list-card.is-muted {
    opacity: 0.68;
}

.app-modal {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: rgba(255, 251, 246, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

:root[data-theme='dark'] .app-modal {
    border-color: rgba(158, 171, 190, 0.14);
    background: rgba(13, 20, 28, 0.96);
}

.app-modal .modal-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

.notice-band {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border-radius: 18px;
    background: rgba(68, 139, 255, 0.08);
    color: var(--teal-deep);
    max-width: 100%;
}

:root[data-theme='dark'] .notice-band {
    background: rgba(68, 139, 255, 0.16);
    color: #c4d8ff;
}

:root[data-theme='dark'] .notice-band.is-blocked {
    background: rgba(220, 53, 69, 0.16);
    color: #ffc0c7;
}

.notice-band.is-blocked {
    background: rgba(153, 27, 27, 0.08);
    color: #991b1b;
}

#orderFormNotice {
    margin-bottom: 0;
}

.order-card {
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(27, 31, 29, 0.06);
    background: rgba(255, 255, 255, 0.68);
    min-width: 0;
}

.order-card + .order-card {
    margin-top: 0.9rem;
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.order-card-head span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.order-note {
    margin-bottom: 0.8rem;
}

.production-controls {
    display: grid;
    grid-template-columns: minmax(88px, 112px);
    gap: 0.35rem;
}

.production-day-bar {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.production-day-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dispatch-requester-bar {
    display: flex;
    gap: 1rem;
    align-items: end;
    justify-content: space-between;
}

.dispatch-requester-select {
    width: min(100%, 420px);
}

.dispatch-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.dispatch-orders-bar {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.dispatch-orders-bar > span {
    color: var(--muted);
    font-size: 0.92rem;
}

.dispatch-order-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.dispatch-row-invalid {
    background: rgba(220, 53, 69, 0.08);
}

.dispatch-row-invalid td {
    box-shadow: inset 0 -1px 0 rgba(220, 53, 69, 0.1);
}

.dispatch-qty-complete {
    border-color: rgba(25, 135, 84, 0.45);
    background: rgba(25, 135, 84, 0.08);
}

.dispatch-qty-partial {
    border-color: rgba(220, 53, 69, 0.45);
    background: rgba(220, 53, 69, 0.08);
}

.status-pill.is-started {
    background: rgba(68, 139, 255, 0.12);
    border-color: rgba(68, 139, 255, 0.18);
    color: var(--teal-deep);
}

.status-pill.is-success {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.24);
    color: #146c43;
}

.status-pill.is-danger {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.24);
    color: #b02a37;
}

.production-date-input {
    max-width: 220px;
}

.production-form {
    margin: 0;
}

.production-qty-input {
    min-height: 40px;
    max-width: 112px;
    padding-inline: 0.7rem;
}

.production-status-select {
    min-height: 40px;
    min-width: 150px;
    max-width: 170px;
}

.production-comment-input {
    min-height: 74px;
    min-width: 240px;
}

.production-summary-table td,
.production-summary-table th {
    vertical-align: middle;
}

.production-summary-list {
    display: grid;
    gap: 0.85rem;
}

.production-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(27, 31, 29, 0.06);
}

.production-summary-item span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 0.7rem 0.9rem;
    border-radius: 999px;
    background: rgba(68, 139, 255, 0.1);
    color: var(--teal-deep);
    font-weight: 700;
    text-align: center;
}

:root[data-theme='dark'] .summary-pill {
    background: rgba(68, 139, 255, 0.18);
    color: #c6d8ff;
}

.production-bulk-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.production-bulk-bar .form-select {
    min-width: 220px;
}

.metric-stack > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    min-width: 0;
}

.metric-stack.compact > div {
    padding: 0.85rem 0.95rem;
}

.metric-stack span,
.insight-list li {
    color: var(--muted);
}

.metric-stack span,
.metric-stack strong {
    overflow-wrap: anywhere;
}

.insight-list {
    margin: 0;
    padding-left: 1rem;
}

.bar-row {
    display: grid;
    gap: 0.5rem;
}

.bar-copy {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.bar-copy span {
    color: var(--muted);
}

.bar-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(68, 139, 255, 0.1);
}

.bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sand), var(--teal));
}

.modern-table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.5);
    --bs-table-border-color: rgba(27, 31, 29, 0.06);
    margin-bottom: 0;
}

:root[data-theme='dark'] .modern-table {
    --bs-table-color: var(--ink);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-border-color: rgba(158, 171, 190, 0.12);
}

.compact-table th,
.compact-table td {
    font-size: 0.92rem;
}

.order-history-table-wrap {
    max-width: 100%;
    overflow: hidden;
}

.order-history-table-wrap .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.order-history-table {
    min-width: 520px;
    table-layout: auto;
}

.dashboard-recent-table-wrap {
    max-width: 100%;
    overflow: hidden;
}

.dashboard-recent-table-wrap .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.dashboard-recent-table {
    min-width: 520px;
    table-layout: auto;
}

.loading-card,
.empty-card {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--muted);
}

.tone-soft {
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(250, 243, 231, 0.9));
}

:root[data-theme='dark'] .tone-soft {
    background: linear-gradient(180deg, rgba(18, 26, 36, 0.96), rgba(14, 21, 29, 0.92));
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
    gap: 1.25rem;
    width: min(1180px, 100%);
}

.login-card-single {
    grid-template-columns: minmax(320px, 420px);
    justify-content: center;
    width: min(420px, 100%);
}

.login-copy {
    padding: 3rem;
    border-radius: 36px;
    background:
        radial-gradient(circle at top left, rgba(216, 185, 142, 0.48), transparent 25%),
        linear-gradient(160deg, rgba(255, 253, 249, 0.96), rgba(241, 232, 220, 0.86));
    border: 1px solid rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
}

:root[data-theme='dark'] .login-copy {
    background:
        radial-gradient(circle at top left, rgba(68, 139, 255, 0.22), transparent 24%),
        linear-gradient(160deg, rgba(19, 27, 36, 0.98), rgba(15, 22, 30, 0.94));
    border-color: rgba(158, 171, 190, 0.14);
}

:root[data-theme='dark'] .btn-dark {
    background: #eaf2fb;
    border-color: #eaf2fb;
    color: #0f141b;
}

:root[data-theme='dark'] .btn-dark:hover,
:root[data-theme='dark'] .btn-dark:focus {
    background: #ffffff;
    border-color: #ffffff;
    color: #0f141b;
}

:root[data-theme='dark'] .btn-outline-dark {
    color: #d8e6f6;
    border-color: rgba(216, 230, 246, 0.34);
}

:root[data-theme='dark'] .btn-outline-dark:hover,
:root[data-theme='dark'] .btn-outline-dark:focus {
    background: #d8e6f6;
    border-color: #d8e6f6;
    color: #0f141b;
}

:root[data-theme='dark'] .btn-close {
    filter: invert(1) grayscale(1);
}

.theme-select {
    min-width: 154px;
}

.login-copy h1 {
    max-width: 12ch;
    margin-top: 0.6rem;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 0.92;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

.login-copy p {
    max-width: 56ch;
    margin-top: 1rem;
    font-size: 1.02rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature-grid article {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.feature-grid span {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 1rem;
    align-content: center;
}

.login-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-align: center;
    font-size: 0.9rem;
}

.login-hint-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: var(--teal-deep);
}

.login-hint-icon svg {
    width: 100%;
    height: 100%;
}

.product-switch {
    display: flex;
    align-items: center;
    padding-top: 2rem;
}

@media (max-width: 1200px) {
    .app-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-grid,
    .login-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
        width: 100%;
    }

    .mobile-topbar {
        display: flex;
    }

    .topbar-panel {
        display: none;
    }

    .sidebar-panel {
        display: none;
        gap: 1rem;
    }

    .content-grid.two-up,
    .form-split,
    .compact-grid,
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .order-card-head,
    .bar-copy {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar-actions > * {
        max-width: 100%;
    }

    .mobile-topbar,
    .panel-card,
    .order-card,
    .notice-band,
    .metric-stack,
    .metric-stack > div {
        width: 100%;
        min-width: 0;
    }

    .status-pill {
        max-width: 100%;
        white-space: normal;
    }

    .main-panel {
        padding: 0;
    }

    .metric-stack > div {
        flex-direction: column;
        align-items: flex-start;
    }

    .production-controls {
        grid-template-columns: 1fr;
    }

    .production-summary-item,
    .production-bulk-bar,
    .production-day-bar,
    .dispatch-requester-bar,
    .dispatch-footer-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .production-day-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .production-comment-input,
    .summary-pill,
    .production-bulk-bar .form-select,
    .dispatch-requester-select,
    .production-date-input {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .modern-table {
        table-layout: fixed;
    }

    .order-history-table {
        min-width: 560px;
        table-layout: auto;
    }

    .dashboard-recent-table {
        min-width: 560px;
        table-layout: auto;
    }
}

@media (max-width: 640px) {
    .login-copy,
    .sidebar-panel,
    .panel-card,
    .hero-card {
        padding: 1.15rem;
    }

    .mobile-topbar {
        padding: 0.55rem 0.7rem;
        border-radius: 18px;
    }

    .mobile-brand strong {
        font-size: 0.96rem;
    }

    .mobile-brand small {
        font-size: 0.8rem;
    }

    .mobile-nav-toggle {
        width: 38px;
        height: 38px;
        padding: 0 10px;
        border-radius: 12px;
    }

    .hero-orb {
        display: none;
    }
}
