:root {
    --black: #2a151c;
    --ink: #241a1d;
    --muted: #75656a;
    --gold: #b78b52;
    --gold-dark: #8c6334;
    --line: #ebcfd7;
    --soft: #fff4f6;
    --white: #ffffff;
    --danger: #9d2525;
    --success: #176744;
    --shadow: 0 14px 34px rgba(11, 11, 13, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

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

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

.admin-body {
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: #2a151c;
    color: var(--white);
    padding: 24px 18px;
    overflow-y: auto;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: var(--white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.22rem;
    font-weight: 700;
}

.admin-brand img {
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: contain;
    border: 1px solid var(--gold);
}

.admin-sidebar nav {
    display: grid;
    gap: 7px;
}

.admin-sidebar nav a {
    color: #e5dfd4;
    padding: 12px 13px;
    border-radius: 6px;
    font-weight: 800;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    color: var(--white);
    background: #5a1f32;
    box-shadow: inset 3px 0 0 var(--gold);
}

.admin-shell {
    margin-left: 270px;
    min-height: 100vh;
}

.admin-topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 30px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.admin-topbar span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-topbar strong {
    color: var(--black);
}

.admin-logout {
    padding: 9px 14px;
    color: var(--black);
    border: 1px solid var(--gold);
    border-radius: 6px;
    font-weight: 900;
}

.admin-main {
    padding: 30px;
}

.admin-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-page-heading span {
    color: var(--gold-dark);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.76rem;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
    color: var(--black);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.15;
    letter-spacing: 0;
}

h1 {
    font-size: 2.1rem;
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.05rem;
}

p {
    color: var(--muted);
}

.admin-btn,
.table-actions button,
.login-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    color: var(--white);
    background: var(--black);
    border: 1px solid var(--black);
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
}

.admin-btn.secondary,
.table-actions button {
    color: var(--black);
    background: var(--white);
    border-color: var(--gold);
}

.admin-btn.light {
    color: var(--black);
    background: var(--white);
    border-color: var(--line);
}

.table-actions button.danger,
button.danger {
    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

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

.stats-grid article,
.admin-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.stats-grid span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.stats-grid strong {
    display: block;
    margin-top: 8px;
    color: var(--black);
    font-size: 2rem;
}

.admin-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 22px;
}

.admin-card {
    padding: 20px;
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-card-head a {
    color: var(--gold-dark);
    font-weight: 900;
}

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

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

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

.admin-table th {
    color: var(--black);
    background: #fbfaf7;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.admin-table td small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    color: var(--black);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 900;
    margin: 2px;
}

.status-pill.gold {
    background: #f3ead6;
    border-color: var(--gold);
}

.product-cell {
    min-width: 260px;
}

.product-cell,
.admin-product-list a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-cell img,
.admin-product-list img {
    width: 58px;
    height: 58px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.product-cell strong,
.admin-product-list span {
    display: block;
    color: var(--black);
    font-weight: 900;
}

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

.admin-product-list a {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.table-actions form {
    display: inline-flex;
}

.admin-filters {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) 170px 190px 145px 135px auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    color: var(--black);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 11px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 137, 46, .14);
}

.admin-form label {
    display: block;
    margin-bottom: 14px;
}

.admin-form label span {
    display: block;
    color: var(--black);
    font-size: 0.84rem;
    font-weight: 900;
    margin-bottom: 7px;
}

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

.form-section {
    margin-bottom: 18px;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.check-row label,
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 900;
}

.check-row input,
.checkbox-label input {
    width: auto;
    min-height: auto;
}

.image-manager {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.image-manager > div {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
}

.image-manager img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.image-manager button {
    width: 100%;
    min-height: 36px;
    color: var(--white);
    background: var(--danger);
    border: 0;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
}

.image-manager-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.image-manager-actions form {
    margin: 0;
}

.image-manager button.set-primary {
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--gold);
}

.primary-image-label {
    display: block;
    margin: -2px 0 9px;
    color: #5a1f32;
    font-size: .78rem;
    font-weight: 900;
}

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

.image-preview-grid > div {
    min-width: 0;
}

.image-preview-grid img,
.category-image-preview {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.image-preview-grid span {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-image-preview {
    max-width: 160px;
    margin: 0 0 14px;
}

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

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.admin-pagination a {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-weight: 900;
}

.admin-pagination a.active {
    color: var(--white);
    background: #5a1f32;
    border-color: #5a1f32;
}

.admin-flash {
    padding: 13px 15px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--white);
    margin-bottom: 16px;
    font-weight: 900;
}

.admin-flash-success {
    color: var(--success);
    border-color: rgba(23, 103, 68, .35);
}

.admin-flash-error {
    color: var(--danger);
    border-color: rgba(157, 37, 37, .35);
}

.detail-card dl {
    margin: 0 0 18px;
}

.detail-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

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

dd {
    margin: 0;
    color: var(--black);
    font-weight: 900;
    text-align: right;
}

.settings-logo {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.settings-logo img {
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--gold);
}

.narrow-card {
    max-width: 560px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(11,11,13,.86), rgba(11,11,13,.94)),
        url('../images/placeholder-jewellery.svg') center / cover no-repeat;
}

.login-card {
    width: min(420px, 100%);
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.login-card img {
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 70px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--gold);
    margin: 0 auto 16px;
}

.login-eyebrow {
    display: block;
    color: var(--gold-dark);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.login-card h1 {
    text-align: center;
}

.login-card button {
    width: 100%;
    margin-top: 6px;
}

.login-card a {
    display: block;
    margin-top: 14px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

@media (max-width: 1050px) {
    .admin-sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-shell {
        margin-left: 0;
    }

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

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

@media (max-width: 720px) {
    .admin-main,
    .admin-topbar {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .admin-sidebar nav,
    .stats-grid,
    .admin-grid-two,
    .admin-filters,
    .form-grid,
    .image-manager,
    .settings-logo {
        grid-template-columns: 1fr;
    }

    .table-actions {
        min-width: 220px;
    }

    .detail-card dl div {
        display: block;
    }

    dd {
        text-align: left;
        margin-top: 2px;
    }
}
