/* CSS para Panel de Administración CoverSur */

:root {
    --primary-color: #0056b3;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--dark-color);
    color: var(--white);
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header img {
    height: 40px;
    margin-bottom: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-color);
    color: var(--white);
    padding-left: 30px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
}

.top-bar {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.top-bar h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Grid responsive para sección de Staff y QR */
.card-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.qr-validation-container {
    text-align: center;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

@media (max-width: 768px) {
    .card-grid-2-1 {
        grid-template-columns: 1fr;
    }
    
    .qr-validation-container {
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 20px;
        margin-top: 10px;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

/* Botones */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #004085;
}

.btn-success {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0,86,179,0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* Switch Toggle CSS */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 10px 15px;
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    width: fit-content;
    transition: all 0.2s;
    margin-top: 5px;
}
.switch-container:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}
.switch-container input {
    display: none !important;
}
.switch-slider {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    background-color: #cbd5e0;
    border-radius: 20px;
    transition: background-color 0.2s;
}
.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch-container input:checked + .switch-slider {
    background-color: var(--secondary-color);
}
.switch-container input:checked + .switch-slider::before {
    transform: translateX(22px);
}
.switch-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-color);
}

@media (max-width: 992px) {
    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table thead {
    background: var(--light-color);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #ddd;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

table tbody tr:hover {
    background: rgba(0,86,179,0.05);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(40,167,69,0.2);
    color: #155724;
}

.badge-danger {
    background: rgba(220,53,69,0.2);
    color: #721c24;
}

.badge-warning {
    background: rgba(255,193,7,0.2);
    color: #856404;
}

.badge-info {
    background: rgba(23,162,184,0.2);
    color: #0c5460;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 5px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(40,167,69,0.1);
    border-left: 4px solid var(--secondary-color);
    color: #155724;
}

.alert-danger {
    background: rgba(220,53,69,0.1);
    border-left: 4px solid var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: rgba(255,193,7,0.1);
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

.alert-info {
    background: rgba(23,162,184,0.1);
    border-left: 4px solid var(--info-color);
    color: #0c5460;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Responsive adjustments for mid-sized screens/laptops (e.g. 1366x768) */
@media (min-width: 769px) and (max-width: 1380px) {
    .sidebar {
        width: 210px !important;
    }
    .main-content {
        margin-left: 210px !important;
        padding: 15px !important;
    }
    table th, table td {
        padding: 8px 6px !important;
        font-size: 0.82rem !important;
    }
    .badge {
        padding: 3px 6px !important;
        font-size: 0.78rem !important;
    }
    .btn-sm {
        padding: 4px 6px !important;
        font-size: 0.78rem !important;
    }
    .form-precio-rapido input {
        width: 90px !important;
        padding: 4px 4px 4px 15px !important;
        font-size: 0.85rem !important;
    }
    .form-precio-rapido span {
        left: 5px !important;
        font-size: 0.8rem !important;
    }
    .form-precio-rapido button {
        padding: 4px 8px !important;
        font-size: 0.78rem !important;
        vertical-align: middle !important;
    }
}

/* ==========================================================================
   ESTILOS DE BOTONES DE ACCIÓN (ÍCONOS DE LÍNEA UNIFICADOS)
   ========================================================================== */
.btn-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    text-decoration: none !important;
    color: #64748b !important; /* Slate grey default */
    vertical-align: middle !important;
}

.btn-action:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #1e293b !important;
}

.btn-action svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    fill: none !important;
    transition: transform 0.2s ease !important;
}

.btn-action:hover svg {
    transform: scale(1.1) !important;
}

/* Modificadores de estado/color específicos */
.btn-action.delete {
    color: #ef4444 !important; /* Rojo */
}

.btn-action.delete:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

.btn-action.pdf-detallado {
    color: #2563eb !important; /* Azul */
}

.btn-action.pdf-detallado:hover {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: #1d4ed8 !important;
}

.btn-action.pdf-comercial {
    color: #10b981 !important; /* Verde */
}

.btn-action.pdf-comercial:hover {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
}

.btn-action.pdf-tecnico {
    color: #8b5cf6 !important; /* Morado */
}

.btn-action.pdf-tecnico:hover {
    background-color: rgba(139, 92, 246, 0.1) !important;
    color: #7c3aed !important;
}

.btn-action.pdf-tecnico-missing {
    color: #cbd5e1 !important; /* Gris claro/vacío */
}

.btn-action.pdf-tecnico-missing:hover {
    background-color: rgba(139, 92, 246, 0.1) !important;
    color: #8b5cf6 !important;
}


