:root {
  --brand: #0068b5;
  --brand-dark: #005393;
  --soft: #e9f3fc;
  --ink: #263544;
  --muted: #647588;
  --line: #e3e9ef;
  --navy: #0068b5;
  --blue: #0068b5;
  --green: #20764b;
  --amber: #945f06;
  --sidebar: #f5f7fa;
  --radius: 12px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font:
    14px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  min-height: 42px;
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 600;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: var(--brand-dark);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #53ace6;
  outline-offset: 3px;
}
.secondary,
.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.secondary:hover,
.ghost:hover {
  background: var(--soft);
}
.warn {
  background: #fff2df;
  color: #825200;
}
.warn:hover {
  background: #ffe3b6;
}
.danger {
  color: #a72e32;
  background: #fff0f0;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd7e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
}
input[type="color"] {
  padding: 3px;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
label {
  display: block;
  font-weight: 600;
  margin: 14px 0 5px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.9px;
  line-height: 1.2;
  margin-bottom: 9px;
  font-weight: 650;
}
h2 {
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 16px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.65;
}
.muted,
.hint {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
body:not(.authenticated) #shell {
  display: none !important;
}
body.authenticated #login {
  display: none !important;
}
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 10% 20%, #2799d3 0, transparent 50%),
    linear-gradient(125deg, #036daf, #004885);
  padding: 24px;
}
.card {
  width: min(430px, 100%);
  padding: 36px 38px;
  border-radius: 20px;
  background: white;
  box-shadow: 0 20px 80px #00355f55;
}
.login h1 {
  font-size: 30px;
  margin-top: 24px;
}
.login .brand {
  font-weight: 700;
  color: var(--brand);
  margin-top: 10px;
}
.login-symbol {
  width: 48px;
  height: 48px;
  background: var(--soft);
  border-radius: 14px;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 30px;
}
.login-submit {
  width: 100%;
  margin-top: 22px;
}
.recovery-link {
  background: none;
  color: var(--brand);
  font-size: 13px;
  width: 100%;
  margin-top: 10px;
}
.recovery-link:hover {
  background: var(--soft);
}
.login-caption {
  color: #d9efff;
  font-size: 12px;
  margin-top: 25px;
  text-align: center;
}
.brand img {
  max-width: 155px !important;
  max-height: 34px !important;
  object-fit: contain;
  background: white;
  border-radius: 5px;
}
.topbar {
  height: 64px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 25px;
}
.topbar .brand {
  font-size: 19px;
  font-weight: 650;
  display: flex;
  align-items: center;
}
.topbar-spacer {
  flex: 1;
}
.topbar-button {
  border: 1px solid #ffffff50;
  background: #ffffff14;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}
.topbar-button:hover {
  background: #ffffff25;
}
.avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d8edfb;
  color: #115b88;
  font-size: 13px;
  padding: 0;
}
.topbar .avatar {
  background: #ffffffdd;
}
.icon-button {
  background: transparent;
  color: inherit;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  font-size: 19px;
}
.icon-button:hover {
  background: #80808015;
}
#menuToggle {
  display: none;
}
.connection-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9de0b7;
  flex-shrink: 0;
}
.sidebar {
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
  border-right: 1px solid var(--line);
  z-index: 15;
  padding: 24px 12px 12px;
}
.workspace-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 25px;
}
.workspace-label strong {
  display: block;
  font-size: 14px;
}
.workspace-label small {
  font-size: 11px;
  color: var(--muted);
}
.workspace-icon {
  font-size: 25px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e2edf8;
  color: var(--brand);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav button {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  background: transparent;
  color: #566778;
  font-size: 13px;
  padding: 11px 15px;
  border-radius: 8px;
  font-weight: 550;
}
.nav button:before {
  content: attr(data-icon);
  font-size: 20px;
  font-weight: 400;
  width: 21px;
  text-align: center;
}
.nav button:not([data-icon]):before {
  content: "▧";
}
.nav button.active {
  background: #e3eef9;
  color: #005c9f;
  font-weight: 650;
}
.nav button:hover {
  background: #eaf0f6;
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px 6px 0;
}
.sync-note {
  font-size: 10px;
  color: #7b8997;
  display: flex;
  gap: 6px;
  align-items: center;
}
.sync-note .connection-dot {
  background: #66a989;
}
.text-button {
  background: none;
  color: var(--muted);
  padding: 5px 0;
  font-size: 11px;
  min-height: 32px;
}
.text-button:hover {
  background: none;
  color: var(--brand);
}
.account {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.account small {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.account .icon-button {
  font-size: 19px;
  min-width: 28px;
  padding: 3px;
}
.content {
  margin-left: 236px;
  padding: 90px 40px 40px;
  max-width: 1800px;
}
.breadcrumb {
  font-size: 11px;
  color: #8794a3;
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
}
.breadcrumb span:last-child {
  color: #506478;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-heading p {
  margin: 0;
  font-size: 13px;
}
.eyebrow {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 10px;
}
.grid,
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 25px 0;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  background: #fff;
}
.metric small {
  color: var(--muted);
  font-size: 11px;
}
.metric b {
  display: block;
  font-size: 31px;
  letter-spacing: -1px;
  font-weight: 600;
  margin-top: 5px;
}
.metric .metric-note {
  font-size: 10px;
  color: #8493a2;
  margin-top: 4px;
}
.metric-icon {
  float: right;
  color: var(--brand);
  font-size: 19px;
  background: #eef6fc;
  border-radius: 8px;
  padding: 4px 9px;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  margin: 18px 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-heading h2 {
  margin: 0;
}
.panel-heading button {
  font-size: 11px;
  min-height: 32px;
  padding: 5px 11px;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr);
  gap: 24px;
}
.dashboard-layout .panel {
  margin: 0;
}
.welcome-banner {
  border: 1px solid #d8eaf8;
  border-radius: 14px;
  padding: 25px;
  background: linear-gradient(110deg, #eef7fe, #f8fcff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.welcome-banner h2 {
  margin-bottom: 7px;
  font-size: 19px;
}
.welcome-banner p {
  margin: 0;
  color: #617a91;
  font-size: 12px;
  max-width: 500px;
}
.banner-symbol {
  font-size: 48px;
  color: #83b6dc;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 380px;
}
.search-field input {
  padding-left: 36px;
  background: #fafbfd;
  border-color: var(--line);
  font-size: 12px;
}
.search-field:before {
  content: "⌕";
  position: absolute;
  left: 13px;
  top: 6px;
  font-size: 24px;
  color: #8795a3;
}
.toolbar select {
  width: auto;
  max-width: 260px;
  font-size: 12px;
}
.result-count {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.data-table th {
  font-size: 10px;
  letter-spacing: 0.4px;
  color: #8a97a4;
  font-weight: 600;
  background: #fafbfd;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 19px 18px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover {
  background: #f9fcff;
}
.name-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 170px;
}
.folder-icon {
  width: 37px;
  height: 37px;
  background: #eaf3ff;
  color: #4e95cf;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 23px;
  flex-shrink: 0;
}
.name-cell strong {
  font-size: 12px;
  color: #304256;
  display: block;
  font-weight: 650;
}
.name-cell small {
  font-size: 10px;
  color: #8a96a3;
  display: block;
  margin-top: 3px;
}
.row-link {
  background: none;
  color: inherit;
  text-align: left;
  padding: 0;
  min-height: 0;
}
.row-link:hover {
  background: none;
  color: var(--brand);
}
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.row-actions button {
  min-height: 32px;
  font-size: 11px;
  padding: 6px 10px;
  white-space: nowrap;
}
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  display: inline-block;
  white-space: nowrap;
  background: #eef2f6;
  color: #627588;
}
.tag.aprobado {
  background: #eaf7f0;
  color: #23794c;
}
.tag.pendiente {
  background: #fff5e3;
  color: #99711f;
}
.tag.observaciones {
  background: #fdefec;
  color: #ad5444;
}
.tag.active {
  background: #e9f4ff;
  color: #2874b1;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
}
.full {
  grid-column: 1/-1;
}
.form-section {
  margin: 22px 0;
  padding: 0;
  border: 0;
}
.form-section legend {
  font-weight: 650;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  padding-bottom: 10px;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
}
.notice {
  color: #9a601a;
  font-size: 12px;
  min-height: 18px;
  margin: 12px 0 0;
}
.entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.entry:last-child {
  border: 0;
}
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.entry p {
  font-size: 12px;
  margin: 7px 0;
  color: #526879;
  white-space: pre-wrap;
}
.entry .muted {
  font-size: 10px;
}
.activity-line {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.activity-line:last-child {
  border: 0;
}
.activity-line p {
  margin: 0;
  font-size: 12px;
}
.activity-line small {
  font-size: 10px;
  color: #8593a2;
}
.activity-mark {
  width: 30px;
  height: 30px;
  background: #eef5fb;
  color: #598eb7;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.quick-action {
  width: 100%;
  background: transparent;
  color: var(--ink);
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 14px 3px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.quick-action:last-child {
  border: 0;
}
.quick-action:hover {
  background: #f8fbff;
}
.quick-action span {
  font-size: 23px;
  color: var(--brand);
  width: 35px;
}
.quick-action strong {
  font-size: 12px;
  display: block;
}
.quick-action small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.empty-state {
  text-align: center;
  padding: 45px 20px;
}
.empty-state .empty-icon {
  font-size: 40px;
  color: #94bada;
  margin-bottom: 12px;
}
.empty-state h2 {
  font-size: 18px;
  margin-bottom: 7px;
}
.empty-state p {
  font-size: 12px;
  color: var(--muted);
}
.modal {
  position: fixed;
  inset: 0;
  background: #19334d66;
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 22px;
}
.modal > .panel,
.modal > .signature,
.dialog {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  margin: 0;
  box-shadow: 0 20px 80px #10263f44;
}
.modal .signature {
  width: min(640px, 94vw);
}
.modal h2 {
  font-size: 22px;
}
.signature canvas {
  width: 100%;
  height: 180px;
  border: 2px dashed #c5d6e5;
  border-radius: 10px;
  touch-action: none;
}
.modal-close {
  float: right;
}
.detail-body {
  white-space: pre-wrap;
}
.detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
}
.files {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.files a {
  color: var(--brand);
}
details {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  margin: 16px 0;
}
summary {
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #213b52;
  color: #fff;
  padding: 13px 22px;
  border-radius: 10px;
  z-index: 100;
  box-shadow: 0 6px 25px #213b5230;
  font-size: 13px;
  max-width: 90vw;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.offline {
  color: #ffe7aa;
}
.project {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.inspection-scroll {
  max-width: 100%;
}
.skeleton {
  height: 150px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f2f5f8, #fafbfd, #f2f5f8);
  background-size: 200% 100%;
  animation: pulse 1.4s infinite;
}
.loading-label {
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
}
.data-editor {
  overflow: auto;
}
a {
  color: var(--brand);
}
@keyframes pulse {
  to {
    background-position: -200% 0;
  }
}
@media (min-width: 1550px) {
  .content {
    padding-left: 55px;
    padding-right: 55px;
  }
}
@media (max-width: 1150px) {
  .content {
    padding: 90px 25px 30px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .dashboard-layout {
    grid-template-columns: 1.5fr 1fr;
  }
  .data-table .optional {
    display: none;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  .sidebar {
    width: 214px;
  }
  .content {
    margin-left: 214px;
    padding: 88px 22px 30px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-layout,
  .split {
    grid-template-columns: 1fr;
  }
  .banner-symbol {
    display: none;
  }
  .topbar {
    padding: 0 18px;
  }
  .topbar .brand {
    font-size: 16px;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 58px;
    padding: 0 12px;
    gap: 10px;
  }
  .topbar .brand {
    font-size: 15px;
  }
  .topbar small {
    font-size: 10px;
  }
  .topbar-button {
    display: none;
  }
  #menuToggle {
    display: block;
  }
  .sidebar {
    top: 58px;
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.18s;
    box-shadow: 5px 0 30px #203d4c20;
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .content {
    margin-left: 0;
    padding: 79px 18px 30px;
  }
  .breadcrumb {
    margin-bottom: 20px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .page-heading > button {
    font-size: 11px;
    white-space: nowrap;
    padding: 9px 12px;
  }
  .welcome-banner {
    padding: 18px;
  }
  .welcome-banner h2 {
    font-size: 17px;
  }
  .welcome-banner p {
    font-size: 11px;
  }
  .metric {
    padding: 15px;
  }
  .metric b {
    font-size: 27px;
  }
  .metric-icon {
    font-size: 15px;
    padding: 3px 7px;
  }
  .panel {
    padding: 18px;
  }
  .toolbar {
    gap: 9px;
  }
  .toolbar select {
    max-width: 100%;
    flex: 1;
  }
  .result-count {
    width: 100%;
    margin: 0;
  }
  .data-table th,
  .data-table td {
    padding: 14px 12px;
  }
  .data-table .mobile-hide {
    display: none;
  }
  .row-actions button {
    padding: 6px 8px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 10px;
  }
  .modal > .panel,
  .modal > .signature,
  .dialog {
    padding: 22px 18px;
    max-height: 94dvh;
    border-radius: 12px;
  }
  .form-actions {
    position: sticky;
    bottom: -22px;
    background: white;
    padding: 14px 0;
    margin-bottom: -10px;
  }
  .card {
    padding: 28px;
  }
  .account {
    margin-top: 12px;
  }
  .name-cell {
    min-width: 145px;
    gap: 8px;
  }
  .folder-icon {
    width: 30px;
    height: 30px;
  }
  .search-field {
    max-width: none;
  }
  .login h1 {
    font-size: 27px;
  }
  .inspection-toolbar button {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 650px) {
  .topbar .brand.company-label {
    font-size: 14px;
    max-width: 145px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .topbar #syncState {
    max-width: 75px;
    line-height: 1.3;
  }
  .sidebar {
    visibility: hidden;
  }
  .menu-open .sidebar {
    visibility: visible;
  }
  #projectResults .table-wrap,
  #entryResults .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  #projectResults .data-table,
  #entryResults .data-table,
  #projectResults tbody,
  #entryResults tbody {
    display: block;
    width: 100%;
  }
  #projectResults thead,
  #entryResults thead {
    display: none;
  }
  #projectResults tbody tr,
  #entryResults tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    background: white;
    gap: 12px;
  }
  #projectResults td,
  #entryResults td {
    display: block;
    padding: 0;
    border: 0;
  }
  #projectResults td:first-child,
  #entryResults td:first-child {
    grid-column: 1/-1;
  }
  #projectResults td.optional,
  #projectResults td.mobile-hide,
  #entryResults td.optional,
  #entryResults td.mobile-hide {
    display: none;
  }
  #projectResults td:last-child,
  #entryResults td:last-child {
    justify-self: end;
    align-self: center;
  }
  #projectResults td:nth-child(3),
  #entryResults td:nth-child(3) {
    align-self: center;
  }
  .name-cell {
    min-width: 0;
  }
  .name-cell strong {
    font-size: 13px;
  }
  .name-cell small {
    font-size: 11px;
    line-height: 1.5;
  }
  .row-actions button {
    min-height: 38px;
    padding: 7px 11px;
  }
  .pagination {
    align-items: flex-start;
    gap: 12px;
  }
  .pagination > span {
    max-width: 90px;
    font-size: 11px;
  }
}
.activity-line .tag {
  align-self: flex-start;
}
