body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin:0; background:#f8f9fa; color:#212529; }
.container { max-width: 1100px; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
.topbar { display:flex; align-items:center; gap:1rem; padding:.75rem 1rem; border-bottom:1px solid #eee; }
.topbar nav a { margin-right: .75rem; text-decoration:none; color:#333; }
.logo { height:32px; }
main { padding: 1rem 0; }
.footer { padding:1.5rem 1rem; border-top:1px solid #e9ecef; color:#6c757d; font-size:.9rem; text-align:center; }
.card { border:1px solid #eee; border-radius:12px; padding:1rem; margin: .5rem 0; }
.grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.5rem; }
.row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.5rem; border-bottom:1px dashed #eee; }
.row:last-child { border-bottom:0; }
input, select, textarea, button { padding:.5rem .6rem; border-radius:8px; border:1px solid #ddd; width:100%; }
button { background:#0d6efd; color:white; border: none; cursor:pointer; }
button[type="button"] { background:#444; }
.muted { background:#fafafa; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

.auth-inline { display:flex; gap:.4rem; align-items:center; }
.auth-inline input { width: 160px; }


/* === LOGIN STYLES === */
.auth-hero {
  min-height: calc(100vh - 80px); /* dejando espacio si tienes header */
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(60% 60% at 20% 10%, rgba(13,110,253,.15), transparent 60%),
    radial-gradient(60% 60% at 80% 90%, rgba(32,201,151,.18), transparent 60%),
    linear-gradient(180deg, #ffffff, #f6f8fb);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 30px -12px rgba(0,0,0,.12);
  text-align: center;
}

.auth-logo { height: 40px; margin-bottom: .75rem; opacity: .9; }

.auth-form { margin-top: 1rem; display: grid; gap: .8rem; text-align: left; }
.auth-form label span { display: block; font-size: .9rem; color: #555; margin-bottom: .25rem; }

.auth-form input {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 12px;
  border: 1px solid #dcdfe5;
  background: #fff;
  font-size: 1rem;
  outline: none;
}
.auth-form input:focus { border-color: #0d6efd; box-shadow: 0 0 0 3px rgba(13,110,253,.12); }

.password-field { position: relative; }
.icon-btn {
  position: absolute; right: .5rem; top: 2.1rem;
  background: transparent; border: none; cursor: pointer; font-size: 1rem;
  opacity: .6;
}

.cta {
  padding: .8rem 1rem; border: none; border-radius: 12px; cursor: pointer;
  background: #0d6efd; color: white; font-weight: 600; letter-spacing: .2px;
  transition: transform .06s ease, box-shadow .2s ease;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -10px rgba(13,110,253,.5); }

.links { margin-top: .75rem; }
.links .ghost {
  font-size: .9rem; color: #555; text-decoration: none;
}
.links .ghost:hover { text-decoration: underline; }

.msg { margin-top: .25rem; font-size: .9rem; color: #3a7; }
.msg.error { color: #d33; }

.muted { color:#6b7280; }
/* === /LOGIN STYLES === */

.auth-hero { min-height: calc(100vh - 80px); display:grid; place-items:center; padding:2rem; }
.auth-card { width:100%; max-width:420px; padding:2rem; border-radius:16px; border:1px solid #eee; background:#fff; box-shadow:0 10px 25px rgba(0,0,0,.08); }
.auth-form { display:grid; gap:.8rem; }
.auth-form label span { display:block; font-size:.9rem; color:#555; margin-bottom:.25rem; }
.cta { padding:.8rem 1rem; border:none; border-radius:12px; background:#0d6efd; color:#fff; cursor:pointer; }
.msg { margin-top:.25rem; font-size:.9rem; color:#3a7; }
.msg.error { color:#d33; }



/*Clientes*/
.clients-section {
  padding: 1.5rem;
}

.clients-section h1 {
  margin-bottom: 0.25rem;
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
}

.clients-table th, .clients-table td {
  border: 1px solid #ddd;
  padding: 0.6rem;
}

.clients-table th {
  background: #0d6efd;
  color: white;
  text-align: left;
}

.cta {
  padding: .5rem 1rem;
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: .5rem;
}

.row {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .5rem 0;
}
.row input, .row select {
  width: auto;
}
details.card {
  padding: .75rem 1rem;
}
.row-click {
  cursor: pointer;
}
.row-click:hover {
  background: #f6f8fb;
}

#formAdd input[placeholder*="opcional"] {
  background: #f9fafb;
  color: #6b7280;
}

#formAdd button {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#formAdd button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.clients-table td:last-child {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.clients-table tr.loading td {
  background: #f0f0f0;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

@media (max-width: 600px) {
  .clients-table {
    display: block;
    overflow-x: auto;
  }
  .clients-table tr {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #eee;
    padding: 0.5rem;
  }
  .clients-table td {
    padding: 0.5rem 0;
    border: none;
  }
  .clients-table td:last-child {
    flex-direction: column;
    gap: 0.3rem;
  }
}

#addMsg {
  opacity: 0;
  transition: opacity 0.3s ease;
}
#addMsg.show {
  opacity: 1;
}
/*Final Clientes*/


/* === DASHBOARD === */
.dash { padding: 1rem; }

.dash-hero {
  text-align: center;
  padding: 1.5rem 1.25rem;
  border-radius: 16px;
  background:
    radial-gradient(60% 60% at 15% 10%, rgba(13,110,253,.10), transparent 60%),
    radial-gradient(60% 60% at 85% 90%, rgba(32,201,151,.12), transparent 60%),
    #fff;
}

.dash-hero h1 { margin: .2rem 0 .25rem; }
.dash-hero .tip { display:block; margin-top: .5rem; }

.dash-search {
  margin: .9rem auto .25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  max-width: 640px;
}
.dash-search input {
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid #dcdfe5;
  background: #fff;
  font-size: 1rem;
}
.dash-search .cta { border-radius: 12px; padding: .8rem 1.25rem; }

.dash-results { margin-top: 1rem; display: grid; gap: .75rem; }
.loading,
.empty { text-align: center; padding: 2rem 1rem; font-weight: 500; }
.empty > div:first-child { font-size: 1.6rem; margin-bottom: .25rem; }

.result-card { padding: 1rem; }
.result-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.result-head .kicker { font-size: .8rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.result-head .title { font-size: 1.05rem; }
.result-head .sub { margin-top: .15rem; }
.badge {
  background: #eef4ff; color: #0d6efd; font-weight: 600;
  padding: .35rem .55rem; border-radius: 999px; font-size: .85rem;
}

.table-wrap { margin-top: .6rem; overflow: auto; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td {
  border: 1px solid #e8e8e8; padding: .5rem .55rem; font-size: .92rem;
}
.mini-table th { background: #f7f9ff; text-align: left; }

button.mini {
  background: #0d6efd; color: #fff; border: none;
  padding: .35rem .6rem; border-radius: 8px; cursor: pointer;
  font-size: .85rem;
}

/* Responsive */
@media (max-width: 720px) {
  .dash-search { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; align-items: flex-start; }
  .badge { align-self: flex-start; }
}


/* === CLIENTES (mejorado) === */
.clients-section {
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.clients-section h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.clients-section p.muted {
  margin-bottom: 1rem;
  color: #6b7280;
}

/* --- Formulario --- */
#addBox {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  overflow: hidden;
}

#addBox summary {
  cursor: pointer;
  padding: .9rem 1.2rem;
  font-weight: 600;
  font-size: 1rem;
  background: #f9fafc;
  color: #111;
  border-bottom: 1px solid #eee;
  list-style: none;
}
#addBox[open] summary { border-bottom: 1px solid #ddd; }

#formAdd {
  padding: 1rem 1.2rem 1.25rem;
  background: #fff;
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#formAdd input {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: .7rem .9rem;
  font-size: .95rem;
  transition: border .2s, box-shadow .2s;
}

#formAdd input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
  outline: none;
}

#formAdd button {
  grid-column: 1 / -1;
  padding: .9rem;
  font-weight: 600;
  border-radius: 12px;
  background: #0d6efd;
  border: none;
  color: white;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease;
}
#formAdd button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 15px -8px rgba(13,110,253,.4);
}

#addMsg {
  text-align: center;
  padding: .5rem;
  font-size: .9rem;
}

/* --- Botón recargar --- */
#btnReload {
  width: 100%;
  border-radius: 10px;
  margin: 1rem 0 .5rem;
  padding: .75rem;
  font-weight: 600;
}

/* --- Tabla de clientes --- */
.clients-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.clients-table th, .clients-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid #eee;
}

.clients-table th {
  background: #0d6efd;
  color: white;
  text-align: left;
  font-weight: 600;
}

.clients-table tr:hover {
  background: #f7f9ff;
}

.clients-table tr:last-child td {
  border-bottom: none;
}

/* --- Fila clicable --- */
.row-click { cursor: pointer; }
.row-click:hover { background: #e9f1ff; }

/* --- Responsive --- */
@media (max-width: 800px) {
  #formAdd {
    grid-template-columns: 1fr;
  }
  #btnReload {
    font-size: .95rem;
  }
  .clients-table th, .clients-table td {
    font-size: .9rem;
    padding: .6rem .75rem;
  }
}


/* === ÓRDENES (filtros + tabla) === */
.orders-section {            /* si quieres, da esta clase al <section> */
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.orders-section h1 {
  font-size: 1.8rem;
  margin-bottom: .75rem;
}
button.danger { background:#ef4444; border-color:#ef4444; }
button.danger:disabled { opacity:.6; }


/* ---- Tarjeta de filtros ---- */
#filters {
  display: grid;                        /* asegura el grid aunque venga inline */
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: .6rem;
}

#filters label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .9rem;
  color: #555;
}

#filters input,
#filters select {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: .65rem .8rem;
  font-size: .95rem;
  transition: border .2s, box-shadow .2s;
  background: #fff;
}

#filters input:focus,
#filters select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
  outline: none;
}

/* contenedor de botones (el <div> dentro del form) */
#filters > div {
  display: flex !important;
  align-items: flex-end;
  gap: .5rem;
}

#filters button {
  border-radius: 10px;
  padding: .7rem .95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, background .2s;
}

/* Aplicar */
#btnApply {
  background: #0d6efd;
  color: #fff;
}
#btnApply:hover { transform: translateY(-1px); box-shadow: 0 8px 15px -10px rgba(13,110,253,.45); }

/* Limpiar (estilo ghost) */
#btnClear {
  background: #eef2f7;
  color: #374151;
}
#btnClear:hover { background: #e6ebf2; }

/* Exportar CSV (ya tiene .cta pero por si acaso) */
#btnCsv {
  background: #0d6efd;
  color: #fff;
}

/* Mensajito debajo del filtro */
#msg.muted {
  margin-top: .25rem;
  color: #6b7280;
}

/* ---- Tabla ---- */
.clients-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.clients-table th,
.clients-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.clients-table th {
  background: #0d6efd;
  color: #fff;
  text-align: left;
  font-weight: 600;
}

/* zebra + hover sutil */
.clients-table tbody tr:nth-child(even) { background: #fafbff; }
.clients-table tbody tr:hover { background: #f3f7ff; }

/* botón "Abrir" dentro de la tabla */
.clients-table tbody button {
  padding: .5rem 1rem;
  border-radius: 10px;
  background: #0d6efd;
  color: #fff;
  border: none;
  cursor: pointer;
}
.clients-table tbody button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 15px -10px rgba(13,110,253,.45);
}

/* selector de estatus dentro de la tabla */
.clients-table select.status {
  min-width: 150px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: .45rem .6rem;
  background: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  #filters {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width: 680px) {
  #filters {
    grid-template-columns: 1fr;
  }
  #filters > div {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  #filters button { width: 100%; }
  .clients-table th, .clients-table td {
    font-size: .9rem;
    padding: .6rem .75rem;
  }
  .clients-table select.status { min-width: 0; width: 100%; }
}



/* ===== Base accesibilidad ===== */
.skip-link {
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus {
  position:fixed; left:1rem; top:1rem; width:auto; height:auto; padding:.5rem .75rem;
  background:#0d6efd; color:#fff; border-radius:.5rem; z-index:9999;
}

/* ===== Topbar mejorada + sticky ===== */
.topbar--sticky { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
.topbar__inner {
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar { border-bottom: 1px solid #eee; box-shadow: 0 4px 14px -12px rgba(0,0,0,.25); }
.brand { display:flex; align-items:center; gap:.5rem; text-decoration:none; color:inherit; }

.logo { height: 32px; display:block; }

/* ===== Navegación ===== */
.mainnav .ico { display: none; } /* Ocultar emojis por defecto */
.mainnav {
  margin-left: auto;
  display: flex;
  gap: .75rem;
}
.mainnav a {
  text-decoration: none;
  color: #333;
  padding: .5rem .7rem;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease;
}
.mainnav a:hover { background: #f2f6ff; }
.mainnav a.is-active {
  font-weight: 600;
  background: #0d6efd; color: #fff;
  box-shadow: 0 8px 16px -10px rgba(13,110,253,.6);
}
  
/* ===== Menú móvil ===== */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent; color: #333;
  border: none; border-radius: .6rem;
  padding: .45rem .6rem; cursor: pointer;
  /* Estilos para las barras del ícono */
  display: none; /* Oculto por defecto, se muestra en media query */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #333; /* Color oscuro para las barras */
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* Animación a 'X' cuando está abierto */
.nav-toggle.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


@media (max-width: 860px) {
  .brand__name { display: none; }
  .mainnav .ico { display: inline; margin-right: .5rem; }
  .topbar__inner { gap:.5rem; }
  .nav-toggle { display: inline-flex; }
  .mainnav {
    position: absolute; right: 1rem; top: 58px;
    background: #fff;
    border: 1px solid #eee; border-radius: 12px;
    box-shadow: 0 18px 28px -14px rgba(0,0,0,.20);
    padding: .4rem;
    display: none;               /* cerrado por defecto */
    flex-direction: column;
    min-width: 180px;
  }
  .mainnav.open { display: flex; }
  .mainnav a { padding: .6rem .75rem; }
}

/* Opcional: suavizar el main al usar topbar sticky */
main#app.container { padding-top: 1rem; }




#technicianId {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: .65rem .8rem;
  font-size: .95rem;
  background: #fff;
}



/* Combo (cliente) */
.combo { position: relative; display: grid; gap: .35rem; }
.combo > input[type="text"] {
  padding: .6rem .7rem; border:1px solid #d1d5db; border-radius:10px;
}
.combo > input[type="text"]:focus {
  outline: none; border-color:#0d6efd; box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.listbox {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  max-height: 260px; overflow: auto; box-shadow: 0 18px 28px -14px rgba(0,0,0,.18);
}
.listbox .item { padding: .55rem .7rem; cursor: pointer; }
.listbox .item:hover, .listbox .item.active { background:#f0f5ff; }
.listbox .item .title { font-weight: 600; }
.listbox .item .sub { font-size: .86rem; color:#6b7280; margin-top: 2px; }
.listbox .empty { padding: .7rem; color:#6b7280; }



.totals-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.totals-grid .col{background:#f8f8f8;border:1px solid #eee;border-radius:8px;padding:.75rem}
.t-title{font-weight:600;margin-bottom:.25rem;color:#222}
.t-row{display:flex;justify-content:space-between;margin:.15rem 0}
.t-row.t-strong{font-weight:700}
.t-row .neg{color:#c22}
.qrow{display:flex;justify-content:space-between;gap:.75rem;padding:.25rem 0}
.qrow span{color:#374151}
.t-strong strong{font-size:1.05rem}

.t-note{margin-top:.5rem;color:#666;font-size:.9em}






@media(max-width:720px){.totals-grid{grid-template-columns:1fr}}

/* ===== Dashboard KPIs ===== */
.kpi-cards{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.75rem;margin:1rem auto;max-width:1100px
}
.kpi-card{display:flex;gap:.75rem;align-items:center;border:1px solid #e5e7eb;border-radius:16px;padding:1rem;background:#fff;box-shadow:0 6px 18px rgba(0,0,0,.04)}
.kpi-icon{font-size:22px}
.kpi-body h3{margin:.1rem 0 .35rem;color:#6b7280;font-size:.95rem}
.kpi-num{margin:0;font-size:26px;font-weight:800;letter-spacing:.3px}
@media (max-width:900px){.kpi-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.kpi-cards{grid-template-columns:1fr}}

.panel-status .status-summary{display:flex;gap:16px;flex-wrap:wrap;padding:12px}
.status-summary li{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:8px 12px}
.dot{width:10px;height:10px;border-radius:999px;display:inline-block}
.dot-new{background:#f59e0b}.dot-wip{background:#0ea5e9}.dot-done{background:#10b981}
.panel-trend .trend-wrap{padding:8px 12px}
.trend-svg{width:100%;height:120px;background:#fff;border:1px solid #e5e7eb;border-radius:12px}
.panel-overdue .list .badge{background:#fff1f2;color:#b91c1c}


/* lista simple ya la tienes (usa .row, .mini-table, .badge, etc.) */
