:root {
    --admin-bg: #f3f6fb;
    --admin-surface: #ffffff;
    --admin-surface-soft: #f8fafc;
    --admin-border: #dce4ef;
    --admin-border-strong: #cbd5e1;
    --admin-text: #162033;
    --admin-muted: #64748b;
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-primary-soft: #e8f0ff;
    --admin-success: #059669;
    --admin-success-soft: #dcfce7;
    --admin-warning: #d97706;
    --admin-warning-soft: #fef3c7;
    --admin-danger: #dc2626;
    --admin-danger-soft: #fee2e2;
    --admin-slate: #475569;
    --admin-sidebar: #101a2f;
    --admin-sidebar-soft: #17233d;
    --admin-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --admin-radius-lg: 20px;
    --admin-radius-md: 14px;
    --admin-radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--admin-bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--admin-text);
    background:
        radial-gradient(circle at 90% 0%, rgba(37, 99, 235, 0.08), transparent 30rem),
        var(--admin-bg);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

[hidden] {
    display: none !important;
}

.admin-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 18px;
    overflow-y: auto;
    color: #e2e8f0;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.14), transparent 26%),
        var(--admin-sidebar);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.17);
}

.admin-brand-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.admin-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.admin-brand-copy strong {
    color: #ffffff;
    font-size: 18px;
    letter-spacing: 0.01em;
}

.admin-brand-copy small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
}

.admin-navigation {
    display: grid;
    gap: 7px;
    margin-top: 24px;
}

.admin-nav-link {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 10px 12px;
    color: #b8c5d9;
    border-radius: 12px;
    text-decoration: none;
    transition:
        color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.admin-nav-link i {
    width: 20px;
    text-align: center;
}

.admin-nav-link small {
    padding: 3px 7px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

a.admin-nav-link:hover {
    color: #ffffff;
    background: rgba(148, 163, 184, 0.11);
    transform: translateX(2px);
}

.admin-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.92), rgba(37, 99, 235, 0.62));
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}

.admin-nav-link.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.admin-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: auto;
    padding: 15px 12px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
}

.admin-sidebar-footer > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.admin-sidebar-footer strong {
    font-size: 12px;
}

.admin-sidebar-footer small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.security-indicator {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 10px;
}

.admin-main {
    min-width: 0;
    padding: 0 34px 44px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 104px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.75);
}

.admin-eyebrow,
.section-kicker {
    margin: 0 0 5px;
    color: var(--admin-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-topbar h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.1;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 13px;
    color: #1e40af;
    background: var(--admin-primary-soft);
    border: 1px solid #c7d7fe;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.icon-text-button,
.primary-button,
.secondary-button,
.table-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 15px;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.icon-text-button {
    color: #334155;
    background: #ffffff;
    border: 1px solid var(--admin-border);
}

.icon-text-button:hover,
.secondary-button:hover {
    border-color: #aebdce;
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--admin-primary), #1e4ed8);
    box-shadow: 0 9px 20px rgba(37, 99, 235, 0.22);
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--admin-primary-dark), #1d4ed8);
    box-shadow: 0 11px 24px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-text-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.secondary-button {
    color: #334155;
    background: #ffffff;
    border: 1px solid var(--admin-border);
}

.access-state {
    display: flex;
    min-height: 370px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow);
}

.state-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    place-items: center;
    color: var(--admin-primary);
    background: var(--admin-primary-soft);
    border-radius: 20px;
    font-size: 24px;
}

.state-icon.denied {
    color: var(--admin-danger);
    background: var(--admin-danger-soft);
}

.state-icon.error {
    color: var(--admin-warning);
    background: var(--admin-warning-soft);
}

.access-state h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
}

.access-state p {
    max-width: 500px;
    margin: 9px 0 0;
    color: var(--admin-muted);
    line-height: 1.6;
}

.access-state .secondary-button {
    margin-top: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-md);
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.045);
}

.summary-icon {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    font-size: 17px;
}

.summary-icon.blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.summary-icon.green {
    color: #047857;
    background: #d1fae5;
}

.summary-icon.amber {
    color: #b45309;
    background: #fef3c7;
}

.summary-icon.slate {
    color: #475569;
    background: #e2e8f0;
}

.summary-card > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.summary-card span:not(.summary-icon) {
    overflow: hidden;
    color: var(--admin-muted);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-card strong {
    margin-top: 4px;
    color: #0f172a;
    font-size: 25px;
    line-height: 1;
}

.products-panel {
    overflow: hidden;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 26px 22px;
}

.panel-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
}

.panel-heading p:last-child {
    max-width: 670px;
    margin: 7px 0 0;
    color: var(--admin-muted);
    font-size: 13px;
    line-height: 1.55;
}

.product-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px auto;
    gap: 12px;
    padding: 17px 26px;
    background: var(--admin-surface-soft);
    border-top: 1px solid #e7edf5;
    border-bottom: 1px solid #e7edf5;
}

.search-control {
    position: relative;
    display: flex;
    align-items: center;
}

.search-control i {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.search-control input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 41px;
    color: var(--admin-text);
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
    outline: none;
}

.filter-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    height: 44px;
    padding-left: 12px;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
}

.filter-control span {
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.filter-control select {
    width: 100%;
    height: 100%;
    padding: 0 30px 0 0;
    color: var(--admin-text);
    background: transparent;
    border: 0;
    outline: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.search-control input:focus,
.filter-control:focus-within {
    border-color: #76a0f8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.table-status {
    margin: 18px 26px 0;
    padding: 13px 15px;
    color: #334155;
    background: #f8fafc;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    font-size: 13px;
}

.table-status.error {
    color: #991b1b;
    background: #fff1f2;
    border-color: #fecdd3;
}

.product-table-wrap {
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.product-table th,
.product-table td {
    padding: 16px 15px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e8edf4;
}

.product-table th:first-child,
.product-table td:first-child {
    padding-left: 26px;
}

.product-table th:last-child,
.product-table td:last-child {
    padding-right: 26px;
}

.product-table th {
    color: #64748b;
    background: #fbfcfe;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.product-table tbody tr {
    transition: background 140ms ease;
}

.product-table tbody tr:hover {
    background: #f9fbff;
}

.product-table tbody tr:last-child td {
    border-bottom: 0;
}

.product-identity {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    overflow: hidden;
    place-items: center;
    color: #2563eb;
    background: #e8f0ff;
    border: 1px solid #d7e3fb;
    border-radius: 12px;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-identity-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.product-identity-copy strong {
    max-width: 250px;
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-identity-copy code {
    margin-top: 4px;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
}

.money-stack,
.income-stack {
    display: flex;
    min-width: 128px;
    flex-direction: column;
}

.money-stack strong,
.income-stack strong {
    color: #1e293b;
    font-size: 12px;
    white-space: nowrap;
}

.money-stack small,
.income-stack small {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    white-space: nowrap;
}

.period-copy {
    color: #334155;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.period-copy small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-pill::before {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    content: "";
}

.status-pill.active {
    color: #047857;
    background: #d1fae5;
}

.status-pill.draft {
    color: #a16207;
    background: #fef3c7;
}

.status-pill.inactive {
    color: #475569;
    background: #e2e8f0;
}

.status-pill.sold_out {
    color: #b91c1c;
    background: #fee2e2;
}

.status-pill.archived {
    color: #52525b;
    background: #e4e4e7;
}

.version-badge {
    display: inline-flex;
    min-width: 34px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    font-weight: 800;
}

.actions-column {
    text-align: right !important;
}

.table-action-button {
    min-height: 34px;
    padding: 8px 11px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 9px;
    font-size: 11px;
}

.table-action-button:hover {
    color: #ffffff;
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.empty-state {
    padding: 65px 24px;
    text-align: center;
}

.empty-state > span {
    display: grid;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    place-items: center;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 18px;
    font-size: 22px;
}

.empty-state h3 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
}

.empty-state p {
    margin: 7px 0 0;
    color: var(--admin-muted);
    font-size: 13px;
}

.modal-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    padding: 28px;
    overflow-y: auto;
    place-items: start center;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(5px);
}

.product-modal {
    width: min(1080px, 100%);
    margin: auto;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.35);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--admin-border);
}

.modal-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 23px;
}

.modal-close-button {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #475569;
    background: #f1f5f9;
    border-radius: 11px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.modal-close-button:hover {
    color: #991b1b;
    background: #fee2e2;
}

.modal-body {
    display: grid;
    gap: 17px;
    max-height: min(72vh, 760px);
    padding: 22px 26px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.form-message {
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.form-message.error {
    color: #991b1b;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.form-section {
    min-width: 0;
    margin: 0;
    padding: 18px;
    background: #fbfcfe;
    border: 1px solid #e4eaf2;
    border-radius: 15px;
}

.form-section legend {
    padding: 0 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.form-section > .form-field {
    margin-top: 14px;
}

.form-field > span {
    margin-bottom: 7px;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.form-field > span b {
    color: var(--admin-danger);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    color: #162033;
    background: #ffffff;
    border: 1px solid var(--admin-border-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-field input,
.form-field select {
    min-height: 43px;
    padding: 9px 11px;
}

.form-field textarea {
    min-height: 82px;
    padding: 11px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #76a0f8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field input:disabled {
    color: #64748b;
    background: #eef2f7;
    cursor: not-allowed;
}

.form-field input.invalid,
.form-field select.invalid,
.form-field textarea.invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.form-field small {
    margin-top: 6px;
    color: #7c8a9e;
    font-size: 10px;
    line-height: 1.4;
}

.derived-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.derived-preview > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 13px;
    background: #ffffff;
    border: 1px solid #dbe5f2;
    border-radius: 11px;
}

.derived-preview span {
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.derived-preview strong {
    margin-top: 5px;
    overflow: hidden;
    color: #172033;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calculation-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 11px 0 0;
    color: #52637a;
    font-size: 10px;
    line-height: 1.45;
}

.calculation-note i {
    margin-top: 2px;
    color: var(--admin-primary);
}

.audit-section {
    background: #fffbeb;
    border-color: #fde68a;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 26px;
    background: #f8fafc;
    border-top: 1px solid var(--admin-border);
}

.version-label {
    color: #64748b;
    font-size: 11px;
}

.version-label strong {
    color: #334155;
}

.modal-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.toast {
    position: fixed;
    z-index: 1200;
    right: 24px;
    bottom: 24px;
    display: flex;
    max-width: min(390px, calc(100vw - 32px));
    align-items: center;
    gap: 10px;
    padding: 14px 17px;
    color: #ecfdf5;
    background: #065f46;
    border: 1px solid rgba(110, 231, 183, 0.35);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(6, 78, 59, 0.28);
    font-size: 12px;
    font-weight: 700;
}

.toast.error {
    color: #fff1f2;
    background: #991b1b;
    border-color: rgba(254, 202, 202, 0.35);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid.four-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .derived-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        position: relative;
        display: block;
        width: 100%;
        height: auto;
        padding: 15px 18px;
        overflow: visible;
    }

    .admin-brand {
        min-height: 44px;
        padding: 0 0 14px;
    }

    .admin-brand-mark {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .admin-navigation {
        display: flex;
        margin-top: 13px;
        padding-bottom: 2px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .admin-nav-link {
        display: inline-flex;
        flex: 0 0 auto;
        min-height: 39px;
        padding: 8px 11px;
    }

    .admin-nav-link small {
        display: none;
    }

    .admin-sidebar-footer {
        display: none;
    }

    .admin-main {
        padding: 0 20px 38px;
    }

    .admin-topbar {
        min-height: 90px;
        margin-bottom: 20px;
    }

    .form-grid.three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .admin-topbar {
        align-items: flex-start;
        padding: 17px 0;
    }

    .admin-session-badge {
        display: none;
    }

    .icon-text-button {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 11px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        align-items: flex-start;
        padding: 15px;
    }

    .summary-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .summary-card span:not(.summary-icon) {
        white-space: normal;
    }

    .summary-card strong {
        font-size: 21px;
    }

    .panel-heading {
        flex-direction: column;
        padding: 20px;
    }

    .panel-heading .primary-button {
        width: 100%;
    }

    .product-toolbar {
        grid-template-columns: 1fr 1fr;
        padding: 14px 20px;
    }

    .search-control {
        grid-column: 1 / -1;
    }

    .table-status {
        margin-right: 20px;
        margin-left: 20px;
    }

    .product-table-wrap {
        padding: 14px;
    }

    .product-table,
    .product-table thead,
    .product-table tbody,
    .product-table tr,
    .product-table td {
        display: block;
        width: 100%;
    }

    .product-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .product-table tbody {
        display: grid;
        gap: 12px;
    }

    .product-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
        padding: 15px;
        background: #ffffff;
        border: 1px solid var(--admin-border);
        border-radius: 14px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    }

    .product-table tbody tr:hover {
        background: #ffffff;
    }

    .product-table td,
    .product-table th:first-child,
    .product-table td:first-child,
    .product-table th:last-child,
    .product-table td:last-child {
        padding: 0;
        border: 0;
    }

    .product-table td:first-child {
        grid-column: 1 / -1;
        padding-bottom: 12px;
        border-bottom: 1px solid #e8edf4;
    }

    .product-table td::before {
        display: block;
        margin-bottom: 5px;
        color: #94a3b8;
        content: attr(data-label);
        font-size: 9px;
        font-weight: 850;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .product-table td:first-child::before,
    .product-table td.actions-column::before {
        display: none;
    }

    .product-table td.actions-column {
        grid-column: 1 / -1;
    }

    .table-action-button {
        width: 100%;
    }

    .modal-backdrop {
        padding: 0;
        place-items: stretch;
    }

    .product-modal {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .modal-header {
        position: sticky;
        z-index: 2;
        top: 0;
        padding: 17px 18px;
        background: #ffffff;
    }

    .modal-body {
        max-height: none;
        padding: 17px 14px;
    }

    .form-grid.two-columns,
    .form-grid.three-columns,
    .form-grid.four-columns,
    .derived-preview {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 14px;
    }

    .modal-footer {
        position: sticky;
        z-index: 2;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 13px 14px;
    }

    .version-label {
        text-align: center;
    }

    .modal-footer-actions {
        width: 100%;
        margin-left: 0;
    }

    .modal-footer-actions button {
        flex: 1;
    }

    .toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 440px) {
    .admin-brand-copy small {
        display: none;
    }

    .admin-nav-link {
        font-size: 12px;
    }

    .admin-topbar h1 {
        font-size: 27px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        align-items: center;
    }

    .product-toolbar {
        grid-template-columns: 1fr;
    }

    .search-control {
        grid-column: auto;
    }

    .filter-control,
    .product-toolbar .secondary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
