/* BeFresh Professional UI Theme
   Logo-aligned blue primary + fresh green accent */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bf-primary: #0255CB;
  --bf-primary-dark: #0142A0;
  --bf-primary-light: #DBEAFE;
  --bf-accent: #00A7EE;
  --bf-success: #7CD614;
  --bf-warning: #d97706;
  --bf-danger: #dc2626;
  --bf-bg: #F0F6FC;
  --bf-surface: #ffffff;
  --bf-border: #e2e8f0;
  --bf-border-strong: #cbd5e1;
  --bf-text: #0F172A;
  --bf-text-muted: #64748b;
  --bf-sidebar: #0B1F3A;
  --bf-sidebar-hover: #123056;
  --bf-radius: 8px;
  --bf-radius-sm: 6px;
  --bf-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --bf-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --bf-space: 16px;
  --bf-space-lg: 24px;
  --bf-input-h: 40px;
  --bf-font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* Report column tokens */
  --bf-col-sales: #ecfdf5;
  --bf-col-sales-head: #a7f3d0;
  --bf-col-opening: #e0f2fe;
  --bf-col-opening-head: #7dd3fc;
  --bf-col-received: #f0fdf4;
  --bf-col-received-head: #86efac;
  --bf-col-balance: #fef2f2;
  --bf-col-balance-head: #fca5a5;
  --bf-col-neutral: #fff7ed;
  --bf-col-neutral-head: #fdba74;
}

/* ========== Base ========== */
html, body {
  font-family: var(--bf-font) !important;
  color: var(--bf-text);
  -webkit-font-smoothing: antialiased;
}

#container {
  background: var(--bf-bg) !important;
}

.container-fluid {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

@media (max-width: 767px) {
  .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ========== Header ========== */
#header {
  background: var(--bf-surface) !important;
  border-bottom: 1px solid var(--bf-border) !important;
  box-shadow: var(--bf-shadow) !important;
  min-height: 56px;
}

#header .navbar-header {
  border-right: 1px solid var(--bf-border) !important;
  width: 240px !important;
  float: left;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 14px;
  box-sizing: border-box;
  background: #fff;
}

@media (min-width: 768px) {
  #header .navbar-header {
    display: flex !important;
  }
}

#header .navbar-brand {
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 56px;
  width: 100%;
  float: none;
}

#header .navbar-brand img {
  width: auto !important;
  height: 48px !important;
  max-width: 210px;
  max-height: 48px !important;
  margin: 0 !important;
  object-fit: contain;
  object-position: left center;
  display: block;
}

#header .nav > li > a {
  color: var(--bf-text-muted) !important;
  line-height: 56px !important;
  padding: 0 16px !important;
  transition: color 0.15s, background 0.15s;
}

#header .nav > li > a:hover {
  color: var(--bf-primary) !important;
  background: var(--bf-primary-light) !important;
}

#header .navbar-right > li {
  border-left: 1px solid var(--bf-border) !important;
}

#button-menu {
  line-height: 56px !important;
  padding: 0 16px !important;
  color: var(--bf-text) !important;
  border-right: 1px solid var(--bf-border) !important;
}

.bf-company-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--bf-font);
  color: var(--bf-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.bf-company-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, 48vw);
  width: 100%;
}

.bf-company-label {
  margin: 0;
  color: var(--bf-primary);
  font-size: 16px;
  flex-shrink: 0;
}

.bf-header-company {
  height: 36px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid var(--bf-border-strong) !important;
  background: #fff !important;
  min-width: 160px;
  width: 100%;
}

@media (max-width: 991px) {
  .bf-company-name {
    font-size: 15px;
    max-width: 36%;
  }

  .bf-company-wrap {
    max-width: 42vw;
    left: 46%;
  }
}

@media (max-width: 575px) {
  .bf-company-name {
    font-size: 13px;
    max-width: 28%;
    left: 42%;
  }

  .bf-company-wrap {
    max-width: 34vw;
    left: 42%;
  }

  .bf-company-label {
    display: none;
  }

  .bf-header-company {
    font-size: 12px !important;
    min-width: 0;
    padding: 4px 6px !important;
  }

  #header .nav > li > a {
    padding: 0 10px !important;
  }

  #header #user-profile + * ,
  #header .nav > li > a .fa-caret-down {
    display: none;
  }
}

/* ========== Sidebar ========== */
#column-left {
  background-color: var(--bf-sidebar) !important;
  width: 240px !important;
  left: -240px;
  padding-top: 56px !important;
}

#navigation {
  background: #020617 !important;
  padding: 14px 18px !important;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #64748b !important;
  text-transform: uppercase;
}

#menu > li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#menu > li > a {
  color: #94a3b8 !important;
  padding: 13px 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease;
  display: flex !important;
  align-items: center;
  gap: 10px;
}

#menu > li > a > i {
  width: 20px !important;
  min-width: 20px;
  margin-right: 0 !important;
  font-size: 15px !important;
  color: #64748b !important;
  text-align: center;
  transition: color 0.18s ease;
}

#menu > li > a:hover {
  background-color: var(--bf-sidebar-hover) !important;
  color: #f8fafc !important;
}

#menu > li > a:hover > i {
  color: #7DD3FC !important;
}

#menu > li.active > a {
  color: #7DD3FC !important;
  background-color: rgba(13, 148, 136, 0.15) !important;
  border-left: 3px solid var(--bf-primary);
  padding-left: 15px !important;
}

#menu > li.active > a > i {
  color: #7DD3FC !important;
}

#menu > li > ul {
  background-color: #020617 !important;
  padding: 4px 0 8px !important;
}

#menu li li a {
  color: #94a3b8 !important;
  padding: 9px 16px 9px 48px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: background 0.15s ease, color 0.15s ease;
}

#menu li li a:before {
  color: #475569 !important;
  left: 30px !important;
}

#menu li li a:hover,
#menu li li.active > a {
  color: #7DD3FC !important;
  background-color: rgba(13, 148, 136, 0.1) !important;
}

#menu li li a:hover:before,
#menu li li.active > a:before {
  color: #7DD3FC !important;
}

@media (min-width: 768px) {
  #column-left {
    left: 0 !important;
  }

  /* Use ~ so margin still applies if markup sits between sidebar and content */
  #column-left ~ #content,
  #column-left ~ #footer {
    margin-left: 240px !important;
  }

  #column-left.active ~ #content,
  #column-left.active ~ #footer {
    margin-left: 240px !important;
  }
}

@media (max-width: 767px) {
  #column-left.active {
    left: 0 !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }

  #column-left.active ~ #content,
  #column-left.active ~ #footer {
    left: 0 !important;
    margin-left: 0 !important;
  }

  body.bf-menu-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9;
  }
}

/* ========== Page header ========== */
.page-header {
  margin: 16px 0 12px 0 !important;
  padding: 0 0 12px 0 !important;
  border-bottom: 1px solid var(--bf-border) !important;
}

.page-header h1 {
  font-family: var(--bf-font) !important;
  font-weight: 600 !important;
  font-size: 22px !important;
  color: var(--bf-text) !important;
  text-shadow: none !important;
  margin-bottom: 0 !important;
  line-height: 1.3;
}

.page-header .pull-right {
  margin-top: 2px;
}

.page-header .pull-right .btn {
  margin-left: 6px;
}

.breadcrumb {
  margin: 6px 0 0 0 !important;
  padding: 0 !important;
}

@media (max-width: 767px) {
  .page-header h1 {
    font-size: 18px !important;
    display: block !important;
    margin-bottom: 10px !important;
  }

  .page-header .pull-right {
    float: none !important;
    margin-bottom: 8px;
  }
}

/* ========== Panels ========== */
.panel {
  border: 1px solid var(--bf-border) !important;
  border-radius: var(--bf-radius) !important;
  box-shadow: var(--bf-shadow) !important;
  background: var(--bf-surface);
  overflow: hidden;
}

.panel-default > .panel-heading {
  background: var(--bf-surface) !important;
  border-bottom: 1px solid var(--bf-border) !important;
  padding: 14px 20px !important;
}

.panel-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--bf-text) !important;
}

.panel-title i {
  color: var(--bf-primary);
  margin-right: 6px;
}

.panel-body {
  padding: 20px !important;
}

@media (max-width: 767px) {
  .panel-body {
    padding: 14px !important;
  }
}

/* ========== Forms & inputs ========== */
.form-control {
  height: var(--bf-input-h) !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-family: var(--bf-font) !important;
  color: var(--bf-text) !important;
  background: #fff !important;
  border: 1px solid var(--bf-border-strong) !important;
  border-radius: var(--bf-radius-sm) !important;
  box-shadow: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:hover {
  border-color: #94a3b8 !important;
  box-shadow: none !important;
}

.form-control:focus {
  border-color: var(--bf-primary) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18) !important;
  outline: 0;
}

textarea.form-control {
  height: auto !important;
  min-height: 80px;
  resize: vertical;
}

select.form-control {
  padding-right: 28px !important;
}

.form-control[readonly],
.form-control[disabled] {
  background: #f8fafc !important;
  color: var(--bf-text-muted) !important;
  cursor: default;
}

label,
.control-label,
.bf-field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bf-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  text-align: left !important;
  padding-top: 0 !important;
}

.form-horizontal .control-label {
  text-align: left !important;
  padding-top: 0 !important;
  margin-bottom: 6px;
}

.form-group {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 16px !important;
  border-top: none !important;
}

.form-horizontal > .form-group {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.text-danger {
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Proper form grid */
.bf-form .row {
  margin-left: -8px;
  margin-right: -8px;
}

.bf-form .row > [class*="col-"] {
  padding-left: 8px;
  padding-right: 8px;
}

/* Mobile: keep 2 fields per row readable */
@media (max-width: 767px) {
  .bf-form .bf-field > label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bf-form .row > .col-xs-6 {
    float: left;
    width: 50%;
  }
}

.bf-field {
  margin-bottom: 16px;
}

.bf-field-inline {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.bf-field-inline .form-control {
  flex: 1;
  min-width: 0;
}

.bf-field-hint {
  font-size: 11px;
  color: var(--bf-text-muted);
  margin-top: 4px;
}

.half-width {
  width: calc(50% - 4px) !important;
  display: inline-block;
  vertical-align: top;
}

.half-width + .half-width {
  margin-left: 8px;
}

/* Select2 polish */
.select2-container {
  width: 100% !important;
}

.select2-container .select2-selection--single {
  height: var(--bf-input-h) !important;
  border: 1px solid var(--bf-border-strong) !important;
  border-radius: var(--bf-radius-sm) !important;
  padding: 4px 8px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 30px !important;
  color: var(--bf-text) !important;
  padding-left: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--bf-primary) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.select2-dropdown {
  border-color: var(--bf-border-strong) !important;
  border-radius: var(--bf-radius-sm) !important;
  box-shadow: var(--bf-shadow-md);
}

.input-group-addon {
  background: #f8fafc !important;
  border: 1px solid var(--bf-border-strong) !important;
  border-radius: var(--bf-radius-sm) 0 0 var(--bf-radius-sm) !important;
  color: var(--bf-text-muted);
}

.input-group .form-control {
  border-radius: 0 var(--bf-radius-sm) var(--bf-radius-sm) 0 !important;
}

/* Datetimepicker */
.bootstrap-datetimepicker-widget {
  border-radius: var(--bf-radius) !important;
  box-shadow: var(--bf-shadow-md) !important;
}

/* ========== Buttons ========== */
.btn {
  font-family: var(--bf-font) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border-radius: var(--bf-radius-sm) !important;
  padding: 8px 14px !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--bf-primary) !important;
  border-color: var(--bf-primary-dark) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--bf-primary-dark) !important;
  border-color: #115e59 !important;
}

.btn-default {
  background: #fff !important;
  border-color: var(--bf-border-strong) !important;
  color: var(--bf-text) !important;
}

.btn-default:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.btn-danger {
  background: var(--bf-danger) !important;
  border-color: #b91c1c !important;
}

.btn-success {
  background: var(--bf-success) !important;
  border-color: #047857 !important;
}

.btn-warning {
  background: var(--bf-warning) !important;
  border-color: #b45309 !important;
  color: #fff !important;
}

.btn-block {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.page-header .btn {
  min-width: 40px;
  height: 36px;
  padding: 6px 12px !important;
}

/* ========== Report filters ========== */
.report-filter,
#filter-delivery.well,
.well.well-sm {
  background: #f8fafc !important;
  border: 1px solid var(--bf-border) !important;
  border-radius: var(--bf-radius) !important;
  padding: 16px 16px 4px !important;
  margin-bottom: 20px !important;
  box-shadow: none !important;
}

.report-filter .form-group,
#filter-delivery .form-group,
.well .form-group {
  margin-bottom: 12px !important;
  padding: 0 !important;
  border: none !important;
}

.report-filter label,
#filter-delivery label,
.well label {
  margin-bottom: 6px;
}

.report-filter .row,
#filter-delivery .row {
  margin-left: -8px;
  margin-right: -8px;
}

.report-filter .row > [class*="col-"],
#filter-delivery .row > [class*="col-"] {
  padding-left: 8px;
  padding-right: 8px;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 12px;
}

.filter-actions .btn {
  min-width: 120px;
}

.filter-action-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 66px;
  margin-bottom: 12px;
}

.filter-action-field .btn {
  width: 100%;
}

@media (max-width: 767px) {
  .filter-action-field {
    min-height: 0;
  }

  .report-filter,
  #filter-delivery.well,
  .well.well-sm {
    padding: 12px 12px 4px !important;
  }
}

/* ========== Tables / Reports ========== */
.table-responsive {
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius);
  margin-bottom: 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.table {
  margin-bottom: 0 !important;
  font-size: 13px;
}

.table > thead > tr > th,
.table > thead > tr > td {
  background: #f1f5f9 !important;
  color: var(--bf-text) !important;
  font-weight: 600 !important;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--bf-border) !important;
  border-color: var(--bf-border) !important;
  padding: 10px 10px !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th {
  padding: 9px 10px !important;
  border-color: var(--bf-border) !important;
  vertical-align: middle !important;
  color: var(--bf-text);
}

.table-hover > tbody > tr:hover {
  background-color: #f0fdfa !important;
}

.table > thead > tr > th .bf-total,
.table > thead > tr > th span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  opacity: 0.9;
}

/* Semantic report columns (override inline styles via !important where needed) */
.col-sales,
th.col-sales,
td.col-sales,
.table th[style*="#88E788"],
.table td[style*="#88E788"] {
  background-color: var(--bf-col-sales) !important;
}

th.col-sales,
.table th[style*="#88E788"] {
  background-color: var(--bf-col-sales-head) !important;
}

.col-opening,
th.col-opening,
td.col-opening,
.table th[style*="#90D5FF"],
.table td[style*="#90D5FF"] {
  background-color: var(--bf-col-opening) !important;
}

th.col-opening,
.table th[style*="#90D5FF"] {
  background-color: var(--bf-col-opening-head) !important;
}

.col-received,
th.col-received,
td.col-received {
  background-color: var(--bf-col-received) !important;
}

th.col-received {
  background-color: var(--bf-col-received-head) !important;
}

.col-balance,
th.col-balance,
td.col-balance,
.table th[style*="#f2b6b6"],
.table td[style*="#f2b6b6"] {
  background-color: var(--bf-col-balance) !important;
}

th.col-balance,
.table th[style*="#f2b6b6"] {
  background-color: var(--bf-col-balance-head) !important;
}

.col-neutral,
th.col-neutral,
td.col-neutral,
.table th[style*="#faebd7"],
.table td[style*="#faebd7"] {
  background-color: var(--bf-col-neutral) !important;
}

th.col-neutral,
.table th[style*="#faebd7"] {
  background-color: var(--bf-col-neutral-head) !important;
}

.report-table tfoot tr,
.table > tfoot > tr {
  background: #f1f5f9;
  font-weight: 700;
}

.report-table tfoot td,
.report-table tfoot th {
  border-top: 2px solid var(--bf-border-strong) !important;
}

.report-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.report-summary-item {
  flex: 1 1 140px;
  background: #fff;
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-sm);
  padding: 12px 14px;
  min-width: 120px;
}

.report-summary-item .label-text {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--bf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.report-summary-item .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--bf-text);
}

.report-summary-item.is-sales { border-top: 3px solid #10b981; }
.report-summary-item.is-received { border-top: 3px solid #22c55e; }
.report-summary-item.is-balance { border-top: 3px solid #ef4444; }
.report-summary-item.is-opening { border-top: 3px solid #0ea5e9; }

.table a {
  color: var(--bf-primary-dark);
  font-weight: 600;
}

.table a:hover {
  color: var(--bf-primary);
  text-decoration: underline;
}

/* Pagination */
.pagination > li > a,
.pagination > li > span {
  color: var(--bf-text);
  border-color: var(--bf-border);
  border-radius: 4px !important;
  margin: 0 2px;
}

.pagination > .active > a,
.pagination > .active > span {
  background: var(--bf-primary) !important;
  border-color: var(--bf-primary) !important;
}

/* Alerts */
.alert {
  border-radius: var(--bf-radius-sm) !important;
  border: none !important;
  padding: 12px 16px !important;
}

.alert-danger {
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.alert-success {
  background: #ecfdf5 !important;
  color: #065f46 !important;
}

/* ========== Login ========== */
.bf-login-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(13, 148, 136, 0.12), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(2, 132, 199, 0.1), transparent 45%),
    var(--bf-bg);
}

.bf-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--bf-border);
  border-radius: 12px;
  box-shadow: var(--bf-shadow-md);
  overflow: hidden;
}

.bf-login-card .panel-heading,
.bf-login-card .bf-login-head {
  background: linear-gradient(135deg, #0142A0 0%, #0255CB 55%, #00A7EE 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 22px 24px !important;
  text-align: center;
}

.bf-login-card .panel-title,
.bf-login-card .bf-login-head h1 {
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  margin: 0;
}

.bf-login-card .panel-body {
  padding: 24px !important;
}

.bf-login-card .btn-primary {
  width: 100%;
  padding: 11px 16px !important;
  font-size: 15px !important;
}

.bf-login-card .help-block a {
  color: var(--bf-primary);
  font-weight: 500;
}

.bf-login-brand {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ========== Content spacing ========== */
#content {
  padding-bottom: 48px !important;
}

#content > .container-fluid {
  max-width: 100%;
}

/* List action column */
.table .btn-xs,
.table .btn-group .btn {
  padding: 4px 8px !important;
  font-size: 12px !important;
}

/* Fix nested panel-body in expense report */
.panel-body > .panel-body {
  padding: 0 !important;
}

/* Sticky table header on desktop */
@media (min-width: 768px) {
  .report-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

/* Mobile table readability */
@media (max-width: 767px) {
  .table > thead > tr > th,
  .table > tbody > tr > td {
    padding: 8px 8px !important;
    font-size: 12px;
  }

  .page-header .btn i + span,
  .hidden-xs-inline {
    display: none;
  }
}

/* ========== Dashboard KPI cards ========== */
.bf-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bf-dash-card {
  background: #fff;
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius);
  overflow: hidden;
  box-shadow: var(--bf-shadow);
}

.bf-dash-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bf-border);
}

.bf-dash-today .bf-dash-card-head {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0.04));
  border-top: 3px solid var(--bf-primary);
}

.bf-dash-mtd .bf-dash-card-head {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(2, 132, 199, 0.04));
  border-top: 3px solid var(--bf-accent);
}

.bf-dash-empty .bf-dash-card-head {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.04));
  border-top: 3px solid var(--bf-warning);
}

.bf-dash-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--bf-text);
}

.bf-dash-card-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--bf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bf-dash-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.bf-dash-metrics-single {
  grid-template-columns: 1fr;
}

.bf-dash-metric {
  padding: 18px;
}

.bf-dash-metric + .bf-dash-metric {
  border-left: 1px solid var(--bf-border);
}

.bf-dash-metric .label-text {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--bf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.bf-dash-metric .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--bf-text);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.bf-dash-today .bf-dash-metric .value {
  color: var(--bf-primary-dark);
}

.bf-dash-mtd .bf-dash-metric .value {
  color: #0369a1;
}

.bf-dash-empty .bf-dash-metric .value {
  color: #b45309;
}

.bf-dash-company-wrap {
  margin: 0;
}

.bf-dash-company-table {
  margin-bottom: 0 !important;
}

.bf-dash-company-table thead th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom-width: 1px !important;
  white-space: nowrap;
}

.bf-dash-company-table tbody td,
.bf-dash-company-table tfoot th {
  font-variant-numeric: tabular-nums;
  vertical-align: middle !important;
}

.bf-dash-company-table tbody td.is-pending {
  color: #b45309;
  font-weight: 600;
}

.bf-dash-company-table tfoot th {
  background: #0f172a;
  color: #f8fafc;
  border-color: #1e293b !important;
  font-size: 13px;
}

.bf-dash-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 280px;
}

.bf-dash-chart-note {
  margin: 12px 0 0;
  font-size: 12px;
  text-align: center;
}

.bf-dash-diff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #F0F6FC;
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-sm);
  font-size: 13px;
  color: var(--bf-text-muted);
}

.bf-dash-diff-bar .is-up {
  color: #15803d;
}

.bf-dash-diff-bar .is-down {
  color: #b91c1c;
}

.bf-compare-up { color: #15803d; font-weight: 600; }
.bf-compare-down { color: #b91c1c; font-weight: 600; }

@media (max-width: 991px) {
  .bf-dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .bf-dash-metric .value {
    font-size: 22px;
  }

  .bf-dash-chart-wrap {
    min-height: 240px;
  }
}

/* Utility */
.bf-mb-0 { margin-bottom: 0 !important; }
.bf-mt-16 { margin-top: 16px; }
.bf-gap-row { margin-bottom: 8px; }

/* Print: keep report colors readable */
@media print {
  #header, #column-left, .page-header .pull-right, .report-filter, .well, .bf-bottom-nav {
    display: none !important;
  }

  #content, #column-left + #content {
    margin: 0 !important;
    left: 0 !important;
  }

  .table-responsive {
    border: none;
    overflow: visible !important;
  }
}

/* ========== Sticky bottom quick-add nav ========== */
.bf-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--bf-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.bf-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--bf-text-muted);
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
  min-width: 0;
}

.bf-bottom-nav__item i {
  font-size: 20px;
  color: var(--bf-primary);
  margin-bottom: 2px;
}

.bf-bottom-nav__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 4px;
}

.bf-bottom-nav__item:hover,
.bf-bottom-nav__item:focus {
  color: var(--bf-primary-dark);
  background: var(--bf-primary-light);
}

.bf-bottom-nav__item.is-disabled {
  opacity: 0.45;
}

body {
  padding-bottom: 72px !important;
}

#content {
  padding-bottom: 88px !important;
}

#footer {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

@media (min-width: 992px) {
  .bf-bottom-nav {
    left: 240px;
  }
}


/* ========== Sticky bottom quick-add nav ========== */
.bf-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--bf-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.bf-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--bf-text-muted);
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
  min-width: 0;
}
.bf-bottom-nav__item i {
  font-size: 20px;
  color: var(--bf-primary);
  margin-bottom: 2px;
}
.bf-bottom-nav__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 4px;
}
.bf-bottom-nav__item:hover,
.bf-bottom-nav__item:focus {
  color: var(--bf-primary-dark);
  background: var(--bf-primary-light);
}
.bf-bottom-nav__item.is-disabled { opacity: 0.45; }
body { padding-bottom: 72px !important; }
#content { padding-bottom: 88px !important; }
#footer { height: auto !important; min-height: 0 !important; padding: 0 !important; }
@media (min-width: 992px) {
  .bf-bottom-nav { left: 240px; }
}
@media print {
  .bf-bottom-nav { display: none !important; }
}
