/* OnTheGo admin: the apps' look (ink on paper, Manrope, soft rounded cards). */
:root {
  --otg-ink: #201d1d;
  --otg-paper: #f7f3f3;
  --otg-bg: #f6f6f6;
  --otg-surface: #ffffff;
  --otg-divider: #e4e4e4;
  --otg-text: #1a1a1a;
  --otg-text-2: #6b6b6b;
  --otg-muted: #9e9e9e;
  --otg-success: #2e7d32;
  --otg-warning: #b26a00;
  --otg-danger: #c62828;
  --otg-info: #1565c0;
  --otg-radius: 14px;
  --otg-shadow: 0 1px 2px rgba(32, 29, 29, 0.04), 0 4px 16px rgba(32, 29, 29, 0.05);
}

html, body, input, button, select, textarea, [data-css] {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}
body { background: var(--otg-bg); color: var(--otg-text); -webkit-font-smoothing: antialiased; }
a { color: var(--otg-ink); }

/* AdminJS chrome */
section[data-css="sidebar"], [data-css="sidebar"] { border-right: 1px solid var(--otg-divider) !important; }
[data-css="sidebar-footer"], [data-css="made-with-love"] { display: none !important; }
button[data-css], a[data-css][class*="Button"] { border-radius: 10px !important; }
input[data-css], textarea[data-css], select[data-css] { border-radius: 10px !important; }
.adminjs_H2 { font-weight: 800 !important; letter-spacing: -0.02em; }
.adminjs_TableCell { word-break: normal !important; overflow-wrap: normal !important; white-space: nowrap; }
*:has(> table[data-css$="-table"]) { overflow-x: auto; }
.otg-truncate { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.adminjs_TableCell .otg-badge, .adminjs_TableCell .otg-money { white-space: nowrap; }

/* Sidebar brand */
.otg-brand { display: flex; align-items: center; gap: 12px; padding: 20px 24px 28px; text-decoration: none; color: var(--otg-ink); }
.otg-brand__tile { width: 40px; height: 40px; border-radius: 12px; background: var(--otg-ink); display: grid; place-items: center; flex-shrink: 0; }
.otg-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.otg-brand__text strong { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.otg-brand__text small { font-size: 12px; font-weight: 600; color: var(--otg-text-2); text-transform: uppercase; letter-spacing: 0.08em; }

/* Shared pieces */
.otg-muted { color: var(--otg-text-2); }
.otg-empty { color: var(--otg-text-2); margin: 4px 0 0; }
.otg-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--otg-text-2); }
.otg-card { background: var(--otg-surface); border: 1px solid var(--otg-divider); border-radius: var(--otg-radius); box-shadow: var(--otg-shadow); padding: 20px; margin-bottom: 20px; min-width: 0; }
.otg-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.otg-card__head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--otg-text); }
.otg-card__head a { font-weight: 700; text-decoration: none; }
.otg-alert { background: #fdecea; color: var(--otg-danger); border-radius: 10px; padding: 12px 14px; font-weight: 600; margin: 12px 0; }
.otg-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.otg-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eeeeee; color: var(--otg-text); }
.otg-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.otg-badge--success { background: #e8f5e9; color: var(--otg-success); }
.otg-badge--warning { background: #fff4e0; color: var(--otg-warning); }
.otg-badge--danger { background: #fdecea; color: var(--otg-danger); }
.otg-badge--info { background: #e3f0fb; color: var(--otg-info); }
.otg-badge--ink { background: var(--otg-ink); color: var(--otg-paper); }
.otg-money { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Maps */
.otg-map { width: 100%; border-radius: 12px; overflow: hidden; background: #ececec; z-index: 0; }
.otg-map--empty { display: grid; place-items: center; color: var(--otg-text-2); font-weight: 600; }
.otg-map .leaflet-tile-pane { filter: grayscale(1) contrast(0.95) brightness(1.04); }
.otg-map .leaflet-control-attribution { font-size: 10px; }
.otg-marker-wrap { background: none; border: none; }
.otg-marker { display: block; width: 22px; height: 22px; box-sizing: border-box; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.otg-marker--pickup { border-radius: 50%; background: var(--otg-ink); border: 6px solid #fff; }
.otg-marker--dropoff { border-radius: 5px; background: var(--otg-ink); border: 6px solid #fff; }
.otg-marker--pin { border-radius: 50%; background: var(--otg-ink); border: 5px solid var(--otg-paper); width: 24px; height: 24px; }
.otg-tooltip { font-family: inherit; font-weight: 700; border-radius: 8px; }
.otg-route { display: grid; gap: 12px; padding-top: 16px; }
.otg-route__stop { display: flex; gap: 12px; align-items: flex-start; }
.otg-route__address { font-weight: 600; margin-top: 2px; }
.otg-route__meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--otg-text-2); font-weight: 600; font-size: 13px; }
.otg-route__meta a { font-weight: 700; text-decoration: none; }
.otg-dot { flex-shrink: 0; margin-top: 3px; width: 12px; height: 12px; background: var(--otg-ink); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--otg-divider); }
.otg-dot--pickup { border-radius: 50%; }
.otg-dot--dropoff { border-radius: 3px; }

/* Ride timeline */
.otg-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--otg-divider); display: grid; gap: 14px; }
.otg-timeline li { position: relative; display: grid; gap: 2px; }
.otg-timeline li::before { content: ''; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--otg-ink); box-shadow: 0 0 0 3px #fff; }
.otg-timeline li.is-cancelled::before { background: var(--otg-danger); }
.otg-timeline__label { font-weight: 700; }
.otg-timeline__time { color: var(--otg-text-2); font-size: 13px; }
.otg-timeline__note { font-size: 13px; color: var(--otg-danger); }

/* Documents */
.otg-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.otg-doc { display: grid; gap: 4px; text-decoration: none; color: var(--otg-text); }
.otg-doc__preview { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--otg-bg); border: 1px solid var(--otg-divider); display: grid; place-items: center; }
.otg-doc__preview img { width: 100%; height: 100%; object-fit: cover; }
.otg-doc:hover .otg-doc__preview { border-color: var(--otg-ink); }
.otg-doc__ext { font-weight: 800; color: var(--otg-text-2); letter-spacing: 0.06em; }
.otg-doc__title { font-weight: 700; }
.otg-doc__file { font-size: 12px; color: var(--otg-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otg-file-thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--otg-bg); border: 1px solid var(--otg-divider); font-size: 10px; font-weight: 800; color: var(--otg-text-2); text-decoration: none; }
.otg-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.otg-file-show { display: inline-grid; gap: 8px; font-weight: 700; text-decoration: none; }
.otg-file-show img { max-width: min(420px, 100%); max-height: 320px; border-radius: 12px; border: 1px solid var(--otg-divider); }

/* Dashboard */
.otg-page { padding: 24px 32px 40px; max-width: 1360px; }
.otg-page__head h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.otg-page__head p { margin: 0 0 24px; line-height: 1.4; }
.otg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.otg-tile { display: grid; gap: 4px; padding: 18px 20px; background: var(--otg-surface); border: 1px solid var(--otg-divider); border-radius: var(--otg-radius); box-shadow: var(--otg-shadow); text-decoration: none; color: var(--otg-text); }
.otg-tile--link:hover { border-color: var(--otg-ink); }
.otg-tile__label { font-size: 13px; font-weight: 700; color: var(--otg-text-2); }
.otg-tile__value { font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.otg-tile__hint { font-size: 12px; color: var(--otg-text-2); }
.otg-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.otg-list { list-style: none; margin: 0; padding: 0; }
.otg-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--otg-divider); }
.otg-list li:first-child { border-top: none; padding-top: 0; }
.otg-list a { font-weight: 700; text-decoration: none; }
.otg-list--people a { display: grid; gap: 2px; min-width: 0; }
.otg-list--people .otg-muted { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otg-count { min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 800; background: #eeeeee; color: var(--otg-text-2); font-variant-numeric: tabular-nums; }
.otg-count.is-on { background: var(--otg-ink); color: var(--otg-paper); }

.otg-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 220px; }
.otg-bars__col { position: relative; display: grid; grid-template-rows: 1fr auto; gap: 8px; outline: none; }
.otg-bars__plot { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--otg-divider); }
.otg-bars__bar { width: min(36px, 70%); background: var(--otg-ink); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity 0.15s; }
.otg-bars__bar.is-zero { height: 2px !important; background: var(--otg-divider); }
.otg-bars__value { font-size: 13px; font-weight: 800; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.otg-bars__label { text-align: center; font-size: 12px; font-weight: 600; color: var(--otg-text-2); }
.otg-bars:hover .otg-bars__bar { opacity: 0.45; }
.otg-bars__col:hover .otg-bars__bar, .otg-bars__col:focus .otg-bars__bar { opacity: 1; }
.otg-bars__tip { position: absolute; bottom: calc(100% - 24px); left: 50%; transform: translateX(-50%); background: var(--otg-ink); color: var(--otg-paper); padding: 8px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 2; display: grid; gap: 2px; }
.otg-bars__col:hover .otg-bars__tip, .otg-bars__col:focus .otg-bars__tip { opacity: 1; }

.otg-table-wrap { overflow-x: auto; }
.otg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.otg-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--otg-text-2); font-weight: 700; padding: 0 12px 10px 0; }
.otg-table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--otg-divider); vertical-align: top; }
.otg-table td a { font-weight: 800; text-decoration: none; }
.otg-table .is-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.otg-table__route { display: grid; gap: 2px; max-width: 360px; }
.otg-table__route span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Login */
.otg-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--otg-bg); box-sizing: border-box; }
.otg-login__card { display: grid; grid-template-columns: 360px 420px; background: var(--otg-surface); border-radius: 20px; overflow: hidden; box-shadow: 0 10px 40px rgba(32, 29, 29, 0.12); }
.otg-login__panel { background: var(--otg-ink); color: var(--otg-paper); padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.otg-login__panel h2 { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.otg-login__panel p { margin: 0; opacity: 0.75; line-height: 1.5; }
.otg-login__form { padding: 48px 40px; display: grid; gap: 16px; align-content: center; }
.otg-login__form h1 { margin: 0; font-size: 26px; font-weight: 800; }
.otg-login__form > p { margin: -8px 0 4px; }
.otg-login__mobile-brand { display: none; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.otg-field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--otg-text-2); }
.otg-field input { font-size: 15px; padding: 13px 14px; border-radius: 12px; border: 1px solid #d6d6d6; background: var(--otg-bg); color: var(--otg-text); outline: none; }
.otg-field input:focus { border-color: var(--otg-ink); background: #fff; box-shadow: 0 0 0 3px rgba(32, 29, 29, 0.08); }
.otg-button { margin-top: 8px; padding: 14px 18px; border: none; border-radius: 12px; background: var(--otg-ink); color: var(--otg-paper); font-size: 15px; font-weight: 800; cursor: pointer; }
.otg-button:hover { background: #000; }
.otg-button:focus-visible { outline: 3px solid rgba(32, 29, 29, 0.3); outline-offset: 2px; }

@media (max-width: 1100px) {
  .otg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .otg-login__card { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 440px; }
  .otg-login__panel { display: none; }
  .otg-login__mobile-brand { display: flex; }
  .otg-login__form { padding: 32px 24px; }
}
@media (max-width: 640px) {
  .otg-page { padding: 16px 16px 32px; }
  .otg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .otg-tile__value { font-size: 24px; }
  .otg-card { padding: 16px; }
  .otg-bars { height: 180px; }
}
