:root {
  --bg: #f6f7f9;
  --ink: #202b36;
  --muted: #8b939e;
  --line: #edf0f3;
  --blue: #419378;
  --green: #289a76;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
aside {
  width: 228px;
  position: fixed;
  inset: 0 auto 0 0;
  background: white;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -1.5px;
  padding: 0 16px;
}
.brand span {
  color: var(--blue);
}
.company {
  margin: 34px 10px 28px;
  padding: 13px 10px;
  background: #f8f9fb;
  border-radius: 9px;
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.company b {
  display: block;
  margin-bottom: 4px;
}
.square {
  background: #eaf4ef;
  color: var(--blue);
  border-radius: 8px;
  padding: 10px;
  font-weight: 700;
}
nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #737e8d;
  text-align: left;
  padding: 13px 15px;
  border-radius: 8px;
  margin: 4px 0;
}
nav button.active {
  color: var(--blue);
  background: #eaf4ef;
  font-weight: 600;
}
svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.navlabel {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #a0a8b2;
  margin: 10px 15px;
}
.navcount {
  margin-left: auto;
  background: #fff;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
}
.asidebottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 22px 10px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.avatar {
  border-radius: 50%;
  background: #ede9e4;
  color: #8b7963;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  font-weight: 600;
  flex-shrink: 0;
}
.asidebottom small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
main {
  margin-left: 228px;
}
header {
  height: 80px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
}
.breadcrumb {
  color: #9aa2ae;
  font-size: 12px;
}
.breadcrumb span {
  color: #4b5665;
  margin-left: 15px;
}
.topright {
  display: flex;
  align-items: center;
  gap: 22px;
}
.demo {
  font-size: 10px;
  color: #7f8b9a;
  background: #f5f6f8;
  border: 1px solid #eceff2;
  border-radius: 5px;
  padding: 6px 9px;
  letter-spacing: 0.6px;
}
.bell {
  position: relative;
  color: #7a8491;
}
.bell:after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #419378;
  border-radius: 50%;
  right: 2px;
  top: 0;
}
.content {
  padding: 37px 42px 50px;
  max-width: 1580px;
  margin: auto;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin: 0 0 9px;
  font-weight: 650;
}
p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.btn {
  border: 1px solid #e2e6ec;
  border-radius: 7px;
  background: #fff;
  padding: 10px 15px;
  color: #616d7b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 3px 6px #41937817;
}
.btn.small {
  padding: 7px 11px;
  font-size: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.statline {
  display: flex;
  justify-content: space-between;
  color: #85909d;
  font-size: 12px;
}
.statline svg {
  color: #a4afc0;
}
.value {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 17px 0 10px;
}
.stat small {
  color: #919aa5;
  font-size: 11px;
}
.stat small em {
  font-style: normal;
  color: var(--green);
  margin-right: 6px;
}
.grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panelhead {
  padding: 23px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panelhead h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
}
.link {
  background: none;
  border: 0;
  color: var(--blue);
  font-size: 12px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  background: #f2f4f7;
  color: #6d7988;
  border-radius: 5px;
  font-size: 10px;
  white-space: nowrap;
}
.tag.green {
  color: #288568;
  background: #eaf6f0;
}
.tag.amber {
  color: #b28a38;
  background: #fcf5e7;
}
.tag.blue {
  color: #5676c6;
  background: #edf2ff;
}
.tag.red {
  color: #c06a69;
  background: #fff0ef;
}
.agenda {
  padding: 0 25px 15px;
}
.task {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.time {
  color: #86909e;
  font-size: 11px;
  width: 42px;
  flex-shrink: 0;
}
.taskbar {
  width: 3px;
  height: 33px;
  border-radius: 4px;
  background: #9baff1;
}
.taskbar.green {
  background: #9bcdbd;
}
.tasktext {
  flex: 1;
}
.tasktext b {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 6px;
}
.tasktext small {
  font-size: 11px;
  color: #9ba3ad;
}
.task .avatar {
  width: 28px;
  height: 28px;
  font-size: 9px;
}
.panelbody {
  padding: 0 25px 20px;
}
.incident {
  border-top: 1px solid var(--line);
  padding: 17px 0;
  display: flex;
  gap: 11px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e9b568;
  margin-top: 5px;
  flex-shrink: 0;
}
.dot.red {
  background: #d88a88;
}
.incident b {
  font-size: 12px;
  font-weight: 550;
  display: block;
  margin-bottom: 6px;
}
.incident small {
  color: #9ba3ad;
  font-size: 11px;
}
.incident .tag {
  margin-left: auto;
  align-self: start;
}
.tablewrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #fafbfc;
  color: #9aa3af;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
  padding: 14px 25px;
  border-block: 1px solid var(--line);
}
td {
  padding: 18px 25px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: #788391;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  color: #485363;
  font-weight: 550;
}
td small {
  display: block;
  font-size: 10px;
  color: #a1a9b4;
  margin-top: 5px;
}
.money {
  color: #455161;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.search {
  border: 1px solid #e6e9ee;
  background: #fff;
  padding: 11px 14px;
  border-radius: 7px;
  min-width: 260px;
  color: #5f6b7b;
}
.tabs {
  display: flex;
  gap: 5px;
  background: #eceedf00;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  border-radius: 6px;
  color: #8993a0;
  font-size: 12px;
}
.tabs button.selected {
  background: #fff;
  box-shadow: 0 1px 5px #26334d0a;
  color: #32785e;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.community {
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s;
}
.community:hover {
  transform: translateY(-3px);
}
.community h3 {
  font-size: 15px;
  margin: 18px 0 6px;
}
.community p {
  font-size: 11px;
}
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.cardfoot {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 22px;
  font-size: 11px;
  color: #8c96a4;
}
.subtle {
  font-size: 11px;
  color: #a1a9b5;
  margin-top: 22px;
}
.empty {
  padding: 40px;
  text-align: center;
  color: #8b939e;
}
.progress {
  height: 4px;
  background: #eff1f6;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.progress i {
  display: block;
  background: #9bb0ef;
  height: 100%;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #a8afb9;
  font-size: 10px;
  margin-top: 26px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #202b3650;
  backdrop-filter: blur(3px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 570px;
  max-height: 90vh;
  overflow: auto;
  padding: 30px;
  box-shadow: 0 20px 100px #202b3620;
}
.modal h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.modal form {
  margin-top: 24px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.full {
  grid-column: 1/-1;
}
label {
  font-size: 11px;
  color: #7c8796;
}
input,
select,
textarea {
  border: 1px solid #e1e6ed;
  border-radius: 6px;
  padding: 11px;
  background: #fff;
  color: #455161;
  width: 100%;
}
textarea {
  min-height: 75px;
  resize: vertical;
}
.modalfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
.close {
  float: right;
  border: 0;
  background: none;
  font-size: 23px;
  color: #8b939e;
}
.detailrow {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 12px;
}
.detailrow span {
  color: #929ba6;
}
.detailsection {
  margin-top: 24px;
  font-size: 13px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + 70px);
  background: #253348;
  color: #fff;
  border-radius: 8px;
  padding: 13px 22px;
  z-index: 30;
  font-size: 12px;
  box-shadow: 0 10px 30px #0002;
}
.statusselect {
  border: 0;
  background: #f5f7fa;
  padding: 6px 8px;
  font-size: 11px;
  width: auto;
  max-width: 160px;
}
.rowclick {
  cursor: pointer;
}
.rowclick:hover {
  background: #fafbff;
}
.hint {
  background: #f5f7fe;
  padding: 12px;
  border-radius: 7px;
  color: #7f8caa;
  font-size: 11px;
  margin-top: 18px;
}
@media (min-width: 1500px) {
  .content {
    padding-top: 45px;
  }
  .task {
    padding: 22px 0;
  }
}
@media (max-width: 1100px) {
  aside {
    width: 190px;
    padding-inline: 12px;
  }
  main {
    margin-left: 190px;
  }
  .content {
    padding: 28px 24px;
  }
  header {
    padding: 0 24px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1.3fr 1fr;
  }
  .stat {
    padding: 17px;
  }
  .stats {
    gap: 12px;
  }
  .tag {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  aside {
    width: 64px;
    padding: 24px 8px;
  }
  .brand {
    font-size: 0;
    padding: 0 9px;
  }
  .brand span {
    font-size: 28px;
  }
  .company,
  .navlabel,
  .asidebottom,
  nav button span {
    display: none;
  }
  nav {
    margin-top: 35px;
  }
  nav button {
    padding: 13px;
    justify-content: center;
  }
  main {
    margin-left: 64px;
  }
  header {
    height: 65px;
    padding: 0 18px;
  }
  .topright {
    gap: 12px;
  }
  .content {
    padding: 26px 18px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .pagehead {
    align-items: start;
    gap: 15px;
  }
  h1 {
    font-size: 23px;
  }
  .pagehead p {
    font-size: 11px;
  }
  .pagehead .btn {
    font-size: 11px;
    padding: 9px;
    white-space: nowrap;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search {
    min-width: 0;
    width: 100%;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .demo {
    font-size: 8px;
  }
  .toast {
    left: 85px;
    right: 20px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  footer {
    gap: 15px;
  }
  .panelhead {
    padding: 20px;
  }
}

.brand {
  padding: 0 12px;
  height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand img {
  width: 170px;
  height: 116px;
  object-fit: contain;
}
.company {
  margin-top: 18px;
}
.stat {
  border-top: 2px solid #a6cdbb;
}
.stat:nth-child(2) {
  border-top-color: #e1cb9c;
}
.analytics {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.chartlegend {
  display: flex;
  gap: 18px;
  color: #8f99a5;
  font-size: 10px;
}
.legenddot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #77ac92;
  margin-right: 5px;
}
.chart {
  height: 158px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 18px;
  border-bottom: 1px solid #edf0f3;
  margin: 10px 0 0;
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 38px,
    #f3f5f6 39px,
    #f3f5f6 40px
  );
}
.bars {
  height: 100%;
  flex: 1;
  display: flex;
  gap: 5px;
  align-items: end;
  justify-content: center;
}
.bars i {
  display: block;
  width: 23px;
  background: #88b59e;
  border-radius: 4px 4px 0 0;
}
.bars i + i {
  background: #e3ebe6;
}
.chartlabels {
  display: flex;
  justify-content: space-around;
  color: #a0a8b1;
  font-size: 10px;
  margin-top: 10px;
}
.financebottom {
  display: flex;
  justify-content: space-between;
  padding: 18px 0 0;
  color: #929ca7;
  font-size: 11px;
}
.donutrow {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 14px 0 8px;
}
.donut {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: conic-gradient(#77ac92 0 100%);
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.donut:before {
  content: "";
  position: absolute;
  inset: 14px;
  background: white;
  border-radius: 50%;
}
.donut b {
  position: relative;
  font-size: 27px;
  font-weight: 600;
}
.servicelegend {
  flex: 1;
}
.servicelegend div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  font-size: 11px;
  color: #8c97a3;
}
.quickactions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.quickactions .btn {
  font-size: 11px;
  padding: 9px 13px;
}
.overviewnote {
  font-size: 10px;
  color: #a3acb5;
  border-top: 1px solid #edf0f3;
  padding-top: 17px;
  margin-top: 15px;
}
@media (max-width: 900px) {
  .analytics {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .brand {
    height: 55px;
    padding: 0;
  }
  .brand img {
    width: 52px;
    height: 52px;
  }
  .company {
    display: none;
  }
  .donutrow {
    gap: 20px;
  }
  .chart {
    gap: 8px;
  }
}

/* Ajustes de adaptación: evitar desbordes horizontales en pantallas estrechas */
.stats > *,
.grid > *,
.analytics > *,
.cards > * {
  min-width: 0;
}
.bars i {
  width: auto;
  flex: 0 1 23px;
}
@media (max-width: 760px) {
  .stats .value {
    font-size: 22px;
  }
  .pagehead {
    flex-wrap: wrap;
  }
  .panelhead {
    flex-wrap: wrap;
    gap: 8px;
  }
}
@media (max-width: 420px) {
  .tabs {
    flex-wrap: wrap;
  }
  .tabs button {
    padding: 8px 10px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 22px 14px;
  }
  .demo {
    display: none;
  }
}

/* ---------- Acceso y sesión ---------- */
[hidden] {
  display: none !important;
}
.loginscreen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
.logincard {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px 30px;
  box-shadow: 0 10px 30px #26334d0d;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.logincard img {
  width: 150px;
  align-self: center;
  margin-bottom: 14px;
}
.logincard h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.logincard p {
  font-size: 12px;
  margin-bottom: 18px;
}
.logincard label {
  font-size: 12px;
  color: #6b7684;
  margin: 10px 0 6px;
}
.logincard input {
  border: 1px solid #e2e6ec;
  border-radius: 7px;
  padding: 11px 12px;
  font: inherit;
}
.logincard input:focus {
  outline: 2px solid #41937833;
  border-color: var(--blue);
}
.logincard .btn {
  margin-top: 22px;
  padding: 12px;
}
.loginmsg {
  background: #fdf2f2;
  color: #a33a3a;
  border: 1px solid #f3d6d6;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.iconbtn {
  background: none;
  border: 0;
  padding: 4px;
  color: #7a8491;
  cursor: pointer;
  display: inline-flex;
}
.iconbtn:hover {
  color: var(--blue);
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn.danger {
  background: #c0504d;
  border-color: #c0504d;
  color: #fff;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.modalfoot.wrap {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .topright .bell {
    display: none;
  }
}
