/* ============================================================
   Henry Importes
   — Loja: inspiração Mercado Livre (amarelo/azul/branco)
   — Admin: visual tecnológico dark com acentos ciano/violeta
   ============================================================ */

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body.admin-body { color-scheme: dark; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Proxima Nova", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============================================================
   ░░░ LOJA PÚBLICA — Paleta Mercado Livre ░░░
   ============================================================ */

body:not(.admin-body):not(.login-body) {
    --ml-yellow: #FFE600;
    --ml-yellow-dark: #FFDB15;
    --ml-blue: #3483FA;
    --ml-blue-hover: #2968c8;
    --ml-green: #00A650;
    --ml-green-dark: #008A43;
    --ml-orange: #F23D4F;

    --bg:           #EBEBEB;
    --surface:      #FFFFFF;
    --surface-2:    #F5F5F5;
    --text:         #333333;
    --text-muted:   #666666;
    --text-soft:    #999999;
    --border:       #E6E6E6;
    --border-strong:#D9D9D9;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
    --shadow:    0 2px 8px rgba(0,0,0,.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,.12);

    --radius-sm: 4px;
    --radius:    6px;
    --radius-lg: 10px;

    background: var(--bg);
    color: var(--text);
}

body:not(.admin-body):not(.login-body) a { color: var(--ml-blue); text-decoration: none; }
body:not(.admin-body):not(.login-body) a:hover { color: var(--ml-blue-hover); text-decoration: underline; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ======= HEADER (amarelo ML) ======= */
.site-header {
    background: var(--ml-yellow);
    box-shadow: 0 1px 0 rgba(0,0,0,.08);
    position: sticky; top: 0; z-index: 10;
}
.header-top {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.logo {
    font-weight: 800;
    font-size: 22px;
    color: #2d2d2d;
    letter-spacing: -0.6px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo:hover { text-decoration: none; color: #2d2d2d; }
.logo-mark {
    width: 36px; height: 36px;
    background: #fff;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 900;
    color: var(--ml-blue);
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.search-box {
    flex: 1;
    min-width: 260px;
    display: flex;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,.12);
    overflow: hidden;
    height: 40px;
}
.search-box input {
    flex: 1;
    border: none;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
}
.search-box button {
    background: #ededed;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    border-left: 1px solid #e6e6e6;
    color: var(--text-muted);
    font-size: 16px;
    transition: background .12s;
}
.search-box button:hover { background: #e0e0e0; }
.header-links {
    display: flex;
    gap: 18px;
    font-size: 13px;
}
.header-links a {
    color: #2d2d2d;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 3px;
    transition: background .12s;
}
.header-links a:hover {
    background: rgba(0,0,0,.06);
    text-decoration: none;
    color: #2d2d2d;
}

/* ======= BREADCRUMBS ======= */
.breadcrumbs {
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 0 8px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--ml-blue); }
.breadcrumbs .sep { margin: 0 6px; color: #ccc; }

/* ======= GRID DE PRODUTOS (HOME) ======= */
.hero-title {
    font-size: 26px;
    font-weight: 600;
    margin: 20px 0 24px;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}
.product-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}
.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}
.product-card-img {
    aspect-ratio: 1;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 20px;
    position: relative;
}
.product-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .2s;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-body {
    padding: 12px 14px 16px;
    border-top: 1px solid var(--border);
}
.product-card-price-old {
    font-size: 12px;
    color: var(--text-soft);
    text-decoration: line-through;
    margin-bottom: 2px;
    min-height: 16px;
}
.product-card-price {
    font-size: 20px;
    font-weight: 500;
    color: #111;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.product-card-discount {
    font-size: 13px;
    font-weight: 500;
    color: var(--ml-green);
}
.product-card-title {
    font-size: 13px;
    color: #333;
    margin-top: 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}
.product-card-badge {
    font-size: 11px;
    color: var(--ml-green);
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ======= PÁGINA DE PRODUTO ======= */
.product-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
}
@media (max-width: 900px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-wrap { padding: 18px; }
}

.gallery {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 14px;
    min-width: 0;
}
.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
}
.gallery-thumbs button {
    width: 60px; height: 60px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 3px;
    cursor: pointer;
    transition: all .15s;
}
.gallery-thumbs button:hover,
.gallery-thumbs button.active {
    border-color: var(--ml-blue);
    border-width: 2px;
    padding: 2px;
}
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.gallery-main {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    aspect-ratio: 1/1;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 28px;
}
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
@media (max-width: 600px) {
    .gallery { grid-template-columns: 1fr; }
    .gallery-thumbs {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        order: 2;
    }
    .gallery-main { order: 1; padding: 14px; }
}

.product-info { min-width: 0; }
.product-condition {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.product-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 18px;
    color: var(--text);
    letter-spacing: -0.2px;
}
.price-block { margin: 8px 0 20px; }
.price-old {
    font-size: 14px;
    color: var(--text-soft);
    text-decoration: line-through;
    margin-bottom: 2px;
}
.price-new {
    font-size: 36px;
    font-weight: 300;
    color: #111;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.price-discount {
    font-size: 16px;
    font-weight: 500;
    color: var(--ml-green);
}
.price-installment {
    font-size: 15px;
    color: var(--ml-green);
    margin-top: 8px;
    font-weight: 400;
}

.shipping-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00A650, #00c25e);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin: 16px 0;
    box-shadow: 0 2px 6px rgba(0,166,80,.2);
}

.stock-info {
    font-size: 14px;
    color: var(--text-muted);
    margin: 14px 0;
}
.stock-info b { color: var(--text); font-weight: 600; }

.qty-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    font-size: 14px;
}
.qty-select {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

/* ======= BOTÕES ======= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, transform .05s, box-shadow .12s;
    width: 100%;
    font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--ml-blue);
    color: #fff;
    box-shadow: 0 2px 4px rgba(52,131,250,.25);
}
.btn-primary:hover {
    background: var(--ml-blue-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(52,131,250,.35);
}
.btn-secondary {
    background: rgba(52,131,250,.12);
    color: var(--ml-blue);
}
.btn-secondary:hover {
    background: rgba(52,131,250,.2);
    color: var(--ml-blue);
    text-decoration: none;
}
.btn-success {
    background: var(--ml-green);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,166,80,.25);
}
.btn-success:hover {
    background: var(--ml-green-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0,166,80,.35);
}

.actions-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* ======= PURCHASE BOX LATERAL ======= */
.purchase-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    align-self: start;
    position: sticky;
    top: 80px;
}
.purchase-box h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}
.purchase-box .feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 12px 0;
    line-height: 1.5;
}
.purchase-box .feature .ico {
    color: var(--ml-blue);
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}
.purchase-box .feature b { color: var(--text); }

/* ======= DESCRIÇÃO ======= */
.description-block {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.description-block h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 18px;
    letter-spacing: -0.2px;
}
.description-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    white-space: pre-wrap;
    max-width: 780px;
}

/* ======= CHECKOUT ======= */
.checkout-wrap {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin: 24px 0;
}
@media (max-width: 900px) {
    .checkout-wrap { grid-template-columns: 1fr; }
}
.checkout-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.checkout-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkout-card h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--ml-blue);
    border-radius: 2px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; }
.form-group.col-12 { grid-column: span 12; }
.form-group.col-8  { grid-column: span 8; }
.form-group.col-6  { grid-column: span 6; }
.form-group.col-5  { grid-column: span 5; }
.form-group.col-4  { grid-column: span 4; }
.form-group.col-3  { grid-column: span 3; }
.form-group.col-2  { grid-column: span 2; }
.form-group.col-9  { grid-column: span 9; }
@media (max-width: 600px) {
    .form-group[class*="col-"] { grid-column: span 12; }
}
.form-group label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #444;
}
.form-group input, .form-group textarea, .form-group select {
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--ml-blue);
    box-shadow: 0 0 0 3px rgba(52,131,250,.14);
}

/* Payment options */
.payment-options { display: grid; gap: 10px; margin-top: 8px; }
.pay-opt {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all .12s;
    background: #fff;
}
.pay-opt:hover { border-color: var(--border-strong); }
.pay-opt input { accent-color: var(--ml-blue); }
.pay-opt.selected {
    border-color: var(--ml-blue);
    background: #f4f8ff;
    box-shadow: 0 2px 8px rgba(52,131,250,.08);
}
.pay-opt .label { font-weight: 600; font-size: 15px; }
.pay-opt .hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.pay-opt-body { flex: 1; }
.pay-opt-icon {
    font-size: 24px;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    background: #f5f5f5;
    border-radius: 50%;
}

/* Order summary */
.order-summary {
    position: sticky;
    top: 80px;
    align-self: start;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin: 10px 0;
    color: #555;
}
.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}
.summary-product {
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.summary-product img {
    width: 64px; height: 64px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 4px;
}
.summary-product .title {
    font-size: 13px;
    line-height: 1.35;
    color: var(--text);
    font-weight: 500;
}

/* ======= PIX SUCCESS PAGE ======= */
.pix-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    max-width: 640px;
    margin: 24px auto;
    text-align: center;
}
.pix-box h1 {
    color: var(--ml-green);
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.4px;
}
.pix-box .order-code {
    display: inline-block;
    background: #f5f5f5;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    letter-spacing: .5px;
}
.pix-qr {
    display: inline-block;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}
.pix-copy {
    width: 100%;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12px;
    background: #f8f8f8;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    line-height: 1.5;
    text-align: left;
    max-height: 100px;
    overflow-y: auto;
    resize: none;
    color: #555;
}
.pix-steps {
    text-align: left;
    max-width: 460px;
    margin: 24px auto;
    color: #555;
    font-size: 14px;
}
.pix-steps ol { padding-left: 24px; }
.pix-steps li { margin: 6px 0; }

.pix-value {
    font-size: 36px;
    font-weight: 300;
    color: #111;
    margin: 8px 0 24px;
    letter-spacing: -0.5px;
}

/* Footer da loja */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 13px;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Flash (loja) */
.flash {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin: 14px 0;
    font-size: 14px;
    border-left: 4px solid;
    background: #fff;
}
.flash.success { background: #e8f7ee; color: #0d5e2a; border-color: var(--ml-green); }
.flash.error   { background: #ffebee; color: #b71c1c; border-color: #e53935; }
.flash.warn    { background: #fff8e1; color: #795600; border-color: #f9a825; }
.flash.info    { background: #e3f2fd; color: #0d47a1; border-color: #1976d2; }

/* Empty state da loja */
body:not(.admin-body) .empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
body:not(.admin-body) .empty-state .big { font-size: 48px; margin-bottom: 10px; }

/* ============================================================
   ░░░ ADMIN — Visual tecnológico dark ░░░
   ============================================================ */

body.admin-body {
    --bg:           #0a0e1a;
    --surface:      #12172a;
    --surface-2:    #1a2039;
    --surface-3:    #232a4a;
    --text:         #e8ecf5;
    --text-muted:   #8a93ad;
    --text-soft:    #5b6485;
    --border:       #232a4a;
    --border-strong:#2d3560;

    --accent:       #06b6d4;   /* ciano tech */
    --accent-hover: #0891b2;
    --accent-glow:  rgba(6,182,212,.35);
    --violet:       #8b5cf6;
    --success:      #10b981;
    --warn:         #f59e0b;
    --danger:       #ef4444;

    --radius-sm: 5px;
    --radius:    8px;
    --radius-lg: 12px;

    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 10% 0%, rgba(6,182,212,.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(139,92,246,.06) 0%, transparent 40%);
    background-attachment: fixed;
}

body.admin-body a { color: var(--accent); text-decoration: none; }
body.admin-body a:hover { color: var(--accent-hover); text-decoration: underline; }

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    background: linear-gradient(180deg, #0f1424 0%, #0a0e1a 100%);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: relative;
}
.admin-sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: -1px;
    width: 1px; height: 120px;
    background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
    opacity: .5;
}

.admin-sidebar .brand {
    color: #fff;
    font-weight: 700;
    padding: 0 22px 22px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}
.admin-sidebar .brand-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
    border-radius: 8px;
    display: grid; place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.admin-nav { list-style: none; padding: 0; margin: 0; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 22px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
    position: relative;
}
.admin-nav a:hover {
    background: rgba(255,255,255,.03);
    color: var(--text);
    text-decoration: none;
}
.admin-nav a.active {
    background: linear-gradient(90deg, rgba(6,182,212,.1) 0%, transparent 100%);
    color: #fff;
    border-left-color: var(--accent);
}
.admin-nav a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

.admin-content {
    padding: 24px 32px;
    min-width: 0;
}

.admin-topbar {
    background: var(--surface);
    margin: -24px -32px 24px;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #fff;
}
.admin-topbar > div {
    font-size: 13px;
    color: var(--text-muted);
}
.admin-topbar b { color: var(--text); }

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
}
.admin-card h2 {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    opacity: .6;
}
.stat .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    font-weight: 600;
}
.stat .value {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    margin-top: 8px;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}
.stat .hint {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 6px;
}
.stat.brand::after   { background: linear-gradient(90deg, var(--accent), transparent); }
.stat.accent::after  { background: linear-gradient(90deg, #fbbf24, transparent); }
.stat.success::after { background: linear-gradient(90deg, var(--success), transparent); }

/* Tabelas admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}
.admin-table th {
    text-align: left;
    background: var(--surface-2);
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.admin-table th:first-child { border-top-left-radius: var(--radius-sm); }
.admin-table th:last-child  { border-top-right-radius: var(--radius-sm); }
.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13.5px;
    color: var(--text);
}
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table .thumb {
    width: 40px; height: 40px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: #fff;
}

/* Chips */
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.chip.success { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.chip.warn    { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.chip.danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.chip.muted   { background: var(--surface-3); color: var(--text-muted); }

/* Botões admin */
.admin-body .btn {
    font-size: 14px;
    padding: 11px 18px;
}
.admin-body .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.admin-body .btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    box-shadow: 0 4px 12px var(--accent-glow);
}
.admin-body .btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.admin-body .btn-outline:hover {
    background: var(--surface-2);
    color: #fff;
    border-color: var(--accent);
}
.admin-body .btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: #fff;
}
.admin-body .btn-success:hover { background: #059669; }
.admin-body .btn-danger {
    background: rgba(239,68,68,.15);
    color: #f87171;
    border: 1px solid rgba(239,68,68,.3);
}
.admin-body .btn-danger:hover { background: rgba(239,68,68,.25); color: #fca5a5; }

.btn-sm {
    padding: 7px 12px !important;
    font-size: 13px !important;
    width: auto !important;
    display: inline-flex !important;
}

/* Formulários admin */
.admin-body .form-group label {
    color: var(--text);
    font-weight: 500;
}
.admin-body .form-group input,
.admin-body .form-group textarea,
.admin-body .form-group select {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.admin-body .form-group input:focus,
.admin-body .form-group textarea:focus,
.admin-body .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.admin-body .form-group small { color: var(--text-soft); }

.admin-body textarea {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12px;
    min-height: 120px;
    width: 100%;
}

/* Flash admin */
.admin-body .flash {
    border-radius: var(--radius-sm);
    border-left-width: 3px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.admin-body .flash.success { background: rgba(16,185,129,.08); color: #34d399; border-left-color: var(--success); }
.admin-body .flash.error   { background: rgba(239,68,68,.08); color: #f87171; border-left-color: var(--danger); }
.admin-body .flash.warn    { background: rgba(245,158,11,.08); color: #fbbf24; border-left-color: var(--warn); }
.admin-body .flash.info    { background: rgba(6,182,212,.08); color: #67e8f9; border-left-color: var(--accent); }

/* Empty state admin */
.admin-body .empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-muted);
}
.admin-body .empty-state .big { font-size: 44px; margin-bottom: 10px; opacity: .6; }

/* Image manager grid */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.img-tile {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 8px;
}
.img-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-tile .remove {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(239,68,68,.95);
    color: #fff;
    border: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.img-tile .remove:hover { background: #ef4444; transform: scale(1.1); }

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ============================================================
   ░░░ LOGIN ADMIN — página cheia com efeito tech ░░░
   ============================================================ */
.login-body {
    background: #0a0e1a;
    min-height: 100vh;
    color: #e8ecf5;
    color-scheme: dark;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 20%, rgba(6,182,212,.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,.1) 0%, transparent 50%),
        #0a0e1a;
    position: relative;
    overflow: hidden;
}
.login-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6,182,212,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6,182,212,.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 70%);
}
.login-card {
    background: rgba(18,23,42,.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 20px 60px rgba(0,0,0,.4),
        0 0 0 1px rgba(6,182,212,.1);
    position: relative;
    z-index: 1;
}
.login-card .logo-mark {
    margin: 0 auto 24px;
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    border-radius: 14px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(6,182,212,.4);
}
.login-card h1 {
    text-align: center;
    margin: 0 0 28px;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
}
.login-card .form-group label {
    color: #c9ccd4;
    font-weight: 500;
}
.login-card input {
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
}
.login-card input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6,182,212,.2);
}
.login-card .btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #fff;
    padding: 13px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(6,182,212,.3);
}
.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    transform: translateY(-1px);
}
.login-card .flash.error {
    background: rgba(239,68,68,.15);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}
.login-card a {
    color: #8a93ad;
}
.login-card a:hover { color: #06b6d4; }

/* ============================================================
   Tabela responsiva wrapper
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

/* Scrollbars no admin */
.admin-body ::-webkit-scrollbar { width: 10px; height: 10px; }
.admin-body ::-webkit-scrollbar-track { background: var(--bg); }
.admin-body ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; }
.admin-body ::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Mobile sidebar collapse */
@media (max-width: 800px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .admin-nav {
        display: flex;
        overflow-x: auto;
        padding: 0 12px 4px;
        gap: 4px;
    }
    .admin-nav li { flex-shrink: 0; }
    .admin-nav a {
        padding: 8px 14px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        font-size: 13px;
    }
    .admin-nav a.active {
        border-left: none;
        border-bottom-color: var(--accent);
    }
    .admin-nav a.active::before { display: none; }
    .admin-sidebar .brand { padding: 0 22px 14px; }
    .admin-content { padding: 20px 18px; }
    .admin-topbar { margin: -20px -18px 20px; padding: 14px 18px; }
}
