:root {
    --tms-gold: #b59a61;
    --tms-gold-light: #d7bf8d;
    --tms-dark: #243047;
    --tms-panel: rgba(255,255,255,.91);
}
body:not(.login-codepen-style),
body.trailer-tool-body {
    background: linear-gradient(138deg,#37445b 0%,#687386 54%,#a5a7a6 100%) fixed;
}
.app-navbar { background: rgba(27,38,58,.92); border-bottom: 1px solid rgba(181,154,97,.55); }
.app-navbar::after { background: linear-gradient(90deg,transparent,#b59a61,#d7bf8d,transparent); }
.tracking-brand-mark { background: linear-gradient(145deg,#d7bf8d,#a88c57)!important; color:#233047!important; box-shadow:0 .35rem 1rem rgba(18,24,39,.25)!important; }
.tracking-brand-copy { background:linear-gradient(100deg,#f2ead9,#c8ac71,#fff2d4)!important; background-clip:text!important; -webkit-background-clip:text!important; }
.main-nav-link.active { border-color:rgba(215,191,141,.55); background:rgba(181,154,97,.19); }
.main-nav-link::after { background:var(--tms-gold-light); }
.main-nav-link:hover,.main-nav-link:focus-visible { border-color:rgba(215,191,141,.4); }
.app-nav-action { border-color:rgba(215,191,141,.65); background:rgba(181,154,97,.12); }
.app-nav-action:hover { border-color:var(--tms-gold-light); background:rgba(181,154,97,.25); }
.btn-primary { background:#947849; border-color:#947849; color:#fff; }
.btn-primary:hover,.btn-primary:focus-visible { background:#7d643d; border-color:#7d643d; color:#fff; }
.btn-outline-primary { color:#6d552e; border-color:#9a7b45; }
.btn-outline-primary:hover { background:#9a7b45; border-color:#9a7b45; color:#fff; }
.app-main > .app-page-header h1 { color:#fff; }
.card { background:var(--tms-panel); }
.local-emoji { width:1.28em; height:1.28em; object-fit:contain; vertical-align:-.2em; flex:none; }
.page-note { color:#eef1f5; }

/* Home: title, compact date/upload, then the map without metric cards. */
.is-home .dashboard-stack { grid-template-columns:1fr auto auto; gap:.6rem 1rem; align-items:end; margin-bottom:.6rem; }
.is-home .dashboard-operations-title { grid-column:1; grid-row:1; justify-self:start; text-align:left; align-items:flex-start; color:#f7f2e8; background:none; -webkit-text-fill-color:#f7f2e8; }
.is-home .dashboard-operations-period { color:var(--tms-gold-light); -webkit-text-fill-color:var(--tms-gold-light); }
.is-home .dashboard-month-control { grid-column:2; grid-row:1; width:auto; min-width:230px; justify-self:end; }
.is-home .dashboard-month-control label { color:#f2f3f5; }
.is-home .home-upload-control { grid-column:3; grid-row:1; align-self:end; }
.is-home .home-upload-control .btn { min-height:44px; display:inline-flex; align-items:center; }
.is-home .dashboard-map-section,.is-home .dashboard-stack--public .dashboard-map-section { grid-column:1 / -1; grid-row:2; padding:.3rem 0; }
.is-home .dashboard-map-section .usa-map-panel { width:100%; }
.is-home .dashboard-map-section .usa-map-wrap { width:100%; max-width:none; }
.is-home .dashboard-map-section .usa-map-canvas { width:100%; max-width:none; }
.home-status-strip { display:flex; flex-wrap:wrap; justify-content:center; gap:.5rem; margin:.25rem auto 1rem; }
.home-status-strip > span { display:inline-flex; align-items:center; gap:.38rem; padding:.38rem .7rem; border:1px solid rgba(255,255,255,.26); border-radius:999px; background:rgba(30,42,62,.55); color:#fff; font-size:.82rem; font-weight:700; }
.home-status-strip strong { color:var(--tms-gold-light); }
.map-route-path { vector-effect:non-scaling-stroke; }
.map-route-group--completed .map-route-path { stroke-dasharray:none!important; animation:none!important; }

/* Content-sized Loads controls. */
.loads-compact-controls { display:flex; flex-wrap:wrap; align-items:end; justify-content:flex-start; gap:.55rem; margin-bottom:.9rem; }
.compact-tool { display:inline-flex!important; flex:0 1 auto!important; width:max-content!important; max-width:100%; align-items:center; gap:.45rem; margin:0!important; padding:.5rem .6rem; border:1px solid rgba(255,255,255,.35); border-radius:.78rem; background:rgba(255,255,255,.9); box-shadow:0 .25rem .8rem rgba(23,31,47,.08); color:#263349; }
.loads-search-form > div { width:auto!important; flex:0 1 auto; }
.loads-search-form .form-control { width:clamp(220px,28vw,480px); max-width:100%; }
.loads-month-form > div { width:auto!important; text-align:left!important; }
.loads-month-form .form-label { margin:0 .2rem 0 0!important; font-size:.75rem; white-space:nowrap; }
.loads-month-form .form-control { min-width:150px!important; width:155px!important; }
.loads-ai-card .card-body { display:contents; }
.loads-ai-card .dashboard-action-copy { font-size:.77rem; white-space:nowrap; }
.loads-ai-card .dashboard-ai-controls { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; }
.loads-ai-card .dashboard-file-name { max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.loads-bulk-toolbar { background:rgba(255,255,255,.95)!important; }
.load-status-badge { display:inline-flex; align-items:center; gap:.2em; font-size:.78rem; font-weight:850; line-height:1.25; }
.load-status-badge .local-emoji { width:1.3em; height:1.3em; }

/* Admin-only Tablo and Dosyalar. */
.ledger-topbar { display:flex; flex-wrap:wrap; gap:.75rem; align-items:center; margin-bottom:.8rem; }
.ledger-topbar input[type=month] { max-width:150px; border:1px solid #c7cbd3; border-radius:.4rem; padding:.25rem; }
.ledger-weeks { display:flex; flex-wrap:wrap; gap:.35rem; }
.ledger-week { display:flex; flex-direction:column; min-width:72px; padding:.35rem .55rem; border:1px solid rgba(255,255,255,.4); border-radius:.65rem; background:rgba(255,255,255,.88); color:#243047; font-size:.75rem; font-weight:800; text-align:center; text-decoration:none; }
.ledger-week small { font-size:.64rem; font-weight:600; white-space:nowrap; }
.ledger-week.active { border-color:#b59a61; background:#b59a61; color:#1b2637; }
.ledger-summary { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:.6rem; }
.ledger-summary > div { display:flex; flex-direction:column; gap:.1rem; flex:0 1 auto; min-width:142px; padding:.55rem .75rem; border:1px solid rgba(255,255,255,.35); border-radius:.75rem; background:rgba(255,255,255,.9); color:#27334b; }
.ledger-summary span { font-size:.7rem; font-weight:700; }
.ledger-summary strong { font-size:1rem; }
.ledger-grid,.document-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,275px),1fr)); gap:.8rem; }
.ledger-card,.document-card { min-width:0; overflow:hidden; border:1.5px solid rgba(255,255,255,.5); border-radius:1rem; background:rgba(255,255,255,.93); box-shadow:0 .4rem 1.2rem rgba(16,24,40,.1); color:#263349; }
.ledger-card.is-complete { border-color:#36bb68; box-shadow:0 0 0 1px rgba(54,187,104,.18),0 0 12px rgba(54,187,104,.2); }
.ledger-card.is-late { border-color:#eb8b3e; box-shadow:0 0 0 1px rgba(235,139,62,.2),0 0 14px rgba(235,139,62,.25); }
.ledger-card-header,.document-card-top { display:flex; align-items:center; gap:.5rem; padding:.55rem .65rem; border-bottom:1px solid #e2e6ec; font-size:.82rem; }
.ledger-card-header span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ledger-pdfs { display:flex; overflow-x:auto; gap:.4rem; padding:.45rem; }
.ledger-pdf { position:relative; display:block; flex:0 0 105px; overflow:hidden; height:135px; border:1px solid #d7dbe3; border-radius:.45rem; background:#eef1f5; color:#263349; font-size:.62rem; text-decoration:none; }
.ledger-pdf iframe { width:210px; height:220px; transform:scale(.5); transform-origin:top left; pointer-events:none; border:0; }
.ledger-pdf span { position:absolute; bottom:0; left:0; right:0; padding:.2rem; background:rgba(255,255,255,.95); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ledger-no-pdf { padding:1rem; color:#687386; font-size:.8rem; }
.ledger-card-body { padding:.65rem; }
.ledger-expected { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:.3rem; padding:.4rem; font-weight:800; }
.ledger-expected strong { color:#176c47; font-size:1.15rem; white-space:nowrap; }
.ledger-facts { margin:0; font-size:.74rem; }
.ledger-facts > div { display:flex; justify-content:space-between; gap:.5rem; padding:.22rem 0; border-bottom:1px solid #e9ebef; }
.ledger-facts dt { color:#637082; }.ledger-facts dd { margin:0; text-align:right; font-weight:650; }
.ledger-status { display:flex; flex-wrap:wrap; gap:.3rem; margin:.55rem 0; }.ledger-status span { display:inline-flex; align-items:center; gap:.15rem; padding:.18rem .35rem; border-radius:.4rem; background:#e8edf3; font-size:.69rem; font-weight:750; }.ledger-status .late-note { background:#fff1e5; color:#9c4b12; }
.ledger-action { display:flex; flex-wrap:wrap; gap:.3rem; align-items:end; padding:.35rem 0; border-top:1px solid #edf0f3; }.ledger-action label { display:flex; flex-direction:column; gap:.12rem; font-size:.65rem; font-weight:750; }.ledger-action input { max-width:130px; min-height:30px; border:1px solid #c9ced7; border-radius:.4rem; padding:.15rem; font-size:.72rem; }.ledger-action input[type=number] { max-width:90px; }
.ledger-editor { margin:.65rem 0; border:1px solid #b6a077; border-radius:.65rem; background:#fffaf0; }
.ledger-editor > summary { padding:.65rem .75rem; color:#513e1d; cursor:pointer; font-size:.88rem; font-weight:850; }
.ledger-editor[open] > summary { border-bottom:1px solid #d5c7a9; }
.ledger-edit-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; padding:.7rem; }
.ledger-edit-form label { display:flex; min-width:0; flex-direction:column; gap:.2rem; color:#364154; font-size:.76rem; font-weight:750; }
.ledger-edit-form input,.ledger-edit-form select,.ledger-edit-form textarea { width:100%; min-width:0; min-height:38px; border:1px solid #bfc8d3; border-radius:.4rem; background:#fff; color:#263349; padding:.4rem .45rem; font-size:.85rem; }
.ledger-edit-form textarea { resize:vertical; }
.ledger-edit-wide { grid-column:1/-1; }
.ledger-edit-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; }
.ledger-edit-footer small { color:#566477; font-size:.72rem; }
.ledger-edit-footer button { min-height:42px; }
.document-card-top { justify-content:space-between; }.document-card-top time { font-size:.65rem; color:#657285; }.document-type { padding:.15rem .3rem; border-radius:.4rem; background:#efe5d0; font-size:.62rem; font-weight:800; }
.document-preview { position:relative; display:block; height:190px; overflow:hidden; background:#e8edf3; }.document-preview iframe { width:100%; height:260px; pointer-events:none; border:0; }.document-preview span { position:absolute; right:.4rem; bottom:.4rem; padding:.22rem .4rem; border-radius:.35rem; background:#fff; color:#27334b; font-size:.7rem; font-weight:700; }
.document-card-info { padding:.6rem; display:grid; gap:.2rem; font-size:.76rem; overflow-wrap:anywhere; }.document-warning,.audit-warning { color:#a84830; font-weight:750; }
.audit-list { display:grid; gap:.65rem; }.audit-card { padding:.65rem; border:1px solid rgba(255,255,255,.4); border-radius:.75rem; background:rgba(255,255,255,.92); color:#263349; }.audit-card-head { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }.audit-good { color:#0b8041; }.audit-bad { color:#b44e20; }.audit-diff { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; padding:.35rem 0; border-top:1px solid #e7e9ee; font-size:.78rem; }
@media (max-width:900px) { .is-home .dashboard-stack { grid-template-columns:1fr auto; }.is-home .dashboard-operations-title { grid-column:1/-1; grid-row:1; justify-self:center; text-align:center; align-items:center; }.is-home .dashboard-month-control { grid-column:1; grid-row:2; justify-self:start; }.is-home .home-upload-control { grid-column:2; grid-row:2; }.is-home .dashboard-map-section,.is-home .dashboard-stack--public .dashboard-map-section { grid-row:3; } }
@media (max-width:600px) { .is-home .dashboard-stack { gap:.45rem; }.is-home .dashboard-month-control { min-width:0; width:100%; }.is-home .home-upload-control { justify-self:end; }.is-home .dashboard-map-section .usa-map-wrap { overflow-x:hidden!important; }.is-home .dashboard-map-section .usa-map-canvas { width:100%!important; min-width:0!important; }.is-home .map-mobile-hint { display:none; }.compact-tool,.loads-search-form,.loads-month-form,.loads-ai-card { width:100%!important; justify-content:flex-start!important; flex-wrap:wrap; }.loads-search-form .form-control { width:100%; }.loads-search-form > div:first-of-type { flex:1 1 100%; }.ledger-summary > div { flex:1 1 40%; min-width:0; }.ledger-weeks { width:100%; }.ledger-week { flex:1 1 22%; min-width:65px; } }

/* Use the desktop drawing on phones, with native pinch zoom for small details. */
.map-mobile-states { display:none; }
@media (max-width:1023.98px) {
    .is-home .dashboard-map-section { width:100%; min-width:0; }
    .is-home .dashboard-map-section .usa-map-wrap { overflow:hidden; touch-action:pan-x pan-y pinch-zoom; }
    .is-home .dashboard-map-section .usa-map-canvas { width:100%; min-width:0; }
    .is-home .map-mobile-hint { display:none; }
    /* Scale route/pin outlines with their SVG geometry instead of retaining
       desktop-sized strokes over the reduced state labels. */
    .is-home .map-route-path,
    .is-home .map-route-pin-core { vector-effect:none; }
}
@media (max-width:767.98px) {
    .map-route-popup-grid span { font-size:.8rem; }
    .map-route-popup-grid strong { font-size:1rem; }
}

/* Tablo / Dosyalar: readable selection and an unmistakable unpaid total. */
.document-check,
#selectDocuments,
.ledger-card input[type="checkbox"] { width:1.55rem; height:1.55rem; margin:0; accent-color:#a48750; cursor:pointer; flex:none; }
.document-card-top label,
.document-bulk-toolbar label { display:inline-flex; align-items:center; gap:.45rem; min-height:44px; }
.ledger-summary > .ledger-summary-unpaid { min-width:225px; padding:.8rem 1rem; border:2px solid #b59a61; background:#fff9e9; box-shadow:0 .25rem .8rem rgba(54,43,20,.12); }
.ledger-summary-unpaid span { font-size:.9rem; font-weight:850; }
.ledger-summary-unpaid strong { font-size:clamp(1.3rem,2vw,1.8rem); line-height:1.2; white-space:nowrap; }
.ledger-card.is-complete { border-width:3px; border-color:#31b862; box-shadow:0 0 0 1px rgba(49,184,98,.25),0 0 16px rgba(49,184,98,.24); }
.ledger-card.is-late { border-width:3px; border-color:#e98735; box-shadow:0 0 0 1px rgba(233,135,53,.28),0 0 17px rgba(233,135,53,.28); }
@media (max-width:600px) {
    .ledger-summary > .ledger-summary-unpaid { flex:1 1 100%; min-width:0; order:-1; }
    .ledger-week { font-size:.85rem; }
    .ledger-week small { font-size:.72rem; }
    .ledger-card-header,.document-card-top { font-size:.9rem; }
    .ledger-expected { font-size:.92rem; }
    .ledger-facts,.document-card-info { font-size:.875rem; }
    .ledger-status span { font-size:.8rem; }
    .ledger-action label { font-size:.8rem; }
    .ledger-action input { min-height:38px; font-size:.875rem; }
    .document-type,.document-card-top time { font-size:.75rem; }
    .ledger-edit-form { grid-template-columns:1fr; }
    .ledger-edit-form label { font-size:.87rem; }
    .ledger-edit-form input,.ledger-edit-form select,.ledger-edit-form textarea { min-height:44px; font-size:1rem; }
}
