* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6f8;
    color: #1a1a1a;
    line-height: 1.5;
}

/* LOGIN */
.login-bg { background: linear-gradient(135deg, #eef2f7 0%, #dce6f0 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: white; padding: 40px 36px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08); width: 100%; max-width: 380px; }
.login-box h1 { font-size: 18px; font-weight: 500; text-align: center; margin-bottom: 24px; color: #333; }
.login-box label { display: block; font-size: 12px; color: #666; margin: 12px 0 4px; }
.login-box input { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px; background: white; }
.login-box input:focus { outline: none; border-color: #1a5490; box-shadow: 0 0 0 3px rgba(26,84,144,.15); }
.login-box button { width: 100%; margin-top: 20px; padding: 11px; font-size: 14px; font-weight: 500; background: #1a5490; color: white; border: none; border-radius: 6px; cursor: pointer; }
.login-box button:hover { background: #144270; }
.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }

/* TOPBAR común */
.topbar { background: white; border-bottom: 1px solid #e5e7eb; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.topbar img { height: 32px; }
.topbar nav { display: flex; gap: 4px; margin-left: 20px; }
.topbar nav a { padding: 8px 14px; color: #555; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 500; }
.topbar nav a:hover { background: #f0f2f5; }
.topbar nav a.active { background: #eff5fb; color: #1a5490; }
.topbar .user { margin-left: auto; font-size: 13px; color: #666; display: flex; align-items: center; gap: 12px; }
.topbar .user a { color: #1a5490; text-decoration: none; }

/* Contenedor principal */
.main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Historial */
.hist-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hist-header h1 { font-size: 20px; font-weight: 500; }
.hist-header .spacer { flex: 1; }
.btn-primary { padding: 9px 18px; background: #1a5490; color: white; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: #144270; }
.btn-secondary { padding: 9px 18px; background: white; color: #333; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-secondary:hover { background: #f5f5f5; }

.searchbar { background: white; padding: 12px 16px; border-radius: 8px; border: 1px solid #e5e7eb; margin-bottom: 16px; }
.searchbar input { width: 100%; padding: 10px 14px; font-size: 14px; border: 1px solid #ddd; border-radius: 6px; }
.searchbar input:focus { outline: none; border-color: #1a5490; }

.table-wrap { background: white; border-radius: 8px; border: 1px solid #e5e7eb; overflow: hidden; }
table.hist { width: 100%; border-collapse: collapse; }
table.hist th { background: #fafbfc; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #666; text-align: left; font-weight: 500; border-bottom: 1px solid #e5e7eb; }
table.hist td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
table.hist tr:last-child td { border-bottom: none; }
table.hist tr:hover { background: #fafbfc; }
table.hist .folio { font-weight: 600; color: #1a5490; }
table.hist .total { text-align: right; font-variant-numeric: tabular-nums; }
table.hist .acciones { text-align: right; white-space: nowrap; }
table.hist .acciones a { display: inline-block; padding: 5px 10px; margin-left: 4px; font-size: 12px; border-radius: 4px; text-decoration: none; }
.acc-ver { background: #eff5fb; color: #1a5490; }
.acc-edit { background: #fef9e7; color: #a06400; }
.acc-wa { background: #e7f7ec; color: #1a7d3f; }
.acc-ver:hover, .acc-edit:hover, .acc-wa:hover { opacity: .85; }

.empty { text-align: center; padding: 60px 20px; color: #888; }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .3; }

/* App de captura */
.app-container { max-width: 900px; margin: 0 auto; background: white; padding: 24px 28px; border-radius: 8px; border: 1px solid #e5e7eb; }
