/* ============================================
   ESTILOS GLOBALES DE ADMINISTRACIÓN
   Pollo Feliz - Sistema Administrativo
   ============================================ */

/* Importar fuente moderna de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Variables CSS - Paleta de Colores */
:root {
    --color-primary: #8B3A62; /* Vino más moderno */
    --color-primary-hover: #6d2d4d;
    --color-primary-light: #a05078;
    --color-secondary: #ffffff;
    --color-text: #2c3e50;
    --color-text-light: #6c757d;
    --color-border: #e1e8ed;
    --color-background: #f5f7fa;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #8B3A62 0%, #6d2d4d 100%);
    color: white;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.sidebar-link:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 0 4px 4px 0;
}

.sidebar-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-icon {
    font-size: 1.25rem;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-text {
    margin-left: 12px;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-badge {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* ============================================
   LAYOUT CON SIDEBAR
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.main-area {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-area.sidebar-collapsed {
    margin-left: 70px;
}

.topbar {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    color: #6c757d;
    font-weight: 500;
}

.page-content {
    flex: 1;
    padding: 32px;
}

.app-footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #e1e8ed;
    font-size: 0.875rem;
}

.app-footer p {
    margin: 0;
}

/* ============================================
   PÁGINA DE INICIO
   ============================================ */

.home-container {
    text-align: center;
    padding: 60px 20px;
}

.home-title {
    color: var(--color-primary);
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.home-subtitle {
    font-size: 1.125rem;
    margin: 20px 0;
    color: var(--color-text-light);
    font-weight: 400;
}

.modules-section {
    margin-top: 50px;
}

.modules-title {
    color: var(--color-text);
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.modules-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 450px;
    margin: 0 auto;
}

.module-button {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.module-button-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6d2d4d 100%);
    color: white;
}

.module-button-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.module-button-disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.home-footer {
    margin-top: 60px;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.home-footer p {
    margin: 6px 0;
}

/* ============================================
   BOTONES MODERNOS
   ============================================ */

.btn-primary-vino {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6d2d4d 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn-primary-vino:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary-vino {
    background-color: white;
    color: var(--color-primary);
    border: 2px solid var(--color-border);
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-vino:hover {
    border-color: var(--color-primary);
    background-color: #fafafa;
}

.btn-edit {
    background-color: var(--color-info);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-toggle {
    background-color: var(--color-warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* ============================================
   ENCABEZADOS
   ============================================ */

.page-header {
    color: var(--color-text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primary);
    letter-spacing: -0.5px;
}

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

.table-admin {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.table-admin thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6d2d4d 100%);
    color: white;
}

.table-admin thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-admin tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

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

.table-admin tbody tr:last-child {
    border-bottom: none;
}

.table-admin tbody td {
    padding: 16px;
    font-size: 0.9375rem;
}

/* ============================================
   BADGES MODERNOS
   ============================================ */

.badge-activo {
    background-color: #d1fae5;
    color: #065f46;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-block;
}

.badge-inactivo {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-block;
}

.actions-container {
    display: flex;
    gap: 8px;
}

/* ============================================
   PANEL DE AYUDA
   ============================================ */

.help-panel {
    background-color: #eff6ff;
    border-left: 4px solid var(--color-info);
    padding: 18px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.help-panel-header:hover {
    opacity: 0.8;
}

.help-panel-title {
    font-weight: 600;
    color: var(--color-info);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.help-panel-content {
    margin-top: 14px;
    color: var(--color-text);
    line-height: 1.7;
    font-size: 0.9375rem;
    padding-top: 14px;
    border-top: 1px solid #bfdbfe;
}

.help-panel-content p {
    margin-bottom: 8px;
}

.help-panel-content ul {
    margin-left: 20px;
    margin-top: 10px;
}

.help-panel-content li {
    margin-bottom: 6px;
}

/* ============================================
   FORMULARIOS MODERNOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 58, 98, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control.is-invalid,
.form-control:invalid {
    border-color: var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.invalid-feedback {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

/* ============================================
   MODALES MODERNOS
   ============================================ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(2px);
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #6d2d4d 100%);
    color: white;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    background-color: #fafbfc;
    border-top: 1px solid var(--color-border);
}

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

.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border-color: #93c5fd;
}

.alert-danger {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #fca5a5;
}

/* ============================================
   UTILIDADES
   ============================================ */

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.p-3 {
    padding: 1rem;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

hr {
    border: 0;
    border-top: 2px solid #f3f4f6;
    margin: 24px 0;
}

h4 {
    color: var(--color-text);
    margin: 20px 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.25px;
}

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

@media (max-width: 768px) {
    .main-area {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .topbar {
        padding: 12px 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .dashboard-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}
