/* ============================================================
   MMC Metrología – Estilo B: Industrial Técnico
   Layout compatible con Bootstrap 5 (dashboard tipo GloBash)
   ============================================================ */

:root {
    --mmc-naranja:      #F26022;
    --mmc-naranja-dark: #D44F15;
    --mmc-azul-gris:    #648A9F;
    --mmc-azul-gris-dark: #4F6D7F;
    --mmc-blanco-metal: #EEF0EF;
    --mmc-negro:        #030404;
    --mmc-texto:        #3A3A3A;
    --mmc-texto-light:  #5C5C5C;
    --mmc-borde:        #D8DEE2;
    --mmc-card:         #F7F9FA;
    --mmc-success:      #1E8F4F;
    --mmc-warning:      #F1A43C;
    --mmc-danger:       #D64545;
    --mmc-info:         #4F7DBF;
}

/* Fondo general */
body {
    background-color: var(--mmc-blanco-metal);
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--mmc-texto);
    margin: 0;
}

/* ================== SIDEBAR ================== */

.sidebar {
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #12212B 0%, #020617 100%);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
    z-index: 100;
    box-shadow: 4px 0 18px rgba(0,0,0,0.4);
}

.sidebar h2 {
    color: var(--mmc-naranja);
    text-align: center;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

.sidebar a {
    color: #CED4DA;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: 0.16s ease;
}

.sidebar a i {
    font-size: 1rem;
}

.sidebar a.active,
.sidebar a:hover {
    background-color: var(--mmc-naranja);
    color: #fff;
}

/* ================== MAIN ================== */

.main {
    margin-left: 260px;
    padding: 20px;
    /* ✅ 2mm extra hacia la derecha (solo del contenido interno) */
    padding-left: calc(20px + 2mm);
}

/* Nav interna del dashboard */
.navbar-main {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(15,23,42,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--mmc-texto);
    border: 1px solid var(--mmc-borde);
    font-size: 0.9rem;
}

/* ================== BOTONES RÁPIDOS ================== */

.quick-btn {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    background: var(--mmc-naranja);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 4px 6px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: 0.15s ease;
}

.quick-btn i {
    font-size: 1rem;
}

.quick-btn:hover {
    background: var(--mmc-naranja-dark);
    color: #fff;
}

/* ================== CARDS ================== */

.card {
    background: var(--mmc-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--mmc-borde);
    box-shadow: 0 2px 10px rgba(15,23,42,0.06);
    color: var(--mmc-texto);
}

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

.card.text-center > div:first-child {
    font-size: 0.85rem;
    color: var(--mmc-texto-light);
    margin-bottom: 4px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--mmc-naranja);
}

/* ================== TABLAS ================== */

.table-responsive { width: 100%; }

table.table {
    margin-bottom: 0;
    background: #ffffff;
}

.table th {
    background-color: var(--mmc-azul-gris);
    color: #fff;
    font-size: 0.8rem;
    border-bottom: none;
}

.table td {
    font-size: 0.8rem;
}

/* Badges de estado */
.badge-small {
    padding: 4px 9px;
    font-size: 0.75rem;
    border-radius: 999px;
}

.badge-pend  { background:#FFF7E6; color:#A15E00; }
.badge-rep   { background:#E7F7EC; color:#157347; }
.badge-del   { background:#FFE8DC; color:#B6571F; }

/* ================== ALERTAS ================== */

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #E7F3FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* ================== BOTONES BS ================== */

.btn-primary {
    background-color: var(--mmc-naranja);
    border: none;
}

.btn-primary:hover {
    background-color: var(--mmc-naranja-dark);
}

.btn-warning {
    background-color: var(--mmc-warning);
    border: none;
    color: #111827;
}

.btn-warning:hover {
    background-color: #E58F27;
}

.btn-danger {
    background-color: var(--mmc-danger);
    border: none;
}

/* ================== CARRUSEL + FOOTER ================== */

.logos-marcas-container {
    background: #ffffff;
    padding: 6px 0;
    border-top: 1px solid var(--mmc-borde);
    overflow: hidden;
    margin-top: 12px;
}

.logos-marcas-strip {
    display: flex;
    gap: 40px;
    animation: slideLogos 22s linear infinite;
}

.logos-marcas-strip img {
    height: 60px;
    filter: grayscale(0.7);
    opacity: 0.85;
    transition: 0.3s ease;
}

.logos-marcas-strip img:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.06);
}

@keyframes slideLogos {
    from { transform: translateX(0); }
    to   { transform: translateX(-60%); }
}

.footer-futurista {
    width: 100%;
    padding: 14px 10px 18px;
    text-align: center;
    background: #F8FAFC;
    color: #6B7280;
    font-size: 0.8rem;
    border-top: 1px solid var(--mmc-borde);
}

.footer-futurista a {
    color: var(--mmc-naranja);
    text-decoration: none;
    font-weight: 600;
}

.footer-futurista a:hover {
    color: var(--mmc-naranja-dark);
}

/* ================== RESPONSIVE ================== */

@media (max-width: 991px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 10px;
    }
    .sidebar h2 {
        display: none;
    }
    .sidebar a {
        white-space: nowrap;
        margin-right: 6px;
    }
    .main {
        margin-left: 0;
        padding-top: 16px;
        /* en móvil no aplica el 2mm extra (se usa el padding normal) */
        padding-left: 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .navbar-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Tablas como cards en móvil */
@media (max-width: 767px) {
    table thead { display: none; }
    table tbody tr {
        display: block;
        background: #ffffff;
        margin-bottom: 10px;
        border-radius: 10px;
        padding: 10px;
        box-shadow: 0 2px 8px rgba(15,23,42,0.08);
    }
    table tbody tr td {
        display: flex;
        justify-content: space-between;
        padding: 5px 6px;
    }
    table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--mmc-texto-light);
        margin-right: 8px;
        font-size: 0.78rem;
    }
}

/* ================== AJUSTE LAYOUT ESCRITORIO ==================
   Mueve TODO el contenido a la derecha cuando existe un sidebar fijo
   para que el dashboard y tablas no queden "debajo" del menú lateral.
   Solo aplica en pantallas grandes.
   ============================================================ */

@media (min-width: 992px) {
    body {
        padding-left: 260px; /* ancho sidebar + margen */
    }
}

/* En móvil / tablet el contenido vuelve a ocupar todo el ancho */
@media (max-width: 991px) {
    body {
        padding-left: 0;
    }
}

/* Desactivar hover naranja SOLO en el logo del sidebar */
.sidebar a.sidebar-logo-link:hover {
    background-color: transparent;
}
