:root {
  --header-blue: #3c8dbc;
  --header-blue-dark: #367fa9;
  --sidebar-bg: #222d32;
  --sidebar-hover: #1e282c;
  --sidebar-text: #b8c7ce;
  --content-bg: #ecf0f5;
  --success: #00a65a;
  --info: #00c0ef;
  --warning: #f39c12;
  --danger: #dd4b39;
}
.remember-login { margin: -3px 0 4px !important; }
.password-strength { height: 24px; margin-top: -7px; }
.password-strength::before { content: ""; position: absolute; }
.password-strength > span { display: block; width: 0; height: 4px; border-radius: 2px; background: #dd4b39; transition: width .2s, background .2s; }
.password-strength[data-score="3"] > span { background: #f39c12; }
.password-strength[data-score="4"] > span, .password-strength[data-score="5"] > span { background: #00a65a; }
.password-strength small { color: #777; font-size: 10px; }

.app-body { background: var(--content-bg); font-family: "Source Sans Pro", Arial, sans-serif; font-size: 14px; }
.app-body::before { display: none; }
.app-body .shell { display: block; min-height: 100vh; padding-top: 50px; }
.main-header { position: fixed; z-index: 1030; inset: 0 0 auto 0; height: 50px; display: flex; color: #fff; background: var(--header-blue); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.header-brand { flex: 0 0 230px; height: 50px; display: flex; align-items: center; justify-content: center; padding: 4px 18px; background: #fff; border-bottom: 1px solid #d7e0e7; }
.header-brand:hover { background: #f7fafc; text-decoration: none; }
.header-brand img { width: 168px; max-width: 100%; max-height: 44px; object-fit: contain; }
.header-brand .brand-icon { display: none; }
.sidebar-toggle, .header-icon { width: 50px; height: 50px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: #fff; font-size: 16px; }
.sidebar-toggle:hover, .header-icon:hover { background: var(--header-blue-dark); text-decoration: none; }
.header-tools { margin-left: auto; display: flex; align-items: center; }
.header-tools .inline { display: block; }
.header-icon { position: relative; display: grid; place-items: center; min-height: 50px; }
.badge-warning { position: absolute; top: 7px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 2px; background: var(--warning); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.user-summary { height: 50px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.user-summary img { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; background: #fff; }

.app-body .sidebar { position: fixed; z-index: 1020; top: 50px; bottom: 0; left: 0; width: 230px; overflow-y: auto; padding: 0; border: 0; background: #202b31; box-shadow: inset -1px 0 rgba(255,255,255,.03); transition: width .18s ease; }
.sidebar-user { min-height: 66px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.05); color: #fff; }
.sidebar-user img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.sidebar-user strong, .sidebar-user small { display: block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { margin-top: 2px; color: #93a6af; font-size: 11px; }
.sidebar-nav { display: block; }
.nav-heading { display: block; padding: 14px 15px 6px; color: #6f858f; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.app-body .sidebar-nav .nav-link { min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 8px 15px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: transparent; color: #c3d0d6; font-weight: 400; transition: color .15s, background .15s, border-color .15s; }
.sidebar-nav .nav-link i { width: 18px; color: #849ba6; text-align: center; }
.app-body .sidebar-nav .nav-link:hover { background: #25343b; color: #fff; text-decoration: none; }
.app-body .sidebar-nav .nav-link.active { border-left-color: var(--header-blue); background: #182329; color: #fff; font-weight: 600; text-decoration: none; }
.sidebar-nav .nav-link.active i, .sidebar-nav .nav-link:hover i { color: #5db0de; }
.app-body .sidebar-nav .nav-new-trip { margin: 4px 10px 6px; padding-left: 10px; border: 1px solid #3284b2; border-left-width: 3px; border-radius: 3px; background: #2f769f; color: #fff; }
.app-body .sidebar-nav .nav-new-trip:hover { background: #28688d; }
.demo-account a[href$="/tournees"],
.demo-account a[href*="/tournees/"],
.demo-account a[href$="/tournee"],
.demo-account a[href*="/tournee/"],
.demo-account a[href$="/recurrences"],
.demo-account a[href*="/recurrences/"],
.demo-account a[href$="/recurrence"],
.demo-account a[href*="/recurrence/"],
.demo-account a[href$="/trips/import-ics"] {
  opacity: .42;
  filter: grayscale(1);
  pointer-events: none;
  cursor: not-allowed;
}
.sidebar-version { padding: 18px 15px; color: #60747d; font-size: 11px; }

.app-body .main { width: auto; min-height: calc(100vh - 50px); margin: 0 0 0 230px; padding: 20px 22px 0; border-radius: 0; box-shadow: none; background: var(--content-bg); transition: margin-left .18s ease; }
.app-body .topbar { margin: 0 0 20px; padding: 0; border: 0; }
.app-body .topbar > div { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.app-body h1 { padding: 0; border: 0; background: transparent; color: #333; font-size: 24px; font-weight: 400; }
.breadcrumb { color: #777; font-size: 12px; }
.breadcrumb a { color: #444; }
.app-body .panel, .app-body table, .app-body .kpis div, .app-body .grid.two > div { border: 0; border-top: 3px solid #d2d6de; border-radius: 3px; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.app-body .panel { padding: 16px 18px; }
.demo-limit-banner, .demo-dashboard-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 16px; padding: 14px 16px; border-left: 4px solid #f39c12; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.demo-limit-banner > div, .demo-dashboard-cta > div { min-width: 0; display: flex; align-items: center; gap: 12px; }
.demo-limit-banner > div > i, .demo-dashboard-cta > div > i { flex: 0 0 auto; color: #f39c12; font-size: 25px; }
.demo-limit-banner span, .demo-dashboard-cta span { min-width: 0; display: grid; gap: 2px; }
.demo-limit-banner strong, .demo-dashboard-cta strong { color: #2c3e50; font-size: 15px; }
.demo-limit-banner small, .demo-dashboard-cta small { color: #667784; font-size: 12px; }
.demo-limit-banner .button, .demo-dashboard-cta .button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.demo-dashboard-cta { margin: 0; border-left-color: var(--header-blue); }
.demo-dashboard-cta > div > i { color: var(--header-blue); }
.app-body .toolbar { border: 0; border-radius: 3px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.app-body th { background: #f5f5f5; color: #333; border-bottom: 2px solid #ddd; }
.app-body tbody tr:nth-child(even) { background: #fafafa; }
.app-body button, .app-body .button { border-color: #367fa9; border-radius: 3px; background: var(--header-blue); box-shadow: none; }
.app-body button:hover, .app-body .button:hover { background: var(--header-blue-dark); text-decoration: none; }
.app-body button.danger { border-color: #d73925; background: var(--danger); color: #fff; }
.app-body input, .app-body select, .app-body textarea { border-color: #d2d6de; border-radius: 0; }
.app-body input:focus, .app-body select:focus, .app-body textarea:focus { border-color: var(--header-blue); outline: 0; }
.app-body input[type="checkbox"], .app-body input[type="radio"],
.auth-body input[type="checkbox"], .auth-body input[type="radio"] {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--header-blue);
}
.app-body .stat-card.aqua { background: var(--info); }
.app-body .stat-card.navy { background: var(--header-blue); }
.app-body .stat-card.yellow { background: var(--warning); }
.app-body .stat-card.red { background: var(--danger); }
.app-footer { margin: 30px -22px 0; padding: 15px 22px; border-top: 1px solid #d2d6de; background: #fff; color: #666; }

body.sidebar-collapsed .sidebar { width: 52px; }
body.sidebar-collapsed .sidebar-user div, body.sidebar-collapsed .sidebar-user img, body.sidebar-collapsed .nav-heading, body.sidebar-collapsed .nav-link span, body.sidebar-collapsed .sidebar-version { display: none; }
body.sidebar-collapsed .sidebar-user { min-height: 12px; padding: 6px; }
body.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: 11px 8px; }
body.sidebar-collapsed .main { margin-left: 52px; }

.trip-editor { position: relative; overflow: visible; }
.trip-editor-app { display: block; padding: 0 !important; overflow: visible; border-top-color: var(--header-blue) !important; }
.trip-editor-section { padding: 18px 20px 20px; border-bottom: 1px solid #e4e9ed; }
.trip-editor-section:last-of-type { border-bottom: 0; }
.trip-editor-app .form-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; background: transparent; }
.trip-editor-app .form-section-title h2 { margin: 0; color: #263c4a; font-size: 16px; font-weight: 700; }
.trip-section-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 50%; background: #e8f4fa; color: var(--header-blue); }
.trip-section-icon i { color: inherit; font-size: 15px; }
.trip-meta-grid { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(260px, 1fr); gap: 14px; }
.trip-meta-grid > label > span, .trip-route-point > span { display: block; margin-bottom: 6px; color: var(--ik-blue); font-weight: 700; }
.trip-meta-grid input, .trip-meta-grid select, .trip-route-editor input, .trip-calculation-row input { min-height: 42px; }
.trip-destination-field .autocomplete-field > i { top: 14px; color: #748996; }
.trip-route-editor { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: start; gap: 12px; }
.trip-route-point { min-width: 0; }
.trip-route-point .address-field > i { position: absolute; z-index: 2; top: 14px; left: 12px; color: #25a65a; font-size: 13px; }
.trip-route-end .address-field > i { color: #dd4b39; font-size: 17px; top: 12px; }
.trip-route-point .address-field > input { padding-left: 36px; }
.trip-route-swap { width: 36px; height: 36px; min-height: 36px; align-self: start; margin-top: 25px; padding: 0 !important; border: 1px solid #c9d7df !important; border-radius: 50% !important; background: #fff !important; color: var(--header-blue) !important; }
.trip-route-swap:hover { border-color: var(--header-blue) !important; background: #eef7fc !important; transform: rotate(180deg); }
.trip-route-swap { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.trip-editor:not(.trip-editor-app) .form-section-title { grid-column: 1 / -1; display: grid; grid-template-columns: 28px max-content; align-items: center; gap: 8px; margin: 2px -18px 0; padding: 8px 18px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: #f8f8f8; color: #444; }
.trip-editor:not(.trip-editor-app) .form-section-title:first-of-type { margin-top: -16px; border-top: 0; }
.form-section-title i { color: var(--header-blue); font-size: 18px; text-align: center; }
.form-section-title span { font-size: 16px; font-weight: 600; }
.form-section-title small { color: #777; font-size: 12px; }
.autocomplete-field, .address-field { position: relative; }
.autocomplete-field > i { position: absolute; z-index: 2; top: 11px; left: 10px; color: #999; }
.autocomplete-field > input { padding-left: 32px; }
.autocomplete-menu { position: absolute; z-index: 1060; top: calc(100% + 2px); right: 0; left: 0; max-height: 290px; overflow-y: auto; border: 1px solid #aaa; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.autocomplete-option { width: 100%; min-height: 0; display: block !important; padding: 8px 11px !important; border: 0 !important; border-bottom: 1px solid #eee !important; border-radius: 0 !important; background: #fff !important; color: #333 !important; text-align: left; box-shadow: none !important; }
.autocomplete-option:hover, .autocomplete-option.active { background: #eaf3f8 !important; }
.autocomplete-option strong, .autocomplete-option small { display: block; }
.autocomplete-option small { margin-top: 2px; color: #777; font-weight: 400; }
.pac-container { z-index: 1200 !important; }
.address-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.address-shortcuts button { min-height: 28px; padding: 3px 9px; border-color: #d5dfe5; background: #f8fafb; color: #50636e; font-size: 11px; }
.address-shortcuts button:hover { border-color: var(--header-blue); background: #f4f8fb; color: var(--header-blue-dark); }
.address-shortcuts i { margin-right: 3px; }
.distance-status { min-height: 20px; color: #777; font-weight: 600; }
.trip-datetime { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(105px, .7fr); gap: 10px; }
.trip-datetime label > span, .trip-calculation-row label > span, .trip-attachment-row label > span { display: block; margin-bottom: 5px; color: var(--ik-blue); font-weight: 700; }
.trip-calculation-row { display: grid; grid-template-columns: minmax(135px, 180px) minmax(115px, 155px) max-content minmax(90px, 1fr) minmax(145px, 175px); align-items: end; gap: 12px; }
.trip-calculation-row .distance-calc { min-height: 42px; padding-inline: 16px; white-space: nowrap; }
.trip-calculation-row .distance-status { align-self: center; margin-top: 20px; }
.input-with-unit { position: relative; }
.input-with-unit input { padding-right: 44px; }
.input-with-unit b { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: #778b96; font-size: 11px; }
.trip-ik-estimate { min-height: 66px; display: grid; align-content: center; padding: 9px 14px; border: 1px solid #cbe2ee; border-left: 4px solid var(--header-blue); border-radius: 3px; background: #eef7fb; }
.trip-ik-estimate span { color: #667985; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.trip-ik-estimate strong { color: var(--header-blue-dark); font-size: 21px; }
.trip-options-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 0; border-top: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; }
.trip-toggle { position: relative; cursor: pointer; }
.trip-toggle input { position: absolute; width: 1px !important; min-width: 1px !important; height: 1px !important; min-height: 1px !important; opacity: 0; }
.trip-toggle > span { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid #d5dfe5; border-radius: 3px; background: #fff; color: #536772; font-size: 12px; transition: border-color .15s, background .15s, color .15s; }
.trip-toggle i { color: #7f939e; }
.trip-toggle input:checked + span { border-color: var(--header-blue); background: #eaf5fb; color: var(--header-blue-dark); }
.trip-toggle input:checked + span i { color: var(--header-blue); }
.trip-toggle input:focus-visible + span { outline: 2px solid rgba(60,141,188,.3); outline-offset: 2px; }
.trip-attachment-row { display: flex; align-items: end; gap: 14px; margin-top: 14px; }
.trip-attachment-row label { width: min(620px, 100%); }
.trip-attachment-row label > span { display: flex; align-items: baseline; gap: 6px; }
.trip-attachment-row label small { color: #7b8d96; font-weight: 400; }
.trip-attachment-row input[type="file"] { min-height: 42px; padding: 4px; background: #f8fafb; }
.trip-attachment-row input[type="file"]::file-selector-button { height: 32px; margin-right: 10px; padding: 0 12px; border: 1px solid #c3d2da; border-radius: 3px; background: #fff; color: #435966; font-weight: 700; cursor: pointer; }
.trip-attachment-row > a { flex: 0 0 auto; margin-bottom: 9px; }
.trip-submit-bar { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 20px; border-top: 1px solid #dfe7eb; background: #f8fafb; }
.trip-submit-bar .button { min-height: 40px; }
.trip-save-button { min-width: 190px; min-height: 40px; font-size: 14px; }
.trip-cancel-button { border-color: #c5d0d6 !important; background: #fff !important; color: #546873 !important; }
.live-trip-map { grid-column: 1 / -1; overflow: hidden; border: 1px solid #d2d6de; background: #fff; }
.live-trip-map > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #e5e8ea; }
.live-trip-map > header strong { color: #333; font-size: 14px; }
.live-trip-map > header i { margin-right: 5px; color: var(--header-blue); }
.live-trip-map .tournee-map { height: 400px; }
@media (max-width: 760px) {
  .trip-editor-section { padding: 16px 14px; }
  .trip-meta-grid, .trip-route-editor { grid-template-columns: 1fr; }
  .trip-route-swap { justify-self: center; margin: -2px 0; transform: rotate(90deg); }
  .trip-route-swap:hover { transform: rotate(270deg); }
  .trip-datetime { grid-template-columns: minmax(145px, 1fr) minmax(105px, .65fr); }
  .trip-calculation-row { grid-template-columns: 1fr 1fr; }
  .trip-calculation-row .distance-calc, .trip-calculation-row .distance-status, .trip-calculation-row .trip-ik-estimate { grid-column: 1 / -1; margin-top: 0; }
  .trip-calculation-row .distance-calc { width: 100%; }
  .trip-options-row { align-items: stretch; flex-direction: column; gap: 6px; }
  .trip-toggle > span { width: 100%; }
  .trip-attachment-row { align-items: stretch; flex-direction: column; }
  .trip-attachment-row > a { margin-bottom: 0; }
  .trip-submit-bar { flex-direction: column-reverse; padding: 14px; }
  .trip-submit-bar .button, .trip-submit-bar button { width: 100%; }
}
.success { border-color: #008d4c !important; background: var(--success) !important; color: #fff !important; }
.tournee-picker { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr); align-items: end; gap: 24px; }
.tournee-picker label { display: block; margin-bottom: 5px; font-weight: 600; }
.tournee-picker .inline { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.tournee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.tournee-card { position: relative; min-height: 105px; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 12px; padding: 15px; border-top: 3px solid var(--header-blue); border-radius: 3px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.14); color: #333; }
.tournee-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,.16); text-decoration: none; }
.tournee-card-icon { grid-row: 1 / 3; align-self: center; color: var(--header-blue); font-size: 38px; text-align: center; }
.tournee-card strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.tournee-card small { color: #777; font-weight: 400; }
.status-label { position: absolute; top: 8px; right: 8px; padding: 2px 5px; border-radius: 2px; background: #f39c12; color: #fff; font-size: 10px; }
.status-label.validated { background: var(--success); }
.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; gap: 7px; padding: 48px 20px; border: 1px dashed #bbb; background: #fff; color: #777; text-align: center; }
.empty-state i { color: #bbb; font-size: 45px; }
.tournee-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.tournee-name { display: flex; align-items: end; gap: 5px; min-width: 280px; }
.tournee-name label { flex: 1; }
.tournee-name label, .tournee-name input { margin: 0; }
.tournee-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.tournee-actions form { margin: 0; }
.tournee-new-step > header, .tournee-timeline-box > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -16px -18px 16px; padding: 10px 15px; border-bottom: 1px solid #eee; }
.tournee-new-step h2, .tournee-timeline-box h2 { margin: 0; color: #444; font-size: 17px; }
.close-panel { width: 32px; min-height: 30px !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #777 !important; }
.distance-row { display: flex; align-items: center; gap: 9px; }
.attach-existing { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-bottom: 18px; padding: 10px; background: #f7f7f7; }
.tournee-timeline { position: relative; margin: 0; padding: 5px 0 5px 62px; list-style: none; }
.tournee-timeline::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 29px; width: 4px; background: #ddd; }
.tournee-timeline > li { position: relative; margin: 0 0 16px; }
.timeline-marker { position: absolute; z-index: 2; top: 10px; left: -50px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #777; color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 0 0 4px #fff; }
.depart-marker { top: 0; background: var(--success); }
.timeline-depart > div { min-height: 34px; display: flex; flex-direction: column; justify-content: center; padding: 3px 0 3px 3px; }
.timeline-depart strong { color: #008d4c; font-size: 12px; text-transform: uppercase; }
.timeline-depart span { color: #444; font-weight: 600; }
.timeline-card { border: 1px solid #d2d6de; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.timeline-card summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 13px; cursor: pointer; list-style: none; }
.timeline-card summary::-webkit-details-marker { display: none; }
.timeline-card summary > span:first-child { min-width: 0; display: grid; }
.timeline-card summary strong { color: #333; font-size: 15px; }
.timeline-card summary small { overflow: hidden; color: #777; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.timeline-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 15px; color: #777; }
.timeline-meta b { min-width: 72px; color: var(--header-blue-dark); text-align: right; }
.timeline-card[open] .timeline-meta > i { transform: rotate(180deg); }
.timeline-details { padding: 14px; border-top: 1px solid #eee; background: #fafafa; }
.trip-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.trip-facts span { padding: 7px 9px; border-left: 3px solid var(--header-blue); background: #fff; }
.trip-facts b { display: block; color: #777; font-size: 10px; text-transform: uppercase; }
.trip-editor.compact { box-shadow: none; }
.step-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.step-actions form { display: flex; gap: 4px; }
.tournee-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 15px; }
.tournee-totals > div { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; align-items: center; padding: 16px 20px; border-radius: 3px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.tournee-totals i { grid-row: 1 / 3; color: var(--success); font-size: 32px; }
.tournee-totals span { color: #666; }
.tournee-totals strong { color: #333; font-size: 24px; }
.validate-tournee { display: flex; justify-content: flex-end; margin-top: 14px; }
.validated-banner { margin-top: 14px; padding: 12px; border-left: 4px solid var(--success); background: #e9f7ef; color: #087a3e; font-weight: 700; text-align: right; }
.tournee-map-box { margin-top: 15px; }
.tournee-map-box > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -16px -18px 12px; padding: 10px 15px; border-bottom: 1px solid #eee; }
.tournee-map-box h2 { margin: 0; color: #444; font-size: 17px; }
.tournee-map-box header span { color: #777; font-size: 12px; }
.tournee-map { width: 100%; height: 380px; background: #e8eef2; }
.tournee-map > div { height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: #788a95; text-align: center; }
.tournee-map > div i { font-size: 42px; }
.trips-command-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.primary-actions, .export-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.export-actions .excel { border-color: #18723a; background: #217346; }
.export-actions .pdf { border-color: #b52d23; background: #d73925; }
.advanced-search { padding: 0 !important; overflow: hidden; }
.advanced-search > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fff; cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; }
.advanced-search > summary::-webkit-details-marker { display: none; }
.advanced-search > summary span { color: #888; font-size: 12px; font-weight: 400; }
.advanced-search form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px 20px; padding: 15px 18px; border-top: 1px solid #eee; background: #fafafa; }
.advanced-search fieldset { min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid #ddd; }
.advanced-search legend { padding: 0 5px; color: #555; font-size: 12px; font-weight: 600; }
.filter-checks { max-height: 105px; display: flex; flex-wrap: wrap; gap: 3px 12px; overflow-y: auto; }
.filter-checks label { width: auto; display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; }
.filter-checks input { width: 14px; min-height: 14px; margin: 0; }
.filter-checks.months { display: grid; grid-template-columns: repeat(4, 1fr); }
.advanced-search .form-actions { grid-column: 1 / -1; }
.trip-kpis .stat-card { position: relative; min-height: 98px; display: grid; grid-template-columns: 58px 1fr; grid-template-rows: auto auto; align-content: center; padding: 12px 17px; color: #fff; }
.trip-kpis .stat-card > i { grid-row: 1 / 3; align-self: center; font-size: 44px; opacity: .42; }
.trip-kpis .stat-card strong { color: #fff; font-size: 25px; }
.trip-kpis .stat-card span { color: rgba(255,255,255,.9); }
.data-table-panel { padding: 0 !important; overflow: hidden; }
.data-table-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 14px; border-bottom: 1px solid #eee; }
.data-table-panel h2 { margin: 0; font-size: 17px; }
.table-search { position: relative; width: min(280px, 50%); margin: 0; }
.table-search i { position: absolute; top: 11px; left: 10px; color: #aaa; }
.table-search input { padding-left: 30px; }
.data-table-panel .table-scroll { overflow: auto; }
.dense-table { border: 0 !important; box-shadow: none !important; font-size: 12px; }
.dense-table th { position: relative; padding: 8px; white-space: nowrap; }
.dense-table th[data-sort] { padding-right: 18px; cursor: pointer; }
.dense-table th[data-sort]::after { content: "\f0dc"; position: absolute; right: 5px; color: #aaa; font-family: FontAwesome; }
.dense-table th[data-direction="asc"]::after { content: "\f0de"; color: var(--header-blue); }
.dense-table th[data-direction="desc"]::after { content: "\f0dd"; color: var(--header-blue); }
.dense-table td { max-width: 210px; padding: 7px 8px; vertical-align: middle; }
.dense-table td small { display: block; color: #888; }
.address-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duplicate-badge, .draft-badge { display: inline-block; margin-left: 4px; padding: 1px 4px; border-radius: 2px; background: #dd4b39; color: #fff; font-size: 9px; }
.draft-badge { background: #f39c12; }
.trip-options { color: #777; white-space: nowrap; }
.trip-options i { margin-right: 5px; }
.attachment-cell { text-align: center; font-size: 16px; }
.icon-actions { display: flex; gap: 4px; white-space: nowrap; }
.icon-actions a { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 2px; background: #eee; color: #444; }
.icon-actions a:hover { background: var(--header-blue); color: #fff; text-decoration: none; }
.data-table-panel .form-actions { padding: 10px 14px; border-top: 1px solid #eee; }
.multi-trip-table { min-width: 1450px; }
.multi-trip-table td { position: relative; padding: 5px; }
.multi-trip-table input, .multi-trip-table select { min-width: 105px; }
.multi-trip-table .address-field input, .multi-trip-table .autocomplete-field input { min-width: 210px; }
.multi-trip-table td:nth-child(9) select { min-width: 105px; margin-bottom: 3px; }
.multi-trip-table td:last-child { width: 48px; }
.multi-trip-table td:last-child button { width: 32px; min-height: 30px; padding: 0; margin-bottom: 4px; }
.multi-trip-table .distance-status { display: block; max-width: 80px; font-size: 10px; }
.chain-previous { position: absolute; top: 8px; right: 8px; width: 26px; min-height: 26px !important; padding: 0 !important; opacity: .72; }
.import-intro > div { display: grid; grid-template-columns: 70px 1fr; align-items: center; }
.import-intro i { grid-row: 1 / 3; color: var(--header-blue); font-size: 52px; text-align: center; }
.import-intro h2 { margin: 0; color: #333; }
.import-intro p { margin: 3px 0 0; color: #777; }
.calendar-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 2px; }
.calendar-source { min-height: 62px !important; justify-content: flex-start !important; gap: 12px; padding: 10px 14px !important; border: 1px solid #d5dce1 !important; background: #fff !important; color: #333 !important; text-align: left; }
.calendar-source:hover { border-color: var(--header-blue) !important; background: #f7fbfd !important; }
.calendar-source > i { width: 30px; color: var(--header-blue); font-size: 24px; text-align: center; }
.calendar-source > span, .calendar-source small { display: block; }
.calendar-source small { margin-top: 2px; color: #777; font-size: 11px; font-weight: 400; }
.calendar-source:disabled { opacity: .58; cursor: not-allowed; }
.calendar-source.microsoft > i { color: #1877b8; }
.route-options-inline { grid-column: 1 / -1; display: flex; align-items: center; gap: 28px; min-height: 32px; }
.route-options-inline .check { min-height: 24px; margin: 0; white-space: nowrap; }
.manual-calendar-import { grid-column: 1 / -1; overflow: hidden; border: 1px solid #d5dce1; background: #fafbfc; }
.manual-calendar-import > summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 12px; color: var(--header-blue-dark); font-weight: 700; cursor: pointer; list-style: none; }
.manual-calendar-import > summary::-webkit-details-marker { display: none; }
.manual-calendar-import > summary .fa-upload { color: var(--header-blue); }
.manual-calendar-import > summary .fa-angle-down { margin-left: auto; transition: transform .15s ease; }
.manual-calendar-import[open] > summary .fa-angle-down { transform: rotate(180deg); }
.manual-calendar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; border-top: 1px solid #e5e8ea; background: #fff; }
.manual-calendar-actions { grid-column: 1 / -1; }
.ics-preview { min-width: 1000px; }
.ics-preview input { min-width: 120px; }
.ics-preview td:nth-child(4) input, .ics-preview td:nth-child(5) input { min-width: 220px; }
.trip-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.trip-detail-header h2 { margin: 0 0 3px; color: #333; font-size: 21px; }
.trip-detail-header span { color: #777; }
.trip-detail-header > div:last-child { display: flex; flex-wrap: wrap; gap: 5px; }
.trip-detail-grid { display: grid; grid-template-columns: 1fr 275px; gap: 14px; }
.trip-detail-grid .panel { margin: 0; }
.trip-detail-grid dl { display: grid; grid-template-columns: 145px 1fr; margin: 0; }
.trip-detail-grid dt, .trip-detail-grid dd { margin: 0; padding: 7px 9px; border-bottom: 1px solid #eee; }
.trip-detail-grid dt { color: #666; font-weight: 600; }
.trip-ik-card { min-height: 175px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 22px; border-radius: 3px; background: var(--success); color: #fff; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.16); }
.trip-ik-card strong { color: #fff; font-size: 36px; }
.trip-ik-card small { color: rgba(255,255,255,.86); }
.trip-map-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.trip-map-panel h2 { margin: 0; font-size: 17px; }
.duplicate-trip > h2 { margin: 0 0 12px; font-size: 17px; }
.duplicate-trip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.duplicate-trip > h2 { grid-column: 1 / -1; }
.duplicate-trip form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 7px; }

@media (max-width: 1024px) {
  .app-body { overflow-x: hidden; }
  .app-body .sidebar {
    width: 230px;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }
  .app-body .sidebar .sidebar-nav {
    display: block;
    grid-template-columns: none;
  }
  .app-body .main, body.sidebar-collapsed .main {
    width: auto;
    margin-left: 0;
    padding-right: 18px;
    padding-left: 18px;
  }
  .app-footer {
    margin-right: -18px;
    margin-left: -18px;
  }
  body.mobile-sidebar-open { overflow: hidden; }
  body.mobile-sidebar-open .sidebar {
    width: 230px;
    transform: translateX(0);
    box-shadow: 5px 0 16px rgba(0,0,0,.25);
  }
  body.mobile-sidebar-open::after {
    content: "";
    position: fixed;
    z-index: 1010;
    inset: 50px 0 0;
    background: rgba(21,31,37,.48);
  }
  body.sidebar-collapsed .sidebar-user div,
  body.sidebar-collapsed .sidebar-user img,
  body.sidebar-collapsed .nav-heading,
  body.sidebar-collapsed .nav-link span,
  body.sidebar-collapsed .sidebar-version { display: initial; }
  body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: flex-start;
    padding: 10px 15px;
  }
  .trip-calculation-row { grid-template-columns: 1fr 1fr; }
  .trip-calculation-row .distance-calc,
  .trip-calculation-row .distance-status,
  .trip-calculation-row .trip-ik-estimate {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .trip-calculation-row .distance-calc { width: 100%; }
}

@media (max-width: 767px) {
  .demo-limit-banner, .demo-dashboard-cta { align-items: stretch; flex-direction: column; }
  .demo-limit-banner .button, .demo-dashboard-cta .button { justify-content: center; width: 100%; }
  .header-brand { flex-basis: 50px; }
  .header-brand .brand-full { display: none; }
  .header-brand .brand-icon { display: block; width: 38px; filter: none; }
  .header-brand strong, .user-summary span { display: none; }
  .app-body .main, body.sidebar-collapsed .main { margin-left: 0; padding: 16px 12px 0; }
  .app-body .topbar > div { align-items: flex-start; gap: 8px; }
  .breadcrumb { display: none; }
  .app-footer { margin-right: -12px; margin-left: -12px; }
  .trip-editor .form-section-title { grid-template-columns: 24px 1fr; }
  .form-section-title small { grid-column: 2; }
  .tournee-picker { grid-template-columns: 1fr; }
  .tournee-toolbar { align-items: stretch; flex-direction: column; }
  .tournee-name { min-width: 0; }
  .tournee-actions { justify-content: flex-start; }
  .tournee-timeline { padding-left: 48px; }
  .tournee-timeline::before { left: 21px; }
  .timeline-marker { left: -43px; width: 30px; height: 30px; }
  .timeline-card summary { align-items: flex-start; flex-direction: column; }
  .timeline-meta { width: 100%; justify-content: space-between; }
  .trip-facts, .tournee-totals { grid-template-columns: 1fr; }
  .trips-command-bar { align-items: stretch; flex-direction: column; }
  .advanced-search form { grid-template-columns: 1fr; }
  .route-options-inline { flex-wrap: wrap; gap: 8px 20px; }
  .manual-calendar-grid { grid-template-columns: 1fr; }
  .table-search { width: 100%; }
  .trip-detail-header { align-items: flex-start; flex-direction: column; }
  .trip-detail-grid, .duplicate-trip { grid-template-columns: 1fr; }
  .duplicate-trip > h2 { grid-column: auto; }
  .duplicate-trip form { grid-template-columns: 1fr; }
}
