@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #10151c;
}
a { color: #0d9488; }
a:hover { color: #0f766e; }
input, button, textarea { font-family: inherit; }
code, .mono { font-family: 'IBM Plex Mono', monospace; }
::selection { background: #99f6e4; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; width: 100%; overflow: hidden; background: #f5f6f8; }

.sidebar { width: 256px; flex-shrink: 0; background: #0f1620; display: flex; flex-direction: column; border-right: 1px solid #1d2733; }
.sidebar-brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #1a2430; }
.sidebar-brand .logo { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(145deg,#0d9488,#115e59); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-brand .name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.sidebar-brand .sub { color: #5f6d7e; font-size: 11px; font-weight: 500; letter-spacing: 0.3px; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label { color: #4a5768; font-size: 10.5px; font-weight: 600; letter-spacing: 1px; padding: 8px 12px 6px; }
.nav-btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background .12s, color .12s;
  background: transparent; color: #9aa7b5;
}
.nav-btn svg { flex-shrink: 0; }
.nav-btn.active { background: rgba(13,148,136,0.16); color: #5eead4; font-weight: 600; }
.nav-btn:hover:not(.active) { background: rgba(255,255,255,0.04); color: #d3dbe4; }

.sidebar-user { padding: 14px; border-top: 1px solid #1a2430; display: flex; align-items: center; gap: 11px; }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: #233040; color: #9db0c4; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.sidebar-user .name { color: #d3dbe4; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .sub { color: #5f6d7e; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: #fff; border-bottom: 1px solid #e6e8ec; padding: 18px 34px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.topbar p { color: #8b94a1; font-size: 13px; margin-top: 2px; }
.topbar-badge { display: flex; align-items: center; gap: 9px; background: #f0faf8; border: 1px solid #cdeee7; padding: 8px 13px; border-radius: 9px; }
.topbar-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.topbar-badge .label { font-size: 12px; color: #5f6d7e; }
.topbar-badge code { font-size: 12px; color: #0f766e; font-weight: 500; }

.content { flex: 1; overflow-y: auto; padding: 34px; }
.screen { animation: fadeUp 0.35s ease both; }

/* ---------- cards / buttons (generic) ---------- */
.card { background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; padding: 20px; }
.btn {
  border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 11px 20px; border: none; background: #0d9488; color: #fff;
  transition: background .12s;
}
.btn:hover { background: #0f766e; }
.btn.secondary { background: #fff; border: 1px solid #d3d9e0; color: #5f6d7e; font-weight: 500; }
.btn.secondary:hover { border-color: #b8bfc8; }
.btn.small { padding: 6px 13px; font-size: 12.5px; border-radius: 7px; background: #fff; border: 1px solid #d3d9e0; color: #10151c; font-weight: 500; }
.btn.small:hover { border-color: #0d9488; color: #0d9488; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- inicio ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 22px; }
.stat-grid .card .label { color: #8b94a1; font-size: 12.5px; font-weight: 500; margin-bottom: 10px; }
.stat-grid .card .value { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.stat-grid .card .value.teal { color: #0d9488; }
.stat-grid .card .value.amber { color: #b45309; }

.recipient-row { background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; padding: 22px 24px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.recipient-row .label { color: #8b94a1; font-size: 12.5px; font-weight: 500; margin-bottom: 8px; }
.recipient-row code { font-size: 15px; color: #10151c; font-weight: 500; }

.section-label { font-size: 14px; font-weight: 600; color: #4a5768; letter-spacing: 0.2px; margin-bottom: 14px; }
.action-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.action-card {
  text-align: left; background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; padding: 20px;
  cursor: pointer; transition: all .15s; width: 100%;
}
.action-card:hover { border-color: #0d9488; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,22,32,0.06); }
.action-card .icon { width: 40px; height: 40px; border-radius: 10px; background: #eafaf7; color: #0d9488; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.action-card .title { font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.action-card .desc { color: #8b94a1; font-size: 13px; line-height: 1.5; }

/* ---------- destinatario ---------- */
.panel-card { background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; padding: 26px 28px; }
.panel-card.narrow { max-width: 560px; }
.field-block { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid #eef0f3; }
.field-block .label { color: #8b94a1; font-size: 12.5px; font-weight: 500; margin-bottom: 8px; }
.field-block code { font-size: 14px; color: #10151c; font-weight: 500; }
label.field-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.input-group { display: flex; align-items: stretch; border: 1px solid #e6e8ec; border-radius: 9px; overflow: hidden; transition: border-color .15s; }
.input-group.focused { border-color: #0d9488; }
.input-group .prefix { background: #f5f6f8; color: #8b94a1; padding: 11px 13px; font-size: 14px; border-right: 1px solid #e6e8ec; display: flex; align-items: center; }
.input-group input { flex: 1; border: none; outline: none; padding: 11px 13px; font-size: 14px; font-family: 'IBM Plex Mono', monospace; }
.help-text { color: #8b94a1; font-size: 12.5px; margin-top: 9px; line-height: 1.5; }
.help-text code { font-size: 12px; }
.preview-box { margin-top: 14px; padding: 11px 13px; background: #f8f9fb; border: 1px dashed #dfe3e8; border-radius: 8px; font-size: 12.5px; color: #5f6d7e; }
.preview-box code { color: #0f766e; font-weight: 500; }
.btn-row { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- empleados ---------- */
.emp-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; max-width: 380px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-box input { width: 100%; border: 1px solid #e6e8ec; border-radius: 9px; padding: 11px 13px 11px 38px; font-size: 14px; outline: none; background: #fff; }
.search-box input:focus { border-color: #0d9488; }
.emp-count { color: #8b94a1; font-size: 13px; }

.emp-table { background: #fff; border: 1px solid #e6e8ec; border-radius: 12px; overflow: hidden; }
.emp-row-head, .emp-row {
  display: grid; grid-template-columns: 2fr 1fr 1.3fr 1.4fr 96px; gap: 14px; align-items: center;
}
.emp-row-head { padding: 13px 20px; background: #fafbfc; border-bottom: 1px solid #eef0f3; font-size: 11.5px; font-weight: 600; color: #8b94a1; letter-spacing: 0.4px; text-transform: uppercase; }
.emp-row { padding: 14px 20px; border-bottom: 1px solid #f2f3f5; }
.emp-row:last-child { border-bottom: none; }
.emp-name { display: flex; align-items: center; gap: 11px; }
.emp-name .avatar { width: 32px; height: 32px; border-radius: 50%; background: #eef1f4; color: #5f6d7e; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.emp-name span { font-size: 14px; font-weight: 500; }
.emp-dni { font-size: 13.5px; color: #5f6d7e; font-family: 'IBM Plex Mono', monospace; }
.emp-area { font-size: 13.5px; color: #5f6d7e; }
.emp-tel { font-size: 13.5px; color: #10151c; font-family: 'IBM Plex Mono', monospace; }
.badge-sintel { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #b45309; background: #fdf6ec; border: 1px solid #f6e4c8; padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.emp-actions { text-align: right; }
.emp-empty { padding: 44px; text-align: center; color: #8b94a1; font-size: 14px; }

/* ---------- upload ---------- */
.upload-drop { display: block; cursor: pointer; }
.upload-drop input[type=file] { display: none; }
.dropzone { background: #fff; border: 2px dashed #d3d9e0; border-radius: 14px; padding: 52px 30px; text-align: center; transition: all .15s; }
.dropzone:hover, .dropzone.dragover { border-color: #0d9488; background: #f6fbfa; }
.dropzone .icon { width: 56px; height: 56px; border-radius: 14px; background: #eafaf7; color: #0d9488; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.dropzone .title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.dropzone .sub { color: #8b94a1; font-size: 13px; }
.upload-hint { margin-top: 18px; background: #f8f9fb; border: 1px solid #eef0f3; border-radius: 10px; padding: 16px 18px; font-size: 13px; color: #5f6d7e; line-height: 1.6; }
.upload-hint strong { color: #10151c; }

.upload-result { background: #fff; border: 1px solid #e6e8ec; border-radius: 14px; padding: 26px 28px; animation: slideIn 0.3s ease both; }
.upload-result-head { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid #eef0f3; margin-bottom: 20px; }
.upload-result-head .icon { width: 44px; height: 44px; border-radius: 10px; background: #eafaf7; color: #0d9488; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.upload-result-head .name { font-size: 15px; font-weight: 600; }
.upload-result-head .status { color: #0d9488; font-size: 12.5px; font-weight: 500; }
.upload-result-head .status.err { color: #b91c1c; }
.upload-result-head button { margin-left: auto; background: none; border: none; color: #8b94a1; cursor: pointer; font-size: 13px; text-decoration: underline; }

.upload-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.upload-stats .box { background: #f8f9fb; border-radius: 10px; padding: 16px; }
.upload-stats .box .label { color: #8b94a1; font-size: 12px; margin-bottom: 6px; }
.upload-stats .box .value { font-size: 24px; font-weight: 700; }
.upload-stats .box .value.teal { color: #0d9488; }
.upload-stats .box .value.amber { color: #b45309; }
.upload-stats .box .value.gray { color: #5f6d7e; }

.report-list { margin-bottom: 18px; }
.report-list .heading { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.report-list .desc { color: #8b94a1; font-size: 12.5px; margin-bottom: 8px; line-height: 1.5; }
.report-list ul { max-height: 160px; overflow-y: auto; background: #f8f9fb; border: 1px solid #eef0f3; border-radius: 8px; padding: 10px 16px; font-size: 12.5px; color: #5f6d7e; list-style: disc; }
.report-list li { margin: 3px 0; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,22,32,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 440px; max-width: 100%; box-shadow: 0 24px 60px rgba(15,22,32,0.28); animation: slideIn 0.25s ease both; }
.modal-head { padding: 22px 26px; border-bottom: 1px solid #eef0f3; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head p { color: #8b94a1; font-size: 13px; margin-top: 3px; }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 16px 26px 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 26px; right: 26px; background: #0f1620; color: #fff; padding: 13px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500; box-shadow: 0 14px 34px rgba(15,22,32,0.3); display: flex; align-items: center; gap: 10px; z-index: 60; animation: slideIn 0.25s ease both; }
.toast.err { background: #7a1f1a; }

.hidden { display: none !important; }
