:root { --app-sidebar-w: 15rem; }
.navbar-brand-text { font-weight: 700; letter-spacing: -.01em; }
.report-card .card-title { font-size: 1rem; }
.report-card .desc { color: var(--tblr-secondary); min-height: 2.6em; }
.period-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tblr-secondary); font-weight: 600; }
.table td, .table th { vertical-align: middle; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--tblr-secondary); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* ---------- Control Panel sidebar (light) ---------- */
.app-sidebar.navbar-vertical { background: #fff; border-right: 1px solid var(--tblr-border-color); box-shadow: none; }
.app-sidebar > .container-fluid { padding: 0; align-items: stretch; }
.app-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.25rem 1.1rem; margin: 0;
  border-bottom: 1px solid var(--tblr-border-color);
  color: inherit; text-decoration: none;
}
.app-brand:hover { text-decoration: none; }
.app-brand-mark {
  flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tblr-primary); color: #fff; font-size: 1.35rem;
}
.app-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.app-brand-name { font-weight: 700; font-size: 1rem; color: var(--tblr-body-color); white-space: nowrap; }
.app-brand-sub { font-size: .75rem; color: var(--tblr-secondary); margin-top: .15rem; }

.app-nav { width: 100%; padding: .75rem .75rem 1.5rem; }
.app-nav-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tblr-secondary); padding: 1rem .75rem .4rem;
}
.app-nav .navbar-nav { margin: 0; gap: 2px; }
.app-sidebar .app-nav .nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .75rem; border-radius: .5rem;
  color: var(--tblr-body-color); font-weight: 500;
}
.app-sidebar .app-nav .nav-link i { font-size: 1.2rem; color: var(--tblr-secondary); }
.app-sidebar .app-nav .nav-link:hover { background: var(--tblr-bg-surface-secondary); }
.app-sidebar .app-nav .nav-link.active { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.app-sidebar .app-nav .nav-link.active i { color: var(--tblr-primary); }
.app-sidebar .app-nav .nav-link.active::after { display: none; }
.app-sidebar .app-nav .app-nav-logout:hover, .app-sidebar .app-nav .app-nav-logout:hover i { color: var(--tblr-danger); }

@media (max-width: 991.98px) {
  .app-sidebar > .container-fluid { padding: 0 .75rem; flex-wrap: wrap; align-items: center; }
  .app-brand { border-bottom: 0; padding: .75rem .5rem; }
  .app-nav { padding-top: 0; border-top: 1px solid var(--tblr-border-color); }
}

/* ---------- Table row actions ---------- */
.row-actions { display: inline-flex; align-items: center; gap: .375rem; justify-content: flex-end; }
.row-actions form { display: inline-flex; margin: 0; }
.act-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid var(--tblr-border-color); border-radius: .5rem;
  background: var(--tblr-bg-surface); color: var(--tblr-secondary);
  font-size: .8125rem; font-weight: 500; line-height: 1; cursor: pointer;
  text-decoration: none; transition: background-color .15s, color .15s, border-color .15s;
}
.act-btn i { font-size: 1rem; }
.act-btn:hover { background: var(--tblr-bg-surface-secondary); color: var(--tblr-body-color); text-decoration: none; }
.act-btn.act-wide { width: auto; padding: 0 .7rem; }
.act-btn.act-primary { background: var(--tblr-primary-lt); border-color: transparent; color: var(--tblr-primary); }
.act-btn.act-primary:hover { background: var(--tblr-primary); color: #fff; }
.act-btn.act-danger:hover { background: var(--tblr-danger-lt); border-color: var(--tblr-danger); color: var(--tblr-danger); }

/* ---------- Status pill (click to toggle) ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .65rem; border-radius: 999px; border: 0;
  font-size: .78rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: filter .15s;
}
.status-pill:hover { filter: brightness(.95); }
.status-pill .status-dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-pill.is-on  { background: var(--tblr-success-lt); color: var(--tblr-success); }
.status-pill.is-off { background: var(--tblr-secondary-lt); color: var(--tblr-secondary); }

/* Keep main text columns readable on narrower screens */
.table .col-main { min-width: 12rem; }

/* ---------- Control Panel top bar ---------- */
.app-topbar {
  position: sticky; top: 0; z-index: 1020;
  background: var(--tblr-bg-surface);
  border-bottom: 1px solid var(--tblr-border-color);
  box-shadow: 0 1px 2px rgba(24, 36, 51, .04);
}
.app-topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 4.5rem; padding: .75rem 0; }
.app-topbar-pre {
  display: flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tblr-secondary); margin-bottom: .15rem;
}
.app-topbar-pre i { font-size: .8rem; color: var(--tblr-primary); }
.app-topbar-title { font-size: 1.25rem; font-weight: 700; margin: 0; line-height: 1.3; }
.app-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem .6rem .35rem .35rem; border-radius: .6rem;
  border: 1px solid var(--tblr-border-color);
  color: inherit; text-decoration: none;
}
.app-user:hover { background: var(--tblr-bg-surface-secondary); text-decoration: none; }
.app-topbar + .page-body { margin-top: 1.5rem; }

/* Sidebar brand and top bar share one height so their bottom borders form a single line */
:root { --app-header-h: 4.75rem; }
@media (min-width: 992px) {
  .app-brand { height: var(--app-header-h); padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
}
.app-topbar { height: var(--app-header-h); box-sizing: border-box; }
.app-topbar > .container-fluid { height: 100%; }
.app-topbar-inner { height: 100%; min-height: 0; padding: 0; }

/* ---------- Report listing: month groups + reorder arrows ---------- */
.table .group-row td {
  background: var(--tblr-bg-surface-secondary);
  font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tblr-body-color); padding-top: .5rem; padding-bottom: .5rem;
}
.order-btns { display: inline-flex; flex-direction: column; gap: 2px; }
.order-btns form { display: flex; margin: 0; }
.order-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.15rem; padding: 0;
  border: 1px solid var(--tblr-border-color); border-radius: .35rem;
  background: var(--tblr-bg-surface); color: var(--tblr-secondary); cursor: pointer;
}
.order-btn i { font-size: .85rem; }
.order-btn:hover { background: var(--tblr-primary-lt); border-color: var(--tblr-primary); color: var(--tblr-primary); }
.order-btn.is-disabled { opacity: .35; cursor: default; pointer-events: none; }
.order-btn { color: var(--tblr-body-color); }
.order-btn i { font-size: .95rem; }
.order-btn.is-disabled { opacity: .25; }

/* Plain icon buttons (edit): yellow tint on hover, alongside the red delete hover */
.act-btn:not(.act-primary):not(.act-danger):hover {
  background: var(--tblr-warning-lt); border-color: var(--tblr-warning); color: #b25e09;
}

/* ---------- Client portal: report list ---------- */
.report-toolbar .card-body { min-height: 4rem; }
.report-search { width: 100%; max-width: 20rem; }
@media (max-width: 767.98px) { .report-search { max-width: none; } }

.report-group { margin-bottom: 2rem; }
.report-group-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.report-group-title {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--tblr-body-color); white-space: nowrap;
}
.report-group-title i { color: var(--tblr-primary); font-size: 1rem; }
.report-group-count {
  font-size: .72rem; font-weight: 600; color: var(--tblr-primary);
  background: var(--tblr-primary-lt); border-radius: 999px; padding: .1rem .5rem;
}
.report-group-line { flex: 1; height: 1px; background: var(--tblr-border-color); }

.report-item {
  position: relative; height: 100%;
  display: flex; align-items: flex-start; gap: .9rem;
  padding: 1rem 1.1rem;
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color); border-radius: .75rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.report-item:hover {
  border-color: var(--tblr-primary);
  box-shadow: 0 6px 18px rgba(6, 111, 209, .10);
  transform: translateY(-1px);
}
.report-item-icon {
  flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: .65rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tblr-primary-lt); color: var(--tblr-primary); font-size: 1.3rem;
}
.report-item-body { flex: 1; min-width: 0; }
.report-item-title {
  display: block; font-weight: 600; font-size: .95rem; line-height: 1.35;
  color: var(--tblr-body-color); text-decoration: none;
}
.report-item-title:hover { text-decoration: none; color: var(--tblr-body-color); }
.report-item-desc {
  margin-top: .2rem; font-size: .83rem; color: var(--tblr-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.report-item-meta {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .55rem; font-size: .75rem; color: var(--tblr-secondary);
}
.report-item-open {
  flex: 0 0 auto; align-self: center;
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .35rem .7rem; border-radius: .5rem;
  font-size: .8rem; font-weight: 600;
  color: var(--tblr-primary); background: var(--tblr-primary-lt);
  transition: background-color .15s, color .15s;
}
.report-item:hover .report-item-open { background: var(--tblr-primary); color: #fff; }

/* ---------- Admin dashboard ---------- */
.min-w-0 { min-width: 0; }
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-welcome-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 .15rem; }

.stat-card {
  position: relative; height: 100%;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color); border-radius: .75rem;
  transition: border-color .15s, box-shadow .15s;
}
/* Same hover on every stat card; only the linked ones show a pointer. */
.stat-card:hover { border-color: var(--tblr-primary); box-shadow: 0 6px 18px rgba(6, 111, 209, .08); }
.stat-card:not(.is-link) { cursor: default; }
.stat-icon {
  flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: .7rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.stat-label { font-size: .8rem; font-weight: 500; color: var(--tblr-secondary); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--tblr-body-color); }
.stat-sub { font-size: .78rem; color: var(--tblr-secondary); margin-top: .2rem; }

.dash-row { display: flex; align-items: center; gap: .75rem; padding-top: .7rem; padding-bottom: .7rem; }
.dash-rank {
  flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  background: var(--tblr-bg-surface-secondary); color: var(--tblr-secondary);
}
.list-group-item:first-child .dash-rank { background: var(--tblr-orange-lt); color: var(--tblr-orange); }

/* ---------- Footer (both panels) ---------- */
/* .page is a full-height column; the wrapper takes the remaining space so the footer sits at the bottom */
.page { min-height: 100vh; }
.page-wrapper { display: flex; flex-direction: column; flex: 1 0 auto; }
.page-wrapper > .page-body { flex: 1 0 auto; }
.app-footer {
  margin-top: 2rem;
  background: var(--tblr-bg-surface);
  border-top: 1px solid var(--tblr-border-color);
}
.app-footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  min-height: 3.25rem; padding-top: .75rem; padding-bottom: .75rem;
  font-size: .8rem; color: var(--tblr-secondary);
}
.app-footer-tag { display: inline-flex; align-items: center; gap: .35rem; }
.app-footer-tag i { color: var(--tblr-primary); font-size: .95rem; }

/* ---------- Login pages ---------- */
.auth-body { background: var(--tblr-bg-surface-secondary, #f6f8fb); }
.auth-wrap { display: flex; min-height: 100vh; }

.auth-brand {
  flex: 0 0 42%; max-width: 36rem;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.5rem 3rem; color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.14) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,.10) 0, rgba(255,255,255,0) 45%),
    linear-gradient(150deg, #0a6fd1 0%, #0b4ea2 60%, #0a3a7a 100%);
}
.auth-brand-top { display: flex; align-items: center; gap: .8rem; }
.auth-mark {
  width: 2.75rem; height: 2.75rem; border-radius: .7rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); font-size: 1.45rem;
}
.auth-brand-name { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.auth-brand-sub { font-size: .8rem; opacity: .8; }
.auth-brand-title { font-size: 2rem; font-weight: 700; line-height: 1.25; margin: 0 0 1.75rem; color: #fff; max-width: 22rem; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; align-items: center; gap: .8rem; font-size: .95rem; opacity: .95; }
.auth-points span {
  flex: 0 0 auto; width: 2.2rem; height: 2.2rem; border-radius: .55rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); font-size: 1.1rem;
}
.auth-brand-foot { font-size: .78rem; opacity: .7; }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card {
  width: 100%; max-width: 26rem;
  background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color);
  border-radius: 1rem; padding: 2.25rem 2rem;
  box-shadow: 0 10px 30px rgba(24, 36, 51, .06);
}
.auth-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem; }
.auth-lead { color: var(--tblr-secondary); margin-bottom: 1.5rem; }
.auth-pw { padding-right: 2.75rem; }
.auth-pw-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--tblr-secondary); font-size: 1.15rem; line-height: 1;
}
.auth-pw-toggle:hover { color: var(--tblr-primary); }
.auth-help {
  display: flex; align-items: flex-start; gap: .5rem;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--tblr-border-color);
  font-size: .82rem; color: var(--tblr-secondary);
}
.auth-help i { font-size: 1rem; margin-top: .05rem; }

@media (max-width: 991.98px) {
  .auth-wrap { flex-direction: column; }
  .auth-brand { flex: none; max-width: none; padding: 1.25rem 1.25rem 1.5rem; }
  .auth-brand-body, .auth-brand-foot { display: none; }
  .auth-main { align-items: flex-start; padding-top: 1.75rem; }
  .auth-card { padding: 1.75rem 1.35rem; }
}

/* Control Panel login: single centered card, logo above */
.auth-centered {
  background:
    radial-gradient(circle at 50% -10%, rgba(10, 111, 209, .10) 0, rgba(10, 111, 209, 0) 55%),
    var(--tblr-bg-surface-secondary, #f6f8fb);
}
.auth-centered .auth-main { flex-direction: column; align-items: center; justify-content: center; padding-top: 2rem; }
.auth-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-logo-mark {
  width: 2.75rem; height: 2.75rem; border-radius: .7rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tblr-primary); color: #fff; font-size: 1.45rem;
  box-shadow: 0 6px 16px rgba(10, 111, 209, .25);
}
.auth-logo-name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; color: var(--tblr-body-color); }
.auth-logo-sub { font-size: .8rem; color: var(--tblr-secondary); }
.auth-copy { margin-top: 1.5rem; font-size: .78rem; color: var(--tblr-secondary); }

/* Control Panel login polish */
.auth-centered {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(10, 111, 209, .10) 0, rgba(10, 111, 209, 0) 35%),
    radial-gradient(circle at 85% 80%, rgba(66, 99, 235, .10) 0, rgba(66, 99, 235, 0) 35%),
    #f4f7fb;
}
.auth-centered::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(24, 36, 51, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0, transparent 70%);
          mask-image: radial-gradient(ellipse at center, #000 0, transparent 70%);
}
.auth-centered .auth-main { position: relative; z-index: 1; }
.auth-card-accent {
  position: relative; overflow: hidden; max-width: 25rem;
  padding: 2.5rem 2.25rem 1.75rem;
  border-color: rgba(24, 36, 51, .08);
  box-shadow: 0 1px 2px rgba(24, 36, 51, .04), 0 20px 45px -12px rgba(10, 58, 122, .18);
}
.auth-card-accent::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, #0a6fd1, #4263eb);
}
.auth-card-head { text-align: center; margin-bottom: 1.75rem; }
.auth-card-head .auth-logo-mark { margin-bottom: 1rem; width: 3.25rem; height: 3.25rem; font-size: 1.6rem; border-radius: .85rem; }
.auth-card-head .auth-title { margin-bottom: .3rem; }
.auth-card-head .auth-lead { margin-bottom: 0; }
.auth-card-accent .form-control:focus { border-color: var(--tblr-primary); box-shadow: 0 0 0 .2rem rgba(10, 111, 209, .12); }
.auth-secure {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--tblr-border-color);
  font-size: .78rem; color: var(--tblr-secondary);
}
.auth-secure i { color: var(--tblr-success); font-size: 1rem; }

/* ---------- Confirm dialog ---------- */
.app-confirm {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(24, 36, 51, .45); backdrop-filter: blur(2px);
}
.app-confirm.is-open { display: flex; animation: appFade .15s ease-out; }
.app-confirm-box {
  width: 100%; max-width: 24rem; text-align: center;
  background: var(--tblr-bg-surface); border-radius: 1rem; padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(24, 36, 51, .25);
}
.app-confirm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.5rem; margin-bottom: .75rem;
  background: var(--tblr-warning-lt); color: var(--tblr-warning);
}
.app-confirm.is-danger .app-confirm-icon { background: var(--tblr-danger-lt); color: var(--tblr-danger); }
.app-confirm-title { font-weight: 700; font-size: 1.1rem; margin-bottom: .35rem; }
.app-confirm-msg { color: var(--tblr-secondary); margin-bottom: 1.25rem; }
.app-confirm-actions { display: flex; gap: .5rem; }
.app-confirm-actions .btn { flex: 1; }
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Clients list avatar ---------- */
.client-cell { display: flex; align-items: center; gap: .75rem; }

/* ---------- Client login touches ---------- */
.auth-brand { position: relative; overflow: hidden; }
.auth-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 60%);
          mask-image: linear-gradient(180deg, transparent 0, #000 60%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-card .form-control:focus { border-color: var(--tblr-primary); box-shadow: 0 0 0 .2rem rgba(10, 111, 209, .12); }
.auth-wrap:not(.auth-centered) .auth-card { box-shadow: 0 1px 2px rgba(24, 36, 51, .04), 0 20px 45px -12px rgba(10, 58, 122, .15); }
