:root {
    --red: #e30613;
    --dark: #1a1a1a;
    --gray-text: #333;
}

* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #f2f2f2;
    color: var(--dark);
}

.wt-light { font-weight: 300; }
.wt-regular { font-weight: 400; }
.wt-semibold { font-weight: 600; }
.wt-italic { font-weight: 400; font-style: italic; }
.wt-semibold-italic { font-weight: 600; font-style: italic; }

/* ---------- Nav ---------- */
.topnav {
    background: #1a1a1a;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.topnav-brand { color: #fff; font-weight: 600; text-decoration: none; }
.topnav-links a {
    color: #ddd;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
}
.topnav-links a:hover { color: #fff; }

.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.app-footer {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #888;
}
.app-footer a { color: #555; font-weight: 600; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* ---------- Generic admin UI ---------- */
h2 { font-weight: 600; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    background: var(--dark);
    color: #fff;
    text-decoration: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}
.btn-red { background: var(--red); }
.btn-outline { background: #fff; color: var(--dark); border: 1px solid #ccc; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.table-wrap { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: middle; }
th { background: #fafafa; font-weight: 600; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #eee; }
tr.row-active { background: #fff3e0; }
.col-check { width: 36px; text-align: center; padding-left: 16px; padding-right: 0; }
.col-check input { width: 16px; height: 16px; cursor: pointer; }

.print-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.search-bar input[type=text] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    min-width: 220px;
    flex: 1 1 220px;
}
.per-page-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    margin-left: auto;
}
.per-page-label select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.pagination-info { font-size: 13px; color: #666; }
.pagination-links { display: flex; gap: 8px; flex-wrap: wrap; }
.check-all-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check-all-label input { width: 16px; height: 16px; cursor: pointer; }
.print-hint { font-size: 13px; color: #777; }
#btn-print:disabled { background: #bbb; cursor: not-allowed; }

.export-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.export-btn:disabled { opacity: .6; cursor: wait; }
tr.row-active td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.form-grid.single { grid-template-columns: 1fr; max-width: 520px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.span-2 { grid-column: span 2; }
.form-field label { font-size: 13px; font-weight: 600; color: #555; }
.form-field input[type=text], .form-field input[type=number], .form-field input[type=url] {
    padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-family: inherit; font-size: 14px;
}
.form-field input[type=file] { font-size: 13px; }
.form-field label a { color: var(--dark); }
.checkbox-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: #555; margin-top: 4px; cursor: pointer; }
.checkbox-inline input { width: 14px; height: 14px; cursor: pointer; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 8px; }

.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-thumb-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.upload-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; background: #fafafa; display: block; }
.upload-thumb-remove {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-thumb-remove:hover { background: #b3050f; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fde2e2; color: #a30000; }
.alert-success { background: #e2fbe8; color: #1a7a34; }

.layout-split { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 28px; align-items: start; }
.preview-sticky { position: sticky; top: 20px; display: flex; justify-content: center; }

/* ---------- Pricelist Card ---------- */
.card {
    width: 460px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-head {
    text-align: center;
    padding: 26px 20px 18px;
}
.card-logo { max-height: 88px; max-width: 240px; object-fit: contain; }
.card-logo-placeholder {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 15px;
    color: var(--dark);
    text-transform: uppercase;
}
.card-title {
    margin: 14px 0 0;
    font-size: 26px;
    letter-spacing: .5px;
}

.card-photo-wrap { position: relative; }
.card-photo { width: 100%; height: 320px; object-fit: cover; display: block; }

.badge-discount {
    position: absolute;
    left: 22px;
    bottom: -34px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.badge-pct { font-size: 22px; font-weight: 700; font-style: italic; }
.badge-off { font-size: 15px; font-weight: 700; font-style: italic; margin-top: 2px; }
.badge-discount-img {
    position: absolute;
    left: 22px;
    bottom: -34px;
    width: 84px;
    height: 84px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.25));
}

.card-body {
    display: flex;
    justify-content: space-between;
    padding: 50px 24px 30px;
    gap: 12px;
}
.card-col-left { display: flex; flex-direction: column; gap: 6px; }
.size-label { font-size: 14px; color: #333; }
.size-value { font-size: 22px; margin-bottom: 8px; }
.qr-code { width: 78px; height: 78px; }

.card-col-right { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.brand-name { font-size: 28px; }
.brand-logo { max-height: 40px; max-width: 200px; object-fit: contain; }
.series-name { font-size: 20px; margin-bottom: 10px; }
.price-original { font-size: 15px; color: #555; text-decoration: line-through; }
.price-final { font-size: 26px; color: var(--red); margin-top: 2px; }

@media (max-width: 900px) {
    .layout-split { grid-template-columns: 1fr; }
    .preview-sticky { position: static; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field.span-2 { grid-column: 1; }
}
