/**
 * CareDesk AMS — shared brand theme
 * Used by landing, login, and post-login app shell.
 */
:root {
    --cd-ink: #14201c;
    --cd-muted: #4a5c55;
    --cd-surface: #e8f0ec;
    --cd-leaf: #1f6b4f;
    --cd-leaf-deep: #0f3d2e;
    --cd-sand: #d4c4a8;
    --cd-amber: #b86a1a;
    --cd-amber-deep: #8f5012;
    --cd-white: #f7faf8;
    --cd-leaf-rgb: 31, 107, 79;
    --cd-leaf-deep-rgb: 15, 61, 46;
    --cd-amber-rgb: 184, 106, 26;
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Sora", "Segoe UI", sans-serif;

    /* Map Velzon / Bootstrap tokens → CareDesk */
    --vz-primary: #1f6b4f;
    --vz-primary-rgb: 31, 107, 79;
    --vz-primary-text-emphasis: #0f3d2e;
    --vz-primary-bg-subtle: #e8f0ec;
    --vz-primary-border-subtle: #a8c9bb;
    --vz-success: #1f6b4f;
    --vz-success-rgb: 31, 107, 79;
    --vz-success-text-emphasis: #0f3d2e;
    --vz-success-bg-subtle: #e8f0ec;
    --vz-success-border-subtle: #a8c9bb;
    --vz-info: #2a6f6a;
    --vz-info-rgb: 42, 111, 106;
    --vz-info-text-emphasis: #1a4a47;
    --vz-info-bg-subtle: #e6f2f1;
    --vz-info-border-subtle: #9ec9c6;
    --vz-warning: #b86a1a;
    --vz-warning-rgb: 184, 106, 26;
    --vz-warning-text-emphasis: #8f5012;
    --vz-warning-bg-subtle: #f8efe4;
    --vz-warning-border-subtle: #e2c49a;
    --vz-secondary: #4a5c55;
    --vz-secondary-rgb: 74, 92, 85;
    --vz-link-color: #1f6b4f;
    --vz-link-hover-color: #0f3d2e;
    --vz-body-bg: #f7faf8;
    --vz-body-color: #14201c;
    --vz-border-color: #d5e3dc;
    --vz-tertiary-bg: #e8f0ec;
    --vz-secondary-bg: #ffffff;
    --vz-focus-ring-color: rgba(31, 107, 79, 0.25);

    /* Light sidebar hover/active accents */
    --vz-vertical-menu-item-bg: rgba(31, 107, 79, 0.12);
    --vz-vertical-menu-item-hover-color: #1f6b4f;
    --vz-vertical-menu-item-active-color: #1f6b4f;
    --vz-vertical-menu-item-active-bg: rgba(31, 107, 79, 0.15);
    --vz-vertical-menu-sub-item-hover-color: #1f6b4f;
    --vz-vertical-menu-sub-item-active-color: #1f6b4f;
}

/* Dark sidebar = marketing leaf-deep panel */
:root[data-sidebar="dark"] {
    --vz-vertical-menu-bg: #0f3d2e;
    --vz-vertical-menu-border: #0f3d2e;
    --vz-vertical-menu-item-color: rgba(247, 250, 248, 0.72);
    --vz-vertical-menu-item-bg: rgba(255, 255, 255, 0.1);
    --vz-vertical-menu-item-hover-color: #ffffff;
    --vz-vertical-menu-item-active-color: #ffffff;
    --vz-vertical-menu-item-active-bg: rgba(184, 106, 26, 0.35);
    --vz-vertical-menu-sub-item-color: rgba(247, 250, 248, 0.65);
    --vz-vertical-menu-sub-item-hover-color: #ffffff;
    --vz-vertical-menu-sub-item-active-color: #ffffff;
    --vz-vertical-menu-title-color: rgba(212, 196, 168, 0.85);
    --vz-twocolumn-menu-iconview-bg: #0c3226;
}

[data-bs-theme="dark"][data-sidebar="dark"] {
    --vz-vertical-menu-bg: #0f3d2e;
    --vz-vertical-menu-border: #0f3d2e;
    --vz-twocolumn-menu-iconview-bg: #0c3226;
}

/* Topbar / page chrome */
:root,
:root[data-topbar="light"] {
    --vz-header-bg: #ffffff;
    --vz-header-border: #d5e3dc;
    --vz-header-item-color: #14201c;
    --vz-header-item-sub-color: #4a5c55;
    --vz-page-title-border: #d5e3dc;
    --vz-footer-bg: #f7faf8;
    --vz-footer-color: #4a5c55;
}

/* App shell only (post-login) — keep marketing pages untouched */
body:not(.cd-landing):not(.cd-login) {
    background-color: var(--cd-white) !important;
    color: var(--cd-ink);
}

#page-topbar {
    border-bottom: 1px solid #d5e3dc;
}

.navbar-menu .navbar-brand-box {
    background: transparent;
}

.main-content,
.page-content {
    background-color: var(--cd-white);
}

body:not(.cd-landing):not(.cd-login) .card {
    border-color: #d5e3dc;
    box-shadow: 0 1px 3px rgba(15, 61, 46, 0.06);
}

.btn-primary {
    --vz-btn-bg: #1f6b4f;
    --vz-btn-border-color: #1f6b4f;
    --vz-btn-hover-bg: #0f3d2e;
    --vz-btn-hover-border-color: #0f3d2e;
    --vz-btn-active-bg: #0f3d2e;
    --vz-btn-active-border-color: #0f3d2e;
    --vz-btn-disabled-bg: #1f6b4f;
    --vz-btn-disabled-border-color: #1f6b4f;
}

.btn-success {
    --vz-btn-bg: #1f6b4f;
    --vz-btn-border-color: #1f6b4f;
    --vz-btn-hover-bg: #0f3d2e;
    --vz-btn-hover-border-color: #0f3d2e;
    --vz-btn-active-bg: #0f3d2e;
    --vz-btn-active-border-color: #0f3d2e;
}

.btn-warning {
    --vz-btn-color: #fff;
    --vz-btn-bg: #b86a1a;
    --vz-btn-border-color: #b86a1a;
    --vz-btn-hover-bg: #8f5012;
    --vz-btn-hover-border-color: #8f5012;
    --vz-btn-hover-color: #fff;
    --vz-btn-active-bg: #8f5012;
    --vz-btn-active-border-color: #8f5012;
    --vz-btn-active-color: #fff;
}

.btn-soft-primary,
.btn-ghost-primary {
    --vz-btn-color: #1f6b4f;
    --vz-btn-bg: rgba(31, 107, 79, 0.12);
    --vz-btn-border-color: transparent;
    --vz-btn-hover-bg: #1f6b4f;
    --vz-btn-hover-color: #fff;
    --vz-btn-active-bg: #0f3d2e;
    --vz-btn-active-color: #fff;
}

.bg-primary {
    background-color: #1f6b4f !important;
}

.bg-success {
    background-color: #1f6b4f !important;
}

.bg-warning {
    background-color: #b86a1a !important;
}

.text-primary {
    color: #1f6b4f !important;
}

.text-success {
    color: #1f6b4f !important;
}

.text-warning {
    color: #b86a1a !important;
}

.border-primary {
    border-color: #1f6b4f !important;
}

.form-check-input:checked {
    background-color: #1f6b4f;
    border-color: #1f6b4f;
}

.form-control:focus,
.form-select:focus {
    border-color: #1f6b4f;
    box-shadow: 0 0 0 0.2rem rgba(31, 107, 79, 0.2);
}

.nav-tabs .nav-link.active {
    color: #1f6b4f;
    border-bottom-color: #1f6b4f;
}

.page-link {
    color: #1f6b4f;
}

.page-item.active .page-link {
    background-color: #1f6b4f;
    border-color: #1f6b4f;
}

.pagination .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #1f6b4f !important;
    border-color: #1f6b4f !important;
    color: #fff !important;
}

.badge.bg-primary,
.badge-soft-primary {
    background-color: rgba(31, 107, 79, 0.15) !important;
    color: #0f3d2e !important;
}

.badge.bg-primary {
    background-color: #1f6b4f !important;
    color: #fff !important;
}

.progress-bar {
    background-color: #1f6b4f;
}

.table thead th {
    color: #ffffff !important;
    background-color: #0f3d2e !important;
    border-color: #0c3226 !important;
}

/* DataTables + Bootstrap tables — blackish green headers everywhere */
table.dataTable thead th,
table.dataTable thead td,
table.table thead th,
table.table > thead > tr > th,
.dataTables_wrapper table.dataTable thead th,
.dataTables_scrollHead table thead th,
.dataTables_scrollHeadInner table thead th {
    background-color: #0f3d2e !important;
    color: #ffffff !important;
    border-color: #0c3226 !important;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead th.sorting_asc_disabled,
table.dataTable thead th.sorting_desc_disabled {
    background-color: #0f3d2e !important;
    color: #ffffff !important;
}

table.dataTable thead th:hover,
table.dataTable thead th.sorting:hover {
    background-color: #1a4d3a !important;
    color: #ffffff !important;
}

#layout-wrapper a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link):not(.logo):not(.navbar-brand) {
    color: #1f6b4f;
}

#layout-wrapper a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link):not(.logo):not(.navbar-brand):hover {
    color: #0f3d2e;
}

/* Soft cards / AMS dashboard accents */
.ams-stat-card {
    border: 1px solid #d5e3dc !important;
    background: #fff;
}

.ams-stat-card .text-primary,
.ams-stat-card .bg-soft-primary {
    color: #1f6b4f !important;
}

.bg-soft-primary {
    background-color: rgba(31, 107, 79, 0.12) !important;
    color: #0f3d2e !important;
}

.bg-soft-success {
    background-color: rgba(31, 107, 79, 0.12) !important;
    color: #0f3d2e !important;
}

.bg-soft-warning {
    background-color: rgba(184, 106, 26, 0.14) !important;
    color: #8f5012 !important;
}

.bg-soft-info {
    background-color: rgba(42, 111, 106, 0.12) !important;
    color: #1a4a47 !important;
}

/* Active menu item amber tint already via CSS vars; reinforce brand logo area */
.app-menu.navbar-menu {
    background: #0f3d2e;
}

[data-sidebar="dark"] .navbar-menu {
    background: #0f3d2e !important;
}
