/* =====================================================================
   WashFlow · Hoja de estilos principal
   Paleta: petróleo profundo + aqua. Layout SaaS con sidebar fijo.
   ===================================================================== */

:root {
  --wf-ink:        #0e2230;
  --wf-ink-soft:   #16334a;
  --wf-accent:     #12b8a6;
  --wf-accent-dk:  #0d9488;
  --wf-amber:      #f5a524;
  --wf-bg:         #f1f4f7;
  --wf-surface:    #ffffff;
  --wf-border:     #e2e8ef;
  --wf-text:       #1d2b36;
  --wf-muted:      #6b7c8c;
  --wf-sidebar-w:  262px;
  --wf-radius:     14px;
  --wf-shadow:     0 1px 2px rgba(14,34,48,.06), 0 8px 24px rgba(14,34,48,.06);
}

[data-bs-theme="dark"] {
  --wf-bg:      #0b141c;
  --wf-surface: #111e28;
  --wf-border:  #1e3040;
  --wf-text:    #e6eef4;
  --wf-muted:   #8ea3b3;
  --wf-shadow:  0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
}

* { scrollbar-width: thin; }

body {
  background: var(--wf-bg);
  color: var(--wf-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: .935rem;
}

/* ------------------------------ Layout ------------------------------ */
.wf-layout { display: flex; min-height: 100vh; }

.wf-sidebar {
  width: var(--wf-sidebar-w);
  flex: 0 0 var(--wf-sidebar-w);
  background: var(--wf-ink);
  color: #cfe0ea;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  overflow-y: auto;
  transition: transform .25s ease;
}

.wf-main {
  flex: 1 1 auto;
  margin-left: var(--wf-sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wf-content { padding: 22px 26px 40px; flex: 1 1 auto; }

.wf-footer {
  padding: 14px 26px;
  border-top: 1px solid var(--wf-border);
  color: var(--wf-muted);
  font-size: .8rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--wf-surface);
}

/* ------------------------------ Marca ------------------------------- */
.wf-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.wf-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--wf-accent), #0891b2);
  color: #04212a; font-size: 1.25rem;
}
.wf-brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.wf-brand-text strong { display: block; color: #fff; font-size: 1.02rem; line-height: 1.1; }
.wf-brand-text small { color: #7f9cb0; font-size: .72rem; }
.wf-sidebar-close { margin-left: auto; color: #9fb6c5; background: transparent; border: 0; }

/* ------------------------------ Menú -------------------------------- */
.wf-nav { display: flex; flex-direction: column; gap: 2px; }
.wf-nav-label {
  color: #5f7f95; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .09em; margin: 14px 0 4px 10px;
}
.wf-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: #c3d6e2; text-decoration: none; font-size: .89rem;
  transition: background .15s, color .15s;
}
.wf-nav-item i { font-size: 1.02rem; width: 20px; text-align: center; }
.wf-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.wf-nav-item.active { background: var(--wf-accent); color: #04212a; font-weight: 600; }
.wf-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wf-amber); margin-left: auto;
}
.wf-sidebar-foot { margin-top: auto; padding-top: 16px; color: #5f7f95; font-size: .72rem; }

.btn-accent {
  background: var(--wf-accent); border: 0; color: #04212a; font-weight: 600;
}
.btn-accent:hover { background: var(--wf-accent-dk); color: #fff; }

/* ------------------------------ Topbar ------------------------------ */
.wf-topbar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px;
  background: var(--wf-surface);
  border-bottom: 1px solid var(--wf-border);
}
.wf-search { position: relative; flex: 1 1 auto; max-width: 520px; }
.wf-search > i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--wf-muted);
}
.wf-search input { padding-left: 36px; border-radius: 10px; background: var(--wf-bg); }
.wf-search-results {
  position: absolute; top: 110%; left: 0; right: 0; z-index: 1050;
  background: var(--wf-surface); border: 1px solid var(--wf-border);
  border-radius: 12px; box-shadow: var(--wf-shadow); max-height: 380px; overflow-y: auto;
}
.wf-search-results a {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 14px; text-decoration: none; color: var(--wf-text); font-size: .86rem;
}
.wf-search-results a:hover { background: var(--wf-bg); }
.wf-search-group {
  padding: 6px 14px; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--wf-muted); background: var(--wf-bg);
}

.wf-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; border: 1px solid var(--wf-border);
  background: var(--wf-surface); color: var(--wf-text);
}
.btn-icon:hover { background: var(--wf-bg); }
.wf-badge-count { position: absolute; top: -4px; right: -4px; font-size: .62rem; }

.wf-user { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; }
.wf-user small { display: block; color: var(--wf-muted); font-size: .72rem; line-height: 1; }
.wf-user strong { font-size: .84rem; }
.wf-avatar {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--wf-ink-soft); color: #fff; font-weight: 600; font-size: .82rem;
}

.wf-notif-menu { width: 340px; max-height: 440px; overflow-y: auto; padding: 0; }
.wf-notif { display: flex; gap: 8px; white-space: normal; padding: 10px 14px; }
.wf-notif-nueva { background: rgba(18,184,166,.07); }
.wf-notif-icon i { font-size: 1.6rem; line-height: 1; }
.wf-notif-info i    { color: #0ea5e9; }
.wf-notif-exito i   { color: #16a34a; }
.wf-notif-alerta i  { color: var(--wf-amber); }
.wf-notif-peligro i { color: #dc2626; }

/* ------------------------------ Tarjetas ---------------------------- */
.card {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius);
  background: var(--wf-surface);
  box-shadow: var(--wf-shadow);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--wf-border);
  font-weight: 600; padding: 14px 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.wf-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.wf-page-head h1 { font-size: 1.42rem; font-weight: 700; margin: 0; }
.wf-page-head p { margin: 2px 0 0; color: var(--wf-muted); font-size: .85rem; }

.wf-stat {
  background: var(--wf-surface); border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius); padding: 16px 18px; height: 100%;
  box-shadow: var(--wf-shadow); position: relative; overflow: hidden;
}
.wf-stat .wf-stat-label { color: var(--wf-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.wf-stat .wf-stat-value { font-size: 1.55rem; font-weight: 700; margin-top: 4px; }
.wf-stat .wf-stat-foot { font-size: .78rem; color: var(--wf-muted); margin-top: 4px; }
.wf-stat-icon {
  position: absolute; right: 14px; top: 14px; width: 38px; height: 38px;
  border-radius: 11px; display: grid; place-items: center; font-size: 1.05rem;
}
.wf-bg-accent { background: rgba(18,184,166,.14); color: var(--wf-accent-dk); }
.wf-bg-amber  { background: rgba(245,165,36,.16); color: #b45309; }
.wf-bg-blue   { background: rgba(14,165,233,.14); color: #0369a1; }
.wf-bg-green  { background: rgba(22,163,74,.14);  color: #15803d; }
.wf-bg-red    { background: rgba(220,38,38,.12);  color: #b91c1c; }
.wf-bg-grey   { background: rgba(107,124,140,.14); color: #475569; }

/* ------------------------------ Tablas ------------------------------ */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--wf-muted); font-weight: 600; border-bottom-width: 1px;
  white-space: nowrap;
}
.table > tbody td { vertical-align: middle; }
.wf-table-wrap { overflow-x: auto; }

.wf-placa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 700; letter-spacing: .04em;
  background: var(--wf-bg); border: 1px solid var(--wf-border);
  padding: 2px 8px; border-radius: 6px; font-size: .82rem; white-space: nowrap;
}

.wf-empty { padding: 46px 20px; text-align: center; color: var(--wf-muted); }
.wf-empty i { font-size: 2.4rem; display: block; margin-bottom: 10px; opacity: .5; }

/* ------------------------------ Kanban ------------------------------ */
.wf-kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; }
.wf-kanban-col {
  background: var(--wf-surface); border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius); display: flex; flex-direction: column; min-height: 220px;
}
.wf-kanban-head {
  padding: 12px 14px; border-bottom: 1px solid var(--wf-border);
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem;
}
.wf-kanban-head .wf-count {
  margin-left: auto; background: var(--wf-bg); border-radius: 20px;
  padding: 1px 9px; font-size: .76rem; color: var(--wf-muted);
}
.wf-kanban-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.wf-order-card {
  border: 1px solid var(--wf-border); border-radius: 12px; padding: 12px;
  background: var(--wf-surface); border-left: 4px solid var(--wf-accent);
  transition: box-shadow .15s, transform .15s;
}
.wf-order-card:hover { box-shadow: var(--wf-shadow); transform: translateY(-1px); }
.wf-order-card .wf-order-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wf-order-card .wf-order-meta { font-size: .78rem; color: var(--wf-muted); line-height: 1.5; }
.wf-order-card .wf-order-serv { font-size: .8rem; margin: 6px 0; }
.wf-order-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.wf-tiempo-ok { color: #15803d; }
.wf-tiempo-alerta { color: #b45309; font-weight: 600; }
.wf-tiempo-tarde { color: #b91c1c; font-weight: 600; }

.brd-warning { border-left-color: #f5a524 !important; }
.brd-info    { border-left-color: #0ea5e9 !important; }
.brd-success { border-left-color: #16a34a !important; }
.brd-primary { border-left-color: #2563eb !important; }
.brd-danger  { border-left-color: #dc2626 !important; }

/* ------------------------- Selector de servicios -------------------- */
.wf-serv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.wf-serv-item {
  border: 1px solid var(--wf-border); border-radius: 12px; padding: 11px 13px;
  cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.wf-serv-item:hover { border-color: var(--wf-accent); }
.wf-serv-item.selected { border-color: var(--wf-accent); background: rgba(18,184,166,.09); }
.wf-serv-item strong { display: block; font-size: .87rem; }
.wf-serv-item small { color: var(--wf-muted); font-size: .76rem; }
.wf-serv-item .wf-serv-precio { font-weight: 700; color: var(--wf-accent-dk); }

.wf-resumen-linea { display: flex; justify-content: space-between; padding: 3px 0; font-size: .87rem; }
.wf-resumen-total {
  display: flex; justify-content: space-between; font-size: 1.2rem;
  font-weight: 700; border-top: 1px dashed var(--wf-border); padding-top: 8px; margin-top: 8px;
}

/* ------------------------------ Varios ------------------------------ */
.wf-timeline { list-style: none; padding: 0; margin: 0; }
.wf-timeline li {
  position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--wf-border);
}
.wf-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.wf-timeline li::before {
  content: ''; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--wf-accent);
}
.wf-timeline .wf-tl-time { font-size: .76rem; color: var(--wf-muted); }

.wf-chart-box { position: relative; height: 280px; }
.wf-chart-box-sm { position: relative; height: 230px; }

.form-label { font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.form-control, .form-select { border-radius: 9px; }
.form-control:focus, .form-select:focus {
  border-color: var(--wf-accent); box-shadow: 0 0 0 .18rem rgba(18,184,166,.18);
}
.wf-required::after { content: ' *'; color: #dc2626; }

.wf-filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.wf-filtros .form-control, .wf-filtros .form-select { min-width: 140px; }

.wf-sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(6,18,26,.5);
  z-index: 1040; display: none;
}
body.wf-sidebar-open .wf-sidebar-backdrop { display: block; }

@media print {
  .wf-sidebar, .wf-topbar, .wf-footer, .no-print { display: none !important; }
  .wf-main { margin-left: 0; }
  .wf-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

@media (max-width: 991.98px) {
  .wf-sidebar { transform: translateX(-100%); }
  body.wf-sidebar-open .wf-sidebar { transform: translateX(0); }
  .wf-main { margin-left: 0; }
  .wf-content { padding: 16px; }
  .wf-topbar { padding: 10px 16px; }
  .wf-kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 575.98px) {
  .wf-kanban { grid-template-columns: 1fr; }
  .wf-page-head h1 { font-size: 1.2rem; }
  .wf-stat .wf-stat-value { font-size: 1.3rem; }
}

/* ---------------------------------------------------------------
   Variantes de color "accent" (equivalentes a las *-subtle de
   Bootstrap, pero con el color propio de WashFlow)
   --------------------------------------------------------------- */
.bg-accent-subtle   { background-color: rgba(18, 184, 166, .14) !important; }
.text-accent-emphasis { color: var(--wf-accent-dk, #0d9488) !important; }
.btn-outline-accent {
  color: var(--wf-accent, #12b8a6);
  border-color: var(--wf-accent, #12b8a6);
}
.btn-outline-accent:hover {
  background-color: var(--wf-accent, #12b8a6);
  border-color: var(--wf-accent, #12b8a6);
  color: #fff;
}
[data-bs-theme="dark"] .text-accent-emphasis { color: #4fd6c6 !important; }
