/* 
 * PT Acuna (migrated UI base)
 * Based on supportpq/public/css/style.css
 */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.15s ease-in-out;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
}

/* Top navigation layout (full-width content for wide tables) */
.app-topbar {
    background: linear-gradient(135deg, #8fb3ff 0%, #9d8fe8 100%);
    box-shadow: 0 2px 14px rgba(0,0,0,0.12);
}

.app-topbar .navbar-brand,
.app-topbar .nav-link {
    color: #ffffff;
}

.app-topbar .nav-link {
    font-weight: 500;
    opacity: 0.9;
    padding: 0.75rem 1rem;
}

.app-topbar .nav-link:hover {
    opacity: 1;
    background: rgba(255,255,255,.10);
}

.app-topbar .nav-link.active {
    opacity: 1;
    background: rgba(255,255,255,.9);
    color: #2a3f8f;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.app-page-header {
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.app-page-header + main.container-fluid {
    margin-top: 1rem;
}

/* Report tables (professional readable palette) */
.report-table {
    --rt-border: #e5e7eb;
    --rt-head: #f8fafc;
    --rt-employee: #eef2ff;
    --rt-detail: #ffffff;
    --rt-zebra: #fbfdff;
    --rt-total: #e7f1ff;
    --rt-text: #111827;
    --rt-muted: #6b7280;
}

.report-table th,
.report-table td {
    border-color: var(--rt-border) !important;
    color: var(--rt-text);
    vertical-align: middle;
}

.report-table thead th {
    background: var(--rt-head) !important;
    color: var(--rt-text);
    font-weight: 600;
    white-space: nowrap;
}

.report-table .report-row-employee td {
    background: var(--rt-employee) !important;
    font-weight: 600;
}

.report-table .report-row-detail td {
    background: var(--rt-detail) !important;
}

/* Shops Bonus: shop group headers/subtotals keep their own backgrounds (not zebra by tbody index). */
.report-table tbody tr:not(.report-row-employee):not(.report-row-total):not(.shops-bonus-shop-heading):not(.shops-bonus-shop-subtotal):nth-child(even) td {
    background: var(--rt-zebra);
}

.report-table .report-row-total td {
    background: var(--rt-total) !important;
    font-weight: 700;
}

.report-table .report-muted {
    color: var(--rt-muted);
}

/* Compact filter bars (inputs/buttons smaller) */
.filter-bar .form-label {
    font-size: 0.80rem;
    margin-bottom: 0.25rem;
    color: #4b5563;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    min-height: calc(1.5em + 0.5rem + 2px);
}

.filter-bar .btn {
    font-size: 0.875rem;
    padding: 0.25rem 0.6rem;
}

.filter-bar .form-check-label {
    font-size: 0.85rem;
}

.filter-bar .form-check-input {
    transform: scale(0.92);
    transform-origin: left center;
}

/* Executive: spacing between From / To date fields */
.exec-filter-dates .form-control[type="date"] {
    min-width: 9.5rem;
}

@media (min-width: 768px) {
    /* Make filters narrower on desktop */
    .filter-bar .form-control[type="date"] {
        width: 165px;
        max-width: 165px;
    }

    .filter-bar .form-select {
        width: 220px;
        max-width: 220px;
    }

    .filter-bar .btn {
        width: auto !important;
    }
}

/* Filter panel width (centered) */
.filter-panel {
    width: 100%;
}

@media (min-width: 992px) {
    .filter-panel {
        max-width: 50%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Dashboard tiles (stat cards style, similar to mantenimiento/admin/dashboard.php) */
.dashboard-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    padding: 1.75rem 1.25rem;
    background: #ffffff;
    color: #343a40;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-tile__icon {
    font-size: 2.1rem;
    margin-left: 0.75rem;
}

.dashboard-tile__label {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 1.05rem;
}

.dashboard-tile__icon i,
.dashboard-tile__icon span {
    color: inherit;
}

.dashboard-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.dashboard-tile--primary {
    border-left-color: #007bff;
    color: #007bff;
}

.dashboard-tile--accent {
    border-left-color: #20c997;
    color: #20c997;
}

.dashboard-tile--teal {
    border-left-color: #17a2b8;
    color: #17a2b8;
}

.dashboard-tile--purple {
    border-left-color: #6f42c1;
    color: #6f42c1;
}

.dashboard-tile--orange {
    border-left-color: #f39c12;
    color: #f39c12;
}

.dashboard-tile--topbonus {
    border-left-color: #b8860b;
    color: #b8860b;
}

.dashboard-tile--slate {
    border-left-color: #6c757d;
    color: #6c757d;
}

/* Generic narrower panel for settings pages */
.settings-panel {
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1200px) {
    .settings-panel {
        max-width: 75%;
    }
}

/* Extra narrow layout for specific screens (e.g. settings/shops) */
.settings-panel--shops-compact {
    max-width: 40% !important;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .settings-panel--shops-compact {
        max-width: 100% !important;
    }
}

/* 40% compact layout for specific settings pages */
.settings-panel--40-compact {
    max-width: 40% !important;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .settings-panel--40-compact {
        max-width: 100% !important;
    }
}

/* 50% compact layout for medium-width filter cards */
.settings-panel--50-compact {
    max-width: 50% !important;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .settings-panel--50-compact {
        max-width: 100% !important;
    }
}

/* Extra narrow layout for specific screens (e.g. settings/bonus/new) */
.settings-panel--bonus-compact {
    max-width: 40% !important;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .settings-panel--bonus-compact {
        max-width: 100% !important;
    }
}

/* Dashboard pages: main content at 80% width (centered) */
.dashboard-page-80 {
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

@media (max-width: 991.98px) {
    .dashboard-page-80 {
        max-width: 100%;
    }
}

/* Extra colors for individual shop cards */
.dashboard-tile--chute {
    border-left-color: #6610f2; /* indigo */
    color: #6610f2;
}

.dashboard-tile--aluminum {
    border-left-color: #198754; /* green */
    color: #198754;
}

.dashboard-tile--hopper {
    border-left-color: #fd7e14; /* orange */
    color: #fd7e14;
}

.dashboard-tile--pedestal {
    border-left-color: #e83e8c; /* pink */
    color: #e83e8c;
}

.dashboard-tile--general-shop {
    border-left-color: #6f42c1; /* violet */
    color: #6f42c1;
}

.dashboard-tile--pedestal-serial {
    border-left-color: #c2185b; /* deeper pink */
    color: #c2185b;
}

.dashboard-tile--efficiency {
    border-left-color: #20c997; /* teal */
    color: #20c997;
}

.dashboard-tile--accessories {
    border-left-color: #0dcaf0; /* cyan */
    color: #0dcaf0;
}

/* Production (/production, /production/new, view, edit): fondo y paneles suaves (fatiga visual) */
.production-fatigue-wrap {
    background:
        radial-gradient(ellipse 110% 70% at 50% -10%, rgba(255, 255, 255, 0.9) 0%, transparent 55%),
        linear-gradient(175deg, #f3f7fd 0%, #e6eef8 48%, #eef3f9 100%);
    border: 1px solid rgba(37, 72, 120, 0.1);
    border-radius: 14px;
    padding: 1rem 1.25rem 1.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.production-fatigue-wrap .card.settings-panel {
    --bs-card-bg: transparent;
    background: linear-gradient(185deg, rgba(255, 255, 255, 0.88) 0%, #f2f7fc 55%, #e9f1f9 100%);
    border: 1px solid rgba(37, 72, 120, 0.14);
    box-shadow: 0 4px 14px rgba(15, 40, 80, 0.06);
}

.production-fatigue-wrap .card.settings-panel .card-body {
    background: transparent;
}

/* Tablas: rayado y encabezado más suaves (menos blanco/gris duro) */
.production-fatigue-wrap .table {
    --bs-table-bg: rgba(252, 253, 255, 0.97);
    --bs-table-striped-bg: rgba(218, 230, 245, 0.42);
    --bs-table-border-color: rgba(37, 72, 120, 0.1);
    color: #1e293b;
}

.production-fatigue-wrap .table > :not(caption) > * > * {
    border-color: rgba(37, 72, 120, 0.08);
}

.production-fatigue-wrap .table thead th {
    background: linear-gradient(180deg, #f0f6fc 0%, #e6eef6 100%);
    color: #334155;
    font-weight: 600;
    border-bottom-color: rgba(37, 72, 120, 0.12);
}

.production-fatigue-wrap .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(244, 249, 255, 0.92);
}

.production-fatigue-wrap .table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-accent-bg: rgba(218, 230, 245, 0.35);
}

/* --------------------------------------------------------------------------
   Scroll vertical + encabezado de tabla fijo (dashboards / settings / production)
   Uso: <div class="table-responsive table-scroll-sticky-wrap">…</div>
   -------------------------------------------------------------------------- */
.table-responsive.table-scroll-sticky-wrap {
    max-height: calc(100vh - 260px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive.table-scroll-sticky-wrap > table thead th {
    position: sticky;
    z-index: 2;
    box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Fondos opacos: variables BS / *-subtle suelen llevar alpha y el tbody se ve al scroll */
.table-responsive.table-scroll-sticky-wrap > table thead.table-light th:not([class*="bg-"]) {
    background-color: #f8f9fa !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead:not(.table-light) th:not([class*="bg-"]) {
    background-color: #ffffff !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-primary-subtle {
    background-color: #cfe2ff !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-success-subtle {
    background-color: #d1e7dd !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-secondary-subtle {
    background-color: #e2e3e5 !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-info-subtle {
    background-color: #cff4fc !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-warning-subtle {
    background-color: #fff3cd !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead th.bg-danger-subtle {
    background-color: #f8d7da !important;
}

.table-responsive.table-scroll-sticky-wrap > table thead tr:first-child th {
    top: 0;
    z-index: 6;
}

.table-responsive.table-scroll-sticky-wrap > table thead tr:nth-child(2) th {
    top: 2.35rem;
    z-index: 5;
}

.production-fatigue-wrap .table-responsive.table-scroll-sticky-wrap > table thead th {
    background: linear-gradient(180deg, #f0f6fc 0%, #e6eef6 100%) !important;
    color: #334155;
    font-weight: 600;
}


