/* =============================================================
   app.css  —  BDArticulos
   Todos los estilos globales de la aplicación.
   Cargado desde layouts/app.blade.php y layouts/auth.blade.php
   ============================================================= */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --primary:       #1a3a5c;
    --primary-light: #2563a8;
    --accent:        #e8a000;
    --accent-light:  #f5b731;
    --surface:       #f8fafc;
    --surface-card:  #ffffff;
    --text-main:     #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --radius:        10px;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--surface);
    color: var(--text-main);
    min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.main-navbar {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2744 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    padding: 0;
}
.main-navbar .navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff !important;
    letter-spacing: -0.3px;
    padding: 14px 0;
}
.main-navbar .navbar-brand span { color: var(--accent-light); }
.main-navbar .nav-link {
    color: rgba(255,255,255,0.82) !important;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    padding: 20px 16px !important;
    transition: color 0.2s, background 0.2s;
    position: relative;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}
.main-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 16px; right: 16px;
    height: 3px;
    background: var(--accent-light);
    border-radius: 3px 3px 0 0;
}
.main-navbar .dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    margin-top: 0;
    min-width: 210px;
}
.main-navbar .dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: background 0.15s;
}
.main-navbar .dropdown-item:hover {
    background: var(--surface);
    color: var(--primary);
}
.main-navbar .dropdown-item i { width: 20px; color: var(--text-muted); }
.main-navbar .dropdown-divider { margin: 4px 0; }

.nav-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

/* User pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 5px 14px 5px 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-pill:hover { background: rgba(255,255,255,0.18); }
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.78rem; color: #fff;
}
.user-pill .user-name {
    color: #fff;
    font-size: 0.84rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-pill .user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.6);
    display: block;
    line-height: 1;
}

/* ── CONTENT ────────────────────────────────────────────────── */
.page-content {
    padding: 32px 0;
    min-height: calc(100vh - 64px);
}
.page-header { margin-bottom: 28px; }
.page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.page-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border: none; font-size: 0.88rem; }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.55);
    text-align: center;
    padding: 14px;
    font-size: 0.78rem;
}

/* ── ROLE BADGES ────────────────────────────────────────────── */
.badge-superadmin { background: #7c3aed; color: #fff; }
.badge-admin      { background: #0284c7; color: #fff; }
.badge-compras    { background: #059669; color: #fff; }
.badge-proveedor  { background: #BF2288; color: #fff; }

/* ── AUTH (login / forgot / reset) ─────────────────────────── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2744 0%, #1a3a5c 40%, #1e4976 100%);
    position: relative;
    overflow: hidden;
}
.auth-body::before {
    content: '';
    position: fixed;
    top: -150px; right: -150px;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(232,160,0,0.08);
    pointer-events: none;
}
.auth-body::after {
    content: '';
    position: fixed;
    bottom: -100px; left: -100px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: rgba(37,99,168,0.15);
    pointer-events: none;
}
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .brand {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}
.auth-logo .brand span { color: var(--accent-light); }
.auth-logo .tagline {
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    margin-top: 2px;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    padding: 36px 36px 32px;
}
.auth-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.auth-card .subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 26px;
}
.auth-card .form-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.auth-card .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,0.12);
}
.auth-card .input-group .form-control { border-right: none; }
.auth-card .input-group .btn-outline-secondary {
    border: 1.5px solid #e2e8f0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: #94a3b8;
    background: #fff;
}
.btn-primary-auth {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.2px;
    width: 100%;
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-primary-auth:hover { opacity: 0.92; transform: translateY(-1px); color: #fff; }
.auth-links a {
    color: var(--primary-light);
    font-size: 0.83rem;
    text-decoration: none;
    font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }
.is-invalid { border-color: #ef4444 !important; }
.invalid-feedback { font-size: 0.78rem; }

/* ── MENÚ PRINCIPAL (módulos) ───────────────────────────────── */
.module-card {
    border-radius: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1.5px solid var(--border);
    cursor: pointer;
}
.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.module-icon {
    width: 60px; height: 60px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
}
.module-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px;
}
.module-desc {
    color: var(--text-muted);
    font-size: 0.86rem;
    margin: 0;
    line-height: 1.5;
}
.module-arrow {
    font-size: 0.83rem;
    font-weight: 600;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

/* ── MÓDULO DISEÑO (layout dos paneles) ─────────────────────── */
.diseno-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 145px);
    min-height: 560px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Panel izquierdo — lista */
.panel-lista {
    width: 270px;
    min-width: 200px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    flex-shrink: 0;
}
.panel-lista .lista-header {
    padding: 14px 12px 10px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.panel-lista .lista-header h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary);
    margin: 0 0 8px;
}
.search-box { display: flex; gap: 5px; }
.search-box input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 6px 9px;
    font-size: .82rem;
    background: #f8fafc;
}
.search-box input:focus { outline: none; border-color: var(--primary-light); background: #fff; }
.btn-search {
    background: var(--primary);
    border: none;
    border-radius: 7px;
    color: #fff;
    padding: 0 9px;
    font-size: .8rem;
    cursor: pointer;
}
.lista-count {
    font-size: .72rem;
    color: var(--text-muted);
    padding: 4px 12px 5px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.lista-scroll { flex: 1; overflow-y: auto; padding: 3px 0; }
.lista-scroll::-webkit-scrollbar { width: 4px; }
.lista-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.lista-item {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    cursor: pointer;
    font-size: .84rem;
    color: var(--text-main);
    border-left: 3px solid transparent;
    transition: background .12s;
    text-decoration: none;
    gap: 6px;
}
.lista-item:hover { background: #e8f0fe; color: var(--primary); text-decoration: none; }
.lista-item.active {
    background: #dbe8ff;
    border-left-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.item-id { font-size: .68rem; color: #94a3b8; min-width: 26px; }

/* Panel derecho — detalle */
.panel-detalle {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.panel-detalle::-webkit-scrollbar { width: 5px; }
.panel-detalle::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
.detalle-header {
    padding: 14px 22px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detalle-header h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.detalle-body { padding: 18px 22px; flex: 1; }
.seccion-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.field-group { flex: 1; min-width: 160px; }
.field-group label { display: block; font-size: .77rem; font-weight: 600; color: #374151; margin-bottom: 3px; }
.field-group .form-control,
.field-group .form-select {
    font-size: .86rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 11px;
}
.field-group .form-control:focus,
.field-group .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,.1);
}

/* Colores */
.colores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.color-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s;
}
.color-card:hover { box-shadow: var(--shadow-md); }
.color-card-header {
    background: var(--primary);
    color: #fff;
    padding: 6px 11px;
    font-size: .77rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.btn-remove-color {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.65);
    padding: 0;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1;
    transition: color .15s;
}
.btn-remove-color:hover { color: #fca5a5; }
.fotos-row { display: grid; grid-template-columns: 1fr 1fr; }
.foto-slot {
    position: relative;
    aspect-ratio: 1;
    background: #f1f5f9;
    overflow: hidden;
    border-right: 1px solid var(--border);
}
.foto-slot:last-child { border-right: none; }
.foto-slot img { width: 100%; height: 100%; object-fit: cover; }
.foto-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 3px;
    color: #cbd5e1; font-size: .68rem;
}
.foto-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.42);
    opacity: 0; transition: opacity .2s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.foto-slot:hover .foto-overlay { opacity: 1; }
.btn-foto-action {
    background: rgba(255,255,255,.9);
    border: none; border-radius: 6px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .8rem; color: var(--primary);
}
.btn-foto-action:hover { background: #fff; }
.file-input-hidden { display: none; }

/* Formularios diseño */
.panel-nuevo {
    background: #f0f7ff;
    border: 1.5px dashed #93c5fd;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.btn-guardar {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}
.btn-guardar:hover { opacity: .87; color: #fff; }
.btn-peligro {
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-peligro:hover { background: #fff1f1; }
.add-color-form {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .diseno-layout { flex-direction: column; height: auto; }
    .panel-lista { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
}
