/* QTC Sales Portal — application styles (Bootstrap 5.3 based, responsive) */
:root {
    --qtc-sidebar-w: 260px;
    --qtc-topbar-h: 62px;
    --qtc-primary: #2f54eb;
    --qtc-primary-dark: #1d39c4;
    --qtc-sidebar-bg: #0f172a;
    --qtc-sidebar-fg: #cbd5e1;
    --qtc-body-bg: #f4f6fb;
    --bs-primary: var(--qtc-primary);
    --bs-primary-rgb: 47, 84, 235;
    --bs-link-color: var(--qtc-primary);
    --bs-link-color-rgb: 47, 84, 235;
    --bs-link-hover-color: var(--qtc-primary-dark);
    --bs-body-font-size: 0.925rem;
}
html, body { height: 100%; }
body { background: var(--qtc-body-bg); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2937; }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--qtc-primary); --bs-btn-border-color: var(--qtc-primary); --bs-btn-hover-bg: var(--qtc-primary-dark); --bs-btn-hover-border-color: var(--qtc-primary-dark); --bs-btn-active-bg: var(--qtc-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--qtc-primary); --bs-btn-border-color: var(--qtc-primary); --bs-btn-hover-bg: var(--qtc-primary); --bs-btn-hover-border-color: var(--qtc-primary); }
.text-primary { color: var(--qtc-primary) !important; }
.bg-primary { background-color: var(--qtc-primary) !important; }
.form-control:focus, .form-select:focus { border-color: #9db0f7; box-shadow: 0 0 0 .2rem rgba(47,84,235,.15); }

/* ---------- Layout ---------- */
.qtc-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--qtc-sidebar-w); background: var(--qtc-sidebar-bg); color: var(--qtc-sidebar-fg); z-index: 1040; display: flex; flex-direction: column; overflow: hidden; }
.qtc-sidebar .brand { height: var(--qtc-topbar-h); display: flex; align-items: center; padding: 0 1.25rem; color: #fff; font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.06); gap: .6rem; }
.qtc-sidebar .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2f54eb, #7c3aed); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.qtc-sidebar .brand small { display: block; font-size: .68rem; font-weight: 500; color: #94a3b8; letter-spacing: .04em; }
.qtc-sidebar .nav-scroll { flex: 1; overflow-y: auto; padding: .75rem .75rem 1.5rem; }
.qtc-sidebar .nav-scroll::-webkit-scrollbar { width: 6px; } .qtc-sidebar .nav-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.qtc-sidebar .nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: .9rem .75rem .35rem; font-weight: 600; }
.qtc-sidebar .nav-link { color: var(--qtc-sidebar-fg); border-radius: .5rem; padding: .55rem .75rem; display: flex; align-items: center; gap: .65rem; font-size: .9rem; transition: background .15s, color .15s; }
.qtc-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.qtc-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.qtc-sidebar .nav-link.active { background: var(--qtc-primary); color: #fff; box-shadow: 0 6px 14px rgba(47,84,235,.35); }
.qtc-sidebar .sidebar-footer { padding: .75rem 1rem; border-top: 1px solid rgba(255,255,255,.06); font-size: .78rem; color: #94a3b8; }
.qtc-main { margin-left: var(--qtc-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.qtc-topbar { height: var(--qtc-topbar-h); background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; padding: 0 1.25rem; gap: 1rem; position: sticky; top: 0; z-index: 1020; }
.qtc-topbar .page-title { font-weight: 600; font-size: 1.05rem; margin: 0; color: #111827; }
.qtc-content { padding: 1.25rem; flex: 1; }
.qtc-footer { padding: .75rem 1.25rem; font-size: .78rem; color: #6b7280; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #e0e7ff; color: var(--qtc-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 600; }
.notif-menu { width: 340px; max-width: 92vw; }
.notif-menu .item { padding: .55rem .9rem; border-bottom: 1px solid #f1f5f9; white-space: normal; }
.notif-menu .item.unread { background: #f5f7ff; }
.notif-menu .item .title { font-weight: 600; font-size: .85rem; }
.notif-menu .item .body { font-size: .78rem; color: #6b7280; }

@media (max-width: 991.98px) {
    .qtc-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    body.sidebar-open .qtc-sidebar { transform: translateX(0); }
    .qtc-main { margin-left: 0; }
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .qtc-content { padding: 1rem; }
    .qtc-topbar { padding: 0 .85rem; }
}

/* ---------- Components ---------- */
.card { border: 1px solid #e9ecf3; border-radius: .85rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f5; font-weight: 600; padding: .85rem 1.1rem; border-radius: .85rem .85rem 0 0 !important; }
.stat-card { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; }
.stat-card .icon { width: 46px; height: 46px; border-radius: .75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; color: #111827; }
.stat-card .label { font-size: .78rem; color: #6b7280; }
.stat-card .sub { font-size: .74rem; color: #9ca3af; }
.badge { font-weight: 600; letter-spacing: .01em; }
.bg-cyan { background: #06b6d4 !important; color: #fff; } .bg-orange { background: #f97316 !important; color: #fff; } .bg-purple { background: #7c3aed !important; color: #fff; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; background: #f9fafb; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f8faff; }
div.dataTables_wrapper div.dataTables_filter input { border-radius: .5rem; }
div.dataTables_wrapper div.dataTables_length select { border-radius: .5rem; }
div.dataTables_wrapper div.dataTables_info { font-size: .8rem; color: #6b7280; padding-top: 1rem; }
div.dataTables_wrapper .pagination { --bs-pagination-font-size: .82rem; }
div.dataTables_processing { background: rgba(255,255,255,.9); border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.08); border-radius: .5rem; padding: .5rem 1rem; }
.dt-actions .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .45rem; }
.filter-bar { background: #fff; border: 1px solid #e9ecf3; border-radius: .85rem; padding: .75rem 1rem; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .85rem; }
.form-label { font-weight: 500; font-size: .82rem; color: #374151; margin-bottom: .3rem; }
.form-text { font-size: .74rem; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: #6b7280; font-weight: 600; margin: 0 0 .75rem; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: #e5e7eb; }
.timeline li { position: relative; padding-left: 2.4rem; padding-bottom: 1rem; }
.timeline li .dot { position: absolute; left: 4px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #c7d2fe; display: flex; align-items: center; justify-content: center; font-size: .65rem; color: var(--qtc-primary); }
.timeline li .time { font-size: .72rem; color: #9ca3af; }
.chat-bubble { max-width: 85%; padding: .55rem .8rem; border-radius: .9rem; font-size: .85rem; margin-bottom: .5rem; white-space: pre-wrap; }
.chat-bubble.out { background: #dcf8c6; margin-left: auto; border-bottom-right-radius: .2rem; }
.chat-bubble.in { background: #fff; border: 1px solid #e5e7eb; border-bottom-left-radius: .2rem; }
.chat-bubble .meta { display: block; font-size: .68rem; color: #6b7280; margin-top: .2rem; text-align: right; }
.lead-header { background: linear-gradient(135deg, #eef2ff, #f5f3ff); border-radius: .85rem; padding: 1.1rem 1.25rem; }
.quick-actions .btn { min-width: 44px; }
.package-card { border: 2px solid #e9ecf3; border-radius: .9rem; transition: border-color .15s, transform .15s; height: 100%; }
.package-card:hover { border-color: #c7d2fe; transform: translateY(-2px); }
.package-card .price { font-size: 1.5rem; font-weight: 700; color: #111827; }
.package-card .price small { font-size: .8rem; color: #6b7280; font-weight: 500; }
.package-card .strike { text-decoration: line-through; color: #9ca3af; font-size: .85rem; }
.qr-box { width: 240px; height: 240px; border: 1px dashed #c7d2fe; border-radius: .75rem; display: flex; align-items: center; justify-content: center; background: #fff; margin: 0 auto; overflow: hidden; }
.qr-box img { max-width: 100%; max-height: 100%; }
.perm-group { border: 1px solid #e9ecf3; border-radius: .6rem; padding: .75rem .9rem; height: 100%; }
.perm-group .title { font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.banner-expired { background: #fff7ed; border: 1px solid #fed7aa; border-radius: .75rem; padding: .85rem 1rem; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 10% 10%, #e0e7ff 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #ede9fe 0%, transparent 60%), #f4f6fb; padding: 1.5rem; }
.login-card { width: 100%; max-width: 420px; border-radius: 1rem; }
.toast-container { z-index: 1090; }
.modal-xl-fluid { max-width: 1100px; }
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kv { font-size: .85rem; } .kv dt { color: #6b7280; font-weight: 500; } .kv dd { margin-bottom: .5rem; }
.progress { background: #eef0f5; }
.report-table th, .report-table td { white-space: nowrap; }
.step-row { background: #f9fafb; border-radius: .5rem; padding: .5rem; }
@media (max-width: 575.98px) {
    .stat-card .value { font-size: 1.15rem; }
    .card-header { padding: .75rem .9rem; }
    .qtc-content h4, .qtc-content h5 { font-size: 1.05rem; }
    div.dataTables_wrapper div.dataTables_filter { text-align: left; margin-top: .5rem; }
    div.dataTables_wrapper div.dataTables_filter label { width: 100%; }
    div.dataTables_wrapper div.dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
    .btn-toolbar-mobile .btn { width: 100%; margin-bottom: .4rem; }
}
