:root {
    --ink: #17202a;
    --muted: #667085;
    --line: #d9e0e7;
    --paper: #ffffff;
    --bg: #f4f7f6;
    --accent: #0d766e;
    --accent-dark: #085e59;
    --warn: #b45309;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    color: var(--ink);
    display: flex;
    gap: 12px;
}

.brand span {
    align-items: center;
    background: var(--accent);
    border-radius: 7px;
    color: white;
    display: inline-flex;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.brand-logo {
    border-radius: 7px;
    height: 38px;
    object-fit: contain;
    width: 38px;
    background: #fff;
    border: 1px solid var(--line);
}

.topbar nav {
    align-items: center;
    display: flex;
    gap: 14px;
}

.nav-toggle {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    height: 44px;
    justify-content: center;
    min-height: 44px;
    padding: 0;
    width: 46px;
}

.nav-toggle span {
    background: var(--ink);
    border-radius: 2px;
    display: block;
    height: 2px;
    transition: transform 0.2s, opacity 0.2s;
    width: 22px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 30px 22px 56px;
}

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

.page-title p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 6px;
}

.back-link {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 5px;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--accent-dark);
}

.page-title h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
    margin: 0;
}

.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 22px;
}

.panel h2 {
    font-size: 18px;
    margin: 0 0 18px;
}

.help-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    margin: -6px 0 16px;
}

.panel-heading,
.actions,
.form-actions,
.row-actions,
.search {
    align-items: center;
    display: flex;
    gap: 10px;
}

.panel-heading {
    justify-content: space-between;
}

.button,
button {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 10px 14px;
}

.button.primary,
button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.button.danger {
    border-color: #f1b7b7;
    color: #b42318;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    min-height: 0;
    padding: 0;
}

.link-button.danger-text {
    color: #b42318;
}

.button:hover,
button:hover {
    border-color: var(--accent);
}

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

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

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
}

input,
select,
textarea {
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

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

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
    height: 18px;
    min-height: 0;
    width: 18px;
}

.items-table {
    display: grid;
    gap: 10px;
}

.item-row {
    align-items: end;
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 12px 14px;
    grid-template-columns: 2fr 1fr 1fr 0.7fr 0.9fr 1.6fr;
    padding: 16px;
}

.item-row-head {
    align-items: center;
    border-bottom: 1px dashed var(--line);
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-bottom: 2px;
    padding-bottom: 10px;
}

.item-row-title {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.item-row .cell {
    font-size: 12px;
    gap: 6px;
}

.sup-row {
    align-items: end;
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 12px 14px;
    grid-template-columns: 2fr 1fr 1fr 0.7fr 0.9fr;
    padding: 16px;
}

.sup-row .cell {
    font-size: 12px;
    gap: 6px;
}

.icon-button {
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0;
}

.file-field {
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
    padding: 10px 12px;
    transition: border-color 0.15s, background 0.15s;
}

.file-field.dragover {
    background: #eef6f5;
    border-color: var(--accent);
    border-style: solid;
}

.file-field input[type="file"] {
    font-size: 12px;
    min-height: 42px;
    padding: 8px;
}

.file-field .file-hint {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.file-field.dragover .file-hint {
    color: var(--accent-dark);
}

.file-field .file-name {
    color: var(--ink);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-field .file-thumb {
    border: 1px solid var(--line);
    border-radius: 6px;
    display: block;
    max-height: 90px;
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.design-thumb {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    max-height: 130px;
    max-width: 100%;
    object-fit: contain;
    padding: 4px;
    width: auto;
}

table .design-thumb {
    max-height: 70px;
}

.details .design-thumb {
    margin-top: 4px;
}

.muted-text {
    color: var(--muted);
}

.dashboard {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric span,
.details span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.metric strong {
    font-size: 26px;
}

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

.summary-list {
    display: grid;
    gap: 0;
}

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

.summary-row span {
    color: var(--muted);
    font-weight: 700;
}

.summary-row strong {
    font-size: 16px;
}

.summary-row.total {
    border-bottom-width: 2px;
}

.summary-row.total strong {
    font-size: 19px;
}

.summary-row.balance {
    border-bottom: 0;
}

.summary-row.balance span {
    color: var(--ink);
    font-weight: 800;
}

.summary-row.balance strong {
    color: var(--accent-dark);
    font-size: 22px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.status {
    background: #e6f5f2;
    border-radius: 999px;
    color: var(--accent-dark);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.status.danger {
    background: #fde8e8;
    color: #b42318;
}

.status.warn {
    background: #fef3e2;
    color: #b45309;
}

select.status-danger {
    border-color: #f1b7b7;
    color: #b42318;
    font-weight: 800;
}

select.status-warn {
    border-color: #f3d6a8;
    color: #b45309;
    font-weight: 800;
}

.row-blacklist td {
    background: #fff5f5;
}

.row-blacklist td:first-child {
    border-left: 4px solid #b42318;
}

.search input {
    min-width: min(420px, 52vw);
}

.search {
    flex-wrap: wrap;
}

.search input {
    flex: 1 1 240px;
}

.sort-field {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
}

.sort-field select {
    min-height: 40px;
    width: auto;
}

.empty {
    padding: 44px 12px;
    text-align: center;
}

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

.hero {
    align-items: center;
    background: linear-gradient(135deg, #0d766e 0%, #0e2a30 100%);
    border-radius: 18px;
    color: #fff;
    display: flex;
    gap: 22px;
    margin-bottom: 24px;
    overflow: hidden;
    padding: 32px 34px;
    position: relative;
}

.hero::after {
    background: radial-gradient(circle at top right, rgba(43, 182, 166, 0.35), transparent 60%);
    content: "";
    inset: 0;
    position: absolute;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero-logo {
    align-items: center;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    display: flex;
    flex: 0 0 auto;
    height: 86px;
    justify-content: center;
    overflow: hidden;
    width: 86px;
}

.hero-logo img {
    background: #fff;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.hero-logo span {
    color: #fff;
    font-size: 36px;
    font-weight: 800;
}

.hero-kicker {
    color: #bfe6e1;
    font-size: 13px;
    letter-spacing: 1.5px;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(26px, 5vw, 40px);
    line-height: 1.06;
    margin: 0;
}

.hero-sub {
    color: #cfeae6;
    margin: 8px 0 0;
}

.mode-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    display: block;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.mode-card::before {
    background: linear-gradient(90deg, #0d766e, #2bb6a6);
    content: "";
    display: block;
    height: 6px;
}

.mode-card.tmode::before {
    background: linear-gradient(90deg, #17202a, #0d766e);
}

.mode-card:hover {
    border-color: var(--accent);
    box-shadow: 0 18px 36px rgba(13, 118, 110, 0.16);
    transform: translateY(-4px);
}

.mode-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 26px 26px;
}

.mode-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mode-icon {
    align-items: center;
    background: #eef6f5;
    border-radius: 14px;
    color: var(--accent);
    display: flex;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.mode-card.tmode .mode-icon {
    background: #eef1f4;
    color: var(--ink);
}

.mode-icon svg {
    height: 28px;
    width: 28px;
}

.mode-icon img {
    background: #fff;
    border-radius: 12px;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.mode-initials {
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
}

.filter-chip {
    align-items: center;
    background: #eef6f5;
    border-radius: 999px;
    color: var(--accent-dark);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
}

.profit-pos {
    color: var(--accent-dark);
}

.profit-neg {
    color: #b42318;
}

.title-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.title-actions .filter-chip {
    margin-top: 0;
}

.mode-badge {
    background: #eef6f5;
    border-radius: 999px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
}

.mode-card.tmode .mode-badge {
    background: #eef1f4;
    color: var(--ink);
}

.mode-body h2 {
    font-size: 24px;
    margin: 6px 0 0;
}

.mode-body p {
    color: var(--muted);
    margin: 0;
}

.mode-go {
    color: var(--accent-dark);
    font-weight: 800;
    margin-top: 12px;
}

.mode-card.tmode .mode-go {
    color: var(--ink);
}

.empty p {
    color: var(--muted);
    margin: 8px auto 20px;
    max-width: 560px;
}

.form-actions {
    justify-content: flex-end;
}

.stock-form {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

.stock-form .button {
    grid-column: 1 / -1;
    justify-content: center;
}

.stock-preview {
    align-items: center;
    background: #eef6f5;
    border: 1px solid #b7e0d8;
    border-radius: 8px;
    color: var(--accent-dark);
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    margin: 14px 0 0;
    min-height: 44px;
    padding: 10px 14px;
}

.stock-preview::before {
    content: "\2713";
    font-weight: 800;
}

.stock-preview.is-empty {
    background: #f5f9f8;
    border-color: var(--line);
    color: var(--muted);
    font-weight: 600;
}

.stock-adjust {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stock-adjust .adjust-qty {
    min-height: 38px;
    width: 72px;
}

.stock-adjust .button {
    min-height: 38px;
    padding: 7px 12px;
}

.stock-edit {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stock-edit .mini-field {
    flex: 0 0 auto;
    font-size: 11px;
    gap: 4px;
}

.stock-edit .mini-field input {
    min-height: 38px;
    width: 72px;
}

.stock-edit .button {
    min-height: 38px;
    padding: 7px 14px;
}

.stock-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stock-setup {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stock-setup .panel {
    margin-bottom: 0;
}

.stat-card {
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    background: var(--accent);
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 5px;
}

.stat-card .stat-icon {
    align-items: center;
    background: #eef6f5;
    border-radius: 12px;
    color: var(--accent);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    margin-bottom: 10px;
    width: 40px;
}

.stat-card .stat-icon svg {
    height: 22px;
    width: 22px;
}

.stat-lines::before {
    background: #2563eb;
}

.stat-lines .stat-icon {
    background: #e8effd;
    color: #2563eb;
}

.stat-ok::before {
    background: #16a34a;
}

.stat-ok .stat-icon {
    background: #e7f6ed;
    color: #16a34a;
}

.stat-alert {
    background: #fff7ed;
}

.stat-alert::before {
    background: var(--warn);
}

.stat-alert .stat-icon {
    background: #fdecd6;
    color: var(--warn);
}

.stat-alert strong {
    color: var(--warn);
}

.orders-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-money strong {
    font-size: 20px;
}

.stat-profit::before {
    background: #0d766e;
}

.stat-profit .stat-icon {
    background: #e6f5f2;
    color: #0d766e;
}

.stat-profit strong {
    color: var(--accent-dark);
}

.stat-income::before {
    background: #16a34a;
}

.stat-income .stat-icon {
    background: #e7f6ed;
    color: #16a34a;
}

.stat-delivery::before {
    background: #7c3aed;
}

.stat-delivery .stat-icon {
    background: #f1eafe;
    color: #7c3aed;
}

.color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 5px;
    display: inline-block;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    width: 16px;
}

.stat-breakdown span em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    margin-left: 4px;
}

.size-overview {
    display: grid;
    gap: 14px;
}

.size-row {
    background: linear-gradient(180deg, #ffffff, #f7faf9);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.size-row:hover {
    box-shadow: 0 10px 24px rgba(13, 118, 110, 0.1);
    transform: translateY(-2px);
}

.size-row-head {
    align-items: center;
    border-bottom: 1px dashed var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.size-row-left {
    align-items: center;
    display: flex;
    gap: 10px;
}

.size-badge {
    background: linear-gradient(135deg, #17202a, #0d766e);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    min-width: 46px;
    padding: 6px 12px;
    text-align: center;
}

.size-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.size-total {
    background: #eef6f5;
    border-radius: 999px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
}

.size-total strong {
    font-size: 16px;
}

.color-tiles {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
}

.color-tile {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.color-tile .color-box {
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    font-size: 16px;
    font-weight: 800;
    height: 48px;
    justify-content: center;
    transition: transform 0.12s;
    width: 100%;
}

.color-tile:hover .color-box {
    transform: scale(1.06);
}

.color-tile.is-low .color-box {
    box-shadow: 0 0 0 3px var(--warn);
}

.color-tile .color-name {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.color-tile.is-low .color-name {
    color: var(--warn);
}

.stock-csv-form {
    display: grid;
    gap: 14px;
}

.csv-paste-label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
}

.csv-input {
    background: #0e2a30;
    border: 1px solid #0d766e;
    border-radius: 8px;
    color: #eafaf7;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    min-height: 150px;
    padding: 12px 14px;
    white-space: pre;
    width: 100%;
}

.csv-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
}

.csv-file-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.inline-status-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) auto;
}

.inline-status-form input,
.inline-status-form select {
    min-height: 38px;
}

.low-stock td {
    background: #fff7ed;
}

.low-stock td:first-child {
    border-left: 4px solid var(--warn);
}

.notice {
    background: #e6f5f2;
    border-color: #b7e0d8;
    color: var(--accent-dark);
    font-weight: 700;
}

.logo-row {
    align-items: center;
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.logo-preview {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex: 0 0 auto;
    height: 96px;
    justify-content: center;
    overflow: hidden;
    width: 96px;
}

.logo-preview img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.logo-preview span {
    color: var(--accent);
    font-size: 30px;
    font-weight: 800;
}

.logo-fields {
    flex: 1 1 auto;
}

.inline-check {
    align-items: center;
    color: var(--ink);
    display: flex;
    flex-direction: row;
    font-weight: 600;
    gap: 8px;
}

.inline-check input {
    height: auto;
    min-height: 0;
    width: auto;
}

@media (max-width: 1024px) and (min-width: 821px) {
    .item-row,
    .sup-row {
        grid-template-columns: 1fr 1fr 1fr;
    }

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

    .item-row .cell-wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .page-title.split {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .detail-actions .button,
    .detail-actions form {
        flex: 1 1 40%;
    }

    .detail-actions .button {
        justify-content: center;
    }

    .detail-actions form .button,
    .detail-actions form button {
        width: 100%;
    }

    .topbar {
        flex-wrap: wrap;
        min-height: 60px;
        padding: 10px 18px;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .topbar nav {
        display: none;
        flex-direction: column;
        gap: 2px;
        margin-top: 8px;
        width: 100%;
    }

    .topbar nav.open {
        display: flex;
    }

    .topbar nav a {
        align-items: center;
        border-radius: 8px;
        display: flex;
        min-height: 48px;
        padding: 6px 12px;
        width: 100%;
    }

    .topbar nav a:not(.button):hover {
        background: #eef6f5;
    }

    .topbar nav a.button.primary {
        justify-content: center;
        margin-top: 6px;
    }

    .grid.two,
    .dashboard,
    .details,
    .stock-form,
    .note-grid,
    .landing,
    .stock-setup {
        grid-template-columns: 1fr;
    }

    .item-row {
        grid-template-columns: 1fr;
    }

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-heading .actions {
        width: 100%;
    }

    .panel-heading .actions .button {
        flex: 1;
        justify-content: center;
    }

    .form-actions {
        background: var(--bg);
        bottom: 0;
        margin: 0 -22px -56px;
        padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
        position: sticky;
        z-index: 5;
    }

    .form-actions .button {
        flex: 1;
        justify-content: center;
    }

    .sup-row {
        grid-template-columns: 1fr;
    }

    .sup-row.labels {
        display: none;
    }

    .search {
        align-items: stretch;
        width: 100%;
    }

    .search input {
        min-width: 0;
    }

    .sort-field {
        flex: 1 1 100%;
    }

    .sort-field select {
        flex: 1;
        width: 100%;
    }

    .search .button {
        flex: 1 1 100%;
        justify-content: center;
    }

    .hero {
        flex-direction: column;
        gap: 16px;
        padding: 26px 22px;
        text-align: center;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    table.cards {
        display: block;
        overflow: visible;
    }

    table.cards thead {
        display: none;
    }

    table.cards tbody {
        display: block;
    }

    table.cards tr {
        background: #fbfcfd;
        border: 1px solid var(--line);
        border-radius: 12px;
        display: block;
        margin-bottom: 12px;
        padding: 6px 14px;
    }

    table.cards td {
        align-items: center;
        border: 0;
        border-bottom: 1px solid var(--line);
        display: flex;
        gap: 14px;
        justify-content: space-between;
        padding: 11px 0;
        text-align: right;
        word-break: break-word;
    }

    table.cards td::before {
        color: var(--muted);
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 12px;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    table.cards td.row-actions {
        border-bottom: 0;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
        padding-top: 12px;
    }

    table.cards td.row-actions::before {
        display: block;
        flex-basis: 100%;
        margin-bottom: 2px;
    }

    table.cards td.row-actions a,
    table.cards td.row-actions form,
    table.cards td.row-actions .link-button {
        flex: 1;
        min-width: 84px;
    }

    table.cards td.row-actions a,
    table.cards td.row-actions .link-button {
        align-items: center;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 8px;
        display: inline-flex;
        justify-content: center;
        min-height: 42px;
        padding: 9px 12px;
        text-align: center;
        width: 100%;
    }

    table.cards td.row-actions form {
        display: flex;
    }

    table.cards td.cell-form {
        align-items: stretch;
        flex-direction: column;
        text-align: left;
    }

    table.cards td.cell-form::before {
        margin-bottom: 6px;
    }

    .inline-status-form {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .stock-adjust {
        width: 100%;
    }

    .stock-adjust .adjust-qty {
        flex: 1 1 100%;
        width: 100%;
    }

    .stock-adjust .button {
        flex: 1;
        justify-content: center;
    }

    .stock-edit {
        width: 100%;
    }

    .stock-edit .button {
        flex: 1;
        justify-content: center;
    }

    .stock-csv-form {
        width: 100%;
    }

    .stock-csv-form label,
    .stock-csv-form .button {
        flex: 1 1 100%;
        justify-content: center;
    }
}
