/* ComplementaGestion v3 - Custom Styles */

:root {
    --cg-primary: #0d6efd;
    --cg-secondary: #6c757d;
    --cg-success: #198754;
    --cg-danger: #dc3545;
    --cg-warning: #ffc107;
    --cg-info: #0dcaf0;
    --cg-light: #f8f9fa;
    --cg-dark: #212529;
    --cg-sidebar-width: 250px;
    /* Typography - modify these two values to change font globally.
       --cg-font-size affects ALL elements (menus, tables, modals, titles, breadcrumbs, etc.)
       since Bootstrap and custom styles use rem units relative to this base. */
    --cg-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cg-font-size: 14px;
}

/* Set base font on html so ALL rem units scale proportionally */
html {
    font-size: var(--cg-font-size);
}

/* Layout */
body {
    min-height: 100vh;
    background-color: #f5f7fa;
    font-family: var(--cg-font-family);
}

#app-container {
    min-height: calc(100vh - 56px);
    padding: 0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cg-primary) 0%, #0b5ed7 100%);
}

/* Login loading overlay - shown while auth is validating */
.login-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.login-card {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card .logo {
    font-size: 3rem;
    color: var(--cg-primary);
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    color: var(--cg-secondary);
    margin-bottom: 2rem;
}

.btn-google {
    background-color: white;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
    padding: 0.625rem 1rem;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--cg-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

/* Dashboard */
.dashboard-header {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .label {
    color: var(--cg-secondary);
    font-size: 0.875rem;
}

/* Content Area */
.content-wrapper {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--cg-secondary);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* File Browser */
.file-browser {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-browser-toolbar {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-browser-path {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-family: monospace;
    font-size: 0.875rem;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item .file-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.file-item .file-icon.folder {
    color: #ffc107;
}

.file-item .file-icon.file {
    color: var(--cg-secondary);
}

.file-item .file-name {
    flex: 1;
    font-weight: 500;
}

.file-item .file-size {
    color: var(--cg-secondary);
    font-size: 0.875rem;
    margin-right: 1rem;
}

.file-item .file-date {
    color: var(--cg-secondary);
    font-size: 0.875rem;
}

.file-item .file-actions {
    opacity: 0;
    transition: opacity 0.15s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: #fafafa;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--cg-primary);
    background-color: rgba(13, 110, 253, 0.05);
}

.upload-zone .icon {
    font-size: 3rem;
    color: var(--cg-secondary);
    margin-bottom: 1rem;
}

.upload-zone.dragover .icon {
    color: var(--cg-primary);
}

/* Client Selector */
.client-selector {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.client-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: var(--cg-primary);
    color: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.client-badge i {
    margin-right: 0.375rem;
}

/* Forms */
.form-floating > label {
    color: var(--cg-secondary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cg-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .file-item .file-date {
        display: none;
    }

    .file-item .file-actions {
        opacity: 1;
    }
}

/* Toast customization */
.toast {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Sidebar Navigation
   ============================================ */

/* Sidebar base */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cg-sidebar-width);
    height: 100vh;
    background: #1a1f2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.75rem;
}

.sidebar-logo {
    height: 32px;
    width: auto;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Menu Groups */
.menu-group {
    margin-bottom: 1rem;
}

.menu-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    font-weight: 600;
}

/* Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.menu-item.active {
    background: rgba(13, 110, 253, 0.2);
    color: var(--cg-primary);
    border-left: 3px solid var(--cg-primary);
}

.menu-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
}

.menu-item .menu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.menu-item.expanded .menu-arrow {
    transform: rotate(90deg);
}

/* Submenus */
.submenu {
    display: none;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 1.5rem;
}

.submenu.show {
    display: block;
}

.submenu .menu-item {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.submenu .menu-item.active {
    border-left: none;
    background: rgba(13, 110, 253, 0.15);
}

/* Nested submenus (3rd level) */
.submenu-nested {
    padding-left: 0.5rem;
    margin-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.submenu-nested .menu-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.submenu-toggle {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Menu Parent */
.menu-parent {
    position: relative;
}

/* Main wrapper with sidebar */
.main-wrapper {
    margin-left: var(--cg-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* No sidebar layout (login, select-environment) */
.main-wrapper.no-sidebar {
    margin-left: 0;
}

.app-container {
    min-height: 100vh;
    padding: 0;
}

/* Mobile navbar */
.mobile-navbar {
    display: none;
    height: 56px;
    background: #1a1f2e;
    color: #fff;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.mobile-brand {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Top header bar */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    height: 64px;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-env-name {
    font-weight: 600;
    color: var(--cg-primary);
    font-size: 0.95rem;
}

.header-welcome {
    color: var(--cg-secondary);
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-last-login {
    color: var(--cg-secondary);
    font-size: 0.8rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--cg-dark);
}

.header-user i {
    font-size: 1.25rem;
    color: var(--cg-primary);
}

/* Impersonation indicator */
.impersonation-indicator {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #212529;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    animation: pulse-glow 2s infinite;
}

.impersonation-indicator i {
    font-size: 1rem;
}

.impersonation-indicator .btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1;
    border-color: rgba(0,0,0,0.3);
    color: #212529;
}

.impersonation-indicator .btn:hover {
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(0,0,0,0.5);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    }
}

/* Header when impersonating */
.top-header.impersonating {
    background: linear-gradient(90deg, #fff8e1 0%, #fff 50%);
    border-bottom-color: #ffc107;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-navbar {
        display: flex;
    }

    .top-header {
        height: auto;
        min-height: 64px;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
    }
}

/* Environment selector cards */
.env-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.env-card:hover {
    border-color: var(--cg-primary);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.env-card .env-icon {
    width: 48px;
    height: 48px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--cg-primary);
}

.env-card .env-name {
    font-weight: 600;
    font-size: 1rem;
}

.env-card .env-description {
    color: var(--cg-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.env-card .env-arrow {
    color: var(--cg-secondary);
    font-size: 1.25rem;
}

.env-card:hover .env-arrow {
    color: var(--cg-primary);
}

/* ============================================
   Productos View Styles
   ============================================ */

/* Pagination active state */
.pagination .page-link.active {
    background-color: var(--cg-primary);
    border-color: var(--cg-primary);
    color: white;
}

.pagination .page-link.disabled {
    color: var(--cg-secondary);
    pointer-events: none;
}

/* Page numbers containers - horizontal layout */
[id$="page-numbers-container"],
[id$="page-numbers"] {
    display: flex;
    gap: 2px;
}

[id$="page-numbers-container"] .page-link,
[id$="page-numbers"] .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Row detail */
.row-detail {
    background-color: #f8f9fa;
}

.row-detail td {
    border-top: none !important;
}

/* Toggle button */
.toggle-row-btn {
    padding: 0.2rem 0.4rem;
    line-height: 1;
}

/* Product detail modal */
#product-detail-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Truncated cells */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Condiment groups in modal */
.condiment-group-header {
    transition: background-color 0.2s ease;
}

.condiment-group-header:hover {
    background-color: #e9ecef !important;
}

.condiment-toggle {
    text-decoration: none;
    color: var(--cg-primary);
}

.condiment-toggle:hover {
    color: var(--cg-primary);
}

.condiment-item {
    font-size: 0.9rem;
}

.condiment-item:last-child {
    border-bottom: none !important;
}

/* ============================================
   Imagenes View Styles
   ============================================ */

/* Image card in grid */
.image-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-card-img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.image-card-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: var(--cg-secondary);
    border-bottom: 1px solid #eee;
}

.image-card-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.image-card-body {
    padding: 0.75rem;
}

.image-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card-code {
    font-size: 0.75rem;
    color: var(--cg-secondary);
    margin-bottom: 0.5rem;
}

/* Image status badges */
.image-badges {
    display: flex;
    gap: 0.25rem;
}

.image-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.image-badge.has-image {
    background-color: rgba(25, 135, 84, 0.15);
    color: var(--cg-success);
}

.image-badge.no-image {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--cg-danger);
}

/* Image preview in modal */
.preview-image-container {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.375rem;
}

/* Upload preview images */
#upload-preview img {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

/* Bulk upload table */
#bulk-files-body tr.valid {
    background-color: rgba(25, 135, 84, 0.05);
}

#bulk-files-body tr.invalid {
    background-color: rgba(220, 53, 69, 0.05);
}

#bulk-files-body .status-icon {
    font-size: 1.1rem;
}

#bulk-files-body .status-icon.success {
    color: var(--cg-success);
}

#bulk-files-body .status-icon.error {
    color: var(--cg-danger);
}

#bulk-files-body .status-icon.pending {
    color: var(--cg-warning);
}

/* Tabs styling for imagenes */
#img-tabs .nav-link {
    color: var(--cg-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
}

#img-tabs .nav-link:hover {
    border-color: #dee2e6;
}

#img-tabs .nav-link.active {
    color: var(--cg-primary);
    border-color: var(--cg-primary);
    background: none;
}

/* ============================================
   Monitoreo Delivery View Styles
   ============================================ */

/* Column widths for monitoreo table */
.mon-col-local { width: 12%; }
.mon-col-integrator { width: 10%; }
.mon-col-date { width: 14%; }
.mon-col-id { width: 10%; }
.mon-col-check { width: 8%; }
.mon-col-vertical { width: 8%; }
.mon-col-items { width: 6%; }
.mon-col-total { width: 10%; }
.mon-col-type { width: 8%; }
.mon-col-status { width: 14%; }

/* Flash animation for updated rows */
.mon-flash {
    animation: monFlashRow 0.6s ease-out;
}

@keyframes monFlashRow {
    0% { background-color: rgba(25, 135, 84, 0.25); }
    100% { background-color: transparent; }
}

/* JSON button styling */
.json-btn {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.json-btn:hover {
    opacity: 1;
}

/* Retry button for rejected orders */
.mon-retry-btn {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 0.85rem;
}

.mon-retry-btn:hover {
    opacity: 1;
}

/* Monitoreo table responsive adjustments */
@media (max-width: 1200px) {
    .mon-col-vertical,
    .mon-col-check {
        display: none;
    }
}

@media (max-width: 992px) {
    .mon-col-id,
    .mon-col-type {
        display: none;
    }
}

@media (max-width: 768px) {
    .mon-col-items,
    .mon-col-integrator {
        display: none;
    }
}

/* ============================================
   Kioskos View Styles
   ============================================ */

/* Column widths for kioskos table */
.kiosk-col-name { width: 18%; }
.kiosk-col-id { width: 10%; }
.kiosk-col-shortname { width: 10%; }
.kiosk-col-enabled { width: 8%; }
.kiosk-col-store { width: 16%; }
.kiosk-col-schedule { width: 12%; }
.kiosk-col-update { width: 16%; }
.kiosk-col-actions { width: 10%; }

/* Kioskos table responsive adjustments */
@media (max-width: 992px) {
    .kiosk-col-update {
        display: none;
    }
}

@media (max-width: 768px) {
    .kiosk-col-store {
        display: none;
    }
}

/* ============================================
   Menu Autoservicio View Styles
   ============================================ */

/* Panel opacity transition */
#menu-panel,
#categorias-panel,
#items-panel {
    transition: opacity 0.3s ease;
}

/* Selected row in menu tables */
.menu-row.table-primary,
.cat-row.table-primary {
    background-color: rgba(13, 110, 253, 0.15) !important;
}

.menu-row:hover,
.cat-row:hover,
.item-row:hover {
    background-color: rgba(0, 0, 0, 0.035);
    cursor: pointer;
}

/* Dragging state */
.cat-row.dragging,
.item-row.dragging {
    opacity: 0.5;
}

/* Drag over state */
.cat-row.table-warning,
.item-row.table-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

/* Card fixed height for menu panels */
#categorias-panel .card-body,
#items-panel .card-body,
.col-lg-4 > .card > .card-body {
    min-height: 0;
}

/* Table responsive wrapper in menu panels */
#categorias-panel .table-responsive,
#items-panel .table-responsive,
.col-lg-4 .table-responsive {
    max-height: 400px;
    overflow-y: auto;
}

/* Sticky header in scrollable tables */
#menu-list-body,
#cat-list-body,
#item-list-body {
    font-size: 0.9rem;
}

/* Category image preview */
#cat-list-body img {
    border-radius: 4px;
    object-fit: cover;
}

/* Menu panel responsive */
@media (max-width: 991px) {
    #categorias-panel,
    #items-panel {
        margin-top: 1rem;
    }
}

/* Item search input styling */
#item-search-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* Item grouping styles */
.item-group-header {
    background-color: rgba(13, 202, 240, 0.08);
    cursor: pointer;
}

.item-group-header:hover {
    background-color: rgba(13, 202, 240, 0.15);
}

.item-sub-row {
    background-color: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--cg-info);
}

.item-sub-row:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.group-toggle-btn {
    color: var(--cg-info);
    text-decoration: none;
}

.group-toggle-btn:hover {
    color: var(--cg-primary);
}

/* Menu tree view styles */
.menu-tree {
    font-size: 0.95rem;
}

.menu-tree-root {
    padding: 0.5rem;
}

.menu-tree ul {
    margin-bottom: 0;
}

.menu-tree li {
    line-height: 1.6;
}

.menu-tree code {
    background-color: #f8f9fa;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Combo and condiment colors in tree view */
.text-purple {
    color: #6f42c1 !important;
}

.bg-purple {
    background-color: #6f42c1 !important;
}

.bi-layers.text-purple {
    color: #6f42c1;
}

/* Tree view nested items */
.menu-tree .list-unstyled .list-unstyled {
    border-left: 1px dashed #dee2e6;
    margin-left: 0.5rem;
}

/* ============================================
   Reportes Giftcard View Styles
   ============================================ */

/* Column widths for giftcard table */
.gc-col-created { width: 14%; }
.gc-col-rut { width: 14%; }
.gc-col-id { width: 18%; }
.gc-col-value { width: 12%; }
.gc-col-valid { width: 14%; }
.gc-col-status { width: 12%; }
.gc-col-actions { width: 8%; }

/* Giftcard row styling */
.gc-row:hover {
    background-color: rgba(0, 0, 0, 0.035);
}

/* Giftcard ID code styling */
.gc-row code {
    background-color: #f8f9fa;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Detail button styling */
.btn-gc-detail {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* gc-page-numbers styles now covered by global [id$="page-numbers-container"] rule */

/* Giftcard table responsive adjustments */
@media (max-width: 992px) {
    .gc-col-valid {
        display: none;
    }
}

@media (max-width: 768px) {
    .gc-col-id,
    .gc-col-actions {
        display: none;
    }
}

/* ========================================
   Sistema - Usuarios View Styles
   ======================================== */

/* User avatar circle */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #6610f2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Permission groups styling */
.permission-group {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.permission-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.permission-parent {
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

/* User table hover effect */
#users-table-body tr {
    cursor: default;
    transition: background-color 0.15s ease;
}

#users-table-body tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Modal scrollable areas */
#permissions-tree,
#stores-list {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

#permissions-tree::-webkit-scrollbar,
#stores-list::-webkit-scrollbar {
    width: 6px;
}

#permissions-tree::-webkit-scrollbar-thumb,
#stores-list::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

/* User edit modal form styling */
#user-edit-modal .form-check {
    margin-bottom: 0.25rem;
}

#user-edit-modal .form-check-label {
    user-select: none;
}

/* Responsive adjustments for user table */
@media (max-width: 768px) {
    #users-table-body .badge {
        font-size: 0.65rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.65rem;
    }

    .user-col-permisos,
    .user-col-tiendas {
        display: none;
    }
}

/* ========================================
   Responsive Expandable Table Rows
   ======================================== */

/* Chevron indicator */
.resp-expand-icon {
    font-size: 0.7rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

/* Make data rows clickable when columns are hidden */
tbody tr:not(.resp-detail-row) {
    cursor: pointer;
}

@media (min-width: 1201px) {
    tbody tr:not(.resp-detail-row) {
        cursor: default;
    }
}

/* Detail row */
.resp-detail-row {
    background-color: #f8f9fa !important;
    border-left: 3px solid var(--primary-color);
}

.resp-detail-row:hover {
    background-color: #f8f9fa !important;
}

.resp-detail-content {
    padding: 0.5rem 1rem;
}

.resp-detail-item {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #e9ecef;
}

.resp-detail-item:last-child {
    border-bottom: none;
}

.resp-detail-label {
    font-weight: 600;
    color: #6c757d;
    margin-right: 0.5rem;
}

.resp-detail-value {
    color: #212529;
}

/* ========================================
   Category Image Hover Expand
   ======================================== */
.cat-img-hover-wrap {
    position: relative;
    display: inline-block;
}
.cat-img-thumb {
    width: 30px;
    height: 30px;
    object-fit: cover;
    cursor: pointer;
}
.cat-img-expanded {
    position: absolute;
    z-index: 100;
    width: 150px;
    height: 150px;
    object-fit: cover;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    pointer-events: none;
    border: 2px solid #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-out 0.5s, transform 0.15s ease-out 0.5s, visibility 0s 0.65s;
}
.cat-img-hover-wrap:hover .cat-img-expanded {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.15s ease-out 0.5s, transform 0.15s ease-out 0.5s, visibility 0s 0s;
}

/* ========================================
   Responsive Column Hiding - Additional Views
   ======================================== */

/* Monitoreo Wallets */
@media (max-width: 992px) {
    .wallet-col-check,
    .wallet-col-pos,
    .wallet-col-motivo {
        display: none;
    }
}

@media (max-width: 768px) {
    .wallet-col-desc,
    .wallet-col-vuelto {
        display: none;
    }
}

/* Configuracion Terminales */
@media (max-width: 992px) {
    .term-col-ext {
        display: none;
    }
}

@media (max-width: 768px) {
    .term-col-pos {
        display: none;
    }
}

/* Reportes Delivery */
@media (max-width: 1200px) {
    .rep-deli-col-vertical,
    .rep-deli-col-check {
        display: none;
    }
}

@media (max-width: 992px) {
    .rep-deli-col-id,
    .rep-deli-col-type {
        display: none;
    }
}

@media (max-width: 768px) {
    .rep-deli-col-items,
    .rep-deli-col-integrator {
        display: none;
    }
}

/* Cupones Campanas */
@media (max-width: 992px) {
    .camp-col-tipo-campana,
    .camp-col-fecha-creacion {
        display: none;
    }
}

@media (max-width: 768px) {
    .camp-col-creado-por,
    .camp-col-tipo {
        display: none;
    }
}

/* Cupones Generar */
@media (max-width: 992px) {
    .gen-col-id-campana,
    .gen-col-destino {
        display: none;
    }
}

@media (max-width: 768px) {
    .gen-col-fecha {
        display: none;
    }
}

/* Actualizacion Kioskos */
@media (max-width: 768px) {
    .upd-col-zipname {
        display: none;
    }
}

/* Store user layout - no sidebar */
.store-user-layout {
    margin-left: 0 !important;
}

/* Resumen Tienda JSON button */
.st-json-btn {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.st-json-btn:hover {
    opacity: 1;
}

/* Resumen Tienda retry button */
.st-retry-btn {
    cursor: pointer;
}
