/* ==========================================================
   Solead CRM - Admin theme on Bootstrap 5.3
   ========================================================== */
:root {
  --sidebar-w: 256px;
  --sidebar-bg: #0f1b2d;
  --sidebar-bg2: #13243c;
  --sidebar-text: #aab8cc;
  --sidebar-active: #ffffff;
  --company-color: #0d6efd;
  --radius: .65rem;
}
body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: .92rem; background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] body { background: #10141b; }
.app-wrapper { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; z-index: 1040;
  display: flex; flex-direction: column; transition: transform .25s ease, width .25s ease;
}
.sidebar-brand { height: 60px; display: flex; align-items: center; padding: 0 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--company-color), #6f42c1); margin-right: .7rem; font-size: 1.1rem; }
.brand-text { color: #fff; font-weight: 700; line-height: 1.1; }
.brand-text small { display: block; color: var(--sidebar-text); font-weight: 400; font-size: .72rem; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { overflow-y: auto; flex: 1; padding: .5rem .6rem 2rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar-nav .nav-header { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #6c7f99; padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar-nav .nav-link { color: var(--sidebar-text); display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .86rem; }
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav .nav-link.active { color: var(--sidebar-active); background: var(--company-color); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sidebar-nav .nav-link.active i { opacity: 1; }

.app-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .25s ease; }
.app-header { height: 60px; }
.app-content { padding: 1.25rem 1.5rem; flex: 1; }
.app-footer { padding: .8rem 1.5rem; background: var(--bs-body-bg); }

body.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .app-main { margin-left: 0; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-main { margin-left: 0; }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
  .app-content { padding: 1rem; }
}

/* ---------- Header ---------- */
.company-pill { background: color-mix(in srgb, var(--company-color) 12%, transparent); color: var(--company-color); border: 1px solid color-mix(in srgb, var(--company-color) 35%, transparent); font-weight: 600; border-radius: 2rem; }
.company-pill:hover { background: var(--company-color); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--company-color), #20c997); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.header-search { width: 320px; }
.header-search .form-control { border-left: 0; }

/* ---------- Cards ---------- */
.card { border: 0; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08); }
.card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color-translucent); font-weight: 600; padding: .85rem 1.1rem; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .04em; }
.bg-soft-primary { background: rgba(13,110,253,.12); color: #0d6efd; }
.bg-soft-success { background: rgba(25,135,84,.12); color: #198754; }
.bg-soft-warning { background: rgba(255,193,7,.18); color: #b58100; }
.bg-soft-danger  { background: rgba(220,53,69,.12); color: #dc3545; }
.bg-soft-info    { background: rgba(13,202,240,.15); color: #0a8ca5; }
.bg-soft-purple  { background: rgba(111,66,193,.13); color: #6f42c1; }
.bg-soft-dark    { background: rgba(33,37,41,.1); color: var(--bs-body-color); }

/* ---------- Tables / forms ---------- */
.table > :not(caption) > * > * { padding: .55rem .7rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); font-weight: 600; white-space: nowrap; background: var(--bs-tertiary-bg); }
.table-hover tbody tr:hover > * { background: color-mix(in srgb, var(--company-color) 5%, transparent); }
.form-label { font-weight: 500; font-size: .83rem; margin-bottom: .3rem; }
.req::after { content: " *"; color: var(--bs-danger); }
.form-section { border: 1px dashed var(--bs-border-color); border-radius: var(--radius); padding: 1rem 1rem .25rem; margin-bottom: 1rem; position: relative; }
.form-section > .legend { position: absolute; top: -.7rem; left: .8rem; background: var(--bs-body-bg); padding: 0 .5rem; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--company-color); }
.locked { background: var(--bs-tertiary-bg) !important; }
.filter-bar { background: var(--bs-body-bg); border-radius: var(--radius); padding: .9rem 1rem .1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.btn { border-radius: .5rem; }
.btn-primary { --bs-btn-bg: var(--company-color); --bs-btn-border-color: var(--company-color); }
.nav-tabs .nav-link.active { font-weight: 600; }
.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid var(--bs-border-color); }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.43rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--company-color); border: 2px solid var(--bs-body-bg); }
.mail-list .list-group-item.unread { font-weight: 600; background: color-mix(in srgb, var(--company-color) 6%, transparent); }
.chart-box { position: relative; height: 280px; }
.kpi-mini { font-size: .8rem; }
.dataTables_wrapper .dataTables_filter input, div.dt-container .dt-search input { border-radius: .5rem; }
div.dt-container div.dt-layout-row { margin: .4rem 0; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(circle at 20% 20%, #1d4ed8 0, transparent 45%), radial-gradient(circle at 80% 70%, #7c3aed 0, transparent 45%), #0f1b2d; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero h1 { font-weight: 800; font-size: 2.4rem; }
.login-hero .feat { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; opacity: .9; }
.login-hero .feat i { font-size: 1.3rem; color: #93c5fd; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; background: var(--bs-body-bg); }
.login-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .login-page { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* ---------- Print ---------- */
@media print {
  .app-sidebar, .app-header, .app-footer, .page-head .d-flex.gap-2, .no-print, .filter-bar { display: none !important; }
  .app-main { margin: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}
.print-doc { max-width: 900px; margin: 0 auto; background: #fff; color: #222; padding: 2rem; }
.id-card { width: 54mm; height: 86mm; border-radius: 10px; overflow: hidden; border: 1px solid #ccc; background: #fff; color: #222; text-align: center; font-size: 10px; display: inline-block; vertical-align: top; margin: 8px; position: relative; }
.id-card .top { background: linear-gradient(135deg, var(--company-color), #6f42c1); color: #fff; padding: 8px 6px 28px; }
.id-card .photo { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; margin: -26px auto 4px; background: #e9ecef; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #555; overflow: hidden; }
.id-card .photo img { width: 100%; height: 100%; object-fit: cover; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .list-group-item:hover, .sidebar-nav a:hover { text-decoration: none; }
.table-leads td { white-space: nowrap; }
