/* ============================================================================
   FlowDent Nomenclatuur — Brand CSS (Bootstrap 5.3 override)
   ============================================================================ */
:root {
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: #0d9488;
    --bs-link-hover-color: #0a7a70;
    --fd-sidebar-width: 250px;
    --fd-topbar-height: 56px;
}
body { font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f0fdfa; }
a { color: #0d9488; }
a:hover { color: #0a7a70; }

.btn-primary { --bs-btn-bg:#0d9488; --bs-btn-border-color:#0d9488; --bs-btn-hover-bg:#0a7a70; --bs-btn-hover-border-color:#0a7a70; --bs-btn-active-bg:#087a6e; --bs-btn-active-border-color:#087a6e; --bs-btn-disabled-bg:#0d9488; --bs-btn-disabled-border-color:#0d9488; }
.btn-outline-primary { --bs-btn-color:#0d9488; --bs-btn-border-color:#0d9488; --bs-btn-hover-bg:#0d9488; --bs-btn-hover-border-color:#0d9488; --bs-btn-active-bg:#0a7a70; --bs-btn-active-border-color:#0a7a70; }
.bg-primary { background-color: #0d9488 !important; }
.text-primary { color: #0d9488 !important; }
.border-primary { border-color: #0d9488 !important; }
.table-dark { --bs-table-bg: #134e4a; --bs-table-color: #fff; --bs-table-border-color: #1a6b63; }
.nav-tabs .nav-link.active { color: #0d9488 !important; border-bottom-color: #0d9488 !important; }
.page-item.active .page-link { background-color: #0d9488; border-color: #0d9488; }
.page-link { color: #0d9488; }
.page-link:hover { color: #0a7a70; }
.badge.bg-primary { background-color: #0d9488 !important; }
.badge.bg-info { background-color: #14b8a6 !important; }
.form-check-input:checked { background-color: #0d9488; border-color: #0d9488; }
.card-header.bg-primary { background-color: #0d9488 !important; }
.alert-danger { border-left: 4px solid #dc3545; }
.alert-info { border-left: 4px solid #0d9488; }

/* --- Sidebar --- */
.fd-sidebar {
    width: var(--fd-sidebar-width); position: fixed; top: 0; left: 0; bottom: 0;
    background: #042f2e; color: rgba(255,255,255,.85);
    overflow-y: auto; overflow-x: hidden; z-index: 1040;
    display: flex; flex-direction: column;
}
.fd-sidebar-brand { padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.fd-sidebar-brand a { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
.fd-sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.fd-logo-text { font-size: 1.1rem; font-weight: 800; letter-spacing: -.03em; }
.fd-logo-sub { font-size: .6rem; opacity: .4; letter-spacing: .05em; text-transform: uppercase; display: block; margin-top: -2px; }
.fd-nav-section { padding: 1rem 1.2rem .35rem; }
.fd-nav-label { font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .35; }
.fd-nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .48rem 1.2rem; font-size: .84rem; font-weight: 500;
    text-decoration: none; border-left: 3px solid transparent;
    color: rgba(255,255,255,.55); transition: all .15s;
}
.fd-nav-item:hover { color: rgba(255,255,255,.95); background: rgba(255,255,255,.06); }
.fd-nav-item.active { color: #fff; background: rgba(255,255,255,.1); border-left-color: #0d9488; }
.fd-nav-item i { font-size: 1rem; width: 1.2rem; text-align: center; }
.fd-sidebar-footer { margin-top: auto; padding: .8rem 1.2rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .75rem; opacity: .4; }

/* --- Main --- */
.fd-main { margin-left: var(--fd-sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.fd-topbar {
    position: sticky; top: 0; z-index: 1020; height: var(--fd-topbar-height);
    background: #fff; border-bottom: 1px solid #0d948818;
    display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem;
}
.fd-topbar-title { font-size: 1rem; font-weight: 700; margin: 0; color: #042f2e; }
.fd-content { flex: 1; padding: 1.2rem 1.5rem; }

/* --- Nomenclatuur-specific --- */
.badge-ambulant { background-color: #0d9488 !important; }
.badge-hospital { background-color: #dc3545 !important; }
.badge-tech { background-color: #6b7280 !important; }
.fee-table td, .fee-table th { white-space: nowrap; }
.tree-node { cursor: pointer; }
.tree-node:hover { background-color: #ccfbf1; }
.code-badge { font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.05em; }
.card-hover:hover { box-shadow: 0 .2rem .5rem rgba(13,148,136,.12); transition: box-shadow .2s; }
.truncate-text {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; white-space: normal;
    max-width: 500px; line-height: 1.35; max-height: 2.7em;
}
.chapter-card { border-left: 4px solid #0d9488; }
.sticky-top-offset { top: calc(var(--fd-topbar-height) + 8px); }

/* Footer */
.fd-footer { background: #042f2e; color: rgba(255,255,255,.5); padding: .8rem 1.5rem; font-size: .78rem; margin-top: auto; }
.fd-footer a { color: rgba(255,255,255,.5); text-decoration: none; }
.fd-footer a:hover { color: #fff; }

/* Mobile */
.fd-menu-toggle { display: none; border: none; background: transparent; font-size: 1.4rem; cursor: pointer; color: #042f2e; }
@media print { .fd-sidebar, .fd-topbar, .fd-footer, .no-print { display: none !important; } .fd-main { margin-left: 0; } }
@media (max-width: 991.98px) {
    .fd-sidebar { display: none; }
    .fd-sidebar.show { display: flex; width: 280px; }
    .fd-main { margin-left: 0; }
    .fd-menu-toggle { display: inline-flex; }
    .fd-content { padding: .8rem; }
}
