@font-face {
    font-family: "Cormorant Garamond";
    src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --adm-bg: #f3eee8;
    --adm-paper: #fffdfa;
    --adm-ink: #2d1c24;
    --adm-muted: #78666d;
    --adm-wine: #7d2f42;
    --adm-wine-dark: #5d2030;
    --adm-dark: #24141b;
    --adm-rose: #c8798a;
    --adm-blush: #f7e7e2;
    --adm-gold: #c9a227;
    --adm-sage: #708564;
    --adm-line: rgba(125, 47, 66, 0.13);
    --adm-shadow: 0 18px 44px rgba(67, 34, 44, 0.08);
    --adm-shadow-lg: 0 28px 80px rgba(67, 34, 44, 0.16);
    --adm-radius: 20px;
    --adm-font-display: "Cormorant Garamond", Georgia, serif;
    --adm-font: "Plus Jakarta Sans", Arial, sans-serif;
    --adm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.admin-body {
    margin: 0;
    min-height: 100vh;
    background: var(--adm-bg);
    color: var(--adm-ink);
    font-family: var(--adm-font);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body.admin-body.lightbox-open,
body.admin-body.sidebar-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

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

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

::selection {
    background: var(--adm-wine);
    color: #fff;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 18px;
    z-index: 9999;
    padding: 10px 18px;
    border-radius: 0 0 10px 10px;
    background: var(--adm-wine);
    color: #fff;
    font-weight: 700;
}

.skip-link:focus {
    top: 0;
}

.admin-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 18px 18px;
    background:
        radial-gradient(circle at 10% 0%, rgba(200, 121, 138, 0.16), transparent 32%),
        var(--adm-dark);
    color: #f4e5e1;
}

.admin-brand-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 26px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-brand img {
    width: 46px;
    height: 46px;
}

.admin-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.admin-brand strong {
    font-family: var(--adm-font-display);
    font-size: 1.72rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: #fffaf6;
}

.admin-brand small {
    margin-top: 4px;
    color: #e7b7b3;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: transparent;
    color: #fff;
}

.admin-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.admin-nav-label {
    padding: 0 12px 8px;
    color: rgba(244, 229, 225, 0.35);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.admin-nav-label-spaced {
    margin-top: 24px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: rgba(244, 229, 225, 0.65);
    font-size: 0.76rem;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.admin-nav a i {
    width: 18px;
    color: rgba(244, 229, 225, 0.5);
    font-size: 0.95rem;
    text-align: center;
    transition: color 0.2s ease;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-nav a.is-active {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(100deg, rgba(125, 47, 66, 0.9), rgba(125, 47, 66, 0.55));
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.admin-nav a.is-active i {
    color: #f6d4ce;
}

.admin-sidebar-footer {
    margin-top: 28px;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-mini-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.admin-avatar,
.admin-topbar-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--adm-blush);
    color: var(--adm-wine);
    font-size: 0.75rem;
    font-weight: 800;
}

.admin-mini-profile > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.35;
}

.admin-mini-profile strong {
    overflow: hidden;
    color: #fff;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-mini-profile small {
    overflow: hidden;
    color: rgba(244, 229, 225, 0.45);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-logout {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(244, 229, 225, 0.55);
    font-size: 0.64rem;
    font-weight: 700;
    transition: color 0.2s ease, background 0.2s ease;
}

.admin-logout:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-overlay {
    display: none;
}

/* Main */
.admin-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 82px;
    padding: 14px 34px;
    border-bottom: 1px solid var(--adm-line);
    background: rgba(243, 238, 232, 0.88);
    backdrop-filter: blur(16px);
}

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

.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--adm-line);
    border-radius: 11px;
    background: var(--adm-paper);
    color: var(--adm-ink);
    font-size: 1.2rem;
}

.admin-topbar-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--adm-muted);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.admin-topbar h1 {
    margin: 0;
    font-family: var(--adm-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--adm-line);
    border-radius: 9px;
    background: rgba(255, 253, 250, 0.6);
    color: var(--adm-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.admin-topbar-link:hover {
    border-color: var(--adm-wine);
    color: var(--adm-wine);
}

.admin-content {
    flex: 1;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 34px 42px;
}

.admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 34px;
    border-top: 1px solid var(--adm-line);
    color: var(--adm-muted);
    font-size: 0.6rem;
}

.admin-footer p {
    margin: 0;
}

/* Flash */
.admin-flashes {
    display: grid;
    gap: 9px;
    margin-bottom: 22px;
}

.admin-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid var(--adm-line);
    border-radius: 11px;
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow);
    font-size: 0.76rem;
    font-weight: 600;
}

.admin-flash-success {
    border-color: rgba(92, 133, 75, 0.25);
    background: #f3f8ef;
    color: #38512d;
}

.admin-flash-error {
    border-color: rgba(160, 54, 64, 0.22);
    background: #fff2f2;
    color: #842f39;
}

.admin-flash-warning {
    border-color: rgba(177, 128, 25, 0.25);
    background: #fff9e9;
    color: #74520c;
}

.admin-flash-close {
    margin-left: auto;
    padding: 3px;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.6;
}

/* Page heading */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-head h2 {
    margin: 0 0 4px;
    font-family: var(--adm-font-display);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
}

.page-head p {
    margin: 0;
    color: var(--adm-muted);
    font-size: 0.74rem;
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Buttons */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 0.2s var(--adm-ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.adm-btn:hover {
    transform: translateY(-1px);
}

.adm-btn-primary {
    background: var(--adm-wine);
    color: #fff;
    box-shadow: 0 8px 18px rgba(125, 47, 66, 0.18);
}

.adm-btn-primary:hover {
    background: var(--adm-wine-dark);
    color: #fff;
}

.adm-btn-soft {
    border-color: var(--adm-line);
    background: var(--adm-paper);
    color: var(--adm-ink);
}

.adm-btn-soft:hover {
    border-color: var(--adm-wine);
    color: var(--adm-wine);
}

.adm-btn-danger {
    border-color: rgba(160, 54, 64, 0.18);
    background: #fff2f2;
    color: #9a3540;
}

.adm-btn-danger:hover {
    background: #9a3540;
    color: #fff;
}

.adm-btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.62rem;
}

.adm-btn-icon {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--adm-line);
    border-radius: 8px;
    background: var(--adm-paper);
    color: var(--adm-muted);
}

.adm-btn-icon:hover {
    border-color: var(--adm-wine);
    color: var(--adm-wine);
}

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

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--adm-line);
    border-radius: var(--adm-radius);
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow);
}

.stat-card::after {
    content: "";
    position: absolute;
    top: -30px;
    right: -20px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--adm-blush);
    opacity: 0.55;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--adm-blush);
    color: var(--adm-wine);
    font-size: 1rem;
}

.stat-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 1px;
    font-family: var(--adm-font-display);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1;
}

.stat-card span {
    position: relative;
    z-index: 1;
    color: var(--adm-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.stat-card-link {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    color: var(--adm-wine);
    font-size: 0.72rem;
}

/* Panels */
.panel {
    border: 1px solid var(--adm-line);
    border-radius: var(--adm-radius);
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow);
}

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

.panel-head h2,
.panel-head h3 {
    margin: 0;
    font-family: var(--adm-font-display);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1;
}

.panel-head p {
    margin: 3px 0 0;
    color: var(--adm-muted);
    font-size: 0.66rem;
}

.panel-body {
    padding: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.quick-action {
    display: flex;
    min-height: 92px;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    border: 1px solid var(--adm-line);
    border-radius: 13px;
    background: #fcf8f3;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--adm-ease);
}

.quick-action:hover {
    border-color: rgba(125, 47, 66, 0.3);
    background: var(--adm-blush);
    transform: translateY(-2px);
}

.quick-action i {
    color: var(--adm-wine);
    font-size: 1.1rem;
}

.quick-action strong {
    font-size: 0.7rem;
    line-height: 1.35;
}

.quick-action small {
    color: var(--adm-muted);
    font-size: 0.58rem;
}

.tips-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(201, 162, 39, 0.24);
    border-radius: 15px;
    background: #fffaf0;
}

.tips-card h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
    color: #74520c;
    font-family: var(--adm-font);
    font-size: 0.7rem;
    font-weight: 800;
}

.tips-card p {
    margin: 0;
    color: #856a2c;
    font-size: 0.66rem;
    line-height: 1.6;
}

.alert-warning {
    display: flex;
    gap: 11px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(177, 128, 25, 0.24);
    border-radius: 12px;
    background: #fff9e9;
    color: #74520c;
    font-size: 0.72rem;
    line-height: 1.6;
}

.alert-warning i {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-warning a {
    font-weight: 800;
    text-decoration: underline;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.admin-table th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--adm-line);
    background: #fcf8f3;
    color: var(--adm-muted);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(125, 47, 66, 0.07);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: #fdf9f5;
}

.table-product {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 230px;
}

.table-thumb {
    width: 48px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    background: var(--adm-blush);
}

.table-product strong {
    display: block;
    max-width: 250px;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-product small {
    display: block;
    max-width: 250px;
    overflow: hidden;
    color: var(--adm-muted);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-price {
    font-family: var(--adm-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.55rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-green {
    background: #eef6e9;
    color: #4f6c40;
}

.badge-red {
    background: #fff0f0;
    color: #9a3540;
}

.badge-gold {
    background: #fff7dd;
    color: #84610d;
}

.badge-gray {
    background: #f1ece8;
    color: var(--adm-muted);
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}

/* Filter bar */
.admin-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.adm-input,
.adm-select,
.adm-textarea {
    width: 100%;
    border: 1px solid var(--adm-line);
    border-radius: 9px;
    outline: none;
    background: var(--adm-paper);
    color: var(--adm-ink);
    font-size: 0.72rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.adm-input,
.adm-select {
    min-height: 40px;
    padding: 9px 12px;
}

.adm-textarea {
    min-height: 140px;
    padding: 11px 12px;
    line-height: 1.7;
    resize: vertical;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
    border-color: var(--adm-wine);
    box-shadow: 0 0 0 3px rgba(125, 47, 66, 0.08);
}

.adm-input::placeholder,
.adm-textarea::placeholder {
    color: #a99a9e;
}

.search-box {
    position: relative;
    min-width: 220px;
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--adm-muted);
    font-size: 0.75rem;
    transform: translateY(-50%);
}

.search-box .adm-input {
    padding-left: 34px;
}

.admin-filter-form .adm-select {
    width: auto;
    min-width: 155px;
}

.result-count {
    color: var(--adm-muted);
    font-size: 0.64rem;
    white-space: nowrap;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.form-panel {
    padding: 24px;
    border: 1px solid var(--adm-line);
    border-radius: var(--adm-radius);
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow);
}

.form-panel h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--adm-line);
    font-family: var(--adm-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}

.form-panel h2 i {
    color: var(--adm-wine);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 17px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.65rem;
    font-weight: 800;
}

.form-label .required {
    color: var(--adm-wine);
}

.form-hint {
    margin: 5px 0 0;
    color: var(--adm-muted);
    font-size: 0.58rem;
    line-height: 1.5;
}

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

.form-errors {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(160, 54, 64, 0.2);
    border-radius: 10px;
    background: #fff2f2;
    color: #842f39;
    font-size: 0.68rem;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.form-errors li + li {
    margin-top: 3px;
}

.input-group {
    position: relative;
}

.input-prefix {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--adm-muted);
    font-size: 0.66rem;
    transform: translateY(-50%);
}

.input-group .adm-input {
    padding-left: 34px;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
    background: #fcf8f3;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
}

.check-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--adm-wine);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

/* Image upload */
.image-upload {
    position: relative;
    overflow: hidden;
    border: 1.5px dashed rgba(125, 47, 66, 0.25);
    border-radius: 13px;
    background: #fcf8f3;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.image-upload:hover,
.image-upload.is-dragover {
    border-color: var(--adm-wine);
    background: var(--adm-blush);
}

.image-upload input[type="file"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-upload-inner {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
}

.image-upload-inner i {
    margin-bottom: 8px;
    color: var(--adm-wine);
    font-size: 1.5rem;
}

.image-upload-inner strong {
    font-size: 0.7rem;
}

.image-upload-inner span {
    margin-top: 3px;
    color: var(--adm-muted);
    font-size: 0.58rem;
}

.image-preview {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--adm-blush);
}

.image-preview img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(36, 20, 27, 0.6);
    color: #fff;
    font-size: 0.65rem;
}

.current-image {
    margin-bottom: 12px;
}

.current-image img {
    width: 100%;
    height: 190px;
    border-radius: 11px;
    object-fit: cover;
}

.current-image span {
    display: block;
    margin-top: 5px;
    color: var(--adm-muted);
    font-size: 0.56rem;
}

.image-upload.is-processing {
    opacity: 0.75;
    pointer-events: none;
}

.image-upload-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 8px 0 0;
    padding: 7px 9px;
    border-radius: 8px;
    background: #eef6e9;
    color: #4f6c40;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.5;
}

.image-upload-note[hidden] {
    display: none;
}

.image-upload-note.is-processing {
    background: #f4ece7;
    color: var(--adm-muted);
}

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--adm-bg);
}

.login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px;
    background:
        linear-gradient(to top, rgba(36, 20, 27, 0.82), rgba(36, 20, 27, 0.16)),
        url("../images/hero-secondary.webp") center / cover no-repeat;
    color: #fff;
}

.login-visual::after {
    content: "";
    position: absolute;
    top: 15%;
    right: -90px;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
}

.login-brand img {
    width: 52px;
    height: 52px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.login-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.login-brand strong {
    font-family: var(--adm-font-display);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.login-brand small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.login-quote {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.login-quote i {
    color: #e9b7b3;
    font-size: 2rem;
}

.login-quote h2 {
    margin: 8px 0 12px;
    font-family: var(--adm-font-display);
    font-size: clamp(2.7rem, 4.5vw, 4.2rem);
    font-weight: 500;
    line-height: 0.95;
}

.login-quote p {
    max-width: 390px;
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.8;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
}

.login-card {
    width: min(100%, 420px);
}

.login-card .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: var(--adm-wine);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0 0 8px;
    font-family: var(--adm-font-display);
    font-size: 2.7rem;
    font-weight: 600;
    line-height: 1;
}

.login-card > p {
    margin-bottom: 24px;
    color: var(--adm-muted);
    font-size: 0.75rem;
}

.login-card form {
    padding: 26px;
    border: 1px solid var(--adm-line);
    border-radius: var(--adm-radius);
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow-lg);
}

.login-card .adm-input {
    min-height: 46px;
}

.password-wrap {
    position: relative;
}

.password-wrap .adm-input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--adm-muted);
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: var(--adm-blush);
    color: var(--adm-wine);
}

.login-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
}

.login-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 12px 13px;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
    background: #fcf8f3;
    color: var(--adm-muted);
    font-size: 0.6rem;
    line-height: 1.6;
}

.login-note i {
    flex-shrink: 0;
    color: var(--adm-wine);
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--adm-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.login-back:hover {
    color: var(--adm-wine);
}

.login-flash {
    margin-bottom: 16px;
}

/* Account */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--adm-line);
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--adm-blush);
    color: var(--adm-wine);
    font-family: var(--adm-font-display);
    font-size: 1.8rem;
    font-weight: 600;
}

.profile-card h2 {
    margin: 0 0 2px;
    font-family: var(--adm-font-display);
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1;
}

.profile-card p {
    margin: 0;
    color: var(--adm-muted);
    font-size: 0.64rem;
}

/* Empty state */
.admin-empty {
    padding: 50px 22px;
    text-align: center;
}

.admin-empty i {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--adm-blush);
    color: var(--adm-wine);
    font-size: 1.4rem;
}

.admin-empty h3 {
    margin: 0 0 5px;
    font-family: var(--adm-font-display);
    font-size: 1.7rem;
    font-weight: 600;
}

.admin-empty p {
    margin: 0 0 16px;
    color: var(--adm-muted);
    font-size: 0.68rem;
}

/* Admin gallery */
.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.admin-gallery-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--adm-line);
    border-radius: var(--adm-radius);
    background: var(--adm-paper);
    box-shadow: var(--adm-shadow);
}

.admin-gallery-media {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--adm-blush);
}

.admin-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-gallery-status {
    position: absolute;
    top: 10px;
    left: 10px;
    backdrop-filter: blur(6px);
}

.admin-gallery-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}

.admin-gallery-body h3 {
    margin: 0;
    font-family: var(--adm-font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.15;
}

.admin-gallery-body p {
    margin: 0;
    color: var(--adm-muted);
    font-size: 0.63rem;
    line-height: 1.65;
}

.admin-gallery-body p.is-muted {
    font-style: italic;
    opacity: 0.72;
}

.admin-gallery-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 9px;
    color: var(--adm-muted);
    font-size: 0.57rem;
}

.admin-gallery-meta i {
    margin-right: 3px;
    color: var(--adm-wine);
}

.admin-gallery-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--adm-line);
}

.admin-gallery-actions form {
    margin: 0;
}

/* Responsive */
@media (max-width: 1199.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .form-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    }
}

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

    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s var(--adm-ease);
    }

    .sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .admin-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(20, 10, 15, 0.5);
        backdrop-filter: blur(3px);
    }

    .sidebar-close,
    .sidebar-toggle {
        display: grid;
        place-items: center;
    }

    .admin-topbar {
        padding-inline: 22px;
    }

    .admin-content {
        padding: 24px 22px 34px;
    }

    .admin-footer {
        padding-inline: 22px;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 280px;
        padding: 30px;
    }

    .login-quote h2 {
        font-size: 2.6rem;
    }

    .login-quote p {
        display: none;
    }

    .login-panel {
        padding: 30px 22px 44px;
    }
}

@media (max-width: 767.98px) {
    .admin-topbar h1 {
        font-size: 1.45rem;
    }

    .admin-topbar-kicker {
        display: none;
    }

    .admin-topbar-link span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card strong {
        font-size: 2rem;
    }

    .page-head {
        display: block;
    }

    .page-head-actions {
        margin-top: 14px;
    }

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

    .admin-filter-bar {
        display: block;
    }

    .admin-filter-form {
        margin-top: 10px;
    }

    .admin-filter-form .search-box {
        width: 100%;
        min-width: 0;
    }

    .result-count {
        display: block;
        margin-top: 8px;
    }

    .admin-table th,
    .admin-table td {
        padding-inline: 10px;
    }

    .admin-footer {
        display: block;
        text-align: center;
    }

    .admin-footer p + p {
        margin-top: 4px;
    }

    .login-visual {
        min-height: 230px;
    }

    .login-brand strong {
        font-size: 1.7rem;
    }

    .login-quote h2 {
        font-size: 2.2rem;
    }

    .login-card form {
        padding: 20px;
    }
}

@media (max-width: 575.98px) {
    .admin-content {
        padding-inline: 16px;
    }

    .admin-topbar {
        padding-inline: 16px;
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

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

    .login-panel {
        padding-inline: 16px;
    }

    .login-visual {
        padding: 22px;
    }
}

/* Category management */
.table-category {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.table-category-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 10px;
    background: var(--adm-blush);
    color: var(--adm-wine);
    font-size: 1rem;
}

.table-category strong {
    display: block;
    max-width: 230px;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-category small {
    display: block;
    max-width: 230px;
    overflow: hidden;
    color: var(--adm-muted);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-muted {
    display: block;
    max-width: 260px;
    color: var(--adm-muted);
    font-size: 0.62rem;
    line-height: 1.5;
}

a.badge-soft {
    text-decoration: none;
}

a.badge-soft:hover {
    text-decoration: underline;
}

.icon-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-preview {
    display: grid;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
    background: #fcf8f3;
    color: var(--adm-wine);
    font-size: 1.15rem;
}

.form-static {
    margin: 0;
    color: var(--adm-muted);
    font-size: 0.64rem;
    line-height: 1.6;
}

.form-static code,
.form-hint code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #f4ece7;
    color: var(--adm-wine);
    font-size: 0.6rem;
}

.form-hint code {
    padding: 1px 4px;
    font-size: 0.56rem;
}

.adm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
