/* =========================================================
   Real Estate ERP — Design System  (Bootstrap 5 companion)
   v3.0 — Matches reference screenshot visual language
   ========================================================= */

/* ──────────────────────────────────────────────────────────
   DESIGN TOKENS
   ────────────────────────────────────────────────────────── */
:root {
    --erp-sidebar-width:           264px;
    --erp-sidebar-collapsed-width: 64px;

    --erp-navy:        #0d1b2e;
    --erp-navy-mid:    #152438;
    --erp-navy-soft:   #1d3250;
    --erp-accent:      #3b82f6;
    --erp-accent-dark: #2563eb;
    --erp-accent-glow: rgba(59,130,246,0.18);

    --erp-bg:          #f1f5fb;
    --erp-surface:     #f1f5fb;
    --erp-border:      #dae0ec;
    --erp-border-light:#edf0f7;

    /* dark sidebar theme (matches reference) */
    --erp-sidebar-bg:        linear-gradient(175deg, #0d1b2e 0%, #091320 100%);
    --erp-sidebar-brand-bg:  linear-gradient(135deg, #152438 0%, #0d1b2e 100%);
    --erp-sidebar-border:    rgba(59,130,246,0.1);
    --erp-sidebar-text:      rgba(175,192,215,0.88);
    --erp-sidebar-text-strong: #ffffff;
    --erp-sidebar-muted:     rgba(255,255,255,0.38);
    --erp-sidebar-section-label: rgba(255,255,255,0.25);
    --erp-sidebar-icon:      rgba(255,255,255,0.4);
    --erp-sidebar-hover-bg:  rgba(255,255,255,0.06);
    --erp-sidebar-hover-text:#e2e8f0;
    --erp-sidebar-hover-icon:#93c5fd;

    --erp-text:        #1a2740;
    --erp-text-soft:   #374151;
    --erp-muted:       #64748b;

    --erp-success:     #16a34a;
    --erp-success-bg:  #dcfce7;
    --erp-warning:     #d97706;
    --erp-warning-bg:  #fef3c7;
    --erp-danger:      #dc2626;
    --erp-danger-bg:   #fee2e2;
    --erp-info:        #0284c7;
    --erp-info-bg:     #dbeafe;

    --erp-sidebar-t:   0.22s ease;
    --erp-radius:      10px;
    --erp-radius-lg:   14px;
    --erp-shadow-sm:   0 1px 3px rgba(15,28,46,0.07), 0 1px 2px rgba(15,28,46,0.04);
    --erp-shadow:      0 2px 8px rgba(15,28,46,0.09), 0 1px 3px rgba(15,28,46,0.05);
    --erp-shadow-lg:   0 4px 20px rgba(15,28,46,0.12), 0 2px 6px rgba(15,28,46,0.06);
}

/* ──────────────────────────────────────────────────────────
   BASE
   ────────────────────────────────────────────────────────── */
html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body.erp-body {
    margin: 0;
    background: var(--erp-bg);
    color: var(--erp-text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ──────────────────────────────────────────────────────────
   SHELL
   ────────────────────────────────────────────────────────── */
.erp-shell { display: flex; min-height: 100vh; }

.erp-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.erp-content { flex: 1 1 auto; padding: 1.5rem; }

.erp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--erp-border);
    background: #fff;
    font-size: 0.78rem;
    color: var(--erp-muted);
}

/* ──────────────────────────────────────────────────────────
   SIDEBAR — shell
   ────────────────────────────────────────────────────────── */
.erp-sidebar {
    width: var(--erp-sidebar-width);
    flex: 0 0 var(--erp-sidebar-width);
    background: var(--erp-sidebar-bg);
    color: var(--erp-sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--erp-sidebar-t), flex-basis var(--erp-sidebar-t);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.07) transparent;
    border-right: 1px solid var(--erp-sidebar-border);
    box-shadow: 2px 0 16px rgba(0,0,0,0.28);
    z-index: 25;
}

.erp-sidebar::-webkit-scrollbar { width: 3px; }
.erp-sidebar::-webkit-scrollbar-track { background: transparent; }
.erp-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 3px; }

body.erp-sidebar-collapsed .erp-sidebar {
    width: var(--erp-sidebar-collapsed-width);
    flex-basis: var(--erp-sidebar-collapsed-width);
}

/* ──────────────────────────────────────────────────────────
   SIDEBAR — brand
   ────────────────────────────────────────────────────────── */
.erp-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 0.9rem 1.05rem 1rem;
    background: var(--erp-sidebar-brand-bg);
    border-bottom: 1px solid var(--erp-sidebar-border);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.erp-brand-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 1.55rem;
    z-index: 1;
}

.erp-brand-chevron {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--erp-sidebar-muted);
    font-size: 0.8rem;
    z-index: 1;
}

.erp-brand-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    opacity: 1;
    transition: opacity var(--erp-sidebar-t);
    z-index: 1;
    overflow: hidden;
    min-width: 0;
}

.erp-brand-text strong { font-size: 0.92rem; color: var(--erp-sidebar-text-strong); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-brand-text small  { font-size: 0.67rem; color: var(--erp-sidebar-muted); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

body.erp-sidebar-collapsed .erp-brand-chevron { display: none; }

body.erp-sidebar-collapsed .erp-brand-text { opacity: 0; pointer-events: none; }

/* ──────────────────────────────────────────────────────────
   SIDEBAR — nav content
   ────────────────────────────────────────────────────────── */
.erp-nav { flex: 1 1 auto; padding: 0.5rem 0 0.5rem; overflow-y: auto; }

/* section labels */
.erp-nav-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--erp-sidebar-section-label);
    padding: 0.85rem 1rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--erp-sidebar-t), height var(--erp-sidebar-t), padding var(--erp-sidebar-t);
}

body.erp-sidebar-collapsed .erp-nav-section-label { opacity: 0; height: 0; padding: 0; }

/* top-level flat nav links */
.erp-nav-link--top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    color: var(--erp-sidebar-text);
    text-decoration: none;
    font-size: 0.855rem;
    font-weight: 400;
    border-radius: 8px;
    margin: 1px 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s;
}

.erp-nav-link--top::before { display: none !important; }

.erp-nav-link--top:hover {
    background: var(--erp-sidebar-hover-bg);
    color: var(--erp-sidebar-hover-text);
}

/* ACTIVE: solid blue highlight matching screenshot */
.erp-nav-link--top.active {
    background: var(--erp-accent);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
}

.erp-nav-link-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    color: var(--erp-sidebar-icon);
    transition: color 0.15s;
}

.erp-nav-link--top:hover .erp-nav-link-icon { color: var(--erp-sidebar-hover-icon); }
.erp-nav-link--top.active .erp-nav-link-icon { color: #fff; }

.erp-nav-link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transition: opacity var(--erp-sidebar-t);
    flex: 1;
}

/* standalone Dashboard link */
.erp-nav-standalone {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    color: var(--erp-sidebar-text);
    text-decoration: none;
    font-size: 0.855rem;
    font-weight: 400;
    border-radius: 8px;
    margin: 1px 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s;
    width: calc(100% - 0.8rem);
}

.erp-nav-standalone .erp-nav-group-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--erp-sidebar-icon);
    transition: color 0.15s;
}

.erp-nav-standalone:hover { background: var(--erp-sidebar-hover-bg); color: var(--erp-sidebar-hover-text); }
.erp-nav-standalone:hover .erp-nav-group-icon { color: var(--erp-sidebar-hover-icon); }

.erp-nav-standalone.active {
    background: var(--erp-accent);
    color: #fff;
    font-weight: 600;
}

.erp-nav-standalone.active .erp-nav-group-icon { color: #fff; }

.erp-nav-standalone-label {
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transition: opacity var(--erp-sidebar-t);
    flex: 1;
}

/* collapsed states */
body.erp-sidebar-collapsed .erp-nav-link--top { padding: 0.55rem; justify-content: center; margin: 1px 0.4rem; }
body.erp-sidebar-collapsed .erp-nav-link-label { opacity: 0; width: 0; overflow: hidden; }
body.erp-sidebar-collapsed .erp-nav-standalone { padding: 0.55rem; justify-content: center; width: calc(100% - 0.8rem); }
body.erp-sidebar-collapsed .erp-nav-standalone-label { opacity: 0; width: 0; overflow: hidden; }
body.erp-sidebar-collapsed .erp-nav-link-icon { margin: 0; }
body.erp-sidebar-collapsed .erp-nav-standalone .erp-nav-group-icon { margin: 0; }

/* ──────────────────────────────────────────────────────────
   SIDEBAR — Collapsible Module Navigation
   ────────────────────────────────────────────────────────── */
.erp-nav-module {
    margin-bottom: 2px;
}

.erp-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 0.8rem);
    margin: 2px 0.4rem 1px;
    padding: 0.48rem 0.65rem 0.48rem 0.85rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--erp-sidebar-text);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.erp-nav-group-toggle:hover {
    background: var(--erp-sidebar-hover-bg);
    color: var(--erp-sidebar-hover-text);
}

.erp-nav-group-toggle.active-module {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
}

.erp-nav-group-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.erp-nav-group-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--erp-sidebar-icon);
    transition: color 0.15s;
}

.erp-nav-group-toggle:hover .erp-nav-group-icon,
.erp-nav-group-toggle.active-module .erp-nav-group-icon {
    color: var(--erp-sidebar-hover-icon);
}

.erp-nav-group-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--erp-sidebar-t);
}

.erp-nav-group-chevron {
    font-size: 0.68rem;
    color: var(--erp-sidebar-muted);
    transition: transform 0.22s ease, color 0.15s;
    flex-shrink: 0;
    margin-left: 0.35rem;
}

.erp-nav-group-toggle:not(.collapsed) .erp-nav-group-chevron {
    transform: rotate(180deg);
    color: #93c5fd;
}

.erp-nav-collapse {
    border: none;
    background: transparent;
    margin: 0;
    padding-left: 0.35rem;
    transition: height 0.22s ease;
}

.erp-nav-collapse .erp-nav-link--top {
    font-size: 0.835rem;
    padding: 0.45rem 0.85rem 0.45rem 1.6rem;
    margin: 1px 0.4rem;
}

.erp-nav-collapse .erp-nav-link--top .erp-nav-link-icon {
    font-size: 0.88rem;
    width: 18px;
}

.erp-nav-subheading {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--erp-sidebar-section-label);
    padding: 0.4rem 0.85rem 0.15rem 1.6rem;
}

/* Sidebar collapsed (icon-only mode) overrides */
body.erp-sidebar-collapsed .erp-nav-group-toggle {
    padding: 0.55rem;
    justify-content: center;
    width: calc(100% - 0.8rem);
    margin: 1px 0.4rem;
}

body.erp-sidebar-collapsed .erp-nav-group-label,
body.erp-sidebar-collapsed .erp-nav-group-chevron,
body.erp-sidebar-collapsed .erp-nav-subheading {
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
    display: none;
}

body.erp-sidebar-collapsed .erp-nav-group-icon {
    margin: 0;
}

body.erp-sidebar-collapsed .erp-nav-collapse {
    padding-left: 0;
}

body.erp-sidebar-collapsed .erp-nav-collapse .erp-nav-link--top {
    padding: 0.55rem;
    justify-content: center;
    margin: 1px 0.4rem;
}

/* ──────────────────────────────────────────────────────────
   SIDEBAR — collapse button (BOTTOM)
   ────────────────────────────────────────────────────────── */
.erp-sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    border: none;
    background: transparent;
    color: var(--erp-sidebar-muted);
    width: 100%;
    cursor: pointer;
    font-size: 0.845rem;
    transition: color 0.15s, background 0.15s;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.erp-sidebar-collapse-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }

.erp-collapse-label {
    opacity: 1;
    transition: opacity var(--erp-sidebar-t);
}

body.erp-sidebar-collapsed .erp-sidebar-collapse-btn { padding: 0.75rem; justify-content: center; }
body.erp-sidebar-collapsed .erp-collapse-label { opacity: 0; width: 0; overflow: hidden; }

/* mobile overlay */
.erp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 24;
    backdrop-filter: blur(2px);
}

/* ──────────────────────────────────────────────────────────
   TOPBAR
   ────────────────────────────────────────────────────────── */
.erp-topbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--erp-border);
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 60px;
    box-shadow: 0 1px 4px rgba(15,28,46,0.06);
    flex-shrink: 0;
}

/* hamburger */
.erp-sidebar-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    background: transparent;
    color: var(--erp-muted);
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.15s, color 0.15s;
}
.erp-sidebar-toggle:hover { background: var(--erp-surface); color: var(--erp-text); }

/* search — dominant center element */
.erp-topbar-search {
    flex: 1 1 auto;
    position: relative;
    max-width: 540px;
    margin: 0 0.5rem;
}

.erp-topbar-search input {
    width: 100%;
    padding: 0.38rem 0.9rem 0.38rem 2.25rem;
    border: 1px solid var(--erp-border);
    border-radius: 24px;
    font-size: 0.845rem;
    background: var(--erp-surface);
    color: var(--erp-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.erp-topbar-search input:focus {
    border-color: var(--erp-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.erp-topbar-search input::placeholder { color: #9ca3af; }

.erp-topbar-search > i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.85rem;
    pointer-events: none;
}

/* right spacer (pushes actions to right) */
.erp-topbar-spacer { flex: 1 1 auto; }

/* actions group */
.erp-topbar-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }

/* icon buttons */
.erp-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--erp-border);
    border-radius: 9px;
    background: #fff;
    color: var(--erp-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}

.erp-icon-btn:hover { background: var(--erp-surface); color: var(--erp-accent); border-color: rgba(59,130,246,0.3); }

/* alias for older class name */
.erp-notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--erp-border); border-radius: 9px; background: #fff; color: var(--erp-muted); font-size: 1rem; cursor: pointer; transition: background 0.15s, color 0.15s; text-decoration: none; flex-shrink: 0; }
.erp-notif-btn:hover { background: var(--erp-surface); color: var(--erp-accent); }

/* badges */
.erp-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
    pointer-events: none;
    line-height: 1;
}

.erp-badge--yellow { background: #f59e0b; }
.erp-badge--green  { background: #16a34a; }

/* user menu */
.erp-user-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid var(--erp-border) !important;
    background: #fff !important;
    border-radius: 10px !important;
    padding: 0.28rem 0.65rem 0.28rem 0.4rem !important;
    transition: background 0.15s, border-color 0.15s !important;
}

.erp-user-btn:hover, .erp-user-btn:focus { background: var(--erp-surface) !important; border-color: rgba(59,130,246,0.3) !important; }

.erp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d3250 0%, #0d1b2e 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid rgba(59,130,246,0.25);
}

.erp-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.erp-user-name { font-size: 0.82rem; font-weight: 600; color: var(--erp-text); }
.erp-user-role { font-size: 0.68rem; color: var(--erp-muted); }

.dropdown-menu { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow-lg); }
.dropdown-item { font-size: 0.85rem; padding: 0.45rem 0.9rem; border-radius: 6px; margin: 1px 4px; }
.dropdown-item:hover { background: var(--erp-surface); color: var(--erp-accent); }

/* dashboard topbar extras */
.db-date-range {
    display: inline-flex;
    align-items: center;
    font-size: 0.83rem;
    color: var(--erp-text-soft);
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    padding: 0.42rem 0.75rem;
    white-space: nowrap;
}

.db-refresh-btn { font-size: 0.78rem; padding: 0.26rem 0.7rem; border-radius: 8px; }

/* ──────────────────────────────────────────────────────────
   BREADCRUMB
   ────────────────────────────────────────────────────────── */
.erp-breadcrumb-bar {
    padding: 0.55rem 1.5rem;
    background: transparent;
    font-size: 0.8rem;
}

.breadcrumb {
    margin: 0;
    font-size: 0.8rem;
    --bs-breadcrumb-divider: '›';
}

.breadcrumb-item + .breadcrumb-item::before { color: #9ca3af; }
.breadcrumb-item a { color: var(--erp-accent); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--erp-muted); }

/* ──────────────────────────────────────────────────────────
   PAGE HEADER — icon circle + title + subtitle pattern
   (matches reference screenshot)
   ────────────────────────────────────────────────────────── */
.erp-ph {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.erp-ph-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.erp-ph-icon--blue   { background: #dbeafe; color: #2563eb; }
.erp-ph-icon--purple { background: #ede9fe; color: #7c3aed; }
.erp-ph-icon--green  { background: #dcfce7; color: #16a34a; }
.erp-ph-icon--orange { background: #ffedd5; color: #ea580c; }
.erp-ph-icon--teal   { background: #ccfbf1; color: #0d9488; }
.erp-ph-icon--indigo { background: #e0e7ff; color: #4338ca; }
.erp-ph-icon--red    { background: #fee2e2; color: #dc2626; }

.erp-ph-body { flex: 1; min-width: 0; }
.erp-ph-body h1, .erp-ph-body h2 { font-size: 1.55rem; font-weight: 700; color: var(--erp-navy); margin: 0 0 0.18rem; line-height: 1.2; }
.erp-ph-body p { color: var(--erp-muted); font-size: 0.858rem; margin: 0; }

/* generic page header (existing views use d-flex + h4) */
.erp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.erp-page-header h2, .erp-page-header h4 { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--erp-navy); }

/* styled existing d-flex + h4 patterns from views */
.d-flex.justify-content-between.align-items-center.mb-3 h4.mb-0,
.d-flex.justify-content-between.align-items-center h4.mb-0 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--erp-navy);
}

/* ──────────────────────────────────────────────────────────
   FORM SECTION TAB HEADER  (blue underline accent)
   ────────────────────────────────────────────────────────── */
.erp-section-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--erp-navy);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--erp-accent);
    margin-bottom: 1.25rem;
}

.erp-section-tab i { color: var(--erp-accent); font-size: 1rem; }

/* ──────────────────────────────────────────────────────────
   INPUT WITH PREFIX ICON
   ────────────────────────────────────────────────────────── */
.erp-ifield {
    position: relative;
}

.erp-ifield > i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.erp-ifield .form-control,
.erp-ifield .form-select {
    padding-left: 2.3rem;
}

/* ──────────────────────────────────────────────────────────
   INFO / TIPS CARDS  (right sidebar pattern)
   ────────────────────────────────────────────────────────── */
.erp-info-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--erp-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.erp-info-card .erp-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.erp-info-card h6 { color: #1e40af; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.3rem; }
.erp-info-card p  { color: #1d4ed8; font-size: 0.8rem; margin: 0; line-height: 1.5; }

.erp-tips-card {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--erp-radius);
    padding: 1rem;
}

.erp-tips-card .erp-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.erp-tips-card h6 { color: #92400e; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.55rem; }

.erp-tips-card ul { list-style: none; padding: 0; margin: 0; }

.erp-tips-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #78350f;
    padding: 0.18rem 0;
    line-height: 1.4;
}

.erp-tips-card ul li i { color: #16a34a; font-size: 0.82rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ──────────────────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow-sm);
    background: #fff;
}

.card.shadow-sm { box-shadow: var(--erp-shadow-sm) !important; }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--erp-border);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--erp-navy);
    border-radius: var(--erp-radius) var(--erp-radius) 0 0 !important;
    padding: 0.85rem 1.1rem;
}

.erp-card { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow-sm); background: #fff; }

/* stat cards */
.erp-stat-card {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    background: #fff;
    box-shadow: var(--erp-shadow-sm);
    transition: box-shadow 0.18s, transform 0.18s;
    overflow: hidden;
}

.erp-stat-card:hover { box-shadow: var(--erp-shadow-lg); transform: translateY(-2px); }
.erp-stat-card .card-body { display: flex; flex-direction: column; gap: 0.12rem; padding: 1.15rem 1.2rem; }

.erp-stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--erp-muted); font-weight: 600; }
.erp-stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; color: var(--erp-navy); }
.erp-stat-hint  { font-size: 0.74rem; color: var(--erp-muted); }

.erp-stat-card--success { border-left: 3px solid #22c55e; }
.erp-stat-card--warning { border-left: 3px solid #f59e0b; }
.erp-stat-card--danger  { border-left: 3px solid #ef4444; }
.erp-stat-card--info    { border-left: 3px solid #06b6d4; }
.erp-stat-card--primary { border-left: 3px solid var(--erp-accent); }

/* ──────────────────────────────────────────────────────────
   TABLES
   ────────────────────────────────────────────────────────── */
.table { font-size: 0.875rem; }

/* override table-dark to use ERP navy */
.table-dark, .table-dark thead, .table > thead.table-dark {
    --bs-table-bg: var(--erp-navy);
    --bs-table-color: rgba(255,255,255,0.88);
}

.table th {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--erp-muted);
    border-bottom: 2px solid var(--erp-border);
    background: #f8fafc;
    white-space: nowrap;
    vertical-align: middle;
}

/* table-dark thead keeps navy */
thead.table-dark th,
.table-dark > thead > tr > th {
    color: rgba(255,255,255,0.72) !important;
    background: var(--erp-navy) !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.table-hover > tbody > tr:hover > td { background-color: #f0f5ff; }
.table td { vertical-align: middle; border-color: var(--erp-border); }

.erp-table-actions { display: flex; align-items: center; gap: 0.3rem; }
.erp-table-actions .btn, td .btn { padding: 0.22rem 0.45rem; font-size: 0.8rem; }

/* ──────────────────────────────────────────────────────────
   BADGES
   ────────────────────────────────────────────────────────── */
.badge { font-size: 0.7rem; font-weight: 600; padding: 0.3em 0.65em; border-radius: 5px; }

/* ──────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────── */
.btn { border-radius: 7px; font-size: 0.875rem; font-weight: 500; transition: all 0.15s; }
.btn-sm { border-radius: 6px; font-size: 0.8rem; }
.btn-lg { border-radius: 9px; }

.btn-primary { background: var(--erp-accent); border-color: var(--erp-accent); box-shadow: 0 1px 3px rgba(59,130,246,0.3); }
.btn-primary:hover { background: var(--erp-accent-dark); border-color: var(--erp-accent-dark); box-shadow: 0 2px 8px rgba(59,130,246,0.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline-secondary { color: var(--erp-muted); border-color: var(--erp-border); }
.btn-outline-secondary:hover { background: var(--erp-surface); color: var(--erp-text); border-color: var(--erp-border); }

/* ──────────────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────────────── */
.form-label { font-size: 0.82rem; font-weight: 600; color: #374151; margin-bottom: 0.28rem; }

.form-control, .form-select {
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.42rem 0.75rem;
    color: var(--erp-text);
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--erp-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    outline: none;
}

.form-control.input-validation-error { border-color: #ef4444; }
.field-validation-error { font-size: 0.77rem; color: #ef4444; }

.form-section {
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    padding: 1.2rem 1.35rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--erp-shadow-sm);
}

.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--erp-muted);
    margin: 0 0 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--erp-border);
}

.erp-required::after { content: " *"; color: #ef4444; }

/* ──────────────────────────────────────────────────────────
   DETAIL LIST
   ────────────────────────────────────────────────────────── */
.erp-detail-list { display: grid; grid-template-columns: 155px 1fr; gap: 0.45rem 1rem; margin: 0; }
.erp-detail-list dt { font-weight: 600; font-size: 0.8rem; color: var(--erp-muted); }
.erp-detail-list dd { margin: 0; font-size: 0.875rem; }

/* card sub-heading + row-based definition list used on Details pages
   (e.g. <h6 class="erp-card-label"> + <dl class="row erp-dl">) */
.erp-card-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--erp-muted);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--erp-border);
}

.erp-dl dt { font-weight: 600; font-size: 0.82rem; color: var(--erp-muted); margin-bottom: 0.5rem; }
.erp-dl dd { font-size: 0.875rem; color: var(--erp-text); margin-bottom: 0.5rem; }

/* ──────────────────────────────────────────────────────────
   ALERTS
   ────────────────────────────────────────────────────────── */
.alert { border-radius: 9px; font-size: 0.875rem; border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.alert-success { background: #dcfce7; color: #166534; }
.alert-warning { background: #fef9c3; color: #854d0e; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ──────────────────────────────────────────────────────────
   MODALS
   ────────────────────────────────────────────────────────── */
.modal-content { border: none; border-radius: var(--erp-radius-lg); box-shadow: 0 10px 40px rgba(0,0,0,0.18); }
.modal-header  { border-bottom: 1px solid var(--erp-border); padding: 1rem 1.25rem; }
.modal-footer  { border-top: 1px solid var(--erp-border); padding: 0.85rem 1.25rem; }
.modal-title   { font-size: 1rem; font-weight: 700; color: var(--erp-navy); }

/* ──────────────────────────────────────────────────────────
   EMPTY STATE
   ────────────────────────────────────────────────────────── */
.erp-empty-state { max-width: 420px; margin: 3.5rem auto; text-align: center; color: var(--erp-muted); }
.erp-empty-state .erp-empty-icon { font-size: 2.8rem; margin-bottom: 1rem; opacity: 0.5; }
.erp-empty-state h2 { font-size: 1.1rem; margin-bottom: 0.45rem; color: var(--erp-navy); }
.erp-empty-state p  { color: var(--erp-muted); font-size: 0.875rem; }

/* ──────────────────────────────────────────────────────────
   FILTER BAR
   ────────────────────────────────────────────────────────── */
.erp-filter-bar {
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: flex-end;
    box-shadow: var(--erp-shadow-sm);
}

/* ──────────────────────────────────────────────────────────
   PAGINATION
   ────────────────────────────────────────────────────────── */
.pagination { --bs-pagination-font-size: 0.8rem; }
.page-link { border-color: var(--erp-border); color: var(--erp-accent); border-radius: 6px !important; margin: 0 1px; }
.page-item.active .page-link { background: var(--erp-accent); border-color: var(--erp-accent); }
.page-link:hover { background: var(--erp-surface); color: var(--erp-accent-dark); }

/* ──────────────────────────────────────────────────────────
   AUTH PAGES
   ────────────────────────────────────────────────────────── */
body.erp-auth-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b2e 0%, #1d3250 100%);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--erp-text);
}

.erp-auth-shell { display: flex; min-height: 100vh; align-items: stretch; justify-content: center; gap: 0; padding: 2rem 1rem; }

.erp-auth-panel { background: #fff; border-radius: 14px 0 0 14px; padding: 2.25rem; width: 100%; max-width: 420px; align-self: center; box-shadow: 0 8px 40px rgba(0,0,0,0.2); }
.erp-auth-aside { color: #dce6f5; padding: 2.5rem; max-width: 420px; align-self: center; }
.erp-auth-aside h2   { font-size: 1.3rem; margin-bottom: 0.75rem; color: #fff; }
.erp-auth-aside ul   { padding-left: 1.1rem; font-size: 0.875rem; }
.erp-auth-aside li   { margin-bottom: 0.35rem; }

.erp-auth-title      { font-size: 1.3rem; margin-bottom: 0.25rem; }
.erp-auth-subtitle   { font-size: 0.875rem; color: var(--erp-muted); margin-bottom: 1.5rem; }
.erp-auth-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 0 1.25rem; }
.erp-auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.erp-auth-brand strong { font-size: 1rem; color: var(--erp-navy); }
.erp-auth-brand small  { font-size: 0.75rem; color: var(--erp-muted); }
.erp-auth-panel .erp-brand-mark { background: linear-gradient(135deg, #1d3250 0%, #0d1b2e 100%); box-shadow: none; }

.erp-validation-summary.validation-summary-valid,
.erp-validation-summary:empty { display: none; }
.erp-validation-summary ul { margin: 0; padding-left: 1.1rem; }

/* ──────────────────────────────────────────────────────────
   DASHBOARD
   ────────────────────────────────────────────────────────── */
.db-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
.db-header-title { font-size: 1.5rem; font-weight: 700; color: var(--erp-navy); margin: 0 0 0.2rem; line-height: 1.2; }
.db-header-subtitle { font-size: 0.858rem; color: var(--erp-muted); margin: 0; }
.db-header-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

.db-kpi-card { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow-sm); transition: box-shadow 0.18s, transform 0.18s; overflow: hidden; }
.db-kpi-card:hover { box-shadow: var(--erp-shadow-lg); transform: translateY(-2px); }
.db-kpi-card .card-body { padding: 1rem 1.1rem; }

.db-kpi-label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--erp-muted); margin-bottom: 0.2rem; }
.db-kpi-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--erp-navy); line-height: 1.1; margin-bottom: 0.28rem; }
.db-kpi-value--sm { font-size: 1.3rem; }

.db-kpi-trend { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.71rem; font-weight: 600; }
.db-kpi-trend.up   { color: #16a34a; }
.db-kpi-trend.down { color: #dc2626; }
.db-kpi-trend.flat { color: #64748b; }

.db-kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 11px; font-size: 1.2rem; flex-shrink: 0; }

.db-chart-card { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow-sm); }
.db-chart-card .card-header { background: #fff; border-bottom: 1px solid var(--erp-border); padding: 0.85rem 1.1rem; font-size: 0.92rem; }

.db-filter-pill { display: inline-flex; align-items: center; font-size: 0.76rem; font-weight: 500; color: var(--erp-muted); background: var(--erp-surface); border: 1px solid var(--erp-border); border-radius: 20px; padding: 0.18rem 0.65rem; cursor: pointer; user-select: none; transition: border-color 0.15s, color 0.15s; }
.db-filter-pill:hover { border-color: var(--erp-accent); color: var(--erp-accent); }

.db-chart-canvas-wrap { position: relative; height: 220px; }
.db-donut-canvas-wrap { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.db-property-cell { max-width: 140px; }

.db-chart-legend { display: flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--erp-muted); }
.db-legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.db-legend-dot.db-dot-blue   { background: #2196f3; }
.db-legend-dot.db-dot-green  { background: #22c55e; }
.db-legend-dot.db-dot-amber  { background: #f59e0b; }
.db-legend-dot.db-dot-purple { background: #8b5cf6; }

.db-donut-legend { display: flex; flex-direction: column; gap: 0.8rem; }
.db-donut-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--erp-text); }
.db-donut-legend-item strong { margin-left: auto; white-space: nowrap; font-weight: 600; color: var(--erp-navy); }

.db-table-card { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow-sm); }
.db-table-card .card-header { background: #fff; border-bottom: 1px solid var(--erp-border); padding: 0.85rem 1.1rem; font-size: 0.92rem; }

.db-view-all-link { font-size: 0.76rem; font-weight: 500; color: var(--erp-accent); text-decoration: none; }
.db-view-all-link:hover { text-decoration: underline; }

.db-recent-table { font-size: 0.8rem; margin: 0; }
.db-recent-table thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.055em; font-weight: 700; color: var(--erp-muted); background: #f8fafc; border-bottom: 1px solid var(--erp-border); padding: 0.6rem 0.85rem; white-space: nowrap; }
.db-recent-table tbody td { padding: 0.5rem 0.85rem; vertical-align: middle; border-color: var(--erp-border); }

.db-ref-link { color: var(--erp-accent); text-decoration: none; font-weight: 600; font-size: 0.78rem; }
.db-ref-link:hover { text-decoration: underline; }

.db-status-badge { display: inline-block; font-size: 0.68rem; font-weight: 600; border-radius: 5px; padding: 0.22em 0.65em; white-space: nowrap; }
.db-status-approved  { background: #dcfce7; color: #15803d; }
.db-status-pending   { background: #fef9c3; color: #a16207; }
.db-status-reserved  { background: #cffafe; color: #0e7490; }
.db-status-rejected  { background: #fee2e2; color: #b91c1c; }
.db-status-cancelled { background: #fee2e2; color: #b91c1c; }
.db-status-paid      { background: #dcfce7; color: #15803d; }
.db-status-partial   { background: #fff7ed; color: #c2410c; }

.db-quick-card { border: 1px solid var(--erp-border); border-radius: var(--erp-radius); background: #fff; box-shadow: var(--erp-shadow-sm); }
.db-quick-card .card-header { background: #fff; border-bottom: 1px solid var(--erp-border); padding: 0.85rem 1.1rem; font-size: 0.92rem; }
.db-quick-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 0.25rem 0; }
.db-quick-btn { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--erp-text); font-size: 0.73rem; font-weight: 500; min-width: 76px; text-align: center; transition: transform 0.15s, color 0.15s; }
.db-quick-btn:hover { transform: translateY(-2px); color: var(--erp-accent); }
.db-quick-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 13px; font-size: 1.25rem; transition: box-shadow 0.15s; }
.db-quick-btn:hover .db-quick-icon { box-shadow: 0 4px 12px rgba(0,0,0,0.14); }

/* icon color variants — used instead of inline style="" so nothing trips the style-src CSP */
.db-icon-blue   { background: #e8f4fd; color: #2196f3; }
.db-icon-green  { background: #e8f8f0; color: #22c55e; }
.db-icon-amber  { background: #fff8e1; color: #f59e0b; }
.db-icon-purple { background: #f0eeff; color: #8b5cf6; }
.db-icon-sky    { background: #e8f4fd; color: #0ea5e9; }
.db-icon-cyan   { background: #e0f2fe; color: #0ea5e9; }
.db-icon-red    { background: #fee2e2; color: #ef4444; }
.db-icon-teal   { background: #ccfbf1; color: #0d9488; }

/* ──────────────────────────────────────────────────────────
   CHECKLISTS / UTILITY
   ────────────────────────────────────────────────────────── */
.erp-checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.erp-checklist li { padding: 0.25rem 0 0.25rem 1.6rem; position: relative; font-size: 0.875rem; }
.erp-checklist li::before { position: absolute; left: 0; font-weight: 700; }
.erp-checklist li.done::before    { content: "✓"; color: #22c55e; }
.erp-checklist li.pending::before { content: "•"; color: #adb5bd; }
.erp-checklist li.pending { color: var(--erp-muted); }

.fw-600 { font-weight: 600; }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .erp-sidebar {
        position: fixed;
        z-index: 30;
        left: calc(-1 * var(--erp-sidebar-width));
        transition: left var(--erp-sidebar-t);
    }

    body.erp-sidebar-open .erp-sidebar { left: 0; }
    body.erp-sidebar-open .erp-sidebar-overlay { display: block; }
    body.erp-sidebar-collapsed .erp-sidebar { width: var(--erp-sidebar-width); flex-basis: var(--erp-sidebar-width); }

    .erp-auth-aside { display: none; }
    .erp-auth-panel { border-radius: 14px; }
}

@media (max-width: 767.98px) {
    .erp-topbar-search { max-width: 100%; }
}

@media (max-width: 575.98px) {
    .erp-content { padding: 1rem; }
    .erp-topbar  { padding: 0.5rem 0.9rem; }
}

/* ──────────────────────────────────────────────────────────
   PRINT
   ────────────────────────────────────────────────────────── */
/* ──────────────────────────────────────────────────────────
   CUSTOM MULTISELECT COMPONENT
   ────────────────────────────────────────────────────────── */
.erp-ms-wrapper {
    width: 100%;
}
.erp-ms-btn {
    min-height: 42px;
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    position: relative;
    background-color: #fff;
}
.erp-ms-btn::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}
.erp-ms-tag {
    background-color: #e5e7eb;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}
.erp-ms-tag .erp-ms-remove {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: #9ca3af;
    transition: color 0.15s;
}
.erp-ms-tag .erp-ms-remove:hover {
    color: #dc2626;
}
.erp-ms-menu {
    width: 100%;
    min-width: 250px;
}
.erp-ms-item {
    border-radius: 4px;
    padding-left: 2rem !important;
}
.erp-ms-item:hover {
    background-color: var(--erp-surface);
}

/* ──────────────────────────────────────────────────────────
   DATATABLES — Premium ERP Visual Styling
   ────────────────────────────────────────────────────────── */
.dataTables_wrapper {
    position: relative;
    clear: both;
    width: 100%;
}

/* Ensure seamless ERP card integration without awkward scroll clipping */
.erp-card .table-responsive {
    overflow-x: auto;
    border-radius: var(--erp-radius);
}

.dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-items: center;
}

.dataTables_wrapper .row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 1. Header Toolbar (Show entries dropdown & Search bar) */
.dataTables_wrapper > .row:first-child {
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--erp-border-light);
    background: #ffffff;
    border-top-left-radius: var(--erp-radius);
    border-top-right-radius: var(--erp-radius);
}

/* Length menu (Show entries) */
.dataTables_wrapper .dataTables_length {
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--erp-muted);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_length .form-select {
    display: inline-block;
    width: auto;
    min-width: 72px;
    height: 38px;
    padding: 0.35rem 2rem 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--erp-navy);
    background-color: #f8fafc;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_length select:hover,
.dataTables_wrapper .dataTables_length .form-select:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_length .form-select:focus {
    background-color: #ffffff;
    border-color: var(--erp-accent);
    box-shadow: 0 0 0 3px var(--erp-accent-glow);
    outline: none;
}

/* 2. Search Bar */
.dataTables_wrapper .dataTables_filter {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin-bottom: 0;
    font-size: 0; /* Hides raw 'Search:' text cleanly */
    color: transparent;
    width: auto;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter .form-control {
    display: inline-block;
    width: 250px !important;
    height: 38px;
    padding: 0.45rem 1.15rem 0.45rem 2.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--erp-text);
    background-color: #f8fafc;
    border: 1px solid var(--erp-border);
    border-radius: 20px; /* Modern pill shape */
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.9rem center;
    background-size: 15px 15px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.dataTables_wrapper .dataTables_filter input::placeholder,
.dataTables_wrapper .dataTables_filter .form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.dataTables_wrapper .dataTables_filter input:hover,
.dataTables_wrapper .dataTables_filter .form-control:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_filter .form-control:focus {
    width: 290px !important;
    background-color: #ffffff;
    border-color: var(--erp-accent);
    box-shadow: 0 0 0 3px var(--erp-accent-glow), 0 2px 6px rgba(15, 23, 42, 0.05);
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%233b82f6' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
}

/* 3. Table area within wrapper */
.dataTables_wrapper table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.dataTables_wrapper table.dataTable thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border-bottom: 2px solid var(--erp-border);
    padding: 0.8rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--erp-border-light);
    color: var(--erp-text);
}

.dataTables_wrapper table.dataTable.table-hover tbody tr:hover td {
    background-color: #f1f5fb;
}

/* Sorting Indicators */
table.dataTable > thead > tr > th.sorting,
table.dataTable > thead > tr > th.sorting_asc,
table.dataTable > thead > tr > th.sorting_desc {
    padding-right: 1.85rem !important;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}

table.dataTable > thead > tr > th.sorting:hover {
    background-color: #f1f5fb;
    color: var(--erp-navy);
}

table.dataTable > thead > tr > th.sorting_asc,
table.dataTable > thead > tr > th.sorting_desc {
    background-color: #edf4ff;
    color: var(--erp-accent-dark);
}

/* 4. Footer Toolbar (Showing info & Pagination) */
.dataTables_wrapper > .row:last-child {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--erp-border-light);
    background: #fafbfc;
    border-bottom-left-radius: var(--erp-radius);
    border-bottom-right-radius: var(--erp-radius);
}

/* Showing info text */
.dataTables_wrapper .dataTables_info {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--erp-muted);
    padding: 0.35rem 0 !important;
}

/* Pagination container */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dataTables_wrapper .dataTables_paginate .page-item {
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid var(--erp-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    user-select: none;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #edf4ff !important;
    border-color: #93c5fd !important;
    color: var(--erp-accent-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: linear-gradient(135deg, var(--erp-accent) 0%, var(--erp-accent-dark) 100%) !important;
    border-color: var(--erp-accent-dark) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    cursor: default;
    transform: none;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.dataTables_wrapper .dataTables_paginate .page-item.previous .page-link,
.dataTables_wrapper .dataTables_paginate .page-item.next .page-link {
    font-weight: 500;
    padding: 0.35rem 0.85rem;
}

/* Fallback for standalone paginate buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0.35rem 0.75rem;
    margin: 0 0.15rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155 !important;
    background: #ffffff !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: #edf4ff !important;
    border-color: #93c5fd !important;
    color: var(--erp-accent-dark) !important;
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--erp-accent) 0%, var(--erp-accent-dark) 100%) !important;
    border-color: var(--erp-accent-dark) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    cursor: default;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

/* 5. Responsive mobile wrapping */
@media (max-width: 767.98px) {
    .dataTables_wrapper > .row:first-child,
    .dataTables_wrapper > .row:last-child {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_filter .form-control {
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_filter input:focus,
    .dataTables_wrapper .dataTables_filter .form-control:focus {
        width: 100% !important;
    }
}

@media print {
    .erp-sidebar, .erp-topbar, .erp-sidebar-overlay, .erp-footer, .no-print { display: none !important; }
    .erp-main { margin: 0 !important; }
    .erp-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { background: #fff !important; }
    .table { font-size: 0.8rem; }
}

/* ── Recovery slip (Payment & Recovery → Receive Payment) ─────────────────── */
.erp-slip-sheet { max-width: 880px; }
.erp-slip {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    padding: 1.5rem 1.75rem;
    font-size: .9rem;
}
.erp-slip-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid #212529;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
}
.erp-slip-org { font-size: 1.15rem; font-weight: 700; }
.erp-slip-title { font-weight: 600; color: #495057; }
.erp-slip-copy {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid #adb5bd;
    border-radius: .25rem;
    padding: .05rem .4rem;
    margin-bottom: .25rem;
}
.erp-slip-muted { color: #6c757d; font-size: .78rem; margin-right: .35rem; }
.erp-slip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem 1.5rem;
    margin-bottom: 1rem;
}
.erp-slip-grid > div { display: flex; justify-content: space-between; border-bottom: 1px dotted #ced4da; padding: .15rem 0; }
.erp-slip-table { width: 100%; border-collapse: collapse; margin-bottom: .75rem; }
.erp-slip-table th, .erp-slip-table td { border: 1px solid #dee2e6; padding: .35rem .5rem; }
.erp-slip-table thead th { background: #f1f3f5; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.erp-slip-table tfoot td { font-weight: 700; background: #f8f9fa; }
.erp-slip-words { font-style: italic; margin-bottom: .75rem; }
.erp-slip-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .75rem;
}
.erp-slip-totals > div { border: 1px solid #dee2e6; border-radius: .35rem; padding: .4rem .6rem; display: flex; flex-direction: column; }
.erp-slip-balance { background: #fff5f5; border-color: #f1aeb5 !important; }
.erp-slip-remarks { margin-bottom: .75rem; }
.erp-slip-foot {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1.5rem;
    align-items: end;
    margin-top: 2.25rem;
    font-size: .8rem;
}
.erp-slip-sign { border-top: 1px solid #212529; text-align: center; padding-top: .25rem; }
.erp-slip-cut { border-top: 1px dashed #868e96; margin: 1.25rem 0; }

@media (max-width: 576px) {
    .erp-slip-grid, .erp-slip-totals, .erp-slip-foot { grid-template-columns: 1fr; }
}

@media print {
    .erp-breadcrumb-bar, .erp-ph .ms-auto { display: none !important; }
    .erp-slip-sheet { max-width: none; }
    .erp-slip { border: none; padding: 0; font-size: 10.5pt; page-break-inside: avoid; }
    .erp-slip-table thead th, .erp-slip-table tfoot td, .erp-slip-balance { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .erp-slip-foot { margin-top: 1.5rem; }
}

/* ── Sale agreement form (Sale Agreement → Print) ─────────────────────────── */
.erp-agr-sheet {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    border: 1px solid #dee2e6;
    margin: 0 auto;
    padding: 14mm;
    color: #1f2a44;
    font-size: 10.5pt;
    box-sizing: border-box;
}
.erp-agr-head { display: flex; align-items: center; gap: 1rem; }
.erp-agr-mark {
    width: 22mm; height: 22mm; flex: none;
    border: 2px solid #1f2a44; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20pt; font-weight: 800;
}
.erp-agr-title { flex: 1; font-size: 24pt; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.erp-agr-photo {
    width: 33mm; height: 40mm; flex: none;
    border: 1px solid #1f2a44;
    display: flex; align-items: center; justify-content: center;
    color: #adb5bd; overflow: hidden;
}
.erp-agr-photo img { width: 100%; height: 100%; object-fit: cover; }
.erp-agr-meta { display: flex; justify-content: space-between; margin: 4mm 0; }
.erp-agr-box { border: 1px solid #1f2a44; margin-bottom: 4mm; }
.erp-agr-box > h3 {
    margin: 0; padding: 1.2mm 3mm;
    background: #1f2a44; color: #fff;
    font-size: 10.5pt; font-weight: 700;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.erp-agr-box dl { display: grid; grid-template-columns: 52mm 1fr; margin: 0; padding: 2mm 3mm; row-gap: 1.5mm; }
.erp-agr-box dt { font-weight: 700; }
.erp-agr-box dd { margin: 0; border-bottom: .5px solid #ced4da; min-height: 5mm; }
.erp-agr-box p { margin: 0; padding: 3mm; }
.erp-agr-note { font-size: 9pt; font-style: italic; }
.erp-agr-code { text-align: center; margin: 4mm 0; font-size: 9pt; }
.erp-agr-code svg { width: 60mm; height: 12mm; display: block; margin: 0 auto 1mm; }
.erp-agr-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; margin-top: 18mm; }
.erp-agr-signs > div { border-top: 1px solid #1f2a44; padding-top: 1mm; text-align: center; font-weight: 700; }
.erp-agr-sheet.is-letterhead .erp-agr-head > :not(.erp-agr-photo),
.erp-agr-sheet.is-letterhead .erp-agr-note,
.erp-agr-sheet.is-letterhead .erp-agr-signs > div:not(:first-child) { visibility: hidden; }

@media print {
    .erp-agr-sheet { border: none; margin: 0; }
}

/* ──────────────────────────────────────────────────────────
   LIVE CAMERA — Modal & Photo Preview
   ────────────────────────────────────────────────────────── */

/* Take Photo button beside the file input */
.erp-camera-btn {
    white-space: nowrap;
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-color: var(--erp-accent);
    color: var(--erp-accent);
    font-weight: 500;
    transition: all 0.18s;
}
.erp-camera-btn:hover {
    background: var(--erp-accent);
    border-color: var(--erp-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

/* Photo preview thumbnail with remove button */
.erp-photo-preview-wrap {
    position: relative;
    display: inline-block;
}
.erp-photo-preview-wrap img {
    max-height: 140px;
    max-width: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--erp-shadow-sm);
}
.erp-photo-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: all 0.15s;
}
.erp-photo-remove-btn:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
    transform: scale(1.1);
}

/* Modal overrides */
.erp-camera-modal-content {
    overflow: hidden;
    border: none;
    border-radius: var(--erp-radius-lg);
    box-shadow: 0 12px 48px rgba(0,0,0,0.22);
}

.erp-camera-modal-header {
    background: var(--erp-navy);
    color: #fff;
    border-bottom: none;
    padding: 0.85rem 1.25rem;
}
.erp-camera-modal-header .modal-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}
.erp-camera-modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Viewport: video / captured image container */
.erp-camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0f18;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.erp-camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Captured photo overlay */
.erp-camera-captured-overlay {
    position: absolute;
    inset: 0;
    background: #0a0f18;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: erpCameraFadeIn 0.25s ease;
}
.erp-camera-captured-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes erpCameraFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Loading spinner */
.erp-camera-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10,15,24,0.85);
    z-index: 2;
}

/* Status / error banner */
.erp-camera-status-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    background: #fef9c3;
    color: #854d0e;
    font-size: 0.82rem;
    font-weight: 500;
    border-bottom: 1px solid #fde68a;
}

/* Footer actions */
.erp-camera-modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--erp-border);
    padding: 0.75rem 1.25rem;
}
.erp-camera-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
}

/* Capture button pulse effect */
.erp-capture-btn:not(:disabled) {
    position: relative;
    overflow: hidden;
}
.erp-capture-btn:not(:disabled)::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(59,130,246,0.45);
    animation: erpCapturePulse 2s ease-in-out infinite;
}

@keyframes erpCapturePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.45); }
    50%      { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .erp-camera-viewport { aspect-ratio: 4 / 3; }
    .erp-camera-actions { flex-direction: column; }
    .erp-camera-actions .btn { width: 100%; }
    .erp-camera-btn { width: 100%; justify-content: center; margin-top: 0.35rem; }
}

