/* ================================
   Money Tracker - Pro Admin Theme
   - Sidebar layout (desktop) + Offcanvas (mobile)
   - Branding (logo + app name)
   - Custom theme colors via CSS variables
================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --mt-primary: #6366f1;
  --mt-secondary: #3b82f6;

  --mt-radius: 20px;
  --mt-radius-sm: 14px;
  --mt-shadow: 0 18px 60px rgba(2, 8, 23, .10);
  --mt-shadow-dark: 0 22px 70px rgba(0, 0, 0, .35);
  --mt-border: 1px solid rgba(100, 116, 139, .18);

  --mt-grad: linear-gradient(135deg, var(--mt-primary), var(--mt-secondary));
  --mt-glass: rgba(255,255,255,.72);
  --mt-glass-dark: rgba(15,23,42,.60);

  --mt-sidebar-w: 270px;
}

*{ font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

body{
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--mt-primary) 26%, transparent), transparent 60%),
    radial-gradient(900px 500px at -5% 100%, rgba(34,197,94,.14), transparent 60%),
    linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,1));
  background-attachment: fixed;
}

[data-bs-theme="dark"] body{
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--mt-primary) 30%, transparent), transparent 60%),
    radial-gradient(900px 500px at -5% 100%, rgba(34,197,94,.14), transparent 60%),
    linear-gradient(180deg, rgba(2,6,23,1), rgba(15,23,42,1));
  background-attachment: fixed;
}

/* Brand */
.brand-badge{
  width: 36px; height: 36px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius: 14px;
  background: var(--mt-grad);
  color: #fff;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--mt-secondary) 28%, transparent);
}
.brand-badge.lg{ width: 48px; height: 48px; border-radius: 18px; }

.brand-logo{
  width: 34px; height: 34px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(100,116,139,.20);
  padding: 4px;
}
[data-bs-theme="dark"] .brand-logo{
  background: rgba(15,23,42,.45);
  border: 1px solid rgba(148,163,184,.16);
}

/* Cards */
.card-soft{
  border: var(--mt-border);
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
}
[data-bs-theme="dark"] .card-soft{
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: var(--mt-shadow-dark);
}

/* Topbar */
.topbar{
  backdrop-filter: blur(12px);
  background: var(--mt-glass);
  border-bottom: 1px solid rgba(100,116,139,.16);
}
[data-bs-theme="dark"] .topbar{
  background: var(--mt-glass-dark);
  border-bottom: 1px solid rgba(148,163,184,.14);
}

/* Sidebar */
.sidebar{
  width: var(--mt-sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: var(--mt-glass);
  border-right: 1px solid rgba(100,116,139,.16);
  backdrop-filter: blur(12px);
}
[data-bs-theme="dark"] .sidebar{
  background: var(--mt-glass-dark);
  border-right: 1px solid rgba(148,163,184,.14);
}

.sidebar .nav-link{
  border-radius: 14px;
  padding: .62rem .80rem;
  display:flex;
  align-items:center;
  gap: .6rem;
  color: var(--bs-body-color);
  transition: transform .08s ease, background-color .2s ease, border-color .2s ease;
  border: 1px solid transparent;
}
.sidebar .nav-link:hover{
  transform: translateY(-1px);
  background: rgba(148,163,184,.10);
}
.sidebar .nav-link.active{
  background: color-mix(in srgb, var(--mt-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mt-primary) 26%, transparent);
}

.sidebar .section{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(100,116,139,.12);
}
[data-bs-theme="dark"] .sidebar .section{
  border-top: 1px solid rgba(148,163,184,.12);
}

/* Main wrapper */
.app-shell{
  min-height: 100vh;
}
.app-main{
  padding: 22px 18px;
}
@media (min-width: 992px){
  .app-main{
    padding: 28px 28px;
  }
}

/* Buttons */
.btn{ border-radius: 14px; }
.btn-sm{ border-radius: 12px; }
.btn-primary{
  background: var(--mt-grad);
  border: none;
  box-shadow: 0 14px 40px color-mix(in srgb, var(--mt-secondary) 18%, transparent);
}
.btn-primary:hover{ filter: brightness(0.98); }
.btn-outline-secondary, .btn-outline-danger, .btn-outline-primary{
  background: rgba(255,255,255,.55);
}
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-danger,
[data-bs-theme="dark"] .btn-outline-primary{
  background: rgba(15,23,42,.30);
}

/* Inputs */
.form-control, .form-select, .input-group-text{
  border-radius: 14px;
  border-color: rgba(100,116,139,.22);
}
.input-group .input-group-text{ border-radius: 14px 0 0 14px; }
.input-group .form-control{ border-radius: 0 14px 14px 0; }

/* Tables */
.table{ --bs-table-bg: transparent; }
.table thead th{
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bs-secondary-color);
}
.table > :not(caption) > * > * { vertical-align: middle; }
.table-hover tbody tr{ transition: transform .08s ease, background-color .2s ease; }
.table-hover tbody tr:hover{ background: rgba(148,163,184,.10); }

/* Badges */
.badge-soft{ border: 1px solid rgba(100,116,139,.22); }

/* KPI */
.kpi{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.kpi .icon{
  width:46px; height:46px; border-radius:18px;
  display:flex; align-items:center; justify-content:center;
  background: color-mix(in srgb, var(--mt-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mt-primary) 22%, transparent);
}
.kpi .icon.success{
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.18);
}
.kpi .icon.danger{
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.16);
}

/* Footer */
footer{
  backdrop-filter: blur(10px);
}
footer.bg-body-tertiary{
  background: rgba(255,255,255,.62) !important;
}
[data-bs-theme="dark"] footer.bg-body-tertiary{
  background: rgba(15,23,42,.50) !important;
}

/* polish */
hr{ opacity: .12; }
.alert{ border-radius: 16px; border: var(--mt-border); }

/* Offcanvas */
.offcanvas{
  backdrop-filter: blur(12px);
}


/* ================================
   Mobile precision tweaks
================================= */
@media (max-width: 575.98px){
  .app-main{ padding: 18px 14px; }
  .card-soft{ border-radius: 18px; }
  h1,h2,h3{ letter-spacing: -0.01em; }
  .kpi{ flex-direction: column; align-items: stretch; }
  .kpi .icon{ width: 44px; height: 44px; border-radius: 16px; }
  .btn{ padding-top: .60rem; padding-bottom: .60rem; }
  .btn-sm{ padding-top: .45rem; padding-bottom: .45rem; }
  .table thead{ display:none; }
  .table tbody tr{
    display:block;
    border: 1px solid rgba(100,116,139,.16);
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255,255,255,.55);
  }
  [data-bs-theme="dark"] .table tbody tr{
    background: rgba(15,23,42,.45);
    border-color: rgba(148,163,184,.14);
  }
  .table tbody td{
    display:flex;
    justify-content:space-between;
    gap: 10px;
    padding: 6px 0;
    border: 0 !important;
  }
  .table tbody td::before{
    content: attr(data-label);
    font-size: .78rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .table tbody td.text-end{ justify-content: flex-end; }
  .table tbody td.text-end::before{ content:''; }
  .mobile-btn-icon-only span{ display:none !important; }
  .topbar .btn{ white-space: nowrap; }
  .filter-row .col-md-2,.filter-row .col-md-3,.filter-row .col-md-4,.filter-row .col-md-5,.filter-row .col-md-6{
    width: 100%;
  }
}


/* ================================
   Ultra modern layout
   - Collapsible sidebar (desktop)
   - Bottom navigation + FAB (mobile)
================================= */

.sidebar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-toggle{
  width: 38px; height: 38px;
  border-radius: 14px;
}

body.sidebar-collapsed{
  --mt-sidebar-w: 92px;
}
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .text-secondary.small{
  display:none !important;
}
body.sidebar-collapsed .sidebar a.d-flex > div{ display:none !important; } /* hides brand text block */
body.sidebar-collapsed .sidebar .nav-link{
  justify-content:center;
  padding: .70rem .65rem;
}
body.sidebar-collapsed .sidebar .nav-link i{
  font-size: 1.15rem;
}
body.sidebar-collapsed .sidebar .section .text-secondary.small{
  display:none !important;
}

/* Bottom nav (mobile) */
.mobile-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1040;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.72);
  border-top: 1px solid rgba(100,116,139,.16);
  backdrop-filter: blur(12px);
}
[data-bs-theme="dark"] .mobile-nav{
  background: rgba(15,23,42,.62);
  border-top: 1px solid rgba(148,163,184,.14);
}
.mobile-nav .nav{
  display:flex;
  justify-content:space-around;
  align-items:center;
  gap: 6px;
}
.mobile-nav .nav a{
  width: 70px;
  padding: 8px 8px;
  border-radius: 16px;
  text-decoration:none;
  color: var(--bs-body-color);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 4px;
  border: 1px solid transparent;
  font-size: .72rem;
}
.mobile-nav .nav a i{ font-size: 1.2rem; }
.mobile-nav .nav a.active{
  background: color-mix(in srgb, var(--mt-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mt-primary) 26%, transparent);
}

/* Floating action button */
.fab-add{
  position: fixed;
  right: 16px;
  bottom: 94px;
  z-index: 1041;
  width: 56px; height: 56px;
  border-radius: 20px;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 18px 60px color-mix(in srgb, var(--mt-secondary) 22%, transparent);
}
.fab-add i{ font-size: 1.35rem; }
@media (min-width: 992px){
  .fab-add{ display:none; }
}

/* Make room for bottom nav on mobile */
@media (max-width: 991.98px){
  .app-main{ padding-bottom: 120px; }
}

/* Page header polish */
.page-title{
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-subtitle{
  color: var(--bs-secondary-color);
}

/* Slight motion */
.card-soft, .sidebar .nav-link, .btn{
  transition: transform .10s ease, box-shadow .2s ease, background-color .2s ease;
}
.card-soft:hover{
  transform: translateY(-1px);
}

/* Better chips */
.chip{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(100,116,139,.18);
  background: rgba(255,255,255,.55);
}
[data-bs-theme="dark"] .chip{
  background: rgba(15,23,42,.35);
  border-color: rgba(148,163,184,.14);
}


/* ================================
   Sidebar tidy (collapsed)
================================= */
.nav-divider{
  list-style: none;
  height: 1px;
  background: rgba(100,116,139,.14);
  margin-left: 6px;
  margin-right: 6px;
  border-radius: 999px;
}
[data-bs-theme="dark"] .nav-divider{
  background: rgba(148,163,184,.14);
}
.nav-section-label{
  list-style: none;
}

body.sidebar-collapsed .nav-divider,
body.sidebar-collapsed .nav-section-label{
  display: none !important;
}

/* make collapsed sidebar feel intentional */
body.sidebar-collapsed .sidebar{
  padding-left: 10px;
  padding-right: 10px;
}
body.sidebar-collapsed .sidebar .nav{
  gap: 8px !important;
}
body.sidebar-collapsed .sidebar .nav-link{
  width: 56px;
  height: 54px;
  padding: 0;
  margin: 0 auto;
  border-radius: 18px;
}
body.sidebar-collapsed .sidebar .nav-link i{
  font-size: 1.22rem;
}

/* Bottom action area: stack nicely in collapsed mode */
body.sidebar-collapsed .sidebar .section{
  margin-top: 18px;
}
body.sidebar-collapsed .sidebar .section > .d-flex{
  flex-direction: column;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}
body.sidebar-collapsed .sidebar .section .d-flex.gap-2{
  flex-direction: column;
  gap: 10px !important;
}
body.sidebar-collapsed .sidebar .section .btn{
  width: 56px;
  height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
}
body.sidebar-collapsed .sidebar .section .btn i{
  font-size: 1.18rem;
}

/* Ensure sidebar header doesn't look cramped when collapsed */
body.sidebar-collapsed .sidebar-header{
  justify-content: center;
}
body.sidebar-collapsed .sidebar-header .sidebar-toggle{
  position: absolute;
  top: 16px;
  right: 12px;
}
body.sidebar-collapsed .sidebar-header a{
  justify-content: center;
  width: 100%;
}

.sidebar-header{ position: relative; }


/* ================================
   Top banner (clock + search)
================================= */
.top-banner{
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(100,116,139,.16);
  background:
    radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--mt-primary) 22%, transparent), transparent 60%),
    radial-gradient(900px 260px at 100% 0%, rgba(34,197,94,.18), transparent 62%),
    linear-gradient(135deg, rgba(15,23,42,.86), rgba(2,6,23,.86));
  box-shadow: 0 18px 60px rgba(2,8,23,.14);
}
[data-bs-theme="light"] .top-banner{
  background:
    radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--mt-primary) 18%, transparent), transparent 60%),
    radial-gradient(900px 260px at 100% 0%, rgba(34,197,94,.14), transparent 62%),
    linear-gradient(135deg, rgba(255,255,255,.85), rgba(241,245,249,.78));
}

.top-banner-inner{
  padding: 16px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.tb-left{ min-width: 0; }
.tb-clock{
  font-size: .90rem;
  color: rgba(226,232,240,.88);
  display:flex;
  align-items:center;
  flex-wrap: wrap;
  gap: 6px;
}
[data-bs-theme="light"] .tb-clock{
  color: rgba(15,23,42,.70);
}
.tb-date{
  font-size: .86rem;
  color: rgba(226,232,240,.72);
}
[data-bs-theme="light"] .tb-date{
  color: rgba(15,23,42,.55);
}
.tb-greet{
  margin-top: 4px;
  font-weight: 800;
  font-size: 1.20rem;
  letter-spacing: -0.02em;
  color: rgba(226,232,240,.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-bs-theme="light"] .tb-greet{
  color: rgba(15,23,42,.86);
}

.tb-search{
  width: 420px;
  max-width: 100%;
}
.tb-search .input-group-text{
  background: rgba(15,23,42,.24);
  border-color: rgba(148,163,184,.22);
  color: rgba(226,232,240,.85);
}
[data-bs-theme="light"] .tb-search .input-group-text{
  background: rgba(255,255,255,.65);
  color: rgba(15,23,42,.70);
}
.tb-search .form-control{
  background: rgba(15,23,42,.18);
  border-color: rgba(148,163,184,.22);
  color: rgba(226,232,240,.94);
}
.tb-search .form-control::placeholder{
  color: rgba(226,232,240,.55);
}
[data-bs-theme="light"] .tb-search .form-control{
  background: rgba(255,255,255,.70);
  color: rgba(15,23,42,.90);
}
[data-bs-theme="light"] .tb-search .form-control::placeholder{
  color: rgba(15,23,42,.45);
}

@media (max-width: 575.98px){
  .top-banner-inner{
    flex-direction: column;
    align-items: stretch;
  }
  .tb-search{
    width: 100%;
  }
  .tb-greet{
    white-space: normal;
  }
}


/* ================================
   Example dashboard style
================================= */
.app-main{
  max-width: 1300px;
  margin: 0 auto;
}

.main-headerbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.main-headerbar .mh-left{
  display:flex;
  align-items:flex-start;
  gap: 14px;
  min-width: 0;
}
.mh-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.40);
  backdrop-filter: blur(10px);
}
[data-bs-theme="light"] .mh-pill{
  background: rgba(255,255,255,.70);
  border-color: rgba(100,116,139,.16);
}
.mh-pill .mh-time{
  color: rgba(226,232,240,.86);
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
[data-bs-theme="light"] .mh-pill .mh-time{
  color: rgba(15,23,42,.70);
}
.mh-pill .mh-sub{
  color: rgba(226,232,240,.62);
  font-size: .85rem;
  white-space: nowrap;
}
[data-bs-theme="light"] .mh-pill .mh-sub{
  color: rgba(15,23,42,.50);
}

.mh-greet{
  font-weight: 900;
  font-size: 1.20rem;
  letter-spacing: -0.02em;
  color: rgba(226,232,240,.94);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-bs-theme="light"] .mh-greet{
  color: rgba(15,23,42,.88);
}

.mh-search{
  width: 280px;
  max-width: 40vw;
}
.mh-search .input-group-text,
.mh-search .form-control{
  border-radius: 14px;
  border-color: rgba(148,163,184,.18);
}
.mh-search .input-group-text{
  background: rgba(15,23,42,.25);
  color: rgba(226,232,240,.78);
}
.mh-search .form-control{
  background: rgba(15,23,42,.18);
  color: rgba(226,232,240,.92);
}
.mh-search .form-control::placeholder{ color: rgba(226,232,240,.55); }
[data-bs-theme="light"] .mh-search .input-group-text{
  background: rgba(255,255,255,.80);
  color: rgba(15,23,42,.70);
}
[data-bs-theme="light"] .mh-search .form-control{
  background: rgba(255,255,255,.80);
  color: rgba(15,23,42,.90);
}
[data-bs-theme="light"] .mh-search .form-control::placeholder{ color: rgba(15,23,42,.45); }

.mh-actions{
  display:flex;
  align-items:center;
  gap: 12px;
}
.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}
[data-bs-theme="light"] .icon-btn{
  background: rgba(255,255,255,.78);
  border-color: rgba(100,116,139,.14);
}
.icon-btn i{ font-size: 1.2rem; }
.icon-badge{
  position:absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: .72rem;
  display:flex;
  align-items:center;
  justify-content:center;
  background: color-mix(in srgb, var(--mt-primary) 70%, #000);
  color: #fff;
  border: 2px solid rgba(2,6,23,.55);
}
[data-bs-theme="light"] .icon-badge{
  border-color: rgba(255,255,255,.9);
}

/* Sidebar profile card (like example) */
.side-profile{
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(15,23,42,.38);
  padding: 14px;
}
[data-bs-theme="light"] .side-profile{
  background: rgba(255,255,255,.78);
  border-color: rgba(100,116,139,.14);
}
.side-profile .avatar{
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: var(--mt-grad);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight: 800;
}
.side-profile .name{
  font-weight: 800;
  color: rgba(226,232,240,.92);
}
[data-bs-theme="light"] .side-profile .name{ color: rgba(15,23,42,.88); }
.side-profile .meta{
  color: rgba(226,232,240,.58);
  font-size: .86rem;
}
[data-bs-theme="light"] .side-profile .meta{ color: rgba(15,23,42,.55); }

/* KPI colorful cards */
.kpi-grid .kpi-card{
  border-radius: 24px;
  padding: 20px 18px;
  border: 1px solid rgba(148,163,184,.12);
  box-shadow: 0 18px 60px rgba(2,8,23,.16);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  overflow:hidden;
  position: relative;
}
.kpi-grid .kpi-card:before{
  content:'';
  position:absolute;
  inset:-40% -20%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,.22), transparent 60%);
  transform: rotate(12deg);
}
.kpi-grid .kpi-card > *{ position: relative; }
.kpi-card .kpi-icon{
  width: 44px; height: 44px;
  border-radius: 18px;
  background: rgba(255,255,255,.22);
  display:flex; align-items:center; justify-content:center;
}
.kpi-card .kpi-icon i{ font-size: 1.3rem; color: rgba(255,255,255,.95); }
.kpi-card .kpi-num{ font-size: 2.05rem; font-weight: 900; color: #fff; line-height: 1; }
.kpi-card .kpi-label{ color: rgba(255,255,255,.88); font-weight: 600; margin-top: 6px; }

.kpi-orange{ background: linear-gradient(135deg, #ffb55b, #ff8a4c); }
.kpi-green { background: linear-gradient(135deg, #67f06f, #25c86c); }
.kpi-purple{ background: linear-gradient(135deg, #b89bf6, #9d71e8); }
.kpi-blue  { background: linear-gradient(135deg, #7db2d6, #4c86b8); }

/* Hero finance card */
.hero-finance{
  border-radius: 28px;
  border: 1px solid rgba(148,163,184,.12);
  background: rgba(15,23,42,.42);
  box-shadow: 0 22px 80px rgba(2,8,23,.28);
  overflow:hidden;
}
[data-bs-theme="light"] .hero-finance{
  background: rgba(255,255,255,.80);
}
.hero-inner{
  padding: 20px;
}
.hero-left{
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(59,130,246,.90), rgba(99,102,241,.85));
  color: #fff;
  position: relative;
  overflow:hidden;
  min-height: 180px;
}
.hero-left:before{
  content:'';
  position:absolute;
  inset:-40% -40%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.26), transparent 60%);
  transform: rotate(10deg);
}
.hero-left > *{ position: relative; }
.hero-left .big{
  font-size: 2.15rem;
  font-weight: 900;
}
.hero-left .small{
  opacity: .92;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .86rem;
}
.hero-right .title{
  font-weight: 800;
  color: rgba(226,232,240,.92);
}
[data-bs-theme="light"] .hero-right .title{ color: rgba(15,23,42,.88); }
.hero-right .mini{
  color: rgba(226,232,240,.60);
  font-size: .86rem;
}
[data-bs-theme="light"] .hero-right .mini{ color: rgba(15,23,42,.55); }

@media (max-width: 991.98px){
  .mh-search{ width: 100%; max-width: 100%; }
  .main-headerbar{
    flex-direction: column;
    align-items: stretch;
  }
  .main-headerbar .mh-actions{
    justify-content:flex-end;
  }
}


/* ================================
   Layout stability fix
================================= */
.layout-row{
  display:flex;
  align-items:stretch;
  min-height: 100vh;
}
.layout-row > .sidebar{ flex: 0 0 auto; }
.layout-row > .app-main{ flex: 1 1 auto; min-width: 0; }

.app-main{
  padding: 24px 22px;
}
@media (max-width: 991.98px){
  .app-main{ padding: 18px 14px; }
}

/* Keep header bar visible and avoid "empty top" feeling */
.main-headerbar{
  position: sticky;
  top: 12px;
  z-index: 1030;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.12);
  background: rgba(2,6,23,.28);
  backdrop-filter: blur(10px);
}
[data-bs-theme="light"] .main-headerbar{
  background: rgba(255,255,255,.60);
  border-color: rgba(100,116,139,.14);
}

/* Give alerts consistent spacing */
.alert{ border-radius: 18px; }

.sidebar{ align-self: flex-start; }


/* ================================
   Layout Stabilizer (fix blank/shift)
================================= */
html, body{ height: 100%; }
.app-shell{
  display:flex;
  flex-direction: column;
  min-height: 100vh;
}
.layout-row{
  flex: 1 1 auto;
  width: 100%;
  overflow-x: hidden;
}

/* ensure main always renders and doesn't get pushed off-screen */
main.app-main{
  width: 100%;
  min-width: 0;
}

/* keep mobile topbar fully visible */
.topbar .container-fluid{
  width: 100%;
}


/* ================================
   Mobile Headerbar Fix
================================= */
@media (max-width: 575.98px){
  .main-headerbar{ gap: 12px; margin-bottom: 10px; }
  .mh-left{ flex-direction: column; align-items: stretch; gap: 10px; }
  .mh-pill{
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 22px;
  }
  .mh-sub{
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mh-greet{
    font-size: 1.05rem;
    line-height: 1.2;
    white-space: normal;
  }
  .mh-search{ width: 100%; max-width: 100%; }
  .mh-actions{ display:none !important; }
}



/* Receipt camera modal */
.receipt-cam-modal{ position: fixed; inset: 0; z-index: 2050; display:none; }
.receipt-cam-modal.open{ display:block; }
.receipt-cam-modal .rcm-backdrop{
  position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
.receipt-cam-modal .rcm-panel{
  position:absolute; left:50%; top:50%; transform: translate(-50%,-50%);
  width: min(520px, calc(100vw - 24px));
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.92);
  color: rgba(226,232,240,.95);
  box-shadow: 0 22px 90px rgba(2,8,23,.55);
  overflow:hidden;
}
[data-bs-theme="light"] .receipt-cam-modal .rcm-panel{
  background: rgba(255,255,255,.96);
  color: rgba(15,23,42,.92);
}
.receipt-cam-modal .rcm-head{
  padding: 12px 12px;
  display:flex; align-items:center; justify-content:space-between;
  background: rgba(2,6,23,.22);
}
[data-bs-theme="light"] .receipt-cam-modal .rcm-head{ background: rgba(241,245,249,.7); }
.receipt-cam-modal .rcm-body{ padding: 12px; }
.receipt-cam-modal .rcm-video{
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.18);
  background: #000;
}
@media (max-width: 480px){
  .receipt-cam-modal .rcm-video{ height: 260px; }
}
.receipt-cam-modal .rcm-actions{
  padding: 12px;
  display:flex; align-items:center; gap: 10px;
  border-top: 1px solid rgba(148,163,184,.14);
}

