/* ============================================
   PORTAL COLABORADOR - CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    overflow-x: hidden;
}

/* LOGIN SCREEN */
.screen {
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
}

.login-container h1 {
    color: white;
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

#login-form {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
}

.login-footer {
    margin-top: 20px;
}

.login-footer a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* APP SCREEN */
.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-name {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 16px;
}

.user-status {
    font-size: 13px;
    color: var(--success);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-icon:active {
    transform: scale(0.95);
}

/* NAVIGATION TABS */
.nav-tabs {
    background: white;
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    min-width: 80px;
}

.nav-tab i {
    font-size: 20px;
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* CONTENT */
.app-content {
    padding: 20px;
    padding-bottom: 80px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 25px 0 15px;
}

/* CARDS */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.welcome-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.welcome-card p {
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    margin: 0 auto 10px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 600;
}

.card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 700;
    color: var(--gray-800);
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pending { background: #fef5e7; color: #d97706; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #fee; color: #c53030; }

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

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

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--gray-600);
}

.producto-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 2px solid var(--gray-200);
}

.producto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.producto-nombre {
    font-weight: 700;
    color: var(--gray-800);
}

.producto-precio {
    color: var(--primary);
    font-weight: 700;
}

.cantidad-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-qty {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    font-size: 20px;
    color: var(--gray-700);
    cursor: pointer;
}

.btn-qty:active {
    transform: scale(0.95);
}

.cantidad-display {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    min-width: 40px;
    text-align: center;
}

.resumen-solicitud {
    background: var(--gray-50);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.resumen-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.resumen-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 2px solid var(--gray-200);
}

/* BUTTONS */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ALERT */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
}

.alert.active {
    display: block;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .resumen-row {
        font-size: 14px;
    }
}
