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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* LOGIN */
.login-body {
    background: linear-gradient(135deg, #1a3a6e 0%, #2c5aa0 50%, #4a90d9 100%);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 44px 30px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-logo {
    max-width: 240px;
    height: auto;
    margin-bottom: 8px;
}

.login-box h2 {
    color: #2c5aa0;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-version {
    text-align: center;
    color: #bbb;
    font-size: 11px;
    margin-top: 20px;
}

.campo-icono {
    position: relative;
    margin-bottom: 16px;
}

.campo-icono-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.4;
    pointer-events: none;
}

.campo-icono input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8f9fa;
}

.campo-icono input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44,90,160,0.15);
    background: #fff;
}

.btn-login {
    margin-top: 8px;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 10px;
    transition: background 0.2s, transform 0.1s;
}

.btn-login:active {
    transform: scale(0.97);
}

.error {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* BOTONES */
.btn {
    background: #2c5aa0;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn:active {
    background: #1e3f73;
}

.btn-secondary {
    background: #888;
}

.btn-secondary:active {
    background: #666;
}

/* APP */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #1a3a6e 0%, #2c5aa0 100%);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-logo {
    height: 36px;
    width: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-name {
    opacity: 0.85;
}

.btn-logout {
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-logout:active {
    background: rgba(255,255,255,0.3);
}

main {
    padding: 20px;
    flex: 1;
}

/* SCANNER */
#scanner-section {
    text-align: center;
    margin-bottom: 24px;
}

#scanner {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 16px;
    border-radius: 12px;
    overflow: hidden;
}

#scanner video {
    width: 100%;
    display: block;
    border-radius: 12px;
}

.btn-scan {
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 12px;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}

.btn-scan:active {
    transform: scale(0.97);
}

/* MENSAJE */
.mensaje {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.mensaje.exito {
    background: #e8f5e9;
    color: #2e7d32;
}

.mensaje.error {
    background: #fee;
    color: #c00;
}

.mensaje.aviso {
    background: #fff3e0;
    color: #e65100;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 30px 24px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-titulo {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.modal-datos {
    background: #f0f4fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.modal-orden {
    font-size: 28px;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 8px;
}

.modal-bono {
    font-size: 22px;
    font-weight: 600;
    color: #555;
}

.modal-botones {
    display: flex;
    gap: 12px;
}

.modal-botones .btn {
    flex: 1;
    padding: 14px;
    font-size: 17px;
}

.modal-box-error {
    border: 3px solid #c00;
}

.modal-box-error .modal-titulo {
    color: #c00;
}

.modal-datos-error {
    background: #fee !important;
}

.modal-datos-error .modal-orden {
    color: #c00 !important;
}

.modal-datos-error .modal-bono {
    color: #900 !important;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 16px;
    color: #bbb;
    font-size: 11px;
}

/* HISTORIAL */
#historial-section h3 {
    color: #444;
    font-size: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.historial-item {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border-left: 4px solid #2e7d32;
}

.historial-check {
    color: #2e7d32;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.historial-datos {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.historial-orden {
    font-weight: 600;
    color: #2c5aa0;
    font-size: 15px;
}

.historial-bono {
    font-size: 13px;
    color: #666;
}

.historial-codigo {
    font-weight: 600;
    color: #2c5aa0;
    flex: 1;
}

.historial-fecha {
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
}

.sin-datos {
    text-align: center;
    color: #aaa;
    padding: 30px 20px;
    font-size: 14px;
}
