:root{
    --primary:#131921;
    --secondary:#232f3e;
    --accent:#febd69;
    --button:#ffd814;
    --button-hover:#f7ca00;
    --bg:#eaeded;
    --white:#ffffff;
    --text:#0f1111;
    --muted:#565959;
    --border:#d5d9d9;
    --success:#007600;
    --shadow:0 2px 8px rgba(15,17,17,.08);
    --radius:12px;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html, body{
    width:100%;
    overflow-x:hidden;
}

body{
    font-family:Arial, Helvetica, sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.45;
}

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

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

.container{
    width:min(1400px, 94%);
    margin:0 auto;
}

/* =========================
   HEADER PRINCIPAL
========================= */
.topbar{
    background:var(--primary);
    color:var(--white);
    padding:12px 0;
}

.topbar-inner{
    display:grid;
    grid-template-columns:220px 1fr 320px;
    gap:18px;
    align-items:center;
}

.logo{
    display:flex;
    flex-direction:column;
    justify-content:center;
    line-height:1.15;
}

.logo-main{
    font-size:1.45rem;
    color:#fff;
    letter-spacing:.4px;
    line-height:1.1;
    font-weight:800;
}

.logo-sub{
    font-size:.85rem;
    color:var(--accent);
    text-transform:uppercase;
    letter-spacing:1px;
    line-height:1.1;
    font-weight:700;
}

.searchbar{
    display:flex;
    overflow:hidden;
    border-radius:10px;
    background:#fff;
    border:2px solid transparent;
}

.searchbar:focus-within{
    border-color:var(--accent);
}

.searchbar input{
    flex:1;
    border:none;
    padding:14px 16px;
    font-size:15px;
    outline:none;
    line-height:1.35;
}

.searchbar button{
    border:none;
    background:var(--accent);
    padding:0 18px;
    font-weight:700;
    cursor:pointer;
    line-height:1.3;
    min-width:86px;
}

.top-links{
    display:flex;
    justify-content:flex-end;
    gap:18px;
    font-size:.92rem;
    align-items:center;
    flex-wrap:wrap;
}

.top-links a{
    color:#fff;
    line-height:1.35;
    display:inline-flex;
    align-items:center;
    min-height:32px;
}

.subnav{
    background:var(--secondary);
    color:#fff;
    padding:10px 0;
}

.subnav-inner{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
    font-size:.92rem;
    align-items:center;
}

/* =========================
   NAV PROVEEDOR
========================= */
.nav-proveedor{
    width:min(1400px, 94%);
    margin:18px auto 26px;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    background:#ffffff;
    border:1px solid #e3e6e6;
    border-radius:16px;
    padding:16px 18px;
    box-shadow:0 2px 8px rgba(15,17,17,.08);
}

.nav-proveedor a{
    color:#232f3e;
    text-decoration:none;
    font-weight:700;
    font-size:14px;
    padding:10px 16px;
    border-radius:999px;
    transition:.2s ease;
    line-height:1.4;
    white-space:nowrap;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
}

.nav-proveedor a:hover{
    background:#fff7e6;
    color:#111;
}

.nav-proveedor a.active{
    background:#232f3e;
    color:#fff;
}

/* =========================
   HERO
========================= */
.hero{
    margin:22px auto 0;
    background:linear-gradient(120deg, #dbefff 0%, #ffe7c2 100%);
    border-radius:18px;
    padding:38px;
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:30px;
    align-items:center;
    box-shadow:var(--shadow);
}

.hero h1{
    font-size:2.5rem;
    margin-bottom:12px;
    line-height:1.1;
}

.hero p{
    color:#1f2937;
    max-width:620px;
    margin-bottom:18px;
    font-size:1.02rem;
    line-height:1.5;
}

.hero-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

/* =========================
   BOTONES
========================= */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    border-radius:999px;
    padding:12px 20px;
    font-weight:700;
    cursor:pointer;
    line-height:1.3;
    min-height:42px;
    text-align:center;
    text-decoration:none;
}

.btn-primary{
    background:var(--button);
    color:#111;
}

.btn-primary:hover{
    background:var(--button-hover);
}

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

/* =========================
   SECCIONES Y TARJETAS
========================= */
.section{
    margin:24px auto 0;
}

.section-title{
    font-size:1.5rem;
    margin-bottom:14px;
    font-weight:700;
    line-height:1.3;
}

.card{
    background:#fff;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    border:1px solid #e3e6e6;
    overflow:hidden;
}

.card-body{
    padding:18px;
}

.grid-categories{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:18px;
}

.category-card{
    min-height:180px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.category-card h3{
    font-size:1.08rem;
    margin-bottom:8px;
    line-height:1.3;
}

.category-card p{
    color:var(--muted);
    font-size:.94rem;
    line-height:1.5;
}

.category-link{
    color:#2162a1;
    font-weight:600;
    margin-top:14px;
    display:inline-block;
}

/* =========================
   PRODUCTOS
========================= */
.grid-products{
    display:grid;
    grid-template-columns:repeat(5, 1fr);
    gap:18px;
}

.product-card{
    background:#fff;
    border-radius:14px;
    border:1px solid #e3e6e6;
    box-shadow:var(--shadow);
    overflow:hidden;
    transition:.2s ease;
}

.product-card:hover{
    transform:translateY(-3px);
}

.product-thumb{
    height:220px;
    background:#f7f8f8;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#777;
    font-size:.95rem;
    padding:12px;
    text-align:center;
}

.product-info{
    padding:16px;
}

.product-title{
    font-size:.98rem;
    min-height:48px;
    margin-bottom:10px;
    line-height:1.4;
}

.product-provider{
    color:#2162a1;
    font-size:.88rem;
    margin-bottom:8px;
    line-height:1.4;
}

.product-price{
    font-size:1.35rem;
    font-weight:700;
    margin-bottom:4px;
    line-height:1.2;
}

/* =========================
   BADGES
========================= */
.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:.78rem;
    font-weight:700;
    line-height:1.3;
}

.badge-verified{
    background:#e6f4ea;
    color:var(--success);
}

.badge-premium{
    background:#fff3cd;
    color:#7a5600;
}

/* =========================
   LOGIN
========================= */
.login-wrap{
    width:min(420px, 94%);
    margin:40px auto;
    background:#fff;
    padding:28px;
    border-radius:18px;
    box-shadow:var(--shadow);
    border:1px solid var(--border);
}

.login-wrap h2{
    margin-bottom:16px;
    text-align:center;
    line-height:1.3;
}

/* =========================
   FORMULARIOS
========================= */
.form-group{
    margin-bottom:14px;
}

.form-group label{
    display:block;
    font-weight:700;
    margin-bottom:6px;
    font-size:.94rem;
    line-height:1.4;
}

.form-group input,
.form-group select,
.form-group textarea{
    width:100%;
    border:1px solid var(--border);
    border-radius:10px;
    padding:12px 14px;
    outline:none;
    font-family:inherit;
    line-height:1.4;
    background:#fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{
    border-color:#f0a500;
}

.form-group input[type="file"]{
    padding:10px 12px;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:16px;
    margin-bottom:18px;
}

.form-group-full{
    grid-column:1 / -1;
}

/* =========================
   ALERTAS
========================= */
.alert{
    padding:12px 14px;
    border-radius:10px;
    margin-bottom:14px;
    font-size:.93rem;
    line-height:1.45;
}

.alert-error{
    background:#fff0f0;
    color:#8a1c1c;
    border:1px solid #f3c2c2;
}

.alert-success{
    background:#edfdf0;
    color:#176b2c;
    border:1px solid #b6e0bf;
}

/* =========================
   DASHBOARD
========================= */
.dashboard{
    padding:8px 0 40px;
}

.dashboard-header{
    background:#fff;
    border-radius:16px;
    padding:26px;
    box-shadow:var(--shadow);
    margin-bottom:22px;
}

.dashboard-header h1{
    font-size:2rem;
    margin-bottom:8px;
    line-height:1.2;
}

.dashboard-header p{
    color:var(--muted);
    line-height:1.45;
}

.dashboard-cards{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:18px;
}

.stat-card{
    background:#fff;
    padding:22px;
    border-radius:16px;
    box-shadow:var(--shadow);
    border-left:5px solid var(--accent);
    min-height:110px;
}

.stat-card h4{
    color:var(--muted);
    font-size:.92rem;
    margin-bottom:8px;
    line-height:1.4;
}

.stat-card p{
    font-size:1.8rem;
    font-weight:800;
    line-height:1.2;
}

/* =========================
   GRID PROVEEDOR
========================= */
.provider-panels-grid{
    display:grid;
    grid-template-columns:1.4fr .8fr;
    gap:20px;
}

.quick-links-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
}

.quick-link-card{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:16px;
    font-weight:700;
    color:#111827;
    transition:.2s ease;
    line-height:1.4;
}

.quick-link-card:hover{
    background:#fff7e6;
    border-color:#f3c76b;
}

/* =========================
   TABLAS
========================= */
.table-responsive{
    width:100%;
    overflow-x:auto;
}

.custom-table{
    width:100%;
    border-collapse:collapse;
    min-width:800px;
}

.custom-table thead{
    background:#f7f7f7;
}

.custom-table th,
.custom-table td{
    padding:14px 12px;
    border-bottom:1px solid #e5e7eb;
    text-align:left;
    font-size:.94rem;
    line-height:1.45;
    vertical-align:middle;
}

.custom-table th{
    font-weight:700;
    color:#222;
}

/* =========================
   EMPTY STATE
========================= */
.empty-state-box{
    padding:28px;
    text-align:center;
    background:#f8fafc;
    border:1px dashed #d1d5db;
    border-radius:14px;
}

.empty-state-box h3{
    margin-bottom:10px;
    font-size:1.4rem;
    line-height:1.3;
    color:#111827;
}

.empty-state-box p{
    color:#565959;
    margin-bottom:12px;
    line-height:1.5;
}

.empty-state-actions{
    display:flex;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
    margin:16px 0;
}

.empty-state-help{
    margin-top:18px;
    color:#666;
    font-size:14px;
    line-height:1.5;
}

/* =========================
   FOOTER
========================= */
.footer{
    margin-top:34px;
    background:var(--secondary);
    color:#fff;
}

.footer-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:24px;
    padding:36px 0;
}

.footer-grid h4{
    margin-bottom:10px;
    line-height:1.3;
}

.footer-grid a{
    display:block;
    color:#ddd;
    margin-bottom:8px;
    font-size:.94rem;
    line-height:1.45;
}

.footer-grid p{
    line-height:1.5;
}

.footer-copy{
    text-align:center;
    padding:14px;
    background:var(--primary);
    font-size:.9rem;
    line-height:1.4;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1200px){
    .grid-products{
        grid-template-columns:repeat(4, 1fr);
    }
}

@media (max-width: 1100px){
    .provider-panels-grid{
        grid-template-columns:1fr;
    }
}

@media (max-width: 992px){
    .topbar-inner{
        grid-template-columns:1fr;
    }

    .top-links{
        justify-content:flex-start;
    }

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

    .grid-categories{
        grid-template-columns:repeat(2, 1fr);
    }

    .grid-products{
        grid-template-columns:repeat(2, 1fr);
    }

    .dashboard-cards{
        grid-template-columns:repeat(2,1fr);
    }

    .footer-grid{
        grid-template-columns:repeat(2,1fr);
    }
}

@media (max-width: 900px){
    .nav-proveedor{
        justify-content:flex-start;
        overflow-x:auto;
        flex-wrap:nowrap;
        padding:12px 14px;
        gap:10px;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:thin;
    }

    .nav-proveedor a{
        flex:0 0 auto;
        font-size:13px;
        padding:10px 14px;
        min-height:40px;
        line-height:1.35;
    }

    .dashboard-header{
        padding:22px 18px;
    }

    .dashboard-header h1{
        font-size:1.7rem;
    }

    .card-body{
        padding:18px;
    }

    .empty-state-box{
        padding:22px 16px;
    }

    .empty-state-box h3{
        font-size:1.2rem;
    }

    .btn{
        min-height:40px;
        line-height:1.35;
    }
}

@media (max-width: 768px){
    .form-grid{
        grid-template-columns:1fr;
    }

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

@media (max-width: 576px){
    .grid-categories,
    .grid-products,
    .dashboard-cards,
    .footer-grid{
        grid-template-columns:1fr;
    }

    .hero{
        padding:24px;
    }

    .hero h1{
        font-size:1.85rem;
    }

    .container{
        width:min(1400px, 96%);
    }
}
.roles-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
    margin-top:10px;
}

.role-card{
    display:flex;
    gap:12px;
    align-items:flex-start;
    padding:14px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#f8fafc;
    cursor:pointer;
    transition:.2s ease;
}

.role-card:hover{
    background:#fff7e6;
    border-color:#f3c76b;
}

.role-card input[type="checkbox"]{
    margin-top:3px;
    transform:scale(1.1);
}

.role-card-content{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.role-card-content strong{
    line-height:1.3;
    color:#111827;
}

.role-card-content span{
    font-size:14px;
    color:#666;
    line-height:1.45;
}

.users-role-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.user-role-item{
    padding:14px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#f8fafc;
    display:flex;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
    align-items:flex-start;
}

.user-role-email{
    margin-top:4px;
    font-size:14px;
    color:#666;
    line-height:1.4;
}

.user-role-badges{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

@media (max-width: 900px){
    .roles-grid{
        grid-template-columns:1fr;
    }
}