/* Dashboard widgets & data tables */
.widget{background:var(--ffm-surface);border:1px solid var(--ffm-border);border-radius:var(--ffm-radius);padding:1rem 1.1rem;height:100%;box-shadow:var(--ffm-shadow)}
.widget h6{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--ffm-muted);margin:0 0 .4rem;font-weight:600}
.widget .kpi{font-size:1.6rem;font-weight:700;color:var(--ffm-text)}
.widget .kpi small{font-size:.8rem;font-weight:500;color:var(--ffm-muted);margin-left:.3rem}
.widget .ico-bg{width:38px;height:38px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:#eef3fa;color:var(--ffm-primary);font-size:1.1rem}
.widget.warn .ico-bg{background:#fff4e0;color:var(--ffm-warn)}
.widget.danger .ico-bg{background:#fdecea;color:var(--ffm-danger)}
.widget.success .ico-bg{background:#e4f4ee;color:#1f7a5c}

.guidance-card{display:flex;gap:.8rem;align-items:flex-start;padding:.9rem 1rem;background:var(--ffm-surface-2);border:1px dashed var(--ffm-border);border-radius:12px;margin-bottom:.6rem}
.guidance-card .bi{font-size:1.2rem;color:var(--ffm-accent);margin-top:.1rem}
.guidance-card h6{margin:0 0 .15rem;font-weight:600;font-size:.95rem}
.guidance-card p{margin:0;font-size:.85rem;color:var(--ffm-muted)}

.timeline{position:relative;padding-left:1.2rem}
.timeline:before{content:"";position:absolute;left:.45rem;top:.2rem;bottom:.2rem;width:2px;background:var(--ffm-border)}
.timeline-item{position:relative;padding:.4rem 0 .7rem}
.timeline-item:before{content:"";position:absolute;left:-1rem;top:.7rem;width:10px;height:10px;border-radius:50%;background:var(--ffm-primary)}
.timeline-item small{color:var(--ffm-muted)}
.timeline-item strong{display:block;font-size:.92rem}

/* Data table */
.ffm-table-wrap{background:var(--ffm-surface);border:1px solid var(--ffm-border);border-radius:var(--ffm-radius);overflow:hidden;box-shadow:var(--ffm-shadow)}
.ffm-table-toolbar{padding:.7rem .9rem;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;border-bottom:1px solid var(--ffm-border);background:var(--ffm-surface-2)}
.ffm-table-toolbar .left{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;flex:1}
.ffm-table-toolbar .right{display:flex;gap:.4rem;align-items:center}
.ffm-table-toolbar select,.ffm-table-toolbar input{font-size:.85rem;border-radius:8px;border:1px solid var(--ffm-border);padding:.35rem .6rem;background:#fff}
.ffm-table{width:100%;border-collapse:separate;border-spacing:0;font-size:.9rem}
.ffm-table thead th{position:sticky;top:0;background:#f6f8fc;color:#4d5872;font-weight:600;text-align:left;padding:.7rem .8rem;border-bottom:1px solid var(--ffm-border);cursor:pointer;user-select:none;white-space:nowrap}
.ffm-table thead th .bi{font-size:.8rem;color:var(--ffm-muted)}
.ffm-table tbody td{padding:.7rem .8rem;border-bottom:1px solid var(--ffm-border);vertical-align:middle}
.ffm-table tbody tr:hover{background:#f9fbfe}
.ffm-table tbody tr.group-row td{background:#eef3fa;font-weight:600;color:var(--ffm-primary)}
.ffm-table .row-actions{display:flex;gap:.25rem;justify-content:flex-end}
.ffm-table .row-actions button{background:transparent;border:1px solid transparent;border-radius:8px;padding:.25rem .45rem;color:var(--ffm-muted);cursor:pointer}
.ffm-table .row-actions button:hover{background:#eef3fa;color:var(--ffm-primary)}
.ffm-table .row-actions button.del:hover{background:#fdecea;color:var(--ffm-danger)}
.ffm-pagination{padding:.6rem .9rem;display:flex;justify-content:space-between;align-items:center;font-size:.85rem;color:var(--ffm-muted);border-top:1px solid var(--ffm-border);background:var(--ffm-surface-2);flex-wrap:wrap;gap:.5rem}
.ffm-pagination .pager{display:flex;gap:.25rem}
.ffm-pagination .pager button{background:#fff;border:1px solid var(--ffm-border);border-radius:8px;padding:.25rem .55rem;font-size:.85rem;cursor:pointer}
.ffm-pagination .pager button.active{background:var(--ffm-primary);color:#fff;border-color:var(--ffm-primary)}
.ffm-pagination .pager button:disabled{opacity:.5;cursor:not-allowed}

/* Family tree */
.tree-canvas{background:linear-gradient(0deg,#f4f7fb 0%,#f9fbfd 100%);border:1px solid var(--ffm-border);border-radius:var(--ffm-radius);height:70vh;position:relative;overflow:hidden}
.tree-canvas svg{width:100%;height:100%}
.tree-node{cursor:grab}
.tree-node rect{fill:#fff;stroke:#cfd9e8;stroke-width:1.2}
.tree-node.root rect{fill:#0f1a2b;stroke:#0f1a2b}
.tree-node.root text{fill:#fff;font-weight:600}
.tree-node text{font-size:12px;fill:#1a2233;pointer-events:none}
.tree-link{stroke:#b9c4d6;stroke-width:1.5;fill:none}
