/* ============================================
   W24H TPV - ESTILOS BASE GLOBALES
   Solo reset, tipografía, botones y layout general
   ============================================ */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #1d1d1f;
    --text-muted: #86868b;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESET Y BASE
   ============================================ */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   BOTONES GLOBALES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary-gradient); color: white; }
.btn-secondary { background: #f3f4f6; color: var(--text-color); }
.btn-warning { background: #f59e0b; color: white; }
.btn-large { width: 100%; padding: 16px; font-size: 1.1rem; }
.btn-small { padding: 8px 16px; font-size: 0.9rem; }

/* ============================================
   APP LAYOUT (Header/Footer)
   ============================================ */
.app-header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.logo { 
    font-size: 1.25rem; 
    font-weight: 800; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    font-size: 0.9rem; 
    font-weight: 500; 
}

.btn-logout { 
    font-size: 1.2rem; 
    text-decoration: none; 
}

.app-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-item.active, .nav-item:hover { 
    color: var(--primary-color); 
    border-bottom-color: var(--primary-color); 
}

.app-main { 
    padding: 1.5rem; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.app-footer { 
    text-align: center; 
    padding: 2rem; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
}

/* ============================================
   ALERTAS
   ============================================ */
.alert { 
    padding: 1rem; 
    border-radius: 8px; 
    margin-bottom: 1rem; 
    font-size: 0.9rem; 
}

.alert-error { 
    background-color: #fee2e2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
}

.alert-success { 
    background-color: #d1fae5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
}

/* ============================================
   TARJETAS BASE
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 { 
    font-size: 1.25rem; 
    font-weight: 700; 
}

.card-body { 
    padding: 1.5rem; 
}

/* ============================================
   FORMULARIOS BASE
   ============================================ */
.form-group { 
    margin-bottom: 1.5rem; 
}

.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 600; 
    font-size: 0.9rem; 
}

.input-field {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-field:focus { 
    outline: none; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); 
}

select.input-field {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

/* ============================================
   TABLAS BASE
   ============================================ */
.table-responsive { 
    overflow-x: auto; 
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    background: #f9fafb;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid #e5e7eb;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table tr:hover { 
    background: #f9fafb; 
}

/* ============================================
   BADGES Y ETIQUETAS
   ============================================ */
.rol-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
    letter-spacing: 0.5px;
}

.rol-admin { background: #dbeafe; color: #1e40af; }
.rol-camarero { background: #d1fae5; color: #065f46; }
.rol-caja { background: #fef3c7; color: #92400e; }
.rol-cocina { background: #fce7f3; color: #9d174d; }

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.inactive { background: #fee2e2; color: #991b1b; }

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ============================================
   MODAL BASE
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

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

.modal-body { 
    padding: 1.5rem; 
}

/* ============================================
   ANIMACIONES BASE
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ============================================
   RESPONSIVE BASE
   ============================================ */
@media (max-width: 768px) {
    .app-main { padding: 1rem; }
    .nav-item { padding: 0.8rem 1rem; font-size: 0.9rem; }
    .btn-large { padding: 14px; font-size: 1rem; }
}