/* Shared responsive layout. Bootstrap 3 is the component framework used by the views. */
html { -webkit-text-size-adjust:100%; }
body { font-size:14px; padding-top:var(--topbar-height); }
.bimbel-topbar { display:block; left:0; right:0; width:100%; min-height:var(--topbar-height); height:var(--topbar-height); padding:0 0 0 var(--sidebar-width); z-index:1036; background:var(--bimbel-white); box-shadow:0 2px 14px rgba(63,14,104,.1); }
.bimbel-topbar .navbar-brand { display:flex; align-items:center; padding:12px 16px; line-height:1.3; }
.brand-icon { flex:0 0 34px; }
.topbar-user { position:static; float:right; height:var(--topbar-height); max-width:300px; padding:0 24px; border:0; border-radius:0; box-shadow:none; }
.topbar-user > span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-avatar { flex:0 0 36px; }
.bimbel-sidebar { display:block; max-height:none; height:auto; padding-bottom:28px; overscroll-behavior:contain; scrollbar-width:thin; }
.sidebar-menu .dropdown-menu { display:none; }
.sidebar-menu .open > .dropdown-menu { display:block; }
.sidebar-menu > li.open > a, .sidebar-menu > li.open > a:hover, .sidebar-menu > li.open > a:focus { background:rgba(253,249,253,.12); border-left-color:var(--bimbel-yellow); color:var(--bimbel-white); }
.sidebar-menu > li > a { min-height:46px; }
.sidebar-menu .dropdown-menu > li > a { min-height:42px; display:flex; align-items:center; white-space:normal; }
.bimbel-submenu-toggle .caret { transition:transform .15s; }
.open > .bimbel-submenu-toggle .caret { transform:rotate(180deg); }
.bimbel-menu-backdrop { display:none; }
.bimbel-content { min-width:0; overflow-wrap:break-word; }
.dashboard-heading { padding-right:0; gap:16px; }
.dashboard-card-header { gap:12px; }
.dashboard-card-header > div { min-width:0; }
.dashboard-card-header > a { flex-shrink:0; }
.dashboard-stat > span { min-width:0; }
.dashboard-stat > i { margin-left:10px; }
img, video { max-width:100%; }
img { height:auto; }
canvas, #my_camera { max-width:100%; }
textarea.form-control { height:auto; min-height:110px; }
.form-control { max-width:100%; }
.bimbel-content select, .modal select { max-width:100%; }
.form-label { display:inline-block; margin-bottom:6px; }
.mb-3 { margin-bottom:16px; }
.w-100 { width:100%; }
.text-white { color:#fff !important; }
.btn-secondary { color:var(--bimbel-purple-dark); background:#eee8f1; border-color:#cfc2d8; }
.btn-secondary:hover, .btn-secondary:focus { color:var(--bimbel-purple-dark); background:#e2d7e9; }
.btn { white-space:normal; overflow-wrap:break-word; }
.input-group-addon { display:flex; align-items:center; justify-content:center; flex:0 0 auto; width:auto; }
.bimbel-search-form { max-width:380px; margin:0 0 16px auto; }
.bimbel-search-form > [class*="col-"] { width:100%; float:none !important; padding:0; }
.bimbel-content > .btn, .bimbel-content > form > .btn { margin-bottom:8px; }
.bimbel-table-scroll { max-width:100%; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
.bimbel-table-scroll > .table { margin-bottom:0; }
.bimbel-table-wide { min-width:680px; }
.table td, .table th { vertical-align:middle; }
.table .btn { display:inline-flex; justify-content:center; align-items:center; min-height:38px; min-width:38px; margin:2px; }
.bimbel-table-scroll:focus-visible { outline-offset:2px; }
.dataTables_wrapper { max-width:100%; }
.dataTables_wrapper .dataTables_filter input { max-width:100%; }
.dataTables_wrapper .row { margin-left:0; margin-right:0; }
.dataTables_wrapper .row > [class*="col-"] { padding-left:0; padding-right:0; }
.pagination { display:flex; flex-wrap:wrap; }
.pagination > li > a, .pagination > li > span { min-height:38px; min-width:38px; text-align:center; }
.nav-tabs { display:flex; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.nav-tabs > li { flex:0 0 auto; float:none; }
.nav-tabs > li > a { white-space:nowrap; }
.modal-header { position:relative; padding-right:58px; }
.modal-header .close { position:absolute; top:4px; right:8px; width:44px; height:44px; opacity:.7; font-size:28px; }
.modal-title { line-height:1.4; }
.modal-footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.modal-footer::before, .modal-footer::after { display:none; }
.modal-footer .btn { float:none !important; margin:0 !important; }
.modal-body { overflow-wrap:break-word; }
/* The login page has its own centered layout, independent of the sidebar width. */
body.bimbel-login .login-container { width:100%; max-width:480px; margin:0 auto !important; padding:24px 16px 40px !important; }
.login-container > [class*="col-"] { width:100%; float:none; margin-left:0; padding:0; }
.login-brandbar { min-height:70px; }
.login-brandbar .navbar-header { float:none; }
.login-brandbar .navbar-brand { height:auto; min-height:60px; line-height:1.4; white-space:normal; }
.login-card .panel-body { padding:24px; }
@media (max-width:991px) {
  :root { --topbar-height:64px; }
  body { padding-top:var(--topbar-height); }
  .bimbel-topbar { display:flex; align-items:center; padding:0 10px; }
  .bimbel-topbar .navbar-brand, .bimbel-topbar .navbar-brand:hover { position:static; flex:1 1 auto; min-width:0; width:auto; height:64px; margin:0; padding:10px 8px; background:transparent; color:var(--bimbel-purple-dark); font-size:16px; }
  .bimbel-topbar .navbar-brand > span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .brand-icon { margin-right:8px; background:var(--bimbel-yellow); }
  .bimbel-menu-toggle { display:inline-flex; position:static; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; margin:0; padding:0; border:1px solid rgba(83,21,131,.18); border-radius:9px; font-size:20px; }
  .topbar-user { flex:0 0 36px; float:none; height:auto; max-width:36px; padding:0; }
  .topbar-user > span:last-child { display:none; }
  .bimbel-sidebar { width:min(84vw,288px); transform:translateX(-110%); visibility:hidden; pointer-events:none; transition:transform .2s, visibility .2s; box-shadow:8px 0 24px rgba(30,10,45,.18); }
  body.bimbel-menu-open { overflow:hidden; }
  .bimbel-menu-open .bimbel-sidebar { transform:translateX(0); visibility:visible; pointer-events:auto; }
  .bimbel-menu-open .bimbel-menu-backdrop:not([hidden]) { display:block; position:fixed; inset:64px 0 0; z-index:1034; width:100%; border:0; padding:0; background:rgba(24,10,34,.45); }
  .bimbel-sidebar + .container, body > .container { width:100%; max-width:100%; margin-left:0; padding:20px 16px; }
  .sidebar-version { padding-bottom:max(20px,env(safe-area-inset-bottom)); }
  .btn, .input-group-btn > .btn { min-height:44px; min-width:44px; }
  .form-control, .input-group .form-control { min-height:44px; height:44px; font-size:16px; min-width:0; }
  textarea.form-control { height:auto; }
  .modal select { width:100%; min-height:44px; font-size:16px; }
  input[type="date"], input[type="time"] { -webkit-min-logical-width:0; }
  .input-group-btn > .btn, .input-group-btn > .btn.pull-right { height:44px; padding-top:11px; padding-bottom:11px; }
}
@media (max-width:767px) {
  .container h4 { font-size:23px; line-height:1.3; }
  .bimbel-search-form { width:100%; max-width:none; margin-bottom:16px; }
  .bimbel-content > a.btn { max-width:100%; }
  .bimbel-content > form.form-inline > .form-group { margin-bottom:10px; }
  .table .btn { min-width:44px; min-height:44px; }
  .table > thead > tr > th, .table > tbody > tr > td, .table > tbody > tr > th { padding:10px; }
  .table-responsive { border:1px solid rgba(83,21,131,.17); }
  .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { width:100%; text-align:left; margin:10px 0; }
  .dataTables_wrapper .dataTables_filter label { display:flex; align-items:center; flex-wrap:wrap; gap:8px; width:100%; }
  .dataTables_wrapper .dataTables_filter input { flex:1 1 140px; width:140px; min-width:0; margin-left:0; }
  .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { text-align:left !important; padding:8px 0; }
  .pagination > li > a, .pagination > li > span { display:flex; align-items:center; justify-content:center; min-height:44px; min-width:40px; }
  .dashboard-heading { flex-wrap:wrap; }
  .dashboard-card-header { flex-wrap:wrap; padding:14px 16px; }
  .dashboard-table > tbody > tr > td { padding:12px; }
  .dashboard-stat { margin-bottom:16px; }
  .balance-item { flex-wrap:wrap; }
  .modal { padding:0 !important; }
  .modal-dialog { width:auto; margin:12px; min-height:calc(100vh - 24px); min-height:calc(100dvh - 24px); display:flex; align-items:center; }
  .modal-content { display:flex; flex-direction:column; width:100%; max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); }
  .modal-content > form { display:flex; flex-direction:column; min-height:0; margin:0; overflow:hidden; }
  .modal-header, .modal-footer { flex-shrink:0; }
  .modal-body { min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .modal-footer .btn { flex:1 1 120px; }
  .login-heading h2 { font-size:27px; }
  .login-card .panel-body { padding:20px; }
}
@media (prefers-reduced-motion:reduce) {
  .bimbel-sidebar, .bimbel-submenu-toggle .caret { transition:none; }
}
@media print {
  body { padding-top:0; }
  .bimbel-menu-backdrop, .bimbel-topbar, .bimbel-sidebar { display:none !important; }
  body > .container { margin:0; padding:0; width:100%; }
  .bimbel-table-scroll, .table-responsive { overflow:visible; border:0; box-shadow:none; }
  .bimbel-table-wide { min-width:0; }
}

/* Keep report date ranges in their natural order on one row. */
.report-date-filters {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:8px;
  width:100%;
  max-width:420px;
  margin:0 0 16px auto;
}
.report-date-filters .form-control { flex:1 1 0; min-width:0; width:0; }
.report-date-filters .btn { flex:0 0 auto; margin:0; }

.report-list-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.report-list-heading h4 { margin:0; flex:0 1 auto; }
.report-list-search { flex:0 1 380px; min-width:140px; margin:0; }

@media (max-width: 767px) {
  .report-list-heading { flex-direction:column; align-items:stretch; gap:12px; }
  .report-list-search { flex:0 1 auto; width:100%; min-width:0; }
}
