:root {
    --app-bg: #f3f6fb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --primary: #321fdb;
    --primary-dark: #2819b3;
    --info: #0ea5e9;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --border: #e6eaf2;
    --sidebar: #111827;
    --sidebar-2: #0b1220;
    --shadow: 0 18px 48px rgba(16, 24, 40, .09);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body.app-body,
body {
    margin: 0;
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }
img { max-width: 100%; }

.btn {
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(50, 31, 219, .18);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-outline-primary { border-color: rgba(50,31,219,.35); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.form-control, .form-select, .input-group-text {
    border-radius: 12px;
    border-color: #d9e1ef;
}
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn, .input-group .input-group-text { border-radius: 12px; }
.input-group > .btn:not(:first-child), .input-group > .input-group-text:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.form-control, .form-select { padding: .74rem .9rem; }
.form-control:focus, .form-select:focus {
    border-color: rgba(50,31,219,.45);
    box-shadow: 0 0 0 .22rem rgba(50,31,219,.10);
}
.form-label { color: #344054; font-weight: 800; font-size: .88rem; }
.text-muted { color: var(--muted) !important; }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 16% 12%, rgba(50,31,219,.23), transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(14,165,233,.18), transparent 28%),
        linear-gradient(135deg, #f9fbff, #edf3ff 52%, #f7fbff);
}
.login-card {
    width: min(460px, 100%);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 28px;
    padding: 36px;
    box-shadow: 0 26px 70px rgba(16,24,40,.15);
    backdrop-filter: blur(12px);
}
.login-logo {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    margin-bottom: 20px;
    box-shadow: 0 18px 34px rgba(50,31,219,.25);
}
.login-card h1 { color: #111827; letter-spacing: -.03em; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 288px;
    background:
        linear-gradient(180deg, rgba(50,31,219,.14), transparent 22%),
        linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #e5e7eb;
    padding: 22px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    box-shadow: 18px 0 50px rgba(15, 23, 42, .18);
}
.brand-box {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 4px 2px 22px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: #fff;
    font-size: 23px;
    box-shadow: 0 15px 30px rgba(50,31,219,.26);
}
.brand-name { font-weight: 900; font-size: 19px; line-height: 1; letter-spacing: -.02em; }
.brand-box small { color: #98a2b3; font-weight: 600; }
.menu { display: grid; gap: 8px; margin-top: 26px; }
.menu-link {
    color: #cbd5e1;
    padding: 13px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: .18s ease;
    font-weight: 700;
}
.menu-link i { font-size: 18px; width: 24px; text-align: center; }
.menu-link:hover, .menu-link.active {
    color: #fff;
    background: rgba(255,255,255,.10);
}
.menu-link.active {
    background: linear-gradient(135deg, var(--primary), #5141e8);
    box-shadow: 0 14px 28px rgba(50,31,219,.32);
}
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.09);
    padding-top: 18px;
}
.user-pill { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 900;
    flex: 0 0 auto;
}
.user-meta { min-width: 0; }
.user-pill strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill small { display: block; color: #98a2b3; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.logout { display: inline-flex; align-items: center; gap: 8px; color: #fecaca; margin-top: 14px; font-weight: 700; }
.logout:hover { color: #fff; }

.topbar {
    margin-left: 288px;
    min-height: 92px;
    background: rgba(243,246,251,.86);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 22px 34px;
    border-bottom: 1px solid rgba(230,234,242,.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.topbar small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.035em; color: #111827; }
.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    font-size: 22px;
    color: #111827;
}
.content-wrap { margin-left: 288px; padding: 30px 34px 52px; }
.sidebar-backdrop { display: none; }

/* Cards e tabelas */
.card-pro, .table-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table-card { overflow: hidden; }
.table { --cui-table-bg: transparent; }
.table thead th {
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .045em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td, .table th { vertical-align: middle; padding: 1rem; }
.table-hover tbody tr:hover { background: #f9fbff; }
.badge-soft { border-radius: 999px; padding: 8px 11px; font-weight: 800; }
.section-title { font-size: 17px; font-weight: 900; margin-bottom: 14px; color: #111827; }

.kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 126px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--primary);
}
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card small { color: var(--muted); font-weight: 800; }
.kpi-card strong { display: block; font-size: 36px; line-height: 1.1; margin-top: 8px; letter-spacing: -.04em; }
.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: var(--primary);
    font-size: 25px;
}
.kpi-card.success .kpi-icon { background: #ecfdf3; color: var(--success); }
.kpi-card.warning .kpi-icon { background: #fffbeb; color: var(--warning); }
.kpi-card.danger .kpi-icon { background: #fef2f2; color: var(--danger); }
.product-row { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: #f8fafc; }
.copy-box { cursor: pointer; }
.best-price { background: #ecfdf3 !important; color: #166534 !important; font-weight: 900; }
.supplier-head { min-width: 190px; }

/* Área pública do fornecedor */
.public-wrap {
    min-height: 100vh;
    padding: 34px 16px;
    background:
        radial-gradient(circle at top right, rgba(50,31,219,.17), transparent 33%),
        radial-gradient(circle at top left, rgba(14,165,233,.13), transparent 28%),
        linear-gradient(135deg, #f8fafc, #eef4ff);
}
.public-card { max-width: 1160px; margin: 0 auto; }
.public-hero {
    background:
        linear-gradient(135deg, rgba(50,31,219,.92), rgba(14,20,44,.98)),
        #111827;
    color: #fff;
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .18);
}
.public-hero small { color: #bfdbfe; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.public-hero h1 { font-weight: 900; margin: 6px 0 12px; letter-spacing: -.04em; }
.public-hero .badge { box-shadow: 0 12px 28px rgba(0,0,0,.12); }

@media (max-width: 1100px) {
    .sidebar { transform: translateX(-105%); transition: .2s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.48); z-index: 1030; }
    .topbar, .content-wrap { margin-left: 0; }
    .sidebar-toggle { display: inline-grid; place-items: center; }
}

@media (max-width: 768px) {
    .topbar { padding: 18px; min-height: auto; }
    .topbar h1 { font-size: 22px; }
    .content-wrap { padding: 20px 16px 42px; }
    .login-card { padding: 28px; border-radius: 22px; }
    .public-hero { padding: 22px; border-radius: 22px; }
    .kpi-card { min-height: auto; }
    .table td, .table th { padding: .82rem; }
}

@media (max-width: 576px) {
    .btn-group { display: grid; gap: 6px; width: 100%; }
    .btn-group .btn { border-radius: 10px !important; }
}


/* =========================================================
   V4.0 - Ajustes tela pública do fornecedor
   Colocar este arquivo em: /assets/css/style.css
   Atualize o link para ?v=4.0 no fornecedor.php
   ========================================================= */
html { scroll-behavior: smooth; }

.public-wrap {
    padding-top: 16px !important;
    padding-bottom: 28px !important;
}

.public-card {
    max-width: 930px !important;
}

.public-hero {
    padding: 16px 20px !important;
    border-radius: 18px !important;
    margin-bottom: 14px !important;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .16) !important;
}

.public-hero small {
    font-size: .66rem !important;
    letter-spacing: .08em !important;
}

.public-hero h1 {
    font-size: clamp(1.22rem, 2vw, 1.65rem) !important;
    line-height: 1.08 !important;
    margin: 4px 0 7px !important;
    letter-spacing: -.035em !important;
}

.public-hero p {
    font-size: .78rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0 !important;
}

.public-hero .badge {
    font-size: .75rem !important;
    padding: .4rem .65rem !important;
    border-radius: 999px !important;
}

.public-period-row {
    margin-top: 12px !important;
}

.public-period-box {
    padding: 8px 10px !important;
    border-radius: 11px !important;
    line-height: 1.18 !important;
}

.public-period-box small {
    font-size: .62rem !important;
}

.public-period-box strong {
    font-size: .84rem !important;
}

.supplier-form.card-pro {
    padding: 18px !important;
    border-radius: 16px !important;
}

.supplier-form h2 {
    font-size: 1rem !important;
}

.supplier-form .text-muted,
.supplier-form small {
    font-size: .78rem !important;
}

.supplier-form .form-label {
    font-size: .78rem !important;
    margin-bottom: 5px !important;
}

.supplier-form .form-control,
.supplier-form .form-select,
.supplier-form .input-group-text {
    min-height: 38px !important;
    padding: .52rem .72rem !important;
    font-size: .88rem !important;
    border-radius: 10px !important;
}

.supplier-form .input-group .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.supplier-form .input-group-text {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.supplier-form hr {
    margin-top: 16px !important;
    margin-bottom: 16px !important;
}

.supplier-form .btn-lg {
    padding: .68rem 1rem !important;
    font-size: .95rem !important;
    border-radius: 12px !important;
}

.quote-product-table {
    margin-bottom: 0 !important;
}

.quote-product-table thead th {
    font-size: .66rem !important;
    padding: .7rem .75rem !important;
}

.quote-product-table td {
    padding: .62rem .75rem !important;
    font-size: .86rem !important;
}

.quote-product-table td strong {
    font-size: .86rem !important;
}

.quote-product-table .price-col {
    width: 150px !important;
    min-width: 150px !important;
}

.quote-product-table .ean-col {
    width: 145px !important;
    min-width: 120px !important;
}

.quote-product-table .obs-col {
    width: 210px !important;
    min-width: 180px !important;
}

.scroll-page-btn {
    position: fixed !important;
    right: 18px !important;
    bottom: 18px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 999px !important;
    border: 0 !important;
    background: linear-gradient(135deg, var(--primary), #5141e8) !important;
    color: #fff !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    box-shadow: 0 14px 30px rgba(50, 31, 219, .35) !important;
    z-index: 99999 !important;
    cursor: pointer !important;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease !important;
}

.scroll-page-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 34px rgba(50, 31, 219, .45) !important;
}

@media (max-width: 768px) {
    .public-wrap {
        padding: 10px 8px 22px !important;
    }

    .public-card {
        max-width: 100% !important;
    }

    .public-hero {
        padding: 13px 14px !important;
        border-radius: 15px !important;
    }

    .public-hero h1 {
        font-size: 1.12rem !important;
        line-height: 1.13 !important;
    }

    .public-hero p {
        font-size: .72rem !important;
    }

    .public-hero .badge {
        font-size: .68rem !important;
        padding: .32rem .55rem !important;
    }

    .public-period-row {
        margin-top: 8px !important;
    }

    .public-period-box {
        padding: 7px 9px !important;
    }

    .public-period-box strong {
        font-size: .78rem !important;
    }

    .supplier-form.card-pro {
        padding: 13px !important;
        border-radius: 14px !important;
    }

    .supplier-form .row.g-3 {
        --bs-gutter-y: .75rem;
    }

    .supplier-form .form-control,
    .supplier-form .form-select,
    .supplier-form .input-group-text {
        min-height: 36px !important;
        padding: .46rem .62rem !important;
        font-size: .82rem !important;
    }

    .quote-product-table thead th,
    .quote-product-table td {
        padding: .52rem .58rem !important;
        font-size: .78rem !important;
    }

    .quote-product-table td strong {
        font-size: .78rem !important;
    }

    .quote-product-table .price-col {
        width: 132px !important;
        min-width: 132px !important;
    }

    .quote-product-table .ean-col {
        width: 112px !important;
        min-width: 112px !important;
    }

    .quote-product-table .obs-col {
        width: 170px !important;
        min-width: 170px !important;
    }

    .scroll-page-btn {
        right: 12px !important;
        bottom: 12px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 20px !important;
    }
}
