* { box-sizing: border-box; }
:root {
  --bg: #eef2f8;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --border: #dbe3ee;
  --primary: #c61d23;
  --primary-dark: #971419;
  --primary-soft: rgba(198, 29, 35, 0.08);
  --success: #1f9d55;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(198,29,35,.09), transparent 22%),
    linear-gradient(180deg, #f5f7fb 0%, #eef2f8 100%);
  color: var(--text);
}
body { min-height: 100vh; }
a { color: inherit; }
.hidden { display: none !important; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 18px; }
.topbar {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  background: linear-gradient(135deg, #c61d23 0%, #8f161b 100%); color: #fff;
  padding: 22px 24px; border-radius: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 999px; background: rgba(255,255,255,.16); color: inherit;
  font-size: .8rem; font-weight: 700; margin-bottom: 10px;
}
.topbar h1 { margin: 0 0 6px; font-size: 1.9rem; }
.topbar p { margin: 0; opacity: .92; max-width: 720px; }
.topbar-actions, .user-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-badge {
  background: rgba(255,255,255,.16); padding: 10px 14px; border-radius: 999px;
  font-size: .94rem; font-weight: 700;
}
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
  padding: 0 7px; border-radius: 999px; background: #111827; color: #fff; font-size: .78rem;
}
main { display: block; }
.card {
  background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: 24px; padding: 20px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05); backdrop-filter: blur(8px);
}
.compact-card { padding: 18px; }
.inner-card { background: var(--card-soft); border-radius: 20px; }
.auth-card { max-width: 1120px; margin: 0 auto; }
.auth-card-wide { overflow: hidden; }
.auth-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: stretch; }
.auth-copy {
  padding: 8px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.auth-copy h2, .auth-form-wrap h2 { margin: 0; }
.auth-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-form-wrap {
  background: var(--card-soft); border: 1px solid #e4ebf5; border-radius: 22px; padding: 22px;
}
.auth-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-info-card {
  background: #fff; border: 1px solid #e7edf6; border-radius: 18px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.mini-info-card strong { font-size: .96rem; }
.mini-info-card span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.workspace-hero {
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
}
.workspace-hero h2 { margin: 0 0 6px; }
.workspace-nav, .admin-nav {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.nav-chip {
  border: 1px solid #d6deea; background: #fff; color: var(--text); border-radius: 999px;
  min-height: 42px; padding: 0 14px; font-weight: 700; cursor: pointer;
}
.nav-chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(198, 29, 35, .18);
}
.workspace-panel { display: block; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 12px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 22px; }
.grid { display: grid; gap: 18px; }
.two-col { grid-template-columns: 1.05fr .95fr; }
.two-col-form, .compact-grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-title-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.section-title-row h2, .section-title-row h3, .section-top-actions h2 { margin: 0; }
.notice {
  display: none; margin-bottom: 16px; padding: 14px 16px; border-radius: 16px; border: 1px solid transparent;
}
.notice.show { display: block; }
.notice.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.notice.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.notice.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
label { display: block; font-weight: 700; font-size: .91rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; border: 1px solid #cad6e2; background: #fff; border-radius: 14px; padding: 12px 14px;
  font: inherit; color: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea { resize: vertical; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 52px; }
.password-toggle-btn {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 38px; height: 38px;
  border: 1px solid #d6deea; background: #fff; border-radius: 12px; cursor: pointer; font-size: 1rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  border-radius: 14px; border: 1px solid transparent; padding: 0 16px; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .04s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(198, 29, 35, .18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border-color: #cad6e2; color: var(--text); }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: #fff7db; color: #7c4b00; border-color: #f2d48f; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; border: 1px solid #d4dbe6; background: #fff;
  font-size: 1.4rem; cursor: pointer;
}
.inline-actions { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.align-end { align-self: end; }
.filter-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-scroll { overflow: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e7edf5; text-align: left; vertical-align: top; font-size: .93rem; }
th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; text-transform: capitalize;
}
.badge.pendiente { background: #fef3c7; color: #92400e; }
.badge.aceptada { background: #dcfce7; color: #166534; }
.badge.rechazada { background: #fee2e2; color: #991b1b; }
.file-link { color: #0f62fe; font-weight: 700; text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.status-detail { margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.rejection-box {
  margin-top: 10px; border-left: 4px solid var(--danger); background: #fff5f5; padding: 10px 12px; border-radius: 12px;
  font-size: .92rem; line-height: 1.4;
}
.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compact-stats .stat-card { padding: 14px; }
.stat-card { border: 1px solid #e6edf6; border-radius: 18px; padding: 14px; background: #fff; }
.stat-label { display: block; color: var(--muted); font-size: .84rem; margin-bottom: 6px; }
.stat-value { display: block; font-size: 1.08rem; font-weight: 800; }
.cards-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.order-card { border: 1px solid #e6edf6; border-radius: 20px; padding: 16px; background: #fff; }
.order-card p { margin: 0; }
.order-card .section-title-row h3 { font-size: 1rem; }
.order-meta { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0; }
.kv { background: var(--card-soft); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.kv span:first-child { color: var(--muted); font-size: .82rem; }
.order-observation {
  background: #fbfcfe; border: 1px solid #edf2f7; border-radius: 14px; padding: 12px; color: #334155; line-height: 1.45;
}
.approval-modal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); gap: 20px; align-items: start; }
.approval-summary-panel { background: var(--card-soft); border-radius: 18px; padding: 16px; }
.approval-summary-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-item { background: #fff; border: 1px solid #e6edf6; border-radius: 14px; padding: 10px 12px; }
.summary-label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 5px; font-weight: 700; }
.summary-value { display: block; font-weight: 700; word-break: break-word; }
.approval-observation-block, .approval-support-block {
  background: #fff; border: 1px solid #e6edf6; border-radius: 14px; padding: 12px;
}
.approval-support-preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: #f1f5f9; margin: 8px 0 10px; }
.signature-box { border: 1px dashed #94a3b8; border-radius: 16px; overflow: hidden; background: #fff; }
#signaturePad { display: block; width: 100%; height: 180px; }
.notification-item { border: 1px solid #e6edf6; border-radius: 16px; padding: 14px; background: #fff; }
.notification-item.unread { border-color: #fecaca; background: #fff7f7; }
.modal {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .58); }
.modal-dialog { position: relative; z-index: 1; width: min(1120px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.small-dialog { width: min(560px, 100%); }
.medium-dialog { width: min(760px, 100%); }
.reject-dialog { width: min(760px, 100%); }
.acta-dialog { width: min(1180px, 100%); }
.camera-capture-block {
  border: 1px solid #e2e8f0; border-radius: 18px; padding: 14px; background: #f8fafc;
}
.help-text { margin: 6px 0 10px; color: #475569; font-size: .92rem; }
.camera-preview-box {
  position: relative; width: 100%; min-height: 240px; border-radius: 16px; overflow: hidden;
  background: #0f172a; display: flex; align-items: center; justify-content: center;
}
.camera-video, .camera-photo-preview { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.camera-status { margin: 10px 0 0; font-size: .92rem; color: #334155; }
.camera-actions-wrap { flex-wrap: wrap; }
.admin-subpanel { display: block; }
.section-top-actions {
  display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap;
}
.compact-cards .order-card { min-height: 100%; }
.acta-stage {
  border: 1px solid #e6edf6; border-radius: 20px; padding: 16px; background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: auto;
}
.acta-sheet {
  width: min(100%, 960px); margin: 0 auto; background: #fff; color: #111827; border: 2px solid #111827;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08); aspect-ratio: 17 / 11; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.acta-header {
  display: grid; grid-template-columns: 138px 1fr 138px; gap: 10px; align-items: center;
}
.acta-logo {
  height: 52px; border: 1px solid #111827; display: flex; align-items: center; justify-content: center; padding: 6px; overflow: hidden; font-weight: 700; font-size: .72rem;
}
.acta-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.acta-title {
  border: 1px solid #111827; text-align: center; font-weight: 800; font-size: 1rem; padding: 12px 10px; letter-spacing: .2px;
}
.acta-meta-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
}
.acta-meta-item {
  border: 1px solid #111827; padding: 7px 8px; min-height: 50px; display: flex; flex-direction: column; gap: 4px; font-size: .72rem;
}
.acta-meta-item strong { font-size: .7rem; }
.acta-paragraph {
  border: 1px solid #111827; padding: 8px 10px; font-size: .72rem; line-height: 1.35; text-align: justify;
}
.acta-main-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.acta-main-table th, .acta-main-table td { border: 1px solid #111827; padding: 6px; text-align: center; }
.acta-main-table td.left { text-align: left; }
.acta-main-table th { background: #f3f4f6; }
.acta-total-label { background: #fff4a8; font-weight: 800; text-align: right !important; }
.acta-secondary-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.acta-detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
}
.acta-detail-card {
  border: 1px solid #111827; min-height: 50px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; font-size: .71rem;
}
.acta-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.acta-evidence-card {
  border: 1px solid #111827; padding: 6px; display: flex; flex-direction: column; gap: 6px; font-size: .7rem; min-height: 138px;
}
.acta-evidence-card strong { font-size: .68rem; }
.acta-evidence-box {
  flex: 1; min-height: 88px; border: 1px solid #cbd5e1; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.acta-evidence-box img { width: 100%; height: 100%; object-fit: contain; }
.acta-signatures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acta-signature-card { border: 1px solid #111827; padding: 8px; min-height: 80px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.acta-sign-line { border-top: 1px solid #111827; padding-top: 6px; font-size: .72rem; text-align: center; }
.acta-sign-preview { min-height: 30px; display: flex; align-items: flex-end; justify-content: center; }
.acta-sign-preview img { max-height: 28px; max-width: 90%; object-fit: contain; }
.acta-typed-signature { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.55rem; line-height: 1; color: #111827; }
.acta-empty { color: #64748b; font-size: .7rem; }
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid, .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .auth-layout, .approval-modal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-benefits, .acta-meta-grid, .acta-secondary-grid, .acta-detail-grid, .acta-evidence-grid, .acta-signatures {
    grid-template-columns: 1fr;
  }
  .acta-header { grid-template-columns: 1fr; }
  .acta-sheet { aspect-ratio: auto; min-height: auto; }
}
@media (max-width: 720px) {
  .app-shell { padding: 12px; }
  .topbar { padding: 18px; border-radius: 20px; }
  .topbar h1 { font-size: 1.45rem; }
  .card { padding: 16px; border-radius: 20px; }
  .workspace-nav, .admin-nav { gap: 8px; overflow: auto; padding-bottom: 2px; }
  .nav-chip { white-space: nowrap; }
  .filter-grid, .compact-grid, .two-col-form, .order-meta, .approval-summary-grid, .stats-grid {
    grid-template-columns: 1fr;
  }
  th, td { font-size: .89rem; }
  .table-scroll table { min-width: 680px; }
  .camera-preview-box { min-height: 220px; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-dialog { max-height: calc(100vh - 20px); border-radius: 22px 22px 0 0; }
}
