/* ============================================================================
   FlowDent - Minimal layout CSS (Bootstrap 5.3 handles everything else)
   ============================================================================ */

/* --- FlowDent green brand override --- */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: #0d9488;
    --bs-link-color-rgb: 13, 148, 136;
    --bs-link-hover-color: #0a7a70;
    --bs-link-hover-color-rgb: 10, 122, 112;
    --fd-sidebar-width: 260px;
}

.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; }
.bg-primary-subtle { background-color: #ccfbf1 !important; }
.text-primary-emphasis { color: #065f56 !important; }
.link-primary { color: #0d9488 !important; }
a { color: #0d9488; }
a:hover { color: #0a7a70; }
.table-primary { --bs-table-bg: #ccfbf1; }
.nav-link.active { color: #0d9488 !important; }

/* Green checkboxes and switches */
.form-check-input:checked {
    background-color: #0d9488;
    border-color: #0d9488;
}
.form-check-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 0.25rem rgba(13, 148, 136, 0.25);
}

/* Admin badge fix: use dark background instead of light */
.badge.text-bg-primary {
    background-color: #0d9488 !important;
    color: #fff !important;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Sidebar: fixed left panel */
.fd-sidebar {
    width: var(--fd-sidebar-width);
    overflow-y: auto;
    overflow-x: hidden;
}
@media (min-width: 992px) {
    .fd-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
    }
}

.fd-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fd-sidebar-brand {
    padding: 1.25rem 1.5rem;
}

.fd-sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.fd-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bs-primary, #0d6efd);
}

.fd-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: inherit;
}

.fd-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.fd-nav-section {
    padding: 1.25rem 1.5rem 0.5rem;
}

.fd-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.5;
}

.fd-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.fd-nav-item:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
    color: inherit;
}

.fd-nav-item.active {
    opacity: 1;
    background: rgba(0,0,0,0.08);
    border-left-color: var(--bs-primary, #0d6efd);
    color: inherit;
}

[data-bs-theme="dark"] .fd-nav-item:hover {
    background: rgba(255,255,255,0.05);
}
[data-bs-theme="dark"] .fd-nav-item.active {
    background: rgba(255,255,255,0.08);
}

.fd-nav-item.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.fd-nav-item i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* Main content area */
.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: 60px;
}

.fd-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.fd-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.fd-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.fd-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.fd-topbar-btn:hover {
    opacity: 1;
}

.fd-user-btn {
    width: auto;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.fd-user-btn i { font-size: 1.3rem; }

.fd-lang-code {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.fd-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.fd-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}

.fd-content {
    flex: 1;
    padding: 1.5rem;
}

/* Notification dropdown */
.fd-notif-dropdown {
    width: 360px;
    max-height: 400px;
    padding: 0;
}

.fd-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.fd-notif-body {
    max-height: 280px;
    overflow-y: auto;
}

.fd-notif-footer {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Public pages (login, register) */
.fd-public-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* Portal dashboard: wider layout */
.fd-portal-wide .fd-public-card {
    max-width: 1260px;
    width: 100%;
}

.fd-public-lang {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 0.25rem;
    z-index: 100;
}

.fd-public-lang a {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    text-decoration: none;
}

.fd-public-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.fd-logo-icon-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--bs-primary, #0d6efd);
    margin-bottom: 1rem;
}

.fd-public-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.fd-public-tagline {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.6;
}

.fd-public-card {
    width: 100%;
    max-width: 460px;
}

.fd-public-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Activity feed items */
.fd-activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.fd-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.fd-activity-text {
    font-size: 0.85rem;
    margin: 0;
}

.fd-activity-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin: 0.15rem 0 0;
}

/* KB article content (TinyMCE output) */
.kb-article-content {
    line-height: 1.7;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.kb-article-content img {
    max-width: 100%;
    height: auto;
}

.kb-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.kb-article-content table th,
.kb-article-content table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .fd-sidebar {
        width: 280px;
    }
    .fd-main {
        margin-left: 0;
    }
    .fd-content {
        padding: 1rem;
    }
    .fd-notif-dropdown {
        width: 300px;
    }
}

@media (max-width: 575.98px) {
    .fd-public-card {
        padding: 1.5rem;
    }
}
