/* ===========================================================
   Green Property Solution — design layer on top of Tabler
   =========================================================== */

:root {
  --gp-brand: #0f9d58;
  --gp-brand-2: #14b8a6;
  --gp-brand-3: #059669;
  --gp-ink: #0f172a;
  --gp-sidebar-1: #0b2f24;
  --gp-sidebar-2: #08201a;
  --tblr-primary: #0f9d58;
  --tblr-primary-rgb: 15, 157, 88;
  --gp-radius: 16px;
  --gp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --gp-shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 24px 48px -24px rgba(15, 23, 42, .35);
}

/* Any element carrying data-bs-theme re-declares Tabler's palette for its own
   subtree, which would reset primary back to Tabler blue. Re-assert the brand
   colour at every theme scope, not just :root. */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --tblr-primary: #0f9d58;
  --tblr-primary-rgb: 15, 157, 88;
  --tblr-primary-fg: #ffffff;
  --tblr-link-color: #0f9d58;
  --tblr-link-hover-color: #0b7c44;
}

.btn-primary {
  --tblr-btn-bg: var(--gp-brand);
  --tblr-btn-border-color: var(--gp-brand);
  --tblr-btn-hover-bg: var(--gp-brand-3);
  --tblr-btn-hover-border-color: var(--gp-brand-3);
  --tblr-btn-active-bg: var(--gp-brand-3);
  --tblr-btn-active-border-color: var(--gp-brand-3);
  --tblr-btn-disabled-bg: var(--gp-brand);
  --tblr-btn-disabled-border-color: var(--gp-brand);
}

.btn-outline-primary {
  --tblr-btn-color: var(--gp-brand);
  --tblr-btn-border-color: var(--gp-brand);
  --tblr-btn-hover-bg: var(--gp-brand);
  --tblr-btn-hover-border-color: var(--gp-brand);
  --tblr-btn-active-bg: var(--gp-brand);
  --tblr-btn-active-border-color: var(--gp-brand);
}

.text-primary { color: var(--gp-brand) !important; }
.bg-primary { background-color: var(--gp-brand) !important; }
.form-check-input:checked { background-color: var(--gp-brand); border-color: var(--gp-brand); }
.form-control:focus, .form-select:focus {
  border-color: rgba(15, 157, 88, .5);
  box-shadow: 0 0 0 .25rem rgba(15, 157, 88, .15);
}
.page-item.active .page-link { background-color: var(--gp-brand); border-color: var(--gp-brand); }
.progress-bar { background-color: var(--gp-brand); }

body {
  font-family: 'Inter', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(20, 184, 166, .10), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(15, 157, 88, .08), transparent 55%),
    #f6f8fb;
  background-attachment: fixed;
}

[data-bs-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(20, 184, 166, .10), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(15, 157, 88, .07), transparent 55%),
    #0d1117;
}

.bn { font-family: 'Noto Sans Bengali', sans-serif; }

/* ---------------- Sidebar ---------------- */

.gp-sidebar {
  background: linear-gradient(180deg, var(--gp-sidebar-1) 0%, var(--gp-sidebar-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  width: 262px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gp-sidebar::before {
  content: '';
  position: absolute;
  inset: -40% -60% auto auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(20, 184, 166, .22), transparent 70%);
  pointer-events: none;
}

.gp-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.15rem 1.25rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  position: relative;
}

.gp-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gp-brand) 0%, var(--gp-brand-2) 100%);
  box-shadow: 0 6px 18px -6px rgba(20, 184, 166, .8);
  flex: none;
}

.gp-brand-mark svg { width: 22px; height: 22px; color: #fff; }
.gp-brand-text { line-height: 1.15; min-width: 0; }
.gp-brand-text strong { display: block; font-size: .95rem; letter-spacing: -.01em; }
.gp-brand-text span { font-size: .68rem; color: rgba(255, 255, 255, .55); letter-spacing: .08em; text-transform: uppercase; }

.gp-nav {
  padding: .75rem .75rem 2rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.gp-nav::-webkit-scrollbar { width: 6px; }
.gp-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }

.gp-nav-label {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
  padding: 1rem .75rem .4rem;
  font-weight: 600;
}

.gp-nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .58rem .75rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .16s ease;
  position: relative;
}

.gp-nav-link svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.gp-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.gp-nav-link.active {
  background: linear-gradient(90deg, rgba(20, 184, 166, .26), rgba(20, 184, 166, .05));
  color: #fff;
}

.gp-nav-link.active::before {
  content: '';
  position: absolute;
  left: -.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--gp-brand-2);
}

.gp-nav-link .badge { margin-left: auto; font-size: .65rem; }

/* ---------------- Shell ---------------- */

.gp-shell { margin-left: 262px; min-height: 100vh; display: flex; flex-direction: column; }

.gp-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

[data-bs-theme="dark"] .gp-topbar {
  background: rgba(22, 27, 34, .82);
  border-bottom-color: rgba(255, 255, 255, .07);
}

.gp-page { padding: 1.5rem; flex: 1; }

@media (max-width: 991.98px) {
  .gp-sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .gp-sidebar.show { transform: none; box-shadow: var(--gp-shadow-lg); }
  .gp-shell { margin-left: 0; }
  .gp-page { padding: 1rem; }
}

.gp-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.gp-backdrop.show { opacity: 1; pointer-events: auto; }

/* ---------------- Cards ---------------- */

.card {
  border-radius: var(--gp-radius);
  border: 1px solid rgba(15, 23, 42, .07);
  box-shadow: var(--gp-shadow);
}

[data-bs-theme="dark"] .card { border-color: rgba(255, 255, 255, .07); }

.gp-stat {
  position: relative;
  overflow: hidden;
  border-radius: var(--gp-radius);
  padding: 1.1rem 1.25rem;
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid rgba(15, 23, 42, .07);
  box-shadow: var(--gp-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
}

.gp-stat:hover { transform: translateY(-3px); box-shadow: var(--gp-shadow-lg); }

.gp-stat::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gp-c1, var(--gp-brand)), var(--gp-c2, var(--gp-brand-2)));
}

.gp-stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--gp-c1, var(--gp-brand)), var(--gp-c2, var(--gp-brand-2)));
  color: #fff;
  box-shadow: 0 8px 20px -10px var(--gp-c1, var(--gp-brand));
}
.gp-stat-icon svg { width: 21px; height: 21px; }

.gp-stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tblr-secondary); font-weight: 600; }
/* Sized so an 8-digit taka figure still fits a 4-per-row tile without truncating. */
.gp-stat-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
@media (min-width: 1600px) { .gp-stat-value { font-size: 1.5rem; } }
.gp-stat-value.sm { font-size: 1.25rem; }
.gp-stat-sub { font-size: .78rem; color: var(--tblr-secondary); }

/* ---------------- Project cards ---------------- */

.gp-project {
  position: relative;
  overflow: hidden;
  border-radius: var(--gp-radius);
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid rgba(15, 23, 42, .07);
  box-shadow: var(--gp-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.gp-project:hover {
  transform: translateY(-4px);
  box-shadow: var(--gp-shadow-lg);
  border-color: rgba(15, 157, 88, .35);
}

.gp-project-head {
  padding: 1.1rem 1.25rem .9rem;
  background: linear-gradient(135deg, rgba(15, 157, 88, .09), rgba(20, 184, 166, .04));
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  position: relative;
}

[data-bs-theme="dark"] .gp-project-head { border-bottom-color: rgba(255, 255, 255, .06); }

.gp-project-title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; margin: 0; }
.gp-project-title a { color: inherit; text-decoration: none; }
.gp-project-title a:hover { color: var(--gp-brand); }

.gp-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(15, 23, 42, .07);
  margin-top: auto;
}
[data-bs-theme="dark"] .gp-metric-grid { background: rgba(255, 255, 255, .07); }

.gp-metric {
  background: var(--tblr-bg-surface, #fff);
  padding: .7rem .9rem;
}
.gp-metric-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tblr-secondary); font-weight: 600; }
.gp-metric-value { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }

/* ---------------- Progress ring ---------------- */

.gp-ring { position: relative; width: 62px; height: 62px; flex: none; }
.gp-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gp-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.gp-ring .ring-bg { stroke: rgba(15, 23, 42, .09); }
[data-bs-theme="dark"] .gp-ring .ring-bg { stroke: rgba(255, 255, 255, .1); }
.gp-ring .ring-fg { transition: stroke-dashoffset 1s cubic-bezier(.4, 0, .2, 1); }
.gp-ring-text {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; letter-spacing: -.02em;
}

/* ---------------- Misc ---------------- */

.gp-progress-thin { height: 6px; border-radius: 99px; background: rgba(15, 23, 42, .08); overflow: hidden; }
[data-bs-theme="dark"] .gp-progress-thin { background: rgba(255, 255, 255, .1); }
.gp-progress-thin > div { height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.4, 0, .2, 1); }

.gp-avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: linear-gradient(135deg, rgba(15, 157, 88, .16), rgba(20, 184, 166, .12));
  color: var(--gp-brand-3);
}
[data-bs-theme="dark"] .gp-avatar { color: #34d399; }
.gp-avatar.sm { width: 30px; height: 30px; font-size: .68rem; border-radius: 9px; }
.gp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.gp-page-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.gp-page-subtitle { color: var(--tblr-secondary); font-size: .85rem; margin: .15rem 0 0; }

.table thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; color: var(--tblr-secondary);
  border-bottom: 1px solid rgba(15, 23, 42, .09);
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .68rem .75rem; }
.table-hover tbody tr { transition: background .12s ease; }

.gp-money { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
.gp-money.neg { color: var(--tblr-danger); }
.gp-money.pos { color: var(--tblr-success); }

.badge { font-weight: 600; letter-spacing: .01em; }

.gp-empty { text-align: center; padding: 3rem 1rem; color: var(--tblr-secondary); }
.gp-empty svg { width: 46px; height: 46px; opacity: .3; margin-bottom: .75rem; }

.form-label { font-weight: 600; font-size: .82rem; }
.form-control, .form-select { border-radius: 10px; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-icon { border-radius: 9px; }

.gp-filter-bar {
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: var(--gp-radius);
  padding: .9rem 1rem;
  box-shadow: var(--gp-shadow);
}
[data-bs-theme="dark"] .gp-filter-bar { border-color: rgba(255, 255, 255, .07); }

.gp-tabs { border-bottom: 1px solid rgba(15, 23, 42, .09); gap: .25rem; }
.gp-tabs .nav-link {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  font-weight: 600; font-size: .875rem; color: var(--tblr-secondary); padding: .6rem .9rem;
}
.gp-tabs .nav-link:hover { color: var(--gp-brand); }
.gp-tabs .nav-link.active { color: var(--gp-brand); border-bottom-color: var(--gp-brand); background: transparent; }

.gp-timeline { position: relative; padding-left: 1.6rem; }
.gp-timeline::before {
  content: ''; position: absolute; left: .43rem; top: .4rem; bottom: .4rem;
  width: 2px; background: rgba(15, 23, 42, .1);
}
[data-bs-theme="dark"] .gp-timeline::before { background: rgba(255, 255, 255, .12); }
.gp-timeline-item { position: relative; padding-bottom: 1.1rem; }
.gp-timeline-item::before {
  content: ''; position: absolute; left: -1.6rem; top: .3rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gp-brand); box-shadow: 0 0 0 3px rgba(15, 157, 88, .18);
}
.gp-timeline-item.pending::before { background: var(--tblr-secondary); box-shadow: 0 0 0 3px rgba(100, 116, 139, .18); }
.gp-timeline-item.warning::before { background: var(--tblr-warning); box-shadow: 0 0 0 3px rgba(245, 159, 0, .18); }
.gp-timeline-item.danger::before { background: var(--tblr-danger); box-shadow: 0 0 0 3px rgba(214, 57, 57, .18); }

/* Login */
.gp-login {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(20, 184, 166, .22), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(15, 157, 88, .22), transparent 60%),
    #071b16;
}
.gp-login-card {
  width: 100%; max-width: 420px; border-radius: 20px; padding: 2rem;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .5);
}

.gp-count { font-variant-numeric: tabular-nums; }

@media print {
  .gp-sidebar, .gp-topbar, .no-print, .btn { display: none !important; }
  .gp-shell { margin-left: 0; }
  .gp-page { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}
