:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --primary: #3157d5;
    --primary-dark: #2444b3;
    --border: #e4e8f0;
    --danger: #c62828;
    --success: #1f7a45;
    --shadow: 0 8px 25px rgba(20, 35, 70, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { font-weight: 800; font-size: 20px; }
.admin-badge {
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #eef2ff;
    color: var(--primary);
    margin-left: 6px;
}
.header-actions { display: flex; gap: 8px; }

.btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.outline { border: 1px solid #cfd6e5; background: #fff; }
.btn.danger-outline { border: 1px solid #e9bcbc; color: var(--danger); background: #fff; }
.btn.danger { background: #fff0f0; color: var(--danger); }
.btn.small { padding: 7px 10px; font-size: 13px; }

.catalog-page, .admin-page, .form-page { padding: 42px 0 70px; }
.catalog-heading, .page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}
h1 { margin: 0 0 7px; font-size: clamp(28px, 4vw, 40px); }
h2 { margin: 0; font-size: 19px; }
.muted { color: var(--muted); margin: 0; line-height: 1.6; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.product-image {
    aspect-ratio: 1 / 1;
    background: #eef1f6;
    overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-image {
    height: 100%;
    display: grid;
    place-items: center;
    color: #8a93a5;
}
.product-body { padding: 18px; }
.product-body p { color: #596273; line-height: 1.6; margin: 10px 0 15px; }
.quantity {
    padding-top: 13px;
    border-top: 1px solid var(--border);
    color: #4f5868;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card {
    width: min(430px, 100%);
    background: #fff;
    padding: 34px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.auth-card .brand { margin-bottom: 26px; }
.auth-card h1 { font-size: 30px; }
.auth-card form { margin-top: 22px; }

form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
input, textarea {
    width: 100%;
    border: 1px solid #d6dce8;
    border-radius: 9px;
    padding: 12px 13px;
    font: inherit;
    color: var(--text);
    background: #fff;
}
input:focus, textarea:focus {
    outline: 3px solid rgba(49, 87, 213, .12);
    border-color: var(--primary);
}
textarea { resize: vertical; }
small { color: var(--muted); font-weight: 400; }

.form-card {
    width: min(760px, 100%);
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 30px;
}
.form-card h1 { font-size: 30px; margin-bottom: 24px; }

.alert {
    padding: 13px 15px;
    border-radius: 10px;
    margin: 0 0 18px;
    line-height: 1.5;
}
.alert.error { background: #fff0f0; color: #9f2222; border: 1px solid #f0cccc; }
.alert.success { background: #edf9f1; color: var(--success); border: 1px solid #c9e9d3; }

.admin-table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow-x: auto;
    box-shadow: var(--shadow);
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th { font-size: 13px; color: #697386; background: #fafbfc; }
.admin-table tr:last-child td { border-bottom: 0; }
.thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    background: #eef1f6;
}
.table-description { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 7px; align-items: center; }
.actions form { display: block; }
.empty {
    background: #fff;
    border: 1px dashed #cfd6e5;
    border-radius: 14px;
    padding: 40px;
    text-align: center;
    color: var(--muted);
}
.current-image { display: grid; gap: 8px; }
.current-image span { font-size: 14px; font-weight: 700; }
.current-image img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

@media (max-width: 850px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .container { width: min(100% - 22px, 1180px); }
    .header-inner { min-height: 64px; }
    .header-inner .brand { font-size: 17px; }
    .header-actions .btn:first-child { display: none; }
    .product-grid { grid-template-columns: 1fr; }
    .catalog-page, .admin-page, .form-page { padding-top: 28px; }
    .page-title { align-items: flex-start; }
    .page-title .btn { white-space: nowrap; }
    .auth-card, .form-card { padding: 24px; }
}

/* logo Modernolux */
.brand-logo{height:40px;width:auto;display:block}
.auth-card .brand-logo{height:64px;margin:0 auto 6px}
.header-inner .brand{display:flex;align-items:center;gap:10px}
