.view { min-width: 0; }
.nav-item b { font: inherit; font-weight: 700; }
.header-filters { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.header-filters input, .header-filters select { min-width: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: #fff; outline: none; }
.header-filters input:focus, .header-filters select:focus { border-color: #53a57d; box-shadow: 0 0 0 3px rgba(83,165,125,.13); }
.header-filters .primary, .header-filters .secondary { padding: 10px 15px; }
.panel { min-width: 0; padding: 20px; border: 1px solid #e3eae5; border-radius: 16px; background: #fff; box-shadow: 0 8px 30px rgba(22,64,47,.04); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 17px; }
.panel-title h2 { margin: 0; font-size: 18px; }
.panel-title span { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.8fr); gap: 18px; }
.trend-chart { height: 285px; display: flex; align-items: stretch; gap: 10px; padding-top: 10px; overflow-x: auto; }
.trend-column { min-width: 44px; flex: 1; display: grid; grid-template-rows: 20px 1fr 20px; gap: 5px; text-align: center; color: #7a8d83; font-size: 11px; }
.trend-column strong { color: #2d5645; font-size: 12px; }
.bar-wrap { display: flex; align-items: flex-end; justify-content: center; min-height: 175px; border-bottom: 1px solid #e9efeb; }
.trend-bar { width: min(28px,70%); min-height: 3px; border-radius: 7px 7px 2px 2px; background: linear-gradient(#4ba77a,#176b47); box-shadow: 0 5px 13px rgba(23,107,71,.15); }
.ranking-list { display: grid; gap: 12px; }
.ranking-item { display: grid; grid-template-columns: 29px minmax(80px,1fr) auto; align-items: center; gap: 10px; }
.ranking-index { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #176b47; background: #e8f6ee; font-weight: 800; }
.ranking-person { min-width: 0; }
.ranking-person strong, .ranking-person small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-person small { color: var(--muted); }
.ranking-head { display: flex; justify-content: space-between; gap: 10px; }
.ranking-head span { color: var(--muted); white-space: nowrap; }
.ranking-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 10px; background: #edf3ef; }
.ranking-track i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg,#55ae82,#176b47); }
.ranking-count { color: #176b47; font-size: 17px; font-weight: 800; }
.inline-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); }
.filters input[type=date] { min-width: 145px; }
.filters .primary, .filters .secondary { padding: 10px 14px; }
.visit-table { min-width: 1120px; }
.ellipsis-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,.7fr); gap: 18px; }
.route-map { position: relative; height: 620px; padding: 0; overflow: hidden; }
.route-map-canvas { width: 100%; height: 100%; }
.map-status { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%,-50%); max-width: 80%; padding: 13px 18px; border-radius: 10px; color: #52695f; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(0,0,0,.1); text-align: center; }
.route-list-panel { height: 620px; display: flex; flex-direction: column; }
.route-list { overflow: auto; padding-right: 4px; }
.route-node { position: relative; width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 11px; padding: 0 0 20px; border: 0; color: inherit; background: transparent; text-align: left; }
.route-node:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 32px; bottom: 0; width: 2px; background: #dce9e1; }
.route-node-index { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid white; border-radius: 50%; color: white; background: #176b47; box-shadow: 0 3px 10px rgba(23,107,71,.28); font-weight: 800; }
.route-node-content { min-width: 0; padding: 3px 0; }
.route-node-content strong, .route-node-content span, .route-node-content small { display: block; }
.route-node-content span { margin: 3px 0; color: #3b5c4e; }
.route-node-content small { color: var(--muted); }
#customerForm { padding: 27px; }
#customerForm header { display: flex; justify-content: space-between; align-items: start; }
#customerForm h2 { margin: 0; font-size: 24px; }
#customerForm label { display: grid; gap: 8px; margin: 17px 0; color: #365148; font-weight: 700; }
#customerForm label span { color: var(--danger); }
#customerForm input, #customerForm select { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; }
#customerForm footer, .dialog-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.wide-dialog { width: min(820px,calc(100% - 30px)); }
.visit-detail { padding: 27px; }
.visit-detail header { display: flex; justify-content: space-between; align-items: start; }
.visit-detail h2 { margin: 0; font-size: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 20px 0; }
.detail-item { padding: 12px; border-radius: 10px; background: #f5f8f6; }
.detail-item span, .detail-item strong { display: block; }
.detail-item span { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.detail-item.full { grid-column: 1/-1; }
.detail-photos { display: flex; gap: 10px; overflow: auto; }
.detail-photos img { width: 128px; height: 128px; flex: none; border-radius: 10px; object-fit: cover; background: #edf1ef; }

@media (max-width: 1100px) {
  .dashboard-grid, .route-layout { grid-template-columns: 1fr; }
  .route-map, .route-list-panel { height: 480px; }
  .route-list-panel { height: auto; max-height: 480px; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .sidebar { position: sticky; top: 0; z-index: 10; overflow: hidden; }
  .sidebar-brand img { width: 38px; height: 38px; }
  .sidebar nav { display: flex; gap: 3px; overflow-x: auto; }
  .sidebar .nav-item { flex: none; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .header-filters { width: 100%; justify-content: flex-start; }
  .header-filters input, .header-filters select { flex: 1; min-width: 118px; }
  .dashboard-grid { gap: 12px; }
  .panel { padding: 15px; }
  .trend-column { min-width: 40px; }
  .route-map { height: 390px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: auto; }
  .wide-dialog { width: calc(100% - 18px); }
  .filters input[type=date] { flex: 1; min-width: 130px; }
}
