/* ============================================================
   eSign BKPSDM — "Berry-like" design system (overrides Bootstrap 5.3)
   ============================================================ */

:root {
    --bs-primary: #7367f0;
    --bs-primary-rgb: 115, 103, 240;
    --bs-info: #3ea2ff;
    --bs-info-rgb: 62, 162, 255;
    --bs-success: #2ca87f;
    --bs-success-rgb: 44, 168, 127;
    --bs-warning: #ffa113;
    --bs-warning-rgb: 255, 161, 19;
    --bs-danger: #f44236;
    --bs-danger-rgb: 244, 66, 54;
    --bs-secondary: #8b93a7;
    --bs-secondary-rgb: 139, 147, 167;
    --bs-dark: #3f4254;
    --bs-dark-rgb: 63, 66, 84;
    --bs-body-bg: #ffffff;
    --bs-body-color: #293240;

    --esign-ink: #293240;
    --esign-muted: #6b7384;
    --esign-line: #e7eaf1;
    --esign-soft: #f1effc;
    --pc-sidebar-w: 264px;
    --pc-header-h: 64px;
}

body {
    font-family: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout (pc-layout: sidebar + header + content)
   ============================================================ */

.pc-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--pc-sidebar-w);
    background: #fff;
    border-right: 1px solid var(--esign-line);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, width .25s ease;
}
.navbar-wrapper { display: flex; flex-direction: column; height: 100%; }
.m-header {
    height: var(--pc-header-h);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--esign-line);
    flex-shrink: 0;
}
.b-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #9e95f5, #7367f0 60%, #5b4fd8);
    color: #fff;
    font-size: .84rem; font-weight: 800;
    letter-spacing: -.02em;
    box-shadow: 0 8px 18px rgb(115 103 240 / .35);
}
.brand-text { font-size: 1.02rem; font-weight: 800; color: var(--esign-ink); line-height: 1.1; }
.brand-text small {
    display: block;
    color: var(--esign-muted);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
}
.navbar-content { flex: 1; overflow-y: auto; padding: .5rem .9rem 1.5rem; }
.pc-navbar { list-style: none; margin: 0; padding: 0; }
.pc-caption {
    color: #9aa3b2;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .95rem .75rem .45rem;
}
.pc-item { margin-bottom: 2px; }
.pc-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .8rem;
    border-radius: .65rem;
    color: #5b6474;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.pc-micon { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.pc-micon svg { width: 20px; height: 20px; }
.pc-link:hover { background: var(--esign-soft); color: var(--bs-primary); }
.pc-link.active {
    background: linear-gradient(90deg, #ece8ff, #e5e0ff);
    color: var(--bs-primary);
    box-shadow: inset 3px 0 0 var(--bs-primary);
}
.pc-navbar-card {
    margin: 1rem .35rem 0;
    padding: 1rem;
    color: #fff;
    border-radius: .9rem;
    background: linear-gradient(135deg, #5b4fd8, #7367f0);
}
.pc-navbar-card small { color: rgb(255 255 255 / .85); }

.pc-main { margin-left: var(--pc-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .25s ease; }
.pc-header {
    position: sticky; top: 0; z-index: 1040;
    height: var(--pc-header-h);
    background: #fff;
    border-bottom: 1px solid var(--esign-line);
}
.header-wrapper { display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; height: 100%; flex-wrap: nowrap; }
.pc-head-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: .6rem;
    color: var(--esign-ink);
    background: transparent;
    border: 0;
    text-decoration: none;
    transition: background .15s;
}
.pc-head-link:hover { background: var(--esign-soft); color: var(--bs-primary); }
.pc-head-link svg { width: 20px; height: 20px; }
.header-breadcrumb { display: flex; align-items: center; }
.pc-container { flex: 1; padding: 1.6rem 1.25rem 2rem; }
.pc-content { max-width: 1280px; margin: 0 auto; }
.pc-footer {
    border-top: 1px solid var(--esign-line);
    background: #fff;
    padding: .75rem 1.25rem;
    color: var(--esign-muted);
    font-size: .8rem;
}
.pc-backdrop { position: fixed; inset: 0; background: rgb(15 23 42 / .45); z-index: 1045; display: none; }

/* Sidebar mini (desktop collapse) & mobile off-canvas */
.sidebar-mini .pc-sidebar { width: 78px; }
.sidebar-mini .pc-main { margin-left: 78px; }
.sidebar-mini .pc-mtext, .sidebar-mini .brand-text, .sidebar-mini .pc-navbar-card,
.sidebar-mini .pc-caption { display: none; }
.sidebar-mini .pc-link { justify-content: center; padding: .7rem; }

@media (max-width: 1023.98px) {
    .pc-sidebar { transform: translateX(-100%); }
    .pc-main { margin-left: 0; }
    .sidebar-open .pc-sidebar { transform: none; }
    .sidebar-open .pc-backdrop { display: block; }
}

/* ============================================================
   Dashnum metric cards (Berry style)
   ============================================================ */
.card.dashnum-card { position: relative; overflow: hidden; border: 0; color: #fff; box-shadow: 0 10px 24px rgb(63 66 84 / .12); }
.dashnum-card .round { position: absolute; border-radius: 50%; background: rgb(255 255 255 / .16); }
.dashnum-card .round.small { width: 120px; height: 120px; top: -52px; right: -32px; }
.dashnum-card .round.big { width: 210px; height: 210px; bottom: -96px; right: -70px; }
.dashnum-card .card-body { position: relative; z-index: 1; padding: 1.1rem 1.25rem; }
.dashnum-1 { background: linear-gradient(135deg, #5b4fd8, #9e95f5); }
.dashnum-2 { background: linear-gradient(135deg, #2f7fe0, #7db8ff); }
.dashnum-3 { background: linear-gradient(135deg, #e68a00, #ffbf5e); }
.dashnum-4 { background: linear-gradient(135deg, #d40f5f, #f56a9b); }
.dashnum-5 { background: linear-gradient(135deg, #1f9d7a, #57c9a2); }
.dashnum-6 { background: linear-gradient(135deg, #6d7488, #a5aec2); }

.avtar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 12px;
    flex-shrink: 0;
}
.avtar svg { width: 22px; height: 22px; }
.avtar.bg-white-15 { background: rgb(255 255 255 / .2); }
.f-30 { font-size: 1.65rem; font-weight: 700; line-height: 1.15; }
.f-w-600 { font-weight: 600; }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.dashnum-card .circle.circle { position: absolute; width: 46px; height: 46px; top: 12px; right: 14px; background: transparent; border: 2px solid rgb(255 255 255 / .25); }
.dashnum-card .dashboard-note { font-size: .72rem; opacity: .8; margin-top: .1rem; }
.opacity-60 { opacity: .6; }

/* ---------- Dashboard custom ---------- */
.progress { background: var(--esign-line); border-radius: 999px; }
.progress-bar { background: var(--bs-primary); border-radius: 999px; }

.activity-feed { margin: 0; padding: 0; }
.activity-item { position: relative; padding: .45rem 0; }
.activity-item .activity-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, #9e95f5, #7367f0);
    margin-top: .32rem; flex-shrink: 0;
    box-shadow: 0 0 0 4px rgb(115 103 240 / .14);
}
.smaller { font-size: .78rem; }

/* Dashboard metric cards: hover lift (Berry feel) */
.dashnum-card { transition: transform .18s ease, box-shadow .18s ease; }
.dashnum-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgb(63 66 84 / .18) !important; }

/* ============================================================
   Components
   ============================================================ */
h1.h4:first-child, h1.h4 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--esign-ink);
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head .page-title { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--esign-ink); }

.btn { border-radius: .6rem; font-weight: 600; }
.btn-sm { border-radius: .5rem; }
.btn-primary { box-shadow: 0 4px 12px rgb(115 103 240 / .30); }
.btn-primary:hover { background: #6357e0; border-color: #6357e0; }
.btn-outline-primary { --bs-btn-color: var(--bs-primary); --bs-btn-border-color: #c1baf7; --bs-btn-active-bg: var(--bs-primary); }
.btn-outline-secondary { --bs-btn-color: #6b7384; --bs-btn-border-color: #d3d8e2; }

.card {
    border: 1px solid var(--esign-line);
    border-radius: .95rem;
    box-shadow: 0 1px 2px rgb(63 66 84 / .05);
    overflow: hidden;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--esign-line);
    font-weight: 700;
    color: var(--esign-ink);
    padding: .85rem 1.25rem;
}
.card-body { padding: 1.25rem; }

.table { --bs-table-border-color: #eef0f5; }
.table thead th {
    background: #f6f7fb;
    color: #697181;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .055em;
    font-weight: 700;
    border-bottom: 1px solid var(--esign-line);
    padding-top: .65rem;
    padding-bottom: .65rem;
}
.table tbody tr:hover { --bs-table-accent-bg: #f7f6fe; }
.table-sm > :not(caption) > * > * { padding-top: .5rem; padding-bottom: .5rem; }
.table-light { --bs-table-bg: #f6f7fb !important; --bs-table-color: #697181; }
.text-muted { color: var(--esign-muted) !important; }
.font-monospace { font-size: .82em; }

.badge { border-radius: 999px; font-weight: 600; font-size: .72rem; letter-spacing: .01em; padding: .42em .72em; }
.badge.bg-info, .badge.text-bg-info { background: #dff2ff !important; color: #0866ad !important; }
.badge.bg-warning, .badge.text-bg-warning { background: #fff2d6 !important; color: #935c00 !important; }
.badge.bg-primary, .badge.text-bg-primary { background: #eae7ff !important; color: #5b4fd8 !important; }
.badge.bg-success, .badge.text-bg-success { background: #d8f5ea !important; color: #0f7a55 !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background: #eaecf1 !important; color: #5b6474 !important; }
.badge.bg-danger, .badge.text-bg-danger { background: #ffdddd !important; color: #c91717 !important; }
.badge.bg-dark, .badge.text-bg-dark { background: #3f4254 !important; color: #fff !important; }

.alert { border-radius: .8rem; border: 1px solid; }
.alert-success { background: #eafaf3; border-color: #bfeadd; color: #0f7a55; }
.alert-info { background: #e8f4ff; border-color: #c3e5ff; color: #0866ad; }
.alert-warning { background: #fff6e6; border-color: #ffe2ae; color: #935c00; }
.alert-danger { background: #fff0f0; border-color: #ffd0d0; color: #c91717; }
.alert-primary { background: #f0eeff; border-color: #d4ceff; color: #5b4fd8; }

.form-label { font-weight: 600; font-size: .84rem; color: #46506a; margin-bottom: .35rem; }
.form-control, .form-select { border-radius: .55rem; border-color: #cdd3df; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: #b3abff; box-shadow: 0 0 0 .22rem rgb(115 103 240 / .13); }
.form-text { color: var(--esign-muted); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }

.signature-canvas {
    width: 100%;
    height: 200px;
    border: 1.5px dashed #b9b2f5;
    border-radius: .8rem;
    background: #fff;
    touch-action: none;
    box-shadow: inset 0 1px 3px rgb(63 66 84 / .06);
}

.dropdown-menu { border-radius: .8rem; border-color: var(--esign-line); box-shadow: 0 12px 30px rgb(63 66 84 / .14); }

/* ---------- Pagination ---------- */
.pagination { --bs-pagination-border-radius: .45rem; --bs-pagination-color: var(--bs-primary); --bs-pagination-bg: #fff; --bs-pagination-border-color: #e3e6ee; --bs-pagination-hover-color: var(--bs-primary); --bs-pagination-hover-bg: var(--esign-soft); --bs-pagination-hover-border-color: #d8d3ff; --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-focus-color: var(--bs-primary); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgb(115 103 240 / .13); --bs-pagination-disabled-bg: #fff; }
.pagination .page-link { font-weight: 600; min-width: 32px; text-align: center; }
.pagination-sm .page-link { font-size: .8rem; padding: .32rem .55rem; }
.page-item.disabled .page-link { color: #b8bfcc; }
.user-avtar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9e95f5, #7367f0);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
}
.breadcrumb { margin-bottom: 0; --bs-breadcrumb-divider: "›"; }
.breadcrumb-item a { color: var(--esign-muted); text-decoration: none; }
.breadcrumb-item.active { color: var(--esign-ink); font-weight: 600; }

/* ---------- Login ---------- */
body.login-page {
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.login-wrap { width: 420px; max-width: 96vw; }
.login-card { border: 1px solid rgb(0 0 0 / .08); border-radius: 1.1rem; box-shadow: 0 18px 45px rgb(0 0 0 / .08); }
.login-card .card-body { padding: 2.2rem 2.2rem 2rem; }
.login-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.login-brand .brand-mark { width: 48px; height: 48px; border-radius: 13px; }
.login-brand .login-title { font-weight: 800; color: var(--esign-ink); margin-bottom: 0; }
.login-brand .login-sub { color: var(--esign-muted); font-size: .78rem; letter-spacing: .04em; }
.login-lead { color: var(--esign-muted); font-size: .86rem; margin-bottom: 1.2rem; line-height: 1.45; }
.login-foot { text-align: center; margin-top: 1.2rem; color: var(--esign-muted); font-size: .78rem; }

/* ---------- Public signing pages ---------- */
.bg-light.public-body { background: var(--bs-body-bg); }
.public-body .card { max-width: 860px; margin: 0 auto; }
.public-body .brand-mark + span { color: #5b4fd8; font-weight: 800; font-size: .95rem; }