/* ezPro Client Management: the application shell (sidebar, top bar) and the shared look of pages. */
:root {
  --brand: #1f3864; --brand-2: #2c4f8f; --brand-soft: #e8edf7; --ink: #111827; --ink-2: #374151; --muted: #6b7280;
  --line: #e5e7eb; --line-2: #eef0f3; --canvas: #f5f6f8; --surface: #fff; --danger: #dc2626; --ok: #15803d;
  --radius: .75rem; --sidebar: 15.5rem;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-primary: #1f3864; --bs-primary-rgb: 31, 56, 100; --bs-link-color: #2c4f8f; --bs-link-color-rgb: 44, 79, 143;
  --bs-link-hover-color: #1f3864; --bs-border-radius: .5rem;
}
body { background: var(--canvas); color: var(--ink); font-size: .9rem; -webkit-font-smoothing: antialiased; }
h1, .h1, .h4, .h5, .h6 { color: var(--ink); letter-spacing: -.01em; }
.h4 { font-weight: 650; }
.h6 { font-weight: 600; }

/* buttons in the brand colour */
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-2);
  --bs-btn-hover-border-color: var(--brand-2); --bs-btn-active-bg: #172a4b; --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #9aaccf; --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn { font-weight: 500; }
.btn-light { --bs-btn-bg: #f3f4f6; --bs-btn-border-color: #f3f4f6; --bs-btn-hover-bg: #e5e7eb; }
.form-control, .form-select { border-color: #d6d9df; }
.form-control:focus, .form-select:focus { border-color: #7d93c0; box-shadow: 0 0 0 .2rem rgba(31, 56, 100, .12); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* the shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex-shrink: 0; color: #c7d0e0; --bs-offcanvas-bg: #14233f;
  --bs-offcanvas-width: var(--sidebar); }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
}
/* Bootstrap makes a responsive off-canvas transparent on wide screens: the colour goes on its body */
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; flex: 1; min-height: 100%;
  background: #14233f; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.1rem 1rem; color: #fff;
  text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.sidebar .brand .logo { width: 2rem; height: 2rem; border-radius: .55rem; background: linear-gradient(135deg, #3b63b0, #1f3864);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.sidebar .brand small { display: block; font-weight: 400; color: #8fa0bf; font-size: .7rem; letter-spacing: .02em; }
.side-nav { padding: .25rem .6rem 1rem; flex: 1; }
.side-nav .group { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #7286a8;
  padding: .9rem .6rem .3rem; font-weight: 600; }
.side-nav a { display: flex; align-items: center; gap: .65rem; padding: .42rem .6rem; border-radius: .45rem;
  color: #c7d0e0; text-decoration: none; font-size: .86rem; line-height: 1.25; }
.side-nav a i { font-size: 1rem; width: 1.1rem; text-align: center; opacity: .85; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: #2c4f8f; color: #fff; }
.side-nav a.sub { padding-left: 2.35rem; font-size: .8rem; color: #a9b6cc; }
.side-nav a.sub.active { background: rgba(255,255,255,.1); color: #fff; }
.side-nav .count { margin-left: auto; font-size: .66rem; }
.side-foot { padding: .75rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .72rem; color: #7286a8; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: .55rem 1.5rem; }
.topbar .search { position: relative; flex: 0 1 26rem; }
.topbar .search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .search input { padding-left: 2.1rem; background: #f3f4f6; border-color: transparent; border-radius: .6rem; }
.topbar .search input:focus { background: #fff; }
.icon-btn { position: relative; display: inline-flex; width: 2.2rem; height: 2.2rem; border-radius: .6rem;
  align-items: center; justify-content: center; color: var(--ink-2); text-decoration: none; font-size: 1.1rem; }
.icon-btn:hover { background: #f3f4f6; color: var(--ink); }
.icon-btn .badge { position: absolute; top: .1rem; right: .05rem; font-size: .6rem; }
.me-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .3rem; border-radius: .7rem;
  color: var(--ink); text-decoration: none; border: 0; background: none; font-size: .82rem; text-align: left; }
.me-chip:hover { background: #f3f4f6; }
.me-chip .who small { display: block; color: var(--muted); font-size: .7rem; line-height: 1.1; }
.content { padding: 1.5rem 1.75rem 3rem; }
@media (max-width: 991.98px) { .content { padding: 1rem; } .topbar { padding: .5rem 1rem; } }

/* page parts */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-bottom: 1rem; }
.page-head > div:first-child { margin-right: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  font-weight: 600; margin-bottom: .6rem; }
.meta { font-size: .78rem; color: var(--muted); }
.avatar { display: inline-flex; width: 1.9rem; height: 1.9rem; border-radius: 50%; align-items: center; flex-shrink: 0;
  justify-content: center; font-size: .7rem; font-weight: 650; background: var(--brand-soft); color: var(--brand); }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s; }
a.tile:hover { border-color: #9aa9c7; box-shadow: 0 4px 12px rgba(16, 24, 40, .06); }
.tile .label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 1.65rem; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.tile.danger .value { color: #b91c1c; }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .28rem .75rem; border-radius: 999px;
  border: 1px solid #d6d9df; background: #fff; font-size: .78rem; color: var(--ink-2); text-decoration: none;
  font-weight: 500; }
.chip:hover { border-color: #9ca3af; color: var(--ink); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* tables */
.table { --bs-table-hover-bg: #f7f9fc; margin-bottom: 0; }
.table > thead th { background: #f9fafb; color: var(--muted); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.panel > .table:first-child thead th:first-child, .panel > .table-responsive:first-child thead th:first-child { border-top-left-radius: var(--radius); }
.panel > .table:first-child thead th:last-child, .panel > .table-responsive:first-child thead th:last-child { border-top-right-radius: var(--radius); }
.table > :not(caption) > * > * { border-bottom-color: var(--line-2); }
.table-sm > :not(caption) > * > * { padding: .45rem .6rem; }
.panel > .table td:first-child, .panel > .table th:first-child { padding-left: 1rem; }
.panel > .table td:last-child, .panel > .table th:last-child { padding-right: 1rem; }

/* tabs */
.nav-tabs { border-bottom: 1px solid var(--line); gap: .15rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500;
  padding: .55rem .8rem; white-space: nowrap; font-size: .86rem; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--ink); border-bottom-color: #cbd2de; }
.nav-tabs .nav-link.active { color: var(--brand); background: none; border-bottom-color: var(--brand); }

/* client list filters */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .5rem .75rem; }
.filter { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.filter > span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.filter.on .form-select { border-color: var(--brand); background-color: var(--brand-soft); font-weight: 500; }

/* side lists (firm files) */
.side-link { display: flex; justify-content: space-between; align-items: center; padding: .45rem .65rem;
  border-radius: .45rem; color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.side-link:hover { background: #f3f4f6; }
.side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.alert { border-radius: .6rem; }
.dropdown-menu { border-color: var(--line); box-shadow: 0 10px 30px rgba(16, 24, 40, .1); border-radius: .6rem; font-size: .86rem; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 10% -10%, #2c4f8f33, transparent), linear-gradient(180deg, #14233f, #1f3864); }
.login-wrap main { width: 100%; }
@media print { .sidebar, .topbar { display: none !important; } .content { padding: 0; } }
/* Bootstrap's responsive off-canvas sets a transparent background with !important on wide screens */
.sidebar.offcanvas-lg, .sidebar.offcanvas-lg .offcanvas-body { background-color: #14233f !important; }
