:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #172026;
    --muted: #68747d;
    --line: #dde4e9;
    --accent: #0f766e;
    --accent-dark: #134e4a;
    --sidebar: #111827;
    --sidebar-muted: #9ca3af;
    --danger: #b73d37;
    --success: #176d3b;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.09);
    --soft-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 32rem),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%);
    color: var(--ink);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select,
summary,
input[type="file"] {
    touch-action: manipulation;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 34px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 26px;
    font-weight: 700;
}

.login-logo {
    width: 96px;
    height: 96px;
    display: block;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 32px;
}

h2 {
    margin-bottom: 6px;
    font-size: 22px;
}

h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

h4 {
    margin: 18px 0 10px;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
}

.muted,
.section-heading p,
.hint {
    color: var(--muted);
}

.hint {
    margin: 18px 0 0;
    font-size: 13px;
}

.login-form,
.product-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #3d3a36;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
}

select {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 7px 9px;
}

input[type="file"] {
    padding: 9px;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 91, 0.16);
    outline: none;
}

button,
.logout {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
}

button:hover {
    background: var(--accent-dark);
}

form.is-loading button,
button.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.eyebrow {
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.2s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    padding: 22px 18px;
    background: var(--sidebar);
    color: #fff;
}

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

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand img {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-toggle {
    display: grid;
    width: 38px;
    min-height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.sidebar-collapsed .sidebar {
    align-items: center;
    padding-inline: 12px;
}

.sidebar-collapsed .sidebar-top {
    flex-direction: column;
}

.sidebar-collapsed .sidebar-brand span,
.sidebar-collapsed .side-nav a > span:not(.nav-icon),
.sidebar-collapsed .side-nav strong,
.sidebar-collapsed .logout {
    display: none;
}

.sidebar-collapsed .side-nav a {
    grid-template-columns: 34px;
    justify-content: center;
}

.sidebar-brand strong {
    font-size: 18px;
}

.sidebar-brand small {
    margin-top: 3px;
    color: var(--sidebar-muted);
    font-size: 12px;
    font-weight: 700;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-nav a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border-radius: 8px;
    color: #d1d5db;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.side-nav a.active {
    box-shadow: inset 3px 0 0 #2dd4bf;
}

.nav-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 900;
}

.side-nav strong {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-size: 12px;
}

.sidebar .logout {
    display: grid;
    place-items: center;
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar .logout:hover {
    background: rgba(255, 255, 255, 0.14);
}

.sidebar-backdrop {
    display: none;
}

.mobile-menu-toggle {
    display: none;
}

.dashboard {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px clamp(18px, 4vw, 46px) 46px;
}

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

.page-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title img {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-head h1 {
    margin: 0;
}

.alert {
    margin-bottom: 18px;
    border-radius: 6px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.error {
    background: #f9e7e5;
    color: #84221d;
}

.alert.success {
    background: #e3f2e9;
    color: var(--success);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.stats-grid article,
.report-grid article,
.product-form,
.inventory-panel,
.dashboard-panel,
.sales-panel,
.cart-panel,
.product-page {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
}

.stats-grid article {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.report-grid article {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    box-shadow: none;
}

.stats-grid span,
.report-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stats-grid strong,
.report-grid strong {
    font-size: 28px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 430px) 1fr;
    gap: 22px;
    align-items: start;
}

.product-form,
.inventory-panel,
.dashboard-panel,
.sales-panel,
.cart-panel,
.product-page {
    padding: 22px;
}

.product-page {
    max-width: 860px;
}

.dashboard-panel {
    display: grid;
    gap: 18px;
}

.product-page .product-form {
    border: 0;
    padding: 0;
}

.product-page .danger-zone {
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.backup-panel {
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.backup-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

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

.danger-zone .section-heading p {
    color: var(--danger);
}

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

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

.current-image {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

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

.current-image img {
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-link,
.small-link {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent-dark);
    font-weight: 700;
    padding: 7px 12px;
    text-decoration: none;
}

.secondary-link:hover,
.small-link:hover {
    background: #edf5f1;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px 150px 120px 140px auto auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.export-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.sub-heading {
    margin-top: 22px;
}

.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #d5e4df;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fcfb 0%, #eef8f5 100%);
    padding: 22px;
}

.dashboard-hero h2 {
    margin-bottom: 8px;
    font-size: 28px;
}

.dashboard-hero p:last-child {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

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

.kpi-grid article {
    display: grid;
    gap: 7px;
    min-height: 132px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.kpi-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.kpi-grid strong {
    font-size: 30px;
}

.kpi-grid small {
    align-self: end;
    color: var(--muted);
    font-weight: 700;
}

.kpi-grid .primary-kpi {
    border-color: #99d5cc;
    background: #effbf8;
}

.kpi-grid .profit-kpi {
    border-color: #badbcc;
    background: #f2fbf5;
}

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

.dashboard-grid section {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    padding: 16px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.panel-heading h3 {
    margin: 0;
}

.panel-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.simple-list {
    display: grid;
    gap: 10px;
}

.simple-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.simple-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.simple-list span {
    color: var(--muted);
    font-weight: 700;
}

.sizes-block {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.compact-size-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.numeric-size-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

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

.table-wrap {
    overflow-x: auto;
}

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

.sales-table {
    min-width: 900px;
}

.cart-table {
    min-width: 900px;
}

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

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

tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: #f8fbfa;
}

td > span,
td strong + span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.product-thumb {
    width: 72px;
    height: 72px;
    display: block;
    max-width: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    object-fit: cover;
    background: #f1eee9;
}

.no-image {
    display: inline-grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.size-pills span {
    border: 1px solid #cfd9d3;
    border-radius: 999px;
    background: #f7fbf8;
    color: #24483d;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.size-pills .low-stock {
    border-color: #e2b4b0;
    background: #f9e7e5;
    color: var(--danger);
}

.row-actions {
    display: grid;
    gap: 8px;
    min-width: 420px;
}

.product-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    padding: 9px 10px;
}

.product-details summary {
    cursor: pointer;
    color: var(--accent-dark);
    font-weight: 800;
}

.product-details dl {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 6px 10px;
    margin: 10px 0 0;
    font-size: 13px;
}

.product-details dt {
    color: var(--muted);
    font-weight: 800;
}

.product-details dd {
    margin: 0;
}

.cart-form {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) 58px 86px auto;
    gap: 6px;
    align-items: center;
}

.stock-adjust-form {
    display: grid;
    grid-template-columns: 110px 80px 64px minmax(96px, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.stock-adjust-form input,
.stock-adjust-form select {
    min-height: 36px;
    padding: 7px 8px;
}

.cart-form input {
    min-height: 36px;
    padding: 7px 8px;
}

.cart-edit-form {
    display: grid;
    grid-template-columns: 70px 92px auto;
    gap: 6px;
    align-items: center;
}

.cart-edit-form input {
    min-height: 36px;
    padding: 7px 8px;
}

.checkout-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 18px;
}

.clear-cart-form {
    margin-top: 10px;
}

.small-button,
.edit-button,
.danger {
    min-height: 36px;
    padding: 7px 10px;
}

.small-button {
    background: var(--accent);
}

.edit-button {
    width: 100%;
    background: #edf5f1;
    border: 1px solid #b9d0c8;
    color: var(--accent-dark);
}

.edit-button:hover {
    background: #dfeee8;
}

.danger {
    background: transparent;
    border: 1px solid #e2b4b0;
    color: var(--danger);
}

.danger:hover {
    background: #f9e7e5;
}

.out-of-stock {
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    display: grid;
    gap: 6px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

.receipt-body {
    background: #fff;
}

.receipt {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.receipt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.receipt-table {
    min-width: 0;
    margin-top: 18px;
}

@media print {
    .receipt-head button {
        display: none;
    }
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 236px minmax(0, 1fr);
    }

    .app-shell.sidebar-collapsed {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .sidebar {
        padding: 18px 14px;
    }

    .dashboard {
        padding-inline: 24px;
    }

    .filter-form {
        grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, 150px));
    }
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        display: flex;
        width: min(84vw, 320px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        flex-direction: column;
        gap: 14px;
        padding: 14px;
        box-shadow: 18px 0 40px rgba(15, 23, 42, 0.24);
        transform: translateX(0);
        transition: transform 0.2s ease;
    }

    .mobile-menu-toggle {
        position: fixed;
        top: max(10px, env(safe-area-inset-top));
        left: 12px;
        z-index: 45;
        display: none;
        min-height: 42px;
        border: 1px solid var(--line);
        background: #fff;
        color: var(--ink);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
        padding: 8px 12px;
    }

    .sidebar-collapsed .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .sidebar-brand {
        justify-content: space-between;
        padding-right: 0;
    }

    .side-nav {
        display: grid;
        gap: 8px;
        overflow: visible;
        padding-bottom: 0;
    }

    .side-nav a {
        grid-template-columns: 30px auto auto;
        min-height: 48px;
        padding: 8px 10px;
    }

    .sidebar .logout {
        position: static;
        min-height: 38px;
        margin: 0;
        padding: 7px 12px;
    }

    .sidebar-collapsed .sidebar {
        transform: translateX(-104%);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        min-height: 0;
        border: 0;
        border-radius: 0;
        background: rgba(15, 23, 42, 0.36);
        padding: 0;
    }

    .sidebar-collapsed .sidebar-backdrop {
        display: none;
    }

    .dashboard {
        padding-top: 64px;
    }

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

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

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

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

    .secondary-link,
    .small-link,
    button,
    .logout {
        min-height: 46px;
    }
}

@media (max-width: 620px) {
    body {
        background: #fff;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 20px;
    }

    input,
    select,
    button,
    .logout {
        min-height: 46px;
        font-size: 16px;
    }

    .login-shell {
        align-items: start;
        padding: 16px;
    }

    .login-panel {
        width: 100%;
        margin-top: 24px;
        box-shadow: none;
    }

    .login-logo {
        width: 82px;
        height: 82px;
    }

    .sidebar {
        padding: 12px;
    }

    .sidebar-top {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: -12px -12px 0;
        background: var(--sidebar);
        padding: 12px;
    }

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

    .side-nav a {
        grid-template-columns: 28px auto;
    }

    .side-nav a strong {
        display: none;
    }

    .page-head,
    .page-title,
    .report-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-title img {
        width: 52px;
        height: 52px;
    }

    .dashboard {
        padding: 64px 12px 32px;
    }

    .stats-grid,
    .kpi-grid,
    .report-grid,
    .dashboard-grid,
    .form-grid,
    .size-grid,
    .compact-size-grid,
    .numeric-size-grid,
    .custom-size-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        gap: 8px;
    }

    .stats-grid article {
        padding: 14px;
    }

    .stats-grid strong {
        font-size: 24px;
    }

    .login-panel,
    .product-form,
    .inventory-panel,
    .dashboard-panel,
    .sales-panel,
    .cart-panel,
    .product-page {
        padding: 18px;
    }

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

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .secondary-link {
        min-height: 46px;
        width: 100%;
    }

    .checkout-form,
    .cart-form,
    .cart-edit-form,
    .stock-adjust-form,
    .filter-form {
        grid-template-columns: 1fr;
    }

    .export-row {
        flex-direction: column;
    }

    .backup-actions {
        flex-direction: column;
    }

    .row-actions {
        min-width: 0;
        width: 100%;
    }

    .table-wrap {
        overflow: visible;
    }

    table,
    .sales-table,
    .cart-table {
        min-width: 0;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
        background: #fff;
    }

    td {
        display: grid;
        grid-template-columns: 98px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        border-bottom: 1px solid var(--line);
        padding: 12px;
        text-align: right;
    }

    td[data-label="Actions"],
    td[data-label="Quantity"] {
        grid-template-columns: 1fr;
        text-align: left;
    }

    td[data-label="Actions"]::before,
    td[data-label="Quantity"]::before {
        margin-bottom: 4px;
    }

    td:last-child {
        border-bottom: 0;
    }

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

    td > * {
        justify-self: end;
        max-width: 100%;
    }

    td[data-label="Actions"] > *,
    td[data-label="Quantity"] > * {
        justify-self: stretch;
        width: 100%;
    }

    td > strong,
    td > span,
    td strong + span {
        text-align: right;
    }

    .size-pills {
        justify-content: flex-end;
    }

    .product-thumb,
    .no-image,
    .current-image img {
        display: block;
        width: 86px;
        height: 86px;
        max-width: none;
    }

    .current-image {
        align-items: flex-start;
        flex-direction: column;
    }

    .checkout-form button,
    .clear-cart-form button,
    .row-actions button,
    .row-actions a,
    .row-actions select,
    .row-actions input {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .dashboard {
        padding-inline: 10px;
    }

    .login-panel,
    .product-form,
    .inventory-panel,
    .dashboard-panel,
    .sales-panel,
    .cart-panel,
    .product-page {
        padding: 14px;
    }

    .page-title {
        gap: 10px;
    }

    .page-title h1 {
        font-size: 25px;
    }

    .stats-grid strong,
    .kpi-grid strong,
    .report-grid strong {
        font-size: 23px;
        overflow-wrap: anywhere;
    }

    td {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }

    .product-details dl {
        grid-template-columns: 1fr;
    }
}
