/* DHRUBO Reseller Panel — design system (light UI, navy sidebar, orange accent) */
:root {
  --dh-navy: #0b1f4b;
  --dh-navy-2: #0a1a3d;
  --dh-navy-3: #13306b;
  --dh-orange: #d9822b;
  --dh-orange-2: #f09a3e;
  --dh-blue: #1e88ff;
  --dh-bg: #f3f6fb;
  --dh-card: #ffffff;
  --dh-line: #e4e9f2;
  --dh-text: #1b2742;
  --dh-muted: #6b7a99;
  --dh-radius: 14px;
  --dh-sidebar-w: 262px;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--dh-text);
  --bs-primary: #1e6fe0;
  --bs-primary-rgb: 30, 111, 224;
  --bs-link-color: #1e6fe0;
  --bs-border-color: var(--dh-line);
}
html { scroll-behavior: smooth; }
body.dh-app { background: var(--dh-bg); font-size: 14px; color: var(--dh-text); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(30, 136, 255, .55); outline-offset: 2px; border-radius: 6px; }
.btn-primary { --bs-btn-bg: #1e6fe0; --bs-btn-border-color: #1e6fe0; --bs-btn-hover-bg: #1759b8; --bs-btn-hover-border-color: #1759b8; --bs-btn-active-bg: #1759b8; }
.btn-accent { background: var(--dh-orange); color: #fff; border: 0; }
.btn-accent:hover { background: #bf7220; color: #fff; }
.badge-soft { font-weight: 600; padding: .38em .7em; border-radius: 20px; font-size: 11.5px; }

/* ---------------- sidebar */
.dh-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--dh-sidebar-w); background: linear-gradient(180deg, #0d2557 0%, #0a1a3d 100%); color: #cfd9f0; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease, width .25s ease; overflow: hidden; }
.dh-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.dh-brand:hover { text-decoration: none; }
.dh-brand-text strong { display: block; font-size: 22px; letter-spacing: .5px; line-height: 1; font-weight: 800; }
.dh-brand-text small { color: #b8c6e6; font-size: 14px; }
.dh-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.dh-nav-section { font-size: 10.5px; letter-spacing: 1.1px; color: #7f93bf; font-weight: 700; margin: 16px 8px 6px; text-transform: uppercase; }
.dh-nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #d5def3; font-weight: 500; transition: background .15s, color .15s; }
.dh-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.dh-nav-link > i:first-child { font-size: 16px; width: 20px; text-align: center; }
.dh-nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-chev { font-size: 11px !important; transition: transform .2s; opacity: .7; }
.dh-nav-item.open > .dh-nav-link .dh-chev { transform: rotate(90deg); }
.dh-nav-item.active > .dh-nav-link { background: linear-gradient(90deg, var(--dh-orange), var(--dh-orange-2)); color: #fff; box-shadow: 0 6px 16px rgba(217,130,43,.35); }
.dh-nav-badge { background: #ef4444; color: #fff; border-radius: 10px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.dh-sub { display: none; margin: 4px 0 6px 20px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
.dh-nav-item.open > .dh-sub { display: block; }
.dh-sub a { display: flex; align-items: center; padding: 6px 10px; color: #aebbdc; font-size: 13px; border-radius: 8px; }
.dh-sub a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.dh-sub a.active { color: #fff; background: rgba(217,130,43,.28); font-weight: 600; }
.dh-side-card { margin: 8px 14px; padding: 12px; border-radius: 12px; background: rgba(30,136,255,.12); border: 1px solid rgba(30,136,255,.3); display: flex; gap: 12px; align-items: center; color: #dbe7ff; }
.dh-side-card > i { font-size: 26px; color: #4aa3ff; }
.dh-side-card span { display: block; font-size: 12px; color: #9fb4de; }
.dh-side-card strong { display: block; color: #4aa3ff; font-size: 15px; line-height: 1.1; }
.dh-side-card small { font-size: 10.5px; color: #9fb4de; }
.dh-side-foot { padding: 10px 18px 14px; font-size: 11px; color: #7f93bf; }

/* collapsed sidebar (desktop) */
body.sidebar-collapsed .dh-sidebar { width: 72px; }
body.sidebar-collapsed .dh-main { margin-left: 72px; }
body.sidebar-collapsed .dh-brand-text, body.sidebar-collapsed .dh-nav-text, body.sidebar-collapsed .dh-chev, body.sidebar-collapsed .dh-nav-section, body.sidebar-collapsed .dh-side-card, body.sidebar-collapsed .dh-side-foot, body.sidebar-collapsed .dh-sub, body.sidebar-collapsed .dh-nav-badge { display: none !important; }
body.sidebar-collapsed .dh-nav-link { justify-content: center; }
body.sidebar-collapsed .dh-brand { justify-content: center; padding-inline: 0; }

/* ---------------- topbar & layout */
.dh-main { margin-left: var(--dh-sidebar-w); min-height: 100vh; transition: margin-left .25s ease; display: flex; flex-direction: column; }
.dh-topbar { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--dh-line); height: 62px; padding: 0 22px; display: flex; align-items: center; gap: 14px; }
.dh-icon-btn { background: none; border: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #44527a; font-size: 19px; }
.dh-icon-btn:hover { background: #eef2fa; text-decoration: none; }
.dh-dot { position: absolute; top: 2px; right: 0; background: #ef4444; color: #fff; border-radius: 10px; min-width: 17px; height: 17px; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.dh-search { position: relative; flex: 0 1 560px; width: 100%; }
.dh-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a97b5; }
.dh-search input { width: 100%; background: #f1f4fa; border: 1px solid transparent; border-radius: 12px; height: 42px; padding: 0 14px 0 40px; font-size: 14px; }
.dh-search input:focus { background: #fff; border-color: #9cc3ff; outline: none; box-shadow: 0 0 0 3px rgba(30,136,255,.15); }
.dh-search-results { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border: 1px solid var(--dh-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(11,31,75,.15); max-height: 420px; overflow: auto; z-index: 1050; }
.dh-search-results a { display: flex; gap: 10px; padding: 9px 14px; color: var(--dh-text); border-bottom: 1px solid #f0f2f8; align-items: baseline; }
.dh-search-results a:hover { background: #f5f8ff; text-decoration: none; }
.dh-search-results .t { font-size: 10.5px; text-transform: uppercase; color: #fff; background: #5b7bd6; border-radius: 6px; padding: 1px 7px; font-weight: 700; min-width: 78px; text-align: center; }
.dh-pill { background: #fff; border: 1px solid var(--dh-line); border-radius: 10px; height: 38px; padding: 0 14px; font-weight: 600; color: #2a3a63; }
.dh-user { display: flex; gap: 10px; align-items: center; background: none; border: 0; padding: 4px 8px; border-radius: 12px; }
.dh-user:hover { background: #eef2fa; }
.dh-user strong { display: block; font-size: 13px; line-height: 1.15; }
.dh-user small { display: block; font-size: 11px; color: var(--dh-muted); }
.dh-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1e88ff, #0a4fd6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.dh-notif { width: 340px; max-height: 430px; overflow: auto; }
.dh-content { padding: 22px 26px 40px; flex: 1; }
.dh-crumbs .breadcrumb { margin-bottom: 14px; font-size: 13px; }
.dh-backdrop { display: none; }

.dh-page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.dh-page-head h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.dh-page-head p { margin: 2px 0 0; color: var(--dh-muted); }
.dh-date-chip { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--dh-line); border-radius: 12px; padding: 8px 16px; }
.dh-date-chip i { font-size: 20px; color: #6b7a99; }
.dh-date-chip small { display: block; color: var(--dh-muted); line-height: 1; }
.dh-date-chip strong { font-size: 13px; }

/* ---------------- cards */
.dh-card { background: var(--dh-card); border: 1px solid var(--dh-line); border-radius: var(--dh-radius); box-shadow: 0 2px 10px rgba(11,31,75,.04); }
.dh-card-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 4px; }
.dh-card-h h2 { font-size: 16px; font-weight: 700; margin: 0; }
.dh-card-b { padding: 12px 18px 18px; }
.dh-kpi { border-radius: var(--dh-radius); padding: 14px; display: flex; gap: 12px; align-items: center; border: 1px solid transparent; height: 100%; color: inherit; transition: transform .15s, box-shadow .15s; }
a.dh-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,31,75,.1); text-decoration: none; }
.dh-kpi .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; flex: none; }
.dh-kpi { min-width: 0; } .dh-kpi > div:last-child { min-width: 0; } .dh-kpi .lbl { color: #44527a; font-size: 12.5px; line-height: 1.2; margin-bottom: 2px; }
.dh-kpi .val { font-size: 21px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.dh-kpi .trend { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend.up { color: #16a34a; } .trend.down { color: #dc2626; } .trend.flat { color: var(--dh-muted); }
.k-blue { background: #eaf3ff; border-color: #cfe3ff; } .k-blue .ic { background: #1e88ff; }
.k-green { background: #e9f9f1; border-color: #c9efdc; } .k-green .ic { background: #22b573; }
.k-orange { background: #fff4e6; border-color: #fde0b8; } .k-orange .ic { background: #f59e2b; }
.k-purple { background: #f1ecff; border-color: #dccfff; } .k-purple .ic { background: #8b5cf6; }
.k-teal { background: #e4f8f5; border-color: #bdeee6; } .k-teal .ic { background: #14b8a6; }
.k-red { background: #feeded; border-color: #fbcfcf; } .k-red .ic { background: #ef4444; }
.k-pink { background: #ffecef; border-color: #fdcdd5; } .k-pink .ic { background: #f43f5e; }
.k-cyan { background: #e6f7fb; border-color: #bfeaf3; } .k-cyan .ic { background: #06b6d4; }
.k-yellow { background: #fff8e1; border-color: #fbe7a1; } .k-yellow .ic { background: #f5b301; }

/* ---------------- tables & forms */
.table { --bs-table-bg: transparent; font-size: 13.5px; }
.table thead th { background: #f5f7fc; color: #4a5a80; font-weight: 600; font-size: 12px; text-transform: none; border-bottom: 1px solid var(--dh-line); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7f9ff; }
.dh-filter { background: #fff; border: 1px solid var(--dh-line); border-radius: var(--dh-radius); padding: 12px 16px; margin-bottom: 14px; }
.form-label { font-weight: 600; font-size: 12.5px; color: #3b4a70; margin-bottom: 4px; }
.form-control, .form-select { border-radius: 10px; border-color: #d6dcea; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: #77adff; box-shadow: 0 0 0 3px rgba(30,136,255,.15); }
.form-section { font-weight: 700; color: var(--dh-navy); border-bottom: 1px solid var(--dh-line); padding-bottom: 6px; margin: 22px 0 14px; display: flex; align-items: center; gap: 8px; }
.req::after { content: " *"; color: #dc2626; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; }
.dl-grid dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--dh-muted); font-weight: 700; margin: 0; }
.dl-grid dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.nav-tabs .nav-link { color: #51618a; font-weight: 600; border: 0; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: var(--dh-navy); border-bottom-color: var(--dh-orange); background: none; }
.timeline { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--dh-line); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--dh-blue); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--dh-blue); }
.empty { text-align: center; color: var(--dh-muted); padding: 34px 10px; }
.empty i { font-size: 34px; display: block; margin-bottom: 6px; opacity: .5; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pipeline .col-stage { background: #eef2fa; border-radius: 12px; padding: 10px; min-height: 160px; }
.pipeline .lead-card { background: #fff; border: 1px solid var(--dh-line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.cap-bar { height: 10px; border-radius: 8px; background: #e8edf7; overflow: hidden; }
.cap-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #22b573, #1e88ff); }
.line-items th { font-size: 11.5px; }
.line-items input, .line-items select { min-width: 90px; }
.approval-tile { display: flex; gap: 12px; align-items: center; border: 1px solid var(--dh-line); border-radius: 12px; padding: 12px 14px; background: #fff; color: inherit; }
.approval-tile:hover { background: #f8faff; text-decoration: none; }
.approval-tile .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.promo { background: linear-gradient(110deg, #0b3da3, #1e88ff); color: #fff; border-radius: var(--dh-radius); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.promo h3 { font-size: 20px; margin: 0 0 4px; font-weight: 800; }
.promo small { opacity: .85; }
.activity { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0f2f8; align-items: flex-start; }
.activity:last-child { border-bottom: 0; }
.activity .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 17px; }
.cal-item { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; position: relative; }
.cal-item .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.cal-item .tm { width: 62px; color: #51618a; font-size: 12.5px; flex: none; }

/* ---------------- auth */
.dh-auth-body { background: #eef2fa; min-height: 100vh; }
.dh-auth-wrap { display: flex; min-height: 100vh; }
.dh-auth-hero { flex: 1.1; background: radial-gradient(1200px 600px at 10% 0, #1d4fb5 0, transparent 60%), linear-gradient(160deg, #0b1f4b, #0a1a3d); color: #fff; align-items: center; padding: 60px; }
.dh-auth-hero h1 { font-size: 40px; font-weight: 800; margin: 22px 0 14px; letter-spacing: -.5px; }
.dh-auth-hero h1 span { display: block; font-weight: 400; color: #9fc2ff; font-size: 26px; }
.dh-auth-hero p { color: #c5d5f5; max-width: 480px; font-size: 16px; }
.dh-auth-hero ul { list-style: none; padding: 0; margin: 24px 0 0; color: #dbe7ff; }
.dh-auth-hero li { margin-bottom: 12px; font-size: 15px; } .dh-auth-hero li i { color: #4aa3ff; margin-right: 10px; }
.dh-auth-card-wrap { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 30px 16px; }
.dh-auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 18px; padding: 34px; box-shadow: 0 20px 60px rgba(11,31,75,.12); }
.dh-auth-card h2 { font-weight: 800; font-size: 24px; margin-bottom: 6px; }

@media (max-width: 991.98px) {
  .dh-sidebar { transform: translateX(-100%); width: 285px; }
  body.sidebar-open .dh-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.sidebar-open .dh-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,16,40,.5); z-index: 1035; }
  .dh-main, body.sidebar-collapsed .dh-main { margin-left: 0; }
  body.sidebar-collapsed .dh-sidebar { width: 285px; }
  body.sidebar-collapsed .dh-brand-text, body.sidebar-collapsed .dh-nav-text, body.sidebar-collapsed .dh-chev, body.sidebar-collapsed .dh-nav-section, body.sidebar-collapsed .dh-side-card, body.sidebar-collapsed .dh-side-foot { display: revert !important; }
  .dh-content { padding: 16px 14px 30px; }
  .dh-topbar { padding: 0 12px; gap: 8px; }
}
@media print {
  .dh-sidebar, .dh-topbar, .dh-filter, .no-print, .dh-crumbs, .btn { display: none !important; }
  .dh-main { margin: 0 !important; } .dh-content { padding: 0 !important; } .dh-card { box-shadow: none; border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: no-preference) {
  .dh-content > * { animation: dhFade .35s ease both; }
  .modal.fade .modal-dialog { transition: transform .22s ease-out; }
}
@keyframes dhFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.skeleton { background: linear-gradient(90deg, #eef1f7 25%, #f7f9fd 37%, #eef1f7 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; min-height: 16px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* promo banner (dashboard) */
.dh-banner { height: 100%; min-height: 110px; border-radius: var(--dh-radius); background: linear-gradient(120deg, #0b1f4b, #1d4fb5); color: #fff; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dh-banner h3 { font-size: 20px; font-weight: 800; margin: 0 0 6px; } .dh-banner small { color: #b9cdf2; }
