﻿/* =========================================================
   app.css (global)
   - Base Blazor template
   - Utilidades responsive (hide/show)
   - Layout helpers (scroll cards)
   - Look TIENDA7/Maitre7 dark con MudBlazor
   - Tablas (light + dark) estilo “Manager”
   ========================================================= */

/* --------------------------
   Base (template)
   -------------------------- */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* --------------------------
   Blazor error UI
   -------------------------- */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiI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DkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* --------------------------
   Loading (Blazor)
   -------------------------- */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* =========================================================
   Utilidades responsive (global)
   ========================================================= */

.hide-on-mobile {
    display: inline !important;
}

.show-on-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }

    .show-on-mobile {
        display: flex !important;
    }
    /* en tus menús móviles suele ser flex */
}

/* =========================================================
   Helpers de layout / scroll (global)
   ========================================================= */

:root {
    --t7-verde-accion: #2e7d32;
    --t7-verde-accion-disabled: rgba(46, 125, 50, 0.45);
}

.acciones-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 769px) {
    .hide-on-mobile.acciones-header {
        display: flex !important;
    }
}

@media (max-width: 768px) {
.hide-on-mobile.acciones-header {
    display: none !important;
}
}

.contenido-centrado {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    background-color: rgba(0, 0, 0, 0.0);
}

.accion-verde-fijo {
    background-color: var(--t7-verde-accion) !important;
    color: #fff !important;
}

.accion-verde-fijo.mud-disabled {
    background-color: var(--t7-verde-accion-disabled) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Página sin scroll externo (scroll interno en card) */
.page-full {
    height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-scroll {
    flex: 1;
    overflow: hidden;
    min-height: 0; /* clave en flex para que overflow funcione */
}

.card-scroll {
    height: 100%;
    overflow: auto;
}

/* Card grande scrollable (como tu “arqueos”) */
.full-height-scrollable-arqueos {
    height: calc(100vh - 200px);
    overflow-y: auto;
    width: 90%;
    margin: 0 auto;
    margin-top: 20px;
}

@media (max-width: 767px) {
    .full-height-scrollable-arqueos {
        width: 100%;
    }
}

/* =========================================================
   LOOK TIENDA7 / MAÎTRE (MudBlazor Dark)
   ========================================================= */

/* Fondo general negro */
body.mud-theme-dark {
    background-color: #1a1a1a !important;
}

    /* AppBar gris oscuro */
    body.mud-theme-dark .mud-appbar {
        background-color: #2d2d2d !important;
    }

    /* Drawer gris oscuro */
    body.mud-theme-dark .mud-drawer {
        background-color: #2d2d2d !important;
    }

    /* Superficies (cards/containers) */
    body.mud-theme-dark .mud-paper,
    body.mud-theme-dark .mud-card,
    body.mud-theme-dark .mud-container,
    body.mud-theme-dark .mud-main-content {
        background-color: transparent;
    }

        /* Si quieres que ciertas papers tengan surface */
        body.mud-theme-dark .mud-paper.mud-elevation-0,
        body.mud-theme-dark .mud-paper.mud-elevation-1,
        body.mud-theme-dark .mud-paper.mud-elevation-2 {
            background-color: #2d2d2d !important;
        }

/* =========================================================
   Tablas (light + dark) estilo “Manager”
   ========================================================= */

/* Contenedores de tabla */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

/* Tablas base */
table,
.table,
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

    /* Headers - Light */
    table thead th,
    table th,
    .table thead th,
    .table th,
    table.table thead th,
    table.table th {
        background-color: #1976d2 !important;
        color: white !important;
        padding: 12px 8px !important;
        font-weight: 600 !important;
        border: 1px solid #1565c0 !important;
        text-align: left !important;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Celdas - Light */
    table tbody td,
    table td,
    .table tbody td,
    .table td,
    table.table tbody td,
    table.table td {
        padding: 8px !important;
        border-bottom: 1px solid var(--mud-palette-lines-default) !important;
        color: var(--mud-palette-text-primary) !important;
        transition: background-color 0.2s ease;
    }

    /* Hover - Light */
    table tbody tr:hover,
    table tr:hover,
    .table tbody tr:hover,
    .table tr:hover,
    table.table tbody tr:hover,
    table.table tr:hover {
        background-color: rgba(25, 118, 210, 0.05) !important;
    }

    /* Alternas - Light */
    table tbody tr:nth-child(even),
    .table tbody tr:nth-child(even),
    table.table tbody tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02) !important;
    }

/* Utilidades */
.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

/* ==========================
   Dark mode - Tablas
   ========================== */

.mud-theme-dark .table-responsive,
body.mud-theme-dark .table-responsive,
html.mud-theme-dark .table-responsive {
    background: var(--mud-palette-surface) !important;
    border-color: rgba(114, 192, 44, 0.2) !important;
}

.mud-theme-dark table,
.mud-theme-dark .table,
.mud-theme-dark table.table,
body.mud-theme-dark table,
body.mud-theme-dark .table,
body.mud-theme-dark table.table,
html.mud-theme-dark table,
html.mud-theme-dark .table,
html.mud-theme-dark table.table {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

    /* Headers - Dark */
    .mud-theme-dark table thead th,
    .mud-theme-dark table th,
    .mud-theme-dark .table thead th,
    .mud-theme-dark .table th,
    .mud-theme-dark table.table thead th,
    .mud-theme-dark table.table th,
    body.mud-theme-dark table thead th,
    body.mud-theme-dark table th,
    body.mud-theme-dark .table thead th,
    body.mud-theme-dark .table th,
    body.mud-theme-dark table.table thead th,
    body.mud-theme-dark table.table th,
    html.mud-theme-dark table thead th,
    html.mud-theme-dark table th,
    html.mud-theme-dark .table thead th,
    html.mud-theme-dark .table th,
    html.mud-theme-dark table.table thead th,
    html.mud-theme-dark table.table th {
        background-color: #2d2d2d !important;
        color: #72c02c !important;
        border-color: rgba(114, 192, 44, 0.3) !important;
    }

    /* Celdas - Dark */
    .mud-theme-dark table tbody td,
    .mud-theme-dark table td,
    .mud-theme-dark .table tbody td,
    .mud-theme-dark .table td,
    .mud-theme-dark table.table tbody td,
    .mud-theme-dark table.table td,
    body.mud-theme-dark table tbody td,
    body.mud-theme-dark table td,
    body.mud-theme-dark .table tbody td,
    body.mud-theme-dark .table td,
    body.mud-theme-dark table.table tbody td,
    body.mud-theme-dark table.table td,
    html.mud-theme-dark table tbody td,
    html.mud-theme-dark table td,
    html.mud-theme-dark .table tbody td,
    html.mud-theme-dark .table td,
    html.mud-theme-dark table.table tbody td,
    html.mud-theme-dark table.table td {
        color: var(--mud-palette-text-primary) !important;
        border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    }

    /* Hover - Dark */
    .mud-theme-dark table tbody tr:hover,
    .mud-theme-dark table tr:hover,
    .mud-theme-dark .table tbody tr:hover,
    .mud-theme-dark .table tr:hover,
    .mud-theme-dark table.table tbody tr:hover,
    .mud-theme-dark table.table tr:hover,
    body.mud-theme-dark table tbody tr:hover,
    body.mud-theme-dark table tr:hover,
    body.mud-theme-dark .table tbody tr:hover,
    body.mud-theme-dark .table tr:hover,
    body.mud-theme-dark table.table tbody tr:hover,
    body.mud-theme-dark table.table tr:hover,
    html.mud-theme-dark table tbody tr:hover,
    html.mud-theme-dark table tr:hover,
    html.mud-theme-dark .table tbody tr:hover,
    html.mud-theme-dark .table tr:hover,
    html.mud-theme-dark table.table tbody tr:hover,
    html.mud-theme-dark table.table tr:hover {
        background-color: rgba(114, 192, 44, 0.08) !important;
    }

    /* Alternas - Dark */
    .mud-theme-dark table tbody tr:nth-child(even),
    .mud-theme-dark .table tbody tr:nth-child(even),
    .mud-theme-dark table.table tbody tr:nth-child(even),
    body.mud-theme-dark table tbody tr:nth-child(even),
    body.mud-theme-dark .table tbody tr:nth-child(even),
    body.mud-theme-dark table.table tbody tr:nth-child(even),
    html.mud-theme-dark table tbody tr:nth-child(even),
    html.mud-theme-dark .table tbody tr:nth-child(even),
    html.mud-theme-dark table.table tbody tr:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.02) !important;
    }

/* ==========================
   Responsive tablas
   ========================== */

@media (max-width: 768px) {
    table {
        font-size: 12px;
    }

        table thead th, table th {
            padding: 8px 4px;
        }

        table tbody td, table td {
            padding: 6px 4px;
        }

    .table-responsive {
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 11px;
    }

        table thead th, table th {
            padding: 6px 2px;
        }

        table tbody td, table td {
            padding: 4px 2px;
        }
}
