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

:root {
    --color-primary: #1a365d;
    --color-secondary: #2d3748;
    --color-accent: #38a169;
    --color-background: #f7fafc;
    --color-text: #1a202c;
    --color-error: #e53e3e;
    --color-warning: #dd6b20;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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: 8px;
}

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

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: 15px 0;
    box-shadow: var(--shadow-md);
}

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

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo img {
    height: 50px;
    object-fit: contain;
}

.header-logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--color-white);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: var(--radius);
    transition: background 0.3s;
    font-weight: 500;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
}

/* Layout */
.app-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 260px;
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--color-background);
    border-left-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 25px;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
}

.card-body {
    padding: 25px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background: #2f855a;
}

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

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    background: var(--color-background);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

/* Botón deshabilitado durante procesamiento */
.btn:disabled,
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

.form-control:disabled {
    background: var(--color-background);
    cursor: not-allowed;
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f8fafc;
}

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

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #742a2a;
}

.alert-warning {
    background: #fffaf0;
    border: 1px solid #fbd38d;
    color: #744210;
}

.alert-info {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #feebc8;
    color: #744210;
}

.badge-error {
    background: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background: #bee3f8;
    color: #2a4365;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination .active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 18px;
    color: var(--color-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-secondary);
    line-height: 1;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.stat-card h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-secondary);
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-card.accent {
    border-left-color: var(--color-accent);
}

.stat-card.accent .value {
    color: var(--color-accent);
}

/* Chart Container */
.chart-container {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.chart-container h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

/* QR Code Display */
.qr-display {
    text-align: center;
    padding: 20px;
}

.qr-display img {
    max-width: 150px;
    border: 5px solid var(--color-white);
    box-shadow: var(--shadow-md);
}

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

.login-box {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-box h1 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 30px;
    font-size: 24px;
}

.login-box .form-group {
    margin-bottom: 25px;
}

.login-box .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--color-secondary);
}

.login-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 25px;
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    color: var(--color-secondary);
    font-weight: 500;
}

.tab:hover {
    color: var(--color-primary);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Titles */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .sidebar {
        display: none;
    }
    
    .sidebar.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--color-accent);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-secondary);
}

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

.empty-state h3 {
    margin-bottom: 10px;
}

/* Receipt PDF Styles */
.receipt-preview {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 40px;
    margin-bottom: 20px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-primary);
}

.receipt-section {
    margin-bottom: 25px;
}

.receipt-section h4 {
    color: var(--color-primary);
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-table th,
.receipt-table td {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
}

.receipt-table th {
    background: var(--color-background);
    font-weight: 600;
}

.receipt-total {
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    padding: 15px;
    background: var(--color-background);
}

.receipt-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

.receipt-signature {
    text-align: center;
    width: 200px;
}

.receipt-signature .line {
    border-top: 1px solid var(--color-text);
    margin-top: 60px;
    padding-top: 10px;
}

/* Hide elements */
.hidden {
    display: none !important;
}

/* Utility classes */
.text-center {
    text-align: center;
}

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

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}
