body { background: #f4f6fa; font-family: 'Montserrat', sans-serif; }
html, body, button, input, select, textarea, .btn, .nav-link, .card, .table, .badge, .form-control, .form-select, .form-label, h1, h2, h3, h4, h5, h6, p, a, td, th, label, span {
  font-family: 'Montserrat', sans-serif !important;
}
:root { --primary: #2563eb; }
.page { min-height: 100vh; }
.navbar-vertical {
  position: fixed; left: 0; top: 0; width: 260px; height: 100vh; background: #fff;
  border-right: 1px solid #e6eaf0; z-index: 1000; display: flex; flex-direction: column;
  overflow: visible !important; transform: none !important; transition: left .25s ease;
}
.navbar-vertical > .container-fluid { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 12px 12px 12px; overflow: hidden; }
.navbar-vertical .navbar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; list-style: none; padding: 0; margin: 8px 0 0; }
.sidebar-brand-row { padding: 8px 4px 12px; }
.sidebar-brand-row .navbar-brand { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; white-space: normal; line-height: 1.25; text-decoration: none; }
.sidebar-org { display: block; font-size: 13px; font-weight: 600; color: #0f172a; }
.nav-link { display: flex; align-items: center; min-height: 44px; border-radius: 12px; margin-bottom: 6px; padding: 10px 14px; color: #334155; font-weight: 600; font-size: 14px; text-decoration: none; transition: .2s; }
.nav-link img { width: 24px; height: 24px; margin-right: 10px; object-fit: contain; }
.nav-link:hover { background: #eff6ff; color: #1e3a8a; }
.nav-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.nav-link.active { background: #2563eb; color: #fff !important; }
.sidebar-hide, .sidebar-reopen { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; color: #64748b; font-size: 13px; font-weight: 600; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.sidebar-hide { margin-top: auto; width: 100%; flex-shrink: 0; }
.sidebar-hide:hover, .sidebar-reopen:hover { background: #f8fafc; color: #1e293b; }
.sidebar-reopen { display: none; position: fixed; left: 12px; top: 12px; z-index: 1100; height: 40px; padding: 0 12px; border: 1px solid #e2e8f0; background: #fff; }
html.sidebar-closed .navbar-vertical { left: -280px !important; pointer-events: none; }
html.sidebar-closed .main-content { margin-left: 0; }
html.sidebar-closed .sidebar-reopen { display: inline-flex; }
html.sidebar-closed header.navbar .container-xl { padding-left: 88px; }
.main-content { margin-left: 260px; padding: 30px; min-width: 0; max-width: calc(100vw - 260px); min-height: 100vh; transition: margin-left .25s ease; }
html.sidebar-closed .main-content { max-width: 100%; }
header.navbar { background: #fff; border-bottom: 1px solid #eef2f7; min-height: 64px; margin-left: 260px; width: calc(100% - 260px); }
html.sidebar-closed header.navbar { margin-left: 0; width: 100%; }
.family-head { background: #fff; }
.family-head h1 { font-size: 22px; margin: 0 0 4px; color: #0f172a; }
.family-kicker { margin: 0 0 2px; font-size: 13px; }
.family-kicker a { color: #2563eb; text-decoration: none; font-weight: 600; }
.family-chip { background: #f1f5f9; color: #475569; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.kpi { border-radius: 16px; padding: 14px 16px; color: #fff; min-height: 84px; transition: transform .3s, box-shadow .3s; }
.kpi strong { display: block; font-size: 24px; line-height: 1.15; }
.kpi span { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; }
.kpi-blue { background: #2563eb; }
.kpi-green { background: #16a34a; }
.kpi-orange { background: #f59e0b; }
.kpi-purple { background: #7c3aed; }
.kpi-plain { background: #fff; color: #0f172a; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.kpi-plain span { color: #64748b; }
.family-tabs { display: flex; gap: 2px; overflow-x: auto; margin: 8px 0 14px; padding-bottom: 2px; }
.family-tabs a, .family-tabs button { appearance: none; border: 0; background: transparent; color: #64748b; font-weight: 600; font-size: 14px; line-height: 1.2; padding: 8px 12px; border-radius: 8px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.family-tabs a.active, .family-tabs button.active { background: #2563eb; color: #fff; }
.family-tabs a:hover, .family-tabs button:hover { color: #1d4ed8; }
.family-tabs a.active:hover, .family-tabs button.active:hover { color: #fff; }
.family-subnav { margin-top: 0; }
.family-subnav .nav-count { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 6px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 12px; line-height: 18px; text-align: center; }
.family-subnav button.active .nav-count { background: rgba(255,255,255,.25); color: #fff; }
.support-group { margin-top: 12px; }
.support-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.support-group-head strong { font-size: 14px; }
.support-group-head .btn { flex: 0 0 auto; }
.support-row { padding: 8px 0; border-top: 1px solid #f1f5f9; }
.support-row a, .support-link { display: inline; font-weight: 600; color: #1d4ed8; text-align: left; }
.support-link { border: 0; background: transparent; padding: 0; cursor: pointer; }
.support-row span, .timeline-item small { display: block; color: #64748b; font-size: 13px; line-height: 1.4; }
.timeline-item .step-title { font-weight: 600; margin: 2px 0; }
.event-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; margin: 0 0 12px; }
.event-facts dt { color: #64748b; font-size: 12px; font-weight: 600; }
.event-facts dd { margin: 2px 0 0; font-size: 14px; line-height: 1.4; }
.event-note { margin: 0; color: #334155; font-size: 14px; line-height: 1.45; }
.support-table td, .support-table th { vertical-align: top; }
.support-next { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 220px; max-width: 420px; line-height: 1.45; }
.support-next form { margin: 0; }
.support-next .btn { white-space: nowrap; }
.family-block { margin: 0 0 18px; }
.income-block { margin-bottom: 12px; }
.income-block > h3 { font-size: 16px; margin-bottom: 6px; }
.income-note { margin: 0 0 8px; color: #64748b; font-size: 13px; }
.income-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .7fr); gap: 16px; align-items: start; }
.income-chart { height: 280px; width: 100%; }
.income-figures { display: grid; gap: 10px; }
.profile-facts { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px 32px; }
.profile-facts span { display: block; color: #64748b; font-size: 13px; font-weight: 600; }
.profile-facts strong { display: block; margin-top: 4px; font-size: 18px; line-height: 1.35; font-weight: 700; color: #0f172a; }
.profile-facts div:first-child strong { font-size: 28px; }
.profile-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-now .family-block { margin-bottom: 0; }
@media (max-width: 900px) {
  .income-layout, .profile-facts, .profile-now { grid-template-columns: 1fr; }
}
.family-block > h3 { font-size: 18px; margin: 0 0 10px; }
.family-map { height: 480px; border-radius: 16px; }
.family-loading { color: #64748b; padding: 18px 4px; }
.chain-note { color: #475569; font-size: 13px; margin-bottom: 8px; }
[hidden] { display: none !important; }
.family-head h1 small { font-size: 16px; color: #64748b; font-weight: 600; }
.family-head p { margin: 0 0 6px; color: #475569; }
.family-head .card-body { padding: 16px 20px; }
.family-head-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card { border: none !important; border-radius: 20px !important; box-shadow: 0 8px 24px rgba(0,0,0,.06); }
h1 { font-weight: 700; }
h2, h3, h4, h5 { font-weight: 600; }
.table { margin-bottom: 0; }
.table th { font-weight: 600; color: #64748b; }
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary { background: #2563eb; border: none; }
.btn-primary:hover { background: #1d4ed8; }
.page-hero, .signal-hero { background: linear-gradient(135deg, #0f172a, #1e3a8a) !important; color: #fff; border-radius: 24px !important; }
.page-hero h1, .page-hero p, .signal-hero h1, .signal-hero p, .hero-block h1, .hero-block p { color: #fff !important; }
.page-hero p, .signal-hero p, .hero-block p { opacity: .85; }
.hero-block { background: linear-gradient(135deg, #2563eb, #4f46e5) !important; color: #fff; border-radius: 24px !important; }
.dashboard-card { border-radius: 24px; padding: 24px 28px; color: #fff; min-height: 148px; box-shadow: 0 10px 30px rgba(0,0,0,.08); display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; transition: .3s; }
.home-kpi-row .dashboard-card { min-height: 168px; }
.home-kpi-row .dashboard-card p { font-size: 18px; }
.dashboard-card:hover { transform: translateY(-8px); }
.dashboard-card h2, .dashboard-card p, .dashboard-card strong { color: #fff !important; }
.dashboard-card h2 { font-size: 42px; line-height: 1; margin: 0 0 8px; }
.dashboard-card p { margin: 0; opacity: .95; font-size: 14px; line-height: 1.4; font-weight: 500; }
.blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.green { background: linear-gradient(135deg, #10b981, #059669); }
.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.opeka-status { display: inline-block; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff !important; }
.opeka-status.status-done { background: #33CC33; }
.opeka-status.status-assigned { background: #33CCFF; }
.opeka-status.status-progress { background: #ffcd56; }
.opeka-status.status-default { background: #94a3b8; }
.opeka-status.status-idle { background: #64748b; }
.opeka-status.status-live { background: #2563eb; }
.opeka-status.status-watch { background: #7c3aed; }
.opeka-status.status-attention { background: #ea580c; }
.status-legend { display: flex; flex-wrap: wrap; gap: 16px 28px; margin: 0 0 16px; }
.status-legend p { margin: 0; color: #334155; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.search-card { margin-bottom: 25px; }
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% - 4px); z-index: 80; background: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.12); margin-top: 8px; max-height: 280px; overflow: auto; display: none; }
.search-suggest.open { display: block; }
.search-suggest a { display: block; padding: 12px 16px; text-decoration: none; color: #1e293b; border-bottom: 1px solid #eef2f7; }
.search-suggest a:hover { background: #eff6ff; }
.search-suggest small { color: #64748b; }
.family-avatar { width: 120px; height: 120px; border-radius: 50%; background: #2563eb; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 42px; }
.chart-pie-wrap { width: 100%; max-width: 720px; height: 420px; margin: 0 auto; position: relative; }
.chart-bar-wrap { position: relative; width: 100%; height: 420px; }
.chart-bar-wrap.chart-short { height: 280px; }
.desk-kpi .dashboard-card { min-height: 132px; }
.desk-routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.desk-route { background: #fff; border-radius: 20px; padding: 18px 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); text-decoration: none; color: #0f172a; display: block; border-top: 4px solid #2563eb; }
.desk-route:hover { color: #0f172a; transform: translateY(-2px); }
.desk-route strong { display: block; font-size: 32px; line-height: 1.1; margin: 4px 0; }
.desk-route span, .desk-route small { display: block; color: #64748b; }
.desk-route.loss { border-top-color: #7c3aed; }
.desk-route.job { border-top-color: #2563eb; }
.desk-route.income { border-top-color: #d97706; }
.desk-note { color: #475569; margin: 0 0 20px; }
.map-popup { font-size: 14px; line-height: 1.45; color: #0f172a; }
.map-popup strong { display: block; margin-bottom: 4px; font-size: 16px; }
.map-popup a { display: inline-block; margin-top: 8px; font-weight: 600; }
.map-district-poly, .map-district-poly:focus, path.map-district-poly { outline: none !important; }
.map-district-off { pointer-events: none !important; }
.map-district-tip { font-weight: 600; font-size: 13px; border: 0; border-radius: 8px; box-shadow: 0 6px 16px rgba(15, 23, 42, .15); }
.desk-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 992px) {
  .desk-routes, .desk-charts { grid-template-columns: 1fr; }
}
.chart-pie-wrap canvas, .chart-bar-wrap canvas { display: block; width: 100% !important; height: 100% !important; }
#mapPage, #mapPage.leaflet-container { height: calc(100vh - 250px); min-height: 520px; border-radius: 20px; }
.map-analytics-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.map-side { background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); max-height: calc(100vh - 220px); overflow: auto; }
.map-mode-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.signal-board { background: #fff; border-radius: 20px; padding: 18px 18px 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); min-height: 100%; }
.signal-board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.signal-board-head h3 { font-size: 18px; margin: 0; }
.signal-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.signal-row strong, .signal-row span { display: block; }
.signal-row span { font-size: 13px; color: #64748b; }
.signal-meta { text-align: right; flex-shrink: 0; }
.signal-meta .opeka-status { display: inline-block; margin-top: 4px; }
.signal-empty { color: #94a3b8; padding: 16px 0; }
.list-pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 16px 16px; }
.list-pager a, .list-pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #f8fafc; color: #0f172a; text-decoration: none; font-size: 14px; }
.list-pager a:hover { background: #e2e8f0; color: #0f172a; }
.list-pager .is-current { background: #2563eb; color: #fff; }
.signal-board .list-pager, .cal-side .list-pager { padding: 8px 0 0; }
.toolbar-row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 992px) {
  header.navbar { margin-left: 0; width: 100%; }
  .main-content { margin-left: 0; padding: 15px; max-width: 100%; }
  .navbar-vertical { box-shadow: 12px 0 28px rgba(15, 23, 42, .12); }
  .map-analytics-layout { grid-template-columns: 1fr; }
  .map-side { max-height: none; }
  #mapPage, #mapPage.leaflet-container { height: 70vh; }
  .topbar { flex-wrap: wrap; }
}
.topbar { display: flex; align-items: center; gap: 16px; width: 100%; }
.topbar-title { font-weight: 700; color: #0f172a; white-space: nowrap; }
.topbar-search { flex: 1 1 240px; max-width: 460px; }
.topbar-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.topbar-org { font-size: 13px; font-weight: 600; color: #0f172a; }
.topbar-user { font-size: 12px; color: #64748b; }
.work-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.work-tabs a { text-decoration: none; color: #334155; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(15,23,42,.04); }
.work-tabs a.active { background: #2563eb; color: #fff; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini-card { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.mini-card span { display: block; color: #64748b; font-size: 12px; font-weight: 600; }
.mini-card strong { display: block; margin-top: 6px; font-size: 20px; color: #0f172a; }
.row-history { background: #f8fafc; color: #64748b; }
.timeline { border-left: 2px solid #dbeafe; margin: 8px 0 0 8px; padding-left: 16px; }
.timeline-item { margin-bottom: 14px; }
.timeline-item small { color: #64748b; }
#taskMap { height: 560px; border-radius: 16px; }
.track-player{
    margin-top:16px;
    padding:16px 18px;
    border-radius:18px;
    background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);
    border:1px solid #dbe7ff;
}
.track-player-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}
.track-player-title{font-weight:700;color:#1e3a8a}
.track-player-sub{color:#64748b;font-size:13px}
.track-player-time{font-weight:700;color:#2563eb;white-space:nowrap}
.track-player-range{width:100%;accent-color:#2563eb}
.track-player-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.track-speed{display:flex;gap:6px;margin-left:auto}
.task-photo-marker{background:transparent;border:0}
.task-photo-pin{width:46px;height:46px;border-radius:12px;overflow:hidden;border:2px solid #fff;box-shadow:0 6px 16px rgba(15,23,42,.28);background:#fff;cursor:pointer}
.task-photo-pin img{width:100%;height:100%;object-fit:cover;display:block}
.task-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.task-photo-card{display:block;border-radius:14px;overflow:hidden;background:#fff;border:1px solid #e2e8f0;color:inherit;text-decoration:none}
.task-photo-card img{width:100%;height:180px;object-fit:cover;display:block;background:#f8fafc}
.task-photo-card span{display:block;padding:8px 10px;font-size:13px;font-weight:600}
.task-sign-card img{height:140px;object-fit:contain;background:#fff}
.task-photo-lightbox{position:fixed;inset:0;z-index:4200;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.55);padding:24px}
.task-photo-lightbox[hidden]{display:none !important}
.task-photo-lightbox-card{position:relative;max-width:min(920px,92vw);background:#fff;border-radius:18px;overflow:hidden}
.task-photo-lightbox-card img{display:block;max-width:100%;max-height:78vh;object-fit:contain;background:#0f172a}
.task-photo-lightbox-cap{padding:10px 14px;font-weight:600}
.task-photo-lightbox-close{position:absolute;top:8px;right:8px;width:36px;height:36px;border:0;border-radius:10px;background:#fff;font-size:22px;line-height:1;cursor:pointer}
.table td, .table th { vertical-align: middle; font-size: 13px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.compare-grid small, .mini-card small { display: block; margin-top: 6px; color: #64748b; font-size: 12px; font-weight: 500; }
.demo-banner { background: #eff6ff; color: #1e3a8a; border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 1.45; margin-bottom: 10px; }
.main-content.family-page { padding: 16px 20px 28px; }
#family-card .family-head { margin-bottom: 8px !important; }
#family-card .family-head .card-body { padding: 10px 16px; }
#family-card .family-head h1 { font-size: 20px; line-height: 1.2; }
#family-card .family-head p { margin: 0; font-size: 14px; line-height: 1.4; }
#family-card .family-kicker { margin-bottom: 0; }
#family-card .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
#family-card .kpi { min-height: 92px; padding: 16px 18px; border-radius: 18px; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
#family-card .kpi:hover { transform: translateY(-8px); box-shadow: 0 18px 34px rgba(15, 23, 42, .16); }
#family-card .kpi strong { font-size: 28px; }
#family-card .kpi span { font-size: 14px; margin-top: 6px; }
#family-card .family-tabs { margin: 8px 0 14px; gap: 8px; }
#family-card .family-tabs a, #family-card .family-tabs button { background: #fff; color: #334155; border-radius: 12px; box-shadow: 0 4px 14px rgba(15, 23, 42, .04); }
#family-card .family-tabs a.active, #family-card .family-tabs button.active,
#family-card .family-tabs a.active:hover, #family-card .family-tabs button.active:hover { background: #2563eb; color: #fff; }
.opeka-hero { display: flex; justify-content: space-between; gap: 20px; background: linear-gradient(105deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%); color: #fff; border-radius: 22px; padding: 22px 24px; margin-bottom: 12px; box-shadow: 0 14px 32px rgba(37, 99, 235, .18); }
.opeka-hero-main { display: flex; gap: 18px; min-width: 0; }
.opeka-avatar { width: 92px; height: 92px; border-radius: 50%; background: #fde68a; color: #1e3a8a; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; flex: 0 0 auto; }
.opeka-hero h1 { color: #fff; font-size: 30px; line-height: 1.15; margin: 0 0 10px; font-weight: 700; }
.opeka-id { font-size: 18px; font-weight: 600; opacity: .8; }
.opeka-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.opeka-pill { background: rgba(255,255,255,.18); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.opeka-facts { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px 24px; }
.opeka-facts span { display: block; font-size: 12px; opacity: .78; font-weight: 500; }
.opeka-facts strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; }
.opeka-hero-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 220px; }
.opeka-hero-actions .btn { background: #fff; color: #1d4ed8; border: 0; font-weight: 700; border-radius: 12px; }
.opeka-strip { background: #ecfdf3; color: #166534; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.opeka-strip-idle { background: #f1f5f9; color: #475569; }
.opeka-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.opeka-actions .btn { border-radius: 12px; font-weight: 700; }
.opeka-mark { background: rgba(255,255,255,.16); border-radius: 16px; min-width: 92px; padding: 14px 12px; text-align: center; }
.opeka-mark strong { display: block; font-size: 18px; }
.opeka-mark span { display: block; font-size: 12px; opacity: .8; }
.opeka-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.opeka-info span { display: block; color: #64748b; font-size: 13px; margin-bottom: 3px; }
.opeka-info strong { display: block; color: #0f172a; font-size: 15px; font-weight: 600; }
.task-page .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-page .kpi strong { font-size: 18px; line-height: 1.25; word-break: break-word; }
.task-page [data-task-panel][hidden] { display: none !important; }
.task-page .work-tabs { margin-bottom: 14px; }
.task-page .work-tabs a { border-radius: 12px; background: #fff; color: #334155; }
.task-page .work-tabs a.active, .task-page .work-tabs a.active:hover { background: #2563eb; color: #fff; }
@media (max-width: 900px) {
  .opeka-hero, .opeka-hero-main { flex-direction: column; }
  .opeka-facts, .opeka-info { grid-template-columns: 1fr; }
}
#family-card .family-block { margin-bottom: 12px; }
#family-card .family-block > h3, #family-card .card-body > h3 { font-size: 16px; margin: 0 0 8px; }
#family-card .table td, #family-card .table th { font-size: 14px; }
#family-card .opeka-status { padding: 2px 8px; font-size: 12px; }
#family-card .toolbar-row .btn { padding: 6px 12px; font-size: 13px; }
#family-card .profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
#family-card .profile-grid p, #family-card .family-block p { font-size: 14px; line-height: 1.45; }
#family-card .portrait-fold { background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); margin-bottom: 10px; }
#family-card .portrait-fold > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 16px; color: #0f172a; list-style: none; }
#family-card .portrait-fold > summary::-webkit-details-marker { display: none; }
#family-card .portrait-body { padding: 0 16px 14px; }
#family-card .family-skeleton { display: grid; gap: 10px; padding: 8px 0 16px; }
#family-card .family-skeleton span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #e8edf5 25%, #f8fafc 37%, #e8edf5 63%); background-size: 400% 100%; animation: cps-skel 1.1s ease infinite; }
#family-card .family-skeleton span.short { width: 55%; }
@keyframes cps-skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (max-width: 1200px) {
  #family-card .profile-grid, #family-card .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.cal-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; color: #334155; font-weight: 600; font-size: 13px; text-decoration: none; box-shadow: 0 6px 18px rgba(15,23,42,.05); }
.cal-chip.is-on, .cal-chip:hover { background: #2563eb; color: #fff; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .85fr); gap: 16px; align-items: start; }
.cal-board, .cal-side { background: #fff; border-radius: 24px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.cal-board { padding: 18px 18px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cal-head h2, .cal-side h2 { margin: 0; font-size: 22px; font-weight: 700; color: #0f172a; text-transform: capitalize; }
.cal-nav { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 14px; background: #f8fafc; color: #1e3a8a; font-size: 24px; line-height: 1; text-decoration: none; }
.cal-nav:hover { background: #eff6ff; }
.cal-legend { display: flex; gap: 16px; margin-bottom: 12px; color: #64748b; font-size: 13px; font-weight: 600; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.cal-dot-check { background: #f59e0b; }
.cal-dot-task { background: #2563eb; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; color: #94a3b8; font-size: 12px; font-weight: 700; padding-bottom: 4px; }
.cal-day { position: relative; min-height: 112px; border-radius: 16px; background: #f8fafc; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.is-out { opacity: .42; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px #2563eb; background: #eff6ff; }
.cal-day.is-selected { background: #1d4ed8; }
.cal-day.is-selected .cal-num, .cal-day.is-selected .cal-more { color: #fff; }
.cal-day-hit { position: absolute; inset: 0; border-radius: 16px; }
.cal-num { position: relative; z-index: 1; font-weight: 700; color: #0f172a; pointer-events: none; }
.cal-pill, .cal-more { position: relative; z-index: 1; }
.cal-pill { display: block; border-radius: 8px; padding: 3px 6px; font-size: 11px; font-weight: 700; line-height: 1.3; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-pill-check { background: #ffedd5; color: #9a3412; }
.cal-pill-task { background: #dbeafe; color: #1e40af; }
.cal-pill.is-overdue { background: #fee2e2; color: #991b1b; }
.cal-day.is-selected .cal-pill { background: rgba(255,255,255,.18); color: #fff; }
.cal-more { color: #64748b; font-size: 11px; font-weight: 700; }
.cal-side { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.cal-side h3 { margin: 8px 0 0; font-size: 15px; color: #0f172a; }
.cal-empty { margin: 0; color: #64748b; }
.cal-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 12px 14px; border-radius: 16px; text-decoration: none; background: #f8fafc; border-left: 4px solid #cbd5e1; }
.cal-item-check { border-left-color: #f59e0b; }
.cal-item-task { border-left-color: #2563eb; }
.cal-item small, .cal-item span, .cal-item em { color: #64748b; font-size: 12px; font-style: normal; line-height: 1.4; }
.cal-item strong { color: #0f172a; font-size: 14px; }
.cal-item:hover { background: #eff6ff; }
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-day { min-height: 84px; }
}
