:root {
    --ink: #1b1b1f;
    --muted: #69707a;
    --paper: #f5f6f8;
    --line: #e3e6ed;
    --accent: #e8344e;
    --accent-dark: #b82036;
    --green: #1d7a63;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

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

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

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

.admin-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 66px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.admin-header div,
.admin-header nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-header img {
    width: auto;
    height: 42px;
}

.admin-header strong {
    font-size: 16px;
    font-weight: 900;
}

.admin-header a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.admin-header a:hover {
    color: var(--accent);
    border-color: rgba(232, 52, 78, 0.45);
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 20px;
    width: min(1220px, calc(100% - 28px));
    margin: 24px auto;
    align-items: start;
}

.admin-card,
.login-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(27, 27, 31, 0.06);
}

.admin-card {
    padding: 20px;
}

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

.card-title h1,
.card-title h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.card-title a,
.card-title span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

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

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

label {
    display: grid;
    gap: 7px;
}

label span {
    color: #3a404b;
    font-size: 13px;
    font-weight: 800;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #d8dde7;
    border-radius: 6px;
    outline: none;
}

textarea {
    resize: vertical;
}

input[type="file"] {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    border: 1px dashed #c8ced9;
    border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(232, 52, 78, 0.62);
    box-shadow: 0 0 0 3px rgba(232, 52, 78, 0.1);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: var(--white);
    font-weight: 900;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.primary-btn:hover {
    background: var(--accent-dark);
}

.alert {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 6px;
}

.alert-success {
    color: #0f5d49;
    background: #e8f6f1;
    border: 1px solid #bfe6d8;
}

.alert-error {
    color: #9d1730;
    background: #fff0f3;
    border: 1px solid #f2c8d1;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.image-preview img {
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.image-preview span {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

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

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

.product-table th,
.product-table td {
    padding: 11px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.product-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.product-table td {
    font-size: 14px;
}

.product-table img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 900;
    border-radius: 999px;
}

.status-pill.is-active {
    color: #0f5d49;
    background: #e8f6f1;
}

.status-pill.is-passive {
    color: #78601a;
    background: #fff6d6;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions a,
.table-actions button {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 10px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

.table-actions button {
    color: #9d1730;
}

.empty-table-row {
    padding: 24px 10px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.muted-cell {
    max-width: 220px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

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

.login-shell {
    width: min(100%, 390px);
}

.login-card {
    display: grid;
    gap: 16px;
    padding: 26px;
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.login-brand img {
    max-width: 180px;
    max-height: 58px;
}

.login-brand h1 {
    margin: 0;
    font-size: 23px;
}

@media (max-width: 980px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .admin-header nav {
        flex-wrap: wrap;
    }

    .form-grid,
    .image-row {
        grid-template-columns: 1fr;
    }
}
