/* Published copy from /assets/css/style.css */
/* TransFlotte Web Integration - Custom styles */
:root {
  --tf-primary: #0d6efd;
  --tf-accent: #0ea5e9;
  --tf-dark: #0b132b;
  --tf-muted: #6c757d;
  --tf-navbar-h: 56px;
  --tf-sidebar-w: 260px;
}

html, body { 
  height: 100%; 
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
}
body { background-color: #f7f8fa; }
.navbar-brand { font-weight: 600; letter-spacing: .2px; }
.navbar-brand .bi { font-size: 1.25rem; }
.auto-dismiss { opacity: 1; transition: opacity 0.4s ease-in; }
.auto-dismiss.hide { opacity: 0; }

:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

/* Responsive adjustments */
@media (max-width: 576px) {
  .table { font-size: 0.92rem; }
  .card .btn { width: 100%; }
  .navbar-brand { font-size: 1rem; }
  .tf-stat-card .card-body { min-height: 150px; padding: 14px; }
  .card.h-100 > .card-body.h-100 { min-height: 140px; }
  .dashboard-box { min-height: 120px; padding: 12px; }
  .dashboard-box .display-6 { font-size: 1.25rem; }
}

@media (max-width: 768px) {
  h1, .display-5 { font-size: 1.75rem; }
  .cf-table .cf-col-label { width: auto !important; }
}

@media (min-width: 992px) {
  .tf-stat-card .card-body { min-height: 120px; }
  .dashboard-box { min-height: 96px; }
}

/* Sortable tables */
th.sortable::after {
  content: '\f0dc'; /* fa-sort */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: .4rem; opacity: .5;
}
th.sortable[aria-sort="ascending"]::after {
  content: '\f160'; /* fa-sort-up */
  opacity: .9;
}
th.sortable[aria-sort="descending"]::after {
  content: '\f161'; /* fa-sort-down */
  opacity: .9;
}

/* Dropdown aesthetics */
.dropdown-menu {
  border-radius: .5rem;
  padding: .5rem;
}
.dropdown-item i { width: 1.25rem; text-align: center; }
.dropdown-item { border-radius: .375rem; }

/* TransFlotte Web - Navigation & Navbar */
.navbar-dark.bg-dark {
  background: linear-gradient(90deg, #0b132b, #1e2746) !important;
}
.navbar .nav-link { white-space: nowrap; }
.offcanvas .list-group-item { padding:.75rem 1rem; }

/* Dropdown custom (menu Plus) */
.tf-dropdown.dropdown-menu {
  min-width: 220px;
  background: radial-gradient(120% 140% at 0% 0%, #162142 0%, rgba(22,33,66,0.9) 45%, rgba(11,19,43,0.95) 100%);
  border: 0;
}
.tf-dropdown .dropdown-item {
  color: #e6edf6;
  padding: .55rem 1rem;
}
.tf-dropdown .dropdown-item .bi { opacity: .85; }
.tf-dropdown .dropdown-item:hover,
.tf-dropdown .dropdown-item:focus {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.tf-dropdown .dropdown-divider { border-color: rgba(255,255,255,.15); }

/* Cards and shadows */
.card { border: 0; box-shadow: 0 4px 18px rgba(9, 12, 16, .06); }
.card-title { font-weight: 600; }

/* Hero */
.hero-gradient {
  background: radial-gradient(80% 120% at 0% 0%, #e9f4ff 0%, transparent 60%),
              radial-gradient(80% 120% at 100% 0%, #eef6ff 0%, transparent 60%);
}

/* Buttons */
.btn .bi { margin-right: .35rem; }

/* Tables */
table.table tr:hover { background-color: #f8fafc; }
.table thead th { color: #4b5563; font-weight: 600; }

/* Badges */
.badge-round { border-radius: 999px; padding: .5em .75em; font-weight: 500; }

/* Footer */
footer { background: #fff; box-shadow: 0 -1px 10px rgba(0,0,0,.04); }

/* Alerts autohide spacing */
.alert { transition: opacity .4s ease; }

/* Subnav (collapse under header) */
.tf-subnav {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border-bottom: 1px solid rgba(13,110,253,.12);
  box-shadow: inset 0 1px 0 #fff, 0 2px 10px rgba(13, 110, 253, .06);
}
.tf-subnav .section-title {
  font-weight: 600;
  color: #0d6efd;
  margin: .25rem 0 .5rem;
}
.tf-subnav .tf-subnav-card { box-shadow: 0 6px 18px rgba(9,12,16,.06); border: 0; }
.tf-subnav .list-group-item {
  border: 0;
  padding: .5rem .5rem;
  border-radius: .375rem;
  margin: .125rem 0;
}
.tf-subnav .list-group-item:hover { background: rgba(13,110,253,.08); }
.tf-subnav .list-group-item i { opacity: .85; }

/* Stat cards grid */
.tf-stat-grid .card { height: 100%; }
.tf-stat-card .card-body {
  min-height: 140px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  overflow: hidden;
  word-break: break-word;
}

/* Generic rule for cards using h-100 */
.card.h-100 > .card-body.h-100 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  overflow: hidden;
  word-break: break-word;
  gap: 6px;
}

/* Cashflow enhancements */
.cf-cards .card.tf-stat-card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(9,12,16,.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

/* Row differentiation for cancellations and compensations */
tr.tf-row-cancelled {
  background: #fffbe6;
}
tr.tf-row-cancelled td {
  color: #6b7280;
}
tr.tf-row-compensation {
  background: #fff2f0;
}
tr.tf-row-compensation td {
  color: #34495e;
}

.bg-danger-subtle {
  background-color: #ffe5e5 !important;
}

/* Responsive tweaks for Cashflow */
@media (max-width: 767.98px) {
  .cf-table .cf-col-label { width: auto !important; }
}

/* Fixed left sidebar (below navbar) - overlay */
.tf-sidebar {
  position: fixed;
  top: var(--tf-navbar-h);
  left: 0;
  width: var(--tf-sidebar-w);
  height: calc(100vh - var(--tf-navbar-h));
  background: linear-gradient(180deg, #0b132b 0%, #1e2746 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1030;
  color: #e6edf6;
}
.tf-sidebar .list-group-item { background: transparent; color: #e6edf6; border: 0; }
.tf-sidebar .list-group-item:hover { background: rgba(255,255,255,.06); }
.tf-sidebar .text-muted { color: rgba(230,237,246,.7)!important; background: transparent; }
.tf-sidebar-inner { padding: .5rem .5rem 1rem; overflow: auto; height: 100%; }

/* Open sidebar overlays content */
body.sidebar-open .tf-sidebar { transform: translateX(0); }

/* Backdrop for sidebar overlay */
.tf-sidebar-backdrop {
  position: fixed;
  top: var(--tf-navbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1025;
}
body.sidebar-open .tf-sidebar-backdrop { opacity: 1; pointer-events: auto; }

/* Cashflow table styling */
.cf-table .table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border-bottom: 1px solid rgba(13,110,253,.15);
  color: #34495e;
  font-weight: 600;
}
.cf-table .table tbody tr:hover { background: #f8fafc; }
.cf-table .table > :not(caption) > * > * { padding-top: .55rem; padding-bottom: .55rem; }

.cf-table .amount-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cf-table .amount-in { background: #e9f7ef; color: #117a65; }
.cf-table .amount-out { background: #fdecea; color: #c0392b; }

/* Dashboard boxes */
.dashboard-box {
  min-height: 110px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  overflow: hidden;
  word-break: break-word;
}
.dashboard-box .display-6 { 
  font-size: clamp(1.1rem, 2.5vw, 1.6rem); 
  line-height: 1; 
}
.dashboard-box .h4 { 
  font-size: clamp(1rem, 2.2vw, 1.2rem); 
  line-height: 1; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}
.dashboard-small { font-size: 0.85rem; }
.dropdown-item:focus, .dropdown-item:hover { background-color: rgba(13,110,253,.08); }

/* Sidebar toggler adjustments: ensure the offcanvas toggler is visible and nicely sized on small screens */
@media (max-width: 992px) {
  .navbar .btn[data-bs-toggle="offcanvas"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: .375rem;
    padding: 0.25rem;
  }
  .navbar .btn[data-bs-toggle="offcanvas"] i {
    font-size: 1.05rem;
  }
}
