:root{
  --blue:#1d4ed8;
  --blue2:#2563eb;
  --dark:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --bg:#f1f5f9;
  --card:#ffffff;
  --green:#16a34a;
  --orange:#f97316;
  --red:#dc2626;
  --purple:#7c3aed;
}

*{box-sizing:border-box}
html{font-size:16px}
body{
  min-height:100vh;
  background:linear-gradient(135deg,#f8fafc 0%,#eef4ff 55%,#f1f5f9 100%);
}

/* App shell */
.nav-link{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  padding:.72rem .85rem;
  color:#dbeafe;
  border-radius:14px;
  font-weight:800;
  text-decoration:none;
  transition:.15s ease;
}
.nav-link:hover{background:rgba(255,255,255,.10);color:#fff}
.nav-link:focus{outline:3px solid rgba(96,165,250,.55);outline-offset:2px}
aside .nav-link:nth-child(1)::before{content:'📊'}
aside .nav-link:nth-child(2)::before{content:'➕'}
aside .nav-link:nth-child(3)::before{content:'🗓️'}
aside .nav-link:nth-child(4)::before{content:'✅'}
aside .nav-link:nth-child(5)::before{content:'🔎'}
aside .nav-link:nth-child(6)::before{content:'📅'}
aside .nav-link:nth-child(7)::before{content:'📦'}
aside .nav-link:nth-child(8)::before{content:'🧾'}
aside .nav-link:nth-child(9)::before{content:'👁️'}

/* Generic cards */
.panel{
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  border-radius:22px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 8px 26px rgba(15,23,42,.06);
}
.page-title{
  font-size:1.45rem;
  line-height:1.2;
  font-weight:950;
  color:#0f172a;
  margin:0 0 14px;
}
.section-title{
  font-size:1.05rem;
  font-weight:950;
  color:#0f172a;
  margin:0 0 12px;
}
.info-box{
  background:#eff6ff;
  border:1px solid #bfdbfe;
  border-right:6px solid var(--blue2);
  color:#172554;
  border-radius:16px;
  padding:12px 14px;
  line-height:1.6;
  margin-bottom:12px;
}
.empty{
  background:#fff7ed;
  border:1px solid #fed7aa;
  border-right:6px solid var(--orange);
  color:#7c2d12;
  border-radius:16px;
  padding:14px;
  font-weight:800;
}

/* Buttons */
.btn-primary,.btn-dark,.btn-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  border:0;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  transition:.14s ease;
  white-space:nowrap;
}
.btn-primary{
  min-height:44px;
  padding:.75rem 1rem;
  background:linear-gradient(135deg,var(--blue2),#1e40af);
  color:white;
  box-shadow:0 6px 16px rgba(37,99,235,.22);
}
.btn-primary:hover{filter:brightness(.98);transform:translateY(-1px)}
.btn-dark{min-height:42px;padding:.7rem .95rem;background:#334155;color:white}
.btn-dark:hover{background:#1e293b}
.btn-small{min-height:38px;padding:.5rem .75rem;background:#2563eb;color:#fff;font-size:.9rem}
.btn-small.green{background:var(--green)}
.btn-small.dark{background:#334155}
.btn-small.orange{background:var(--orange)}
.btn-small.red{background:var(--red)}
.submit-btn[disabled]{opacity:.65;cursor:not-allowed;transform:none}

.action-row{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;margin-top:.65rem}

/* Forms */
.field, input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=url], select, textarea{
  width:100%;
  min-height:44px;
  padding:.78rem .9rem;
  border:1px solid #cbd5e1;
  border-radius:14px;
  background:white;
  color:#0f172a;
  font-size:1rem;
  outline:none;
  transition:border-color .14s ease, box-shadow .14s ease;
}
.field:focus, input:focus, select:focus, textarea:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.18);
}
input[type=date]{direction:ltr;text-align:right}
textarea{min-height:110px;resize:vertical}
.form-section{
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
}
.form-section h2,.form-section h3{
  font-weight:950;
  color:#0f172a;
  margin:0 0 10px;
}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.filter-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:center}
.max-w-3xl{max-width:900px}

/* Stats */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
}
.stat-card{
  background:#f8fafc;
  border:1px solid var(--line);
  border-right:7px solid var(--blue2);
  border-radius:18px;
  padding:15px;
  min-height:98px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  font-weight:850;
  color:#475569;
}
.stat-card.green{border-right-color:var(--green);background:#f0fdf4;color:#166534}
.stat-card.orange{border-right-color:var(--orange);background:#fff7ed;color:#9a3412}
.stat-card.red{border-right-color:var(--red);background:#fef2f2;color:#991b1b}
.stat-card.purple{border-right-color:var(--purple);background:#f5f3ff;color:#5b21b6}
.stat-number{font-size:2rem;line-height:1;font-weight:950;color:#0f172a;margin-bottom:.45rem}

/* Jobs */
.job-card{
  background:white;
  border:1px solid var(--line);
  border-right:7px solid var(--blue2);
  border-bottom:3px solid #cbd5e1;
  border-radius:18px;
  padding:14px;
  margin-bottom:10px;
  box-shadow:0 4px 14px rgba(15,23,42,.04);
  overflow-wrap:anywhere;
}
.job-card.status-open{background:#f8fbff;border-right-color:#2563eb}
.job-card.status-done{background:#f0fdf4;border-right-color:#16a34a;border-color:#bbf7d0}
.job-card.status-delayed{background:#fff7ed;border-right-color:#f97316;border-color:#fed7aa}
.job-card.status-not_done{background:#fef2f2;border-right-color:#dc2626;border-color:#fecaca}
.job-card.status-no_answer_phone{background:#fff7ed;border-right-color:#f97316;border-color:#fed7aa}
.stage-box{
  background:#f8fafc;
  border:1px solid var(--line);
  border-right:7px solid var(--purple);
  border-radius:18px;
  padding:16px;
}

/* Table */
.table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px;overflow:hidden;border-radius:16px}
.table th{background:#1d4ed8;color:white;padding:12px;text-align:right;white-space:nowrap}
.table td{background:white;border-bottom:1px solid var(--line);padding:12px;white-space:nowrap}
.table tr:nth-child(even) td{background:#f8fafc}

/* Login form */
main form p{display:grid;gap:6px;margin-bottom:12px}
main form label{font-weight:900;color:#334155}
.helptext{display:none}
ul.errorlist{background:#fef2f2;color:#991b1b;border:1px solid #fecaca;border-radius:12px;padding:10px 14px;margin-bottom:12px;font-weight:800}

/* Responsive */
@media(max-width:1024px){
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  body{background:#f1f5f9}
  aside{border-radius:0 0 22px 22px!important}
  aside nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .panel{padding:14px;border-radius:18px}
  .grid2,.grid3,.filter-grid{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .stat-number{font-size:1.55rem}
  .action-row .btn-small{flex:1;min-width:95px}
}
@media(max-width:420px){
  aside nav{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr}
}

/* V7 workflow badges/timer */
.badge{display:inline-flex;align-items:center;justify-content:center;min-width:46px;padding:.22rem .55rem;border-radius:999px;color:#fff;font-weight:950;font-size:.78rem;margin-left:.35rem}
.badge-new_install{background:#16a34a}
.badge-upgrade{background:#2563eb}
.badge-service{background:#7c3aed}
.badge-move{background:#0f766e}
.job-card.status-at_customer{background:#eff6ff;border-right-color:#2563eb;border-color:#bfdbfe}
.job-card.status-done{background:#f0fdf4;border-right-color:#16a34a;border-color:#bbf7d0}
.job-card.status-delayed{background:#fff7ed;border-right-color:#f97316;border-color:#fed7aa}
.btn-light{min-height:42px;padding:.7rem .95rem;background:#e2e8f0;color:#0f172a;border:0;border-radius:12px;font-weight:900;cursor:pointer}
.btn-light:hover{background:#cbd5e1}
