/* VYSITE BONOS - Dashboard Oscuro Profesional */
/* Versión 2.1 - Tema Dark */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    /* Colores Oscuros */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border-color: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Brand Colors */
    --brand-primary: #3b82f6;
    --brand-hover: #2563eb;
    --brand-light: #60a5fa;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #064e3b;
    --warning: #f59e0b;
    --warning-bg: #78350f;
    --danger: #ef4444;
    --danger-bg: #7f1d1d;
    --info: #06b6d4;
    --info-bg: #164e63;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== LOGIN SCREEN ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.login-box {
    background: var(--bg-secondary);
    padding: 48px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 440px;
    width: 90%;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.logo-large {
    font-size: 3em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.app-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 0.95em;
    font-weight: 500;
}

.error-message {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: #fecaca;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 0.9em;
    animation: slideDown 0.3s ease;
}

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

/* ==================== FORM ELEMENTS ==================== */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95em;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

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

select.input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
}

/* ==================== BUTTONS ==================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-hover) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-hover) 0%, #1d4ed8 100%);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-primary);
}

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
}

.btn-block {
    width: 100%;
}

/* ==================== HEADER ==================== */

.header {
    background: var(--bg-secondary);
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-title {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-welcome {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

/* ==================== MENU GRID ==================== */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.menu-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a2332 100%);
    padding: 32px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.menu-card:hover::before {
    transform: scaleX(1);
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--brand-primary);
}

.menu-icon {
    font-size: 3.5em;
    margin-bottom: 16px;
    filter: grayscale(0.2);
}

.menu-title {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.menu-desc {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* ==================== SECTIONS ==================== */

.section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.section h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.section h3 {
    color: var(--text-secondary);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 16px;
}

.admin-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.admin-section h2 {
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==================== FORM ROWS ==================== */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.form-section h3 {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ==================== ITEM CARDS ==================== */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.2s ease;
}

.item-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.item-info {
    flex: 1;
}

.item-info h4 {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.detail-item span {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.item-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
    flex-shrink: 0;
}

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

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.finished {
    background: var(--danger-bg);
    color: #fca5a5;
    border: 1px solid var(--danger);
}

.invoice-number {
    font-family: 'Courier New', monospace;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--brand-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--brand-light);
    font-weight: 700;
    font-size: 0.9em;
}

/* ==================== PROGRESS BARS ==================== */

.progress-bar {
    background: var(--bg-tertiary);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-light));
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* ==================== SIGNATURE PADS ==================== */

.signature-container {
    margin-bottom: 24px;
}

.signature-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.signature-container canvas {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: crosshair;
    transition: border-color 0.2s;
}

.signature-container canvas:hover {
    border-color: var(--brand-primary);
}

/* ==================== EXPORT BUTTONS ==================== */

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* ==================== EMPTY STATES ==================== */

.empty-message {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.95em;
}

/* ==================== SCREENS ==================== */

.screen {
    display: none;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

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

@media (max-width: 768px) {
    .login-box {
        padding: 32px 24px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .item-card {
        flex-direction: column;
    }

    .item-actions {
        flex-direction: row;
        width: 100%;
    }

    .item-actions .btn {
        flex: 1;
    }

    .export-buttons {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 20px;
    }

    .admin-section {
        padding: 20px;
    }
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ==================== UTILITIES ==================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ==================== ANIMATIONS ==================== */

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .btn, .header, .menu-grid {
        display: none;
    }
}
