/* ===== SecureRond Pro - Estilos ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: #f0f4f8; min-height: 100vh; }

/* ---- LOGIN ---- */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a3a5c 0%, #2a5f7a 100%); padding: 1rem; }
.login-box { background: white; padding: 3rem 2.5rem; border-radius: 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); width: 100%; max-width: 420px; animation: slideUp .5s ease; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.login-box h2 { text-align: center; color: #1a3a5c; font-size: 2rem; margin-bottom: .5rem; }
.login-box .subtitle { text-align: center; color: #64748b; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 500; color: #1e293b; margin-bottom: .4rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: .75rem 1rem; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1rem; transition: all .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a3a5c; box-shadow: 0 0 0 3px rgba(26,58,92,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-login { width: 100%; padding: .9rem; background: #1a3a5c; color: white; border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-login:hover { background: #0f2a44; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26,58,92,.3); }
.login-error, .alert { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.login-error, .alert-error, .alert-danger { color: #b91c1c; background: #fee2e2; }
.alert-success { color: #065f46; background: #d1fae5; }
.alert-info { color: #0369a1; background: #e0f2fe; }
.login-demo { margin-top: 1.5rem; padding: 1rem; background: #f8fafc; border-radius: 12px; font-size: .8rem; color: #64748b; }
.login-demo b { color: #1e293b; }

/* ---- HEADER ---- */
.header { background: linear-gradient(135deg, #1a3a5c, #2a5f7a); color: white; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.header h1 { font-weight: 300; letter-spacing: 1px; font-size: 1.6rem; }
.header h1 i { margin-right: 10px; color: #ffd166; }
.header-info { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.user-badge, .company-badge { background: rgba(255,255,255,.15); padding: .4rem 1rem; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; }
.company-badge { background: rgba(255,215,0,.2); border: 1px solid rgba(255,215,0,.3); }
.btn-logout { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: white; padding: .5rem 1.2rem; border-radius: 30px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all .2s; }
.btn-logout:hover { background: rgba(255,255,255,.3); }

/* ---- LAYOUT ---- */
.main-container { display: flex; padding: 1.5rem; gap: 1.5rem; max-width: 1600px; margin: 0 auto; width: 100%; align-items: flex-start; }
.sidebar { width: 240px; background: white; border-radius: 20px; padding: 1.2rem .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.06); position: sticky; top: 1.5rem; flex-shrink: 0; }
.side-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: .75rem 1rem; border: none; background: transparent; border-radius: 12px; font-size: .93rem; font-weight: 500; color: #2c3e50; cursor: pointer; transition: all .2s; margin-bottom: .25rem; text-decoration: none; }
.side-link i { width: 22px; color: #5a7d9a; }
.side-link:hover { background: #eaf0f6; }
.side-link.active { background: #1a3a5c; color: white; }
.side-link.active i { color: white; }

.content { flex: 1; background: white; border-radius: 20px; padding: 2rem; box-shadow: 0 8px 24px rgba(0,0,0,.06); min-height: 600px; min-width: 0; }
.content h2 { color: #0f172a; margin-bottom: .3rem; }
.content .page-sub { color: #64748b; margin-bottom: 1.2rem; }

/* ---- CARDS / GRID ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.stat-card { background: #f8fafc; padding: 1.5rem; border-radius: 16px; border-left: 5px solid #1a3a5c; }
.stat-card h3 { font-size: .8rem; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: #0f172a; margin-top: .3rem; }
.stat-card .sub { font-size: .85rem; color: #64748b; margin-top: .2rem; }

/* ---- TABLES ---- */
.table-responsive { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f1f5f9; padding: .7rem 1rem; text-align: left; font-weight: 600; color: #1e293b; white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid #e9edf2; }
tr:hover { background: #f8fafc; }

.badge { background: #dbeafe; color: #1e40af; padding: .2rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 500; }
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0f2fe; color: #0369a1; }

/* ---- BUTTONS ---- */
.btn { padding: .55rem 1.3rem; border: none; border-radius: 30px; font-weight: 500; cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; text-decoration: none; }
.btn-primary { background: #1a3a5c; color: white; }
.btn-primary:hover { background: #0f2a44; }
.btn-success { background: #0b7e4b; color: white; }
.btn-success:hover { background: #09643b; }
.btn-danger { background: #b91c1c; color: white; }
.btn-danger:hover { background: #991b1b; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: #1e293b; }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; }
.actions-row { display: flex; gap: .5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.actions { display: flex; gap: .4rem; }

/* ---- FORMS ---- */
.form-card { background: #f8fafc; padding: 1.5rem; border-radius: 16px; margin-top: 1rem; max-width: 700px; }
.checkbox-group { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; margin: .8rem 0; }
.checkbox-group label { display: flex; align-items: center; gap: .4rem; font-weight: 400; color: #1e293b; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* ---- QR SCANNER ---- */
.qr-scanner { background: #f8fafc; padding: 2rem; border-radius: 16px; text-align: center; margin: 1.5rem 0; }
#video-container { width: 100%; max-width: 480px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #000; position: relative; }
#video-container video, #video-container canvas { width: 100%; display: block; }
#video-container .scan-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 200px; height: 200px; border: 3px solid #00ff00; border-radius: 16px; pointer-events: none; box-shadow: 0 0 30px rgba(0,255,0,.3); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: .5; transform: translate(-50%,-50%) scale(.95); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.05); } 100% { opacity: .5; transform: translate(-50%,-50%) scale(.95); } }
.qr-result { margin-top: 1rem; padding: 1rem; background: white; border-radius: 12px; border: 1px solid #d1d9e6; min-height: 50px; }
.camera-controls { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---- MISC ---- */
.company-header { background: linear-gradient(135deg, #fef3c7, #fde68a); padding: 1rem 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 5px solid #f59e0b; }
.company-header .company-name { font-size: 1.15rem; font-weight: 600; color: #92400e; }
.company-header .company-detail { font-size: .88rem; color: #78350f; }

.turno-card { background: #f8fafc; padding: 1.5rem; border-radius: 16px; margin-top: 1.5rem; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.turno-card .hora { font-size: 2rem; font-weight: 700; color: #1a3a5c; }
.turno-card .estado { font-size: .9rem; color: #64748b; }

.guard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.guard-card { background: #f8fafc; border-radius: 16px; padding: 1.4rem; text-align: center; border: 1px solid #e9edf2; transition: all .2s; }
.guard-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.guard-card .avatar { width: 70px; height: 70px; border-radius: 50%; background: #1a3a5c; color: white; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto .7rem; object-fit: cover; overflow: hidden; }
.guard-card .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.guard-card .name { font-weight: 600; font-size: 1.05rem; color: #0f172a; }
.guard-card .company { font-size: .82rem; color: #64748b; }

.tabs { display: flex; gap: .5rem; border-bottom: 2px solid #e9edf2; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs a { padding: .6rem 1.2rem; text-decoration: none; color: #64748b; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: #1a3a5c; border-color: #1a3a5c; }

.novedad-item { background: #f8fafc; padding: 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid #e9edf2; }
.novedad-item .foto-preview { max-width: 200px; max-height: 150px; border-radius: 8px; margin-top: .5rem; }

.logo-preview { max-width: 130px; max-height: 70px; object-fit: contain; display: block; margin-bottom: .5rem; }

@media (max-width: 900px) {
    .main-container { flex-direction: column; padding: 1rem; }
    .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: .3rem; position: static; padding: .8rem; }
    .side-link { flex: 1; min-width: 110px; justify-content: center; font-size: .82rem; padding: .55rem .7rem; }
    .form-row { grid-template-columns: 1fr; }
    .content { padding: 1.2rem; }
}
@media (max-width: 600px) {
    .login-box { padding: 2rem 1.5rem; }
    .header h1 { font-size: 1.3rem; }
    #video-container .scan-overlay { width: 130px; height: 130px; }
}
