:root {
    --ms-primary: #0bbf95;
    --ms-primary-600: #0aa885;
    --ms-primary-700: #089276;
    --ms-primary-light: #e2f8f1;
    --ms-accent: #3b82f6;
    --ms-text: #1e2b45;
    --ms-muted: #64748b;
    --ms-border: #e4e9f2;
    --ms-bg: #f5f7fb;
    --ms-radius: 14px;
    --ms-radius-sm: 9px;
    --ms-shadow-sm: 0 1px 2px rgba(23, 35, 61, .05);
    --ms-shadow: 0 6px 18px rgba(23, 35, 61, .07);
    --ms-shadow-lg: 0 18px 40px rgba(23, 35, 61, .12);
    --ms-gradient: linear-gradient(135deg, #0bbf95 0%, #089276 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--ms-bg);
    color: var(--ms-text);
    font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: var(--ms-primary-700);
    transition: color .15s ease;
}

a:hover {
    color: var(--ms-primary);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ms-text);
    letter-spacing: -.01em;
}

::selection {
    background: var(--ms-primary);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c7d0e0;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aab6cc;
}

.btn {
    border-radius: var(--ms-radius-sm);
    font-weight: 500;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

.btn:focus {
    box-shadow: 0 0 0 .25rem rgba(11, 191, 149, .22);
}

.btn-primary,
.btn-primary-btn,
.btn-primary.disabled,
.btn-primary:disabled,
.btn-primary-btn.disabled,
.btn-primary-btn:disabled {
    background: var(--ms-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(11, 191, 149, .32);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary-btn:hover,
.btn-primary-btn:focus {
    background: var(--ms-gradient);
    border: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(11, 191, 149, .4);
    filter: brightness(1.05);
}

.btn-primary:not(:disabled):active,
.btn-primary-btn:not(:disabled):active {
    background: var(--ms-primary-700);
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--ms-primary-700);
    border: 1.5px solid var(--ms-primary);
}

.btn-outline-primary:hover {
    background: var(--ms-primary);
    border-color: var(--ms-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 191, 149, .3);
}

.btn-secondary {
    background: #eef2f8;
    border: 1px solid var(--ms-border);
    color: var(--ms-text);
}

.btn-secondary:hover {
    background: #e2e8f2;
    border-color: #d3dceb;
    color: var(--ms-text);
}

.btn-light {
    background: #fff;
    border: 1px solid var(--ms-border);
    color: var(--ms-text);
}

.btn-light:hover {
    background: var(--ms-bg);
    color: var(--ms-text);
}

.btn-danger-soft,
.btn-info-soft,
.btn-success-soft,
.btn-warning-soft {
    border: none;
}

.card {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--ms-border);
    border-top-left-radius: var(--ms-radius);
    border-top-right-radius: var(--ms-radius);
}

.card-header.ms-card-header {
    background: var(--ms-gradient);
    border-bottom: none;
}

.card-header.ms-card-header .card-title,
.card-header.ms-card-header .page-title {
    color: #fff;
}

.card-header .card-title,
.card .card-title {
    color: var(--ms-text);
    font-weight: 600;
}

.card-body {
    color: var(--ms-text);
}

.card-footer {
    background-color: #fff;
    border-top: 1px solid var(--ms-border);
    border-bottom-left-radius: var(--ms-radius);
    border-bottom-right-radius: var(--ms-radius);
}

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ms-border);
    box-shadow: 0 1px 0 rgba(23, 35, 61, .03), 0 10px 24px -18px rgba(23, 35, 61, .2);
}

.main-nav > li > a {
    color: var(--ms-text);
    font-weight: 500;
}

.main-nav > li > a:hover,
.main-nav > li.active > a {
    color: var(--ms-primary-700);
}

.main-nav > li > a:hover::after,
.main-nav > li.active > a::after {
    background-color: var(--ms-primary);
}

.nav .nav-link {
    color: var(--ms-text);
}

.nav .nav-link:hover {
    color: var(--ms-primary-700);
}

.header-navbar-rht .logged-item .dropdown-menu {
    border: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow);
    border-radius: var(--ms-radius-sm);
}

.dropdown-menu {
    border: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow);
    border-radius: var(--ms-radius-sm);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
}

.section-header h2,
.section-header .title {
    font-weight: 700;
    color: var(--ms-text);
}

.section-header .sub-title {
    color: var(--ms-muted);
}

.section-title {
    color: var(--ms-text);
    font-weight: 600;
}

.form-control {
    border-color: var(--ms-border);
    border-radius: var(--ms-radius-sm);
    padding: .55rem .9rem;
    color: var(--ms-text);
}

.form-control-compact {
    padding: .3rem .75rem;
    font-size: .875rem;
    border-radius: var(--ms-radius-sm);
    height: calc(1.5em + .6rem + 2px);
    min-height: 0;
}

select.form-control-compact {
    height: calc(1.5em + .6rem + 2px);
    min-height: 0;
    padding: .3rem 2rem .3rem .75rem;
}

.btn-compact {
    padding: .3rem .85rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: var(--ms-radius-sm);
}

.form-control:focus {
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 .25rem rgba(11, 191, 149, .15);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-label,
label {
    color: var(--ms-text);
    font-weight: 500;
}

.form-group label {
    color: var(--ms-text);
    font-weight: 500;
}

select.form-control,
.custom-select {
    border-color: var(--ms-border);
    border-radius: var(--ms-radius-sm);
}

select.form-select {
    display: inline-block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem 1.75rem .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ms-text);
    vertical-align: middle;
    background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center / 8px 10px;
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius-sm);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.form-select:focus {
    border-color: var(--ms-primary);
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(11, 191, 149, .15);
}

select.form-select.is-invalid {
    border-color: #dc3545;
}

.table thead th {
    color: var(--ms-muted);
    font-weight: 600;
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ms-border);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table-responsive {
    border-radius: var(--ms-radius-sm);
}

.badge {
    border-radius: 50rem;
    font-weight: 500;
    padding: .42em .7em;
}

.avatar {
    border-radius: 12px;
}

.avatar > img,
.avatar-img {
    border-radius: 12px;
}

.profile-sidebar {
    position: relative;
    overflow: visible;
}

.profile-sidebar .widget-profile {
    background: linear-gradient(135deg, #0bbf95 0%, #089276 100%);
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: 0 8px 20px -8px rgba(11, 191, 149, .5);
}

.profile-sidebar .widget-profile {
    padding: 12px 12px;
}

.profile-sidebar .widget-profile .booking-doc-img {
    margin: 0 0 8px;
    padding: 4px;
}

.profile-sidebar .widget-profile .booking-doc-img img {
    height: 56px;
    width: 56px;
}

.profile-sidebar .profile-det-info h3 {
    font-size: 14px;
    margin-bottom: 2px;
}

.profile-sidebar .patient-details h5 {
    font-size: 12px;
}

.profile-sidebar .profile-info-widget h3,
.profile-sidebar .patient-details h5,
.profile-sidebar .patient-details h5 i {
    color: #fff;
}

.profile-sidebar .widget-profile .booking-doc-img img {
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

.profile-sidebar .dashboard-widget {
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
}

.dashboard-menu .menu-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9aa5b4;
    padding: 18px 22px 6px;
}

.profile-sidebar .dashboard-menu > ul > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    margin: 2px 8px;
    padding: 10px 10px;
    color: var(--ms-muted);
    font-weight: 500;
    line-height: 1.2;
    transition: background-color .15s ease, color .15s ease;
}

.profile-sidebar .dashboard-menu > ul > li > a i {
    width: 18px;
    margin-right: 0;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.profile-sidebar .dashboard-menu > ul > li > a span {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-sidebar .dashboard-menu > ul > li > a:hover {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
}

.profile-sidebar .dashboard-menu > ul > li.active > a {
    background: var(--ms-gradient);
    color: #fff;
    box-shadow: 0 5px 14px -4px rgba(11, 191, 149, .5);
}

.profile-sidebar .dashboard-menu > ul > li.active > a i {
    color: #fff;
}

@media (min-width: 992px) {
    .tenant-sidebar {
        position: sticky;
        top: 102px;
        align-self: flex-start;
        max-height: calc(100vh - 118px);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .tenant-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .tenant-sidebar::-webkit-scrollbar-thumb {
        background: var(--ms-border);
        border-radius: 4px;
    }

    .tenant-sidebar .profile-sidebar {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .tenant-sidebar .widget-profile {
        flex: 0 0 auto;
    }

    .tenant-sidebar .dashboard-widget {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ms-border);
}

/* Header carte moderne (inspiré du journal d'activité) */
.ms-page-header-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--ms-border);
    border-left: 4px solid var(--ms-primary);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
}

.ms-page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ms-page-header-heading {
    min-width: 0;
}

.ms-page-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ms-text);
}

.ms-page-header-subtitle {
    margin: 0.25rem 0 0;
    color: var(--ms-muted);
    font-size: 0.875rem;
}

.ms-page-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
    border: 1px solid #c9efe2;
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-page-header-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.875rem;
    border-top: 1px dashed var(--ms-border);
}

/* Carte toolbar agenda (filtres + actions) */
.ms-toolbar-card {
    display: block;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
}

.ms-toolbar-card .agenda-toolbar-select {
    width: 260px;
    max-width: 260px;
    min-height: 32px;
    height: 32px;
    padding: 4px 12px;
    font-size: 14px;
}

.ms-toolbar-card .agenda-toolbar-btn {
    height: 32px;
    min-height: 32px;
    padding: 4px 12px;
    font-size: 14px;
}

/* Rôle sélectionné dans la liste (master-detail) */
.ms-role-selected {
    background-color: var(--ms-primary-light);
    border-left: 3px solid var(--ms-primary) !important;
}

.ms-role-selected .font-weight-medium {
    color: var(--ms-primary-700);
}

/* Pills de permission (master-detail rôles) */
.ms-perm-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--ms-border);
    border-radius: 999px;
    background: #fff;
    color: var(--ms-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--ms-shadow-sm);
    transition: all 0.15s;
    margin-bottom: 0;
    user-select: none;
}

.ms-perm-pill:hover {
    background: var(--ms-primary-light);
    border-color: var(--ms-primary);
}

.ms-perm-pill .ms-perm-check {
    display: none;
    font-size: 11px;
}

.ms-perm-pill.is-selected {
    background: var(--ms-primary);
    border-color: var(--ms-primary);
    color: #fff;
}

.ms-perm-pill.is-selected .ms-perm-check {
    display: inline-block;
}

.ms-perm-pill input.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-heading {
    min-width: 0;
}

.page-header .page-title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ms-text);
}

.page-header .page-subtitle {
    margin: 0.25rem 0 0;
    color: var(--ms-muted);
    font-size: 0.875rem;
}

.page-header .breadcrumb {
    margin: 0 0 0.3rem;
    padding: 0;
    background: transparent;
    font-size: 0.8125rem;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #b6c0d2;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item a {
    color: var(--ms-muted);
    text-decoration: none;
    transition: color .15s ease;
}

.breadcrumb-item a:hover {
    color: var(--ms-primary-700);
}

.breadcrumb-item.active {
    color: var(--ms-primary-700);
}

.footer {
    background: #0f1b33;
}

.footer .footer-top {
    background: #0f1b33;
}

.footer .footer-widget .footer-title {
    color: #fff;
    font-weight: 600;
}

.footer .footer-widget p,
.footer .footer-widget li,
.footer .footer-widget a {
    color: #9fb0c9;
}

.footer .footer-widget a:hover {
    color: var(--ms-primary);
}

.footer .footer-bottom {
    background: #0b1426;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.footer .copyright-text,
.footer .copyright-text p,
.footer .copyright-text a {
    color: #9fb0c9;
}

.speicality-item .speicality-img {
    transition: transform .2s ease, box-shadow .2s ease;
}

.speicality-item:hover .speicality-img {
    transform: translateY(-4px);
}

.speicality-item p {
    color: var(--ms-text);
    font-weight: 500;
}

.profile-widget {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
}

.profile-widget:hover {
    box-shadow: var(--ms-shadow);
    transform: translateY(-3px);
}

.profile-widget .doc-info .doc-name a {
    color: var(--ms-text);
    font-weight: 600;
}

.loginbox {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow);
    background: #fff;
}

.loginbox .account-subtitle {
    color: var(--ms-muted);
}

.account-box .login-btn,
.account-box .btn-primary {
    width: 100%;
}

.widget-profile {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
}

.dashboard-stat {
    border-radius: var(--ms-radius);
}

.dashboard-stat i {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
    width: 44px;
    height: 44px;
    line-height: 44px;
    border-radius: 12px;
    margin: 0 auto 10px;
    display: block;
    font-size: 1.15rem;
}

.dashboard-stat h3 {
    font-weight: 700;
    color: var(--ms-text);
}

.stat-card {
    border-left-width: 4px;
    border-radius: var(--ms-radius);
}

/* --- Compact stat cards (rapports) --- */
.ms-stat-card {
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: #fff;
    border-radius: var(--ms-radius);
    border: 1px solid var(--ms-border);
    padding: 14px 16px;
    min-height: 72px;
    transition: box-shadow 0.2s, transform 0.15s;
}

.ms-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.ms-stat-card__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    align-self: flex-start;
}

.ms-stat-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    justify-content: space-between;
}

.ms-stat-card__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ms-text);
    line-height: 1.2;
    text-align: right;
}

.ms-stat-card__label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: auto;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color variants */
.ms-stat-card--blue .ms-stat-card__icon {
    background: #e0edff;
    color: #2563eb;
}

.ms-stat-card--green .ms-stat-card__icon {
    background: #d1fae5;
    color: #059669;
}

.ms-stat-card--orange .ms-stat-card__icon {
    background: #fef3c7;
    color: #d97706;
}

.ms-stat-card--purple .ms-stat-card__icon {
    background: #ede9fe;
    color: #7c3aed;
}

.ms-stat-card--red .ms-stat-card__icon {
    background: #fee2e2;
    color: #dc2626;
}

.pagination .page-link {
    border-color: var(--ms-border);
    color: var(--ms-text);
    border-radius: var(--ms-radius-sm);
    margin: 0 3px;
}

.pagination .page-item.active .page-link {
    background: var(--ms-gradient);
    border-color: var(--ms-primary);
}

.pagination .page-link:hover {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
}

.alert {
    border: none;
    border-radius: var(--ms-radius-sm);
}

.alert-success {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
}

.list-group-item {
    border-color: var(--ms-border);
}

.list-group-item.active {
    background: var(--ms-gradient);
    border-color: var(--ms-primary);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--ms-muted);
    font-weight: 500;
    border-radius: var(--ms-radius-sm);
}

.nav-tabs .nav-link:hover {
    color: var(--ms-primary-700);
}

.nav-tabs .nav-link.active {
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
}

.tab-content {
    border-radius: var(--ms-radius-sm);
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
    cursor: pointer;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

.modal-content {
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--ms-border);
}

.modal-footer {
    border-top: 1px solid var(--ms-border);
}

.swal2-popup {
    border-radius: var(--ms-radius);
}

.booking-doc-img img {
    border-radius: 14px;
}

.booking-info-card {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
}

.booking-summary {
    background: var(--ms-primary-light);
    border-radius: var(--ms-radius-sm);
}

.chat-window {
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
}

.doctor-img,
.doc-img img {
    border-radius: 14px;
}

.doc-department {
    color: var(--ms-primary-700);
    font-weight: 500;
}

.facility-img,
.facility-detail img {
    border-radius: 14px;
}

.rating i.filled {
    color: #f59e0b;
}

.text-primary {
    color: var(--ms-primary-700) !important;
}

.bg-primary {
    background-color: var(--ms-primary) !important;
}

.border-primary {
    border-color: var(--ms-primary) !important;
}

.btn-primary {
    color: #fff;
}

.btn-primary:hover {
    color: #fff;
}

/*------------------------------------------------------------------
  Bootstrap 5 utility compatibility (app runs on Bootstrap 4.4)
------------------------------------------------------------------*/
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.text-end { text-align: right !important; }
.text-start { text-align: left !important; }

.me-auto { margin-right: auto !important; }
.ms-auto { margin-left: auto !important; }
.me-0 { margin-right: 0 !important; }
.ms-0 { margin-left: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.ms-1 { margin-left: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.ms-2 { margin-left: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-3 { margin-left: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }
.ms-5 { margin-left: 3rem !important; }

/*------------------------------------------------------------------
  FullCalendar v6 — agenda tenant
------------------------------------------------------------------*/
.agenda-calendar {
    min-height: 720px;
    background: #fff;
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    padding: 1rem;
}

.agenda-calendar.fc-loading {
    opacity: .6;
    pointer-events: none;
}

.agenda-calendar .fc-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ms-text);
}

.agenda-calendar .fc-button-primary {
    background-color: var(--ms-primary);
    border-color: var(--ms-primary);
    font-weight: 500;
}

.agenda-calendar .fc-button-primary:not(:disabled):hover,
.agenda-calendar .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--ms-primary-700);
    border-color: var(--ms-primary-700);
}

.agenda-calendar .fc-button-primary:disabled {
    background-color: #a7c6be;
    border-color: #a7c6be;
}

.agenda-calendar .fc-col-header-cell-cushion {
    color: var(--ms-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .04em;
}

.agenda-calendar .fc-timegrid-slot-label-cushion {
    color: var(--ms-muted);
}

.agenda-calendar .fc-timegrid-slot {
    height: 46px;
}

.agenda-calendar .fc-event {
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 12px;
    border-width: 0;
}

.agenda-calendar .fc-event .fc-event-time,
.agenda-calendar .fc-event .fc-event-title {
    font-weight: 500;
}

.agenda-calendar .fc-event .fc-event-time {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.agenda-calendar .fc-daygrid-event {
    white-space: normal;
}

.agenda-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--ms-muted);
}

.agenda-legend-wrap {
    margin-bottom: 1rem;
}

.agenda-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.agenda-legend .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.agenda-legend .legend-box {
    width: 14px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

@media (max-width: 991.98px) {
    .main-menu-wrapper {
        background: #fff;
        box-shadow: var(--ms-shadow-lg);
    }

    .menu-header .menu-close {
        color: var(--ms-text);
    }
}

/*------------------------------------------------------------------
  Toolbar agenda — alignement et dimensions homogènes
------------------------------------------------------------------*/
.agenda-toolbar {
    min-width: 0;
}

.agenda-toolbar .agenda-toolbar-select,
.agenda-toolbar .agenda-toolbar-btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.agenda-toolbar .agenda-toolbar-select {
    min-height: 38px;
    max-width: 260px;
    padding: 6px 14px;
    font-size: 14px;
}

.agenda-toolbar .agenda-toolbar-btn {
    padding: 4px 12px;
    font-size: 14px;
}

@media (max-width: 767.98px) {
    .agenda-toolbar {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .agenda-toolbar .agenda-toolbar-select {
        flex: 1 1 100%;
        max-width: none;
    }
}

.banner-wrapper .banner-header h1 {
    white-space: nowrap;
    font-size: min(36px, calc((100vw - 30px) / 22));
}

@media (max-width: 849.98px) {
    .banner-wrapper .banner-header h1 {
        font-size: min(33px, calc((100vw - 30px) / 22));
    }
}

/* Pricing cards (onboarding) */
.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    background: #fff;
    box-shadow: var(--ms-shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ms-shadow);
    border-color: var(--ms-primary);
}

.pricing-card.featured {
    border: 2px solid var(--ms-primary);
    box-shadow: 0 12px 32px -14px rgba(11, 191, 149, .45);
}

.pricing-card.selected:not(.featured) {
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px rgba(11, 191, 149, .18), var(--ms-shadow-sm);
}

.pricing-card.featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px -16px rgba(11, 191, 149, .55);
}

.pricing-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ms-gradient);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .32rem .9rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 5px 12px -5px rgba(11, 191, 149, .6);
}

.pricing-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.6rem 1.4rem 1.4rem;
}

.pricing-card.featured .pricing-card-body {
    padding-top: 2rem;
}

.pricing-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ms-text);
    margin-bottom: .25rem;
}

.pricing-card-tagline {
    color: var(--ms-muted);
    font-size: .8125rem;
    line-height: 1.4;
    margin-bottom: .9rem;
}

.pricing-card-price {
    margin-bottom: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ms-border);
}

.pricing-card-price .amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--ms-text);
    line-height: 1.1;
}

.pricing-card-price .currency {
    color: var(--ms-muted);
    font-size: .875rem;
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex: 1 1 auto;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .42rem 0;
    font-size: .875rem;
    color: var(--ms-text);
}

.pricing-features li i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: .12rem;
    border-radius: 50%;
    background: var(--ms-primary-light);
    color: var(--ms-primary-700);
    font-size: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pricing-card .btn-pricing {
    padding: .6rem 1rem;
    font-size: .9375rem;
    font-weight: 600;
    border-radius: var(--ms-radius-sm);
}

.pricing-card .btn-pricing.btn-pricing-featured {
    background: var(--ms-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(11, 191, 149, .55);
}

.pricing-card .btn-pricing.btn-pricing-featured:hover {
    background: var(--ms-primary-700);
    color: #fff;
}

@media (max-width: 991.98px) {
    .pricing-card {
        margin-top: 1.25rem;
        margin-bottom: 1.5rem;
    }
}

.content .pricing-cards-wrap {
    padding-bottom: 3rem;
}

/* Onboarding stepper */
.wizard-steps-ms {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto;
}

.wizard-step-ms {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    min-width: 88px;
}

.wizard-step-circle-ms {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ms-muted);
    background: #fff;
    border: 2px solid var(--ms-border);
    transition: all .2s ease;
}

.wizard-step-ms.done .wizard-step-circle-ms {
    background: var(--ms-primary);
    border-color: var(--ms-primary);
    color: #fff;
}

.wizard-step-ms.active .wizard-step-circle-ms {
    background: var(--ms-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(11, 191, 149, .18);
}

.wizard-step-label-ms {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--ms-muted);
    white-space: nowrap;
}

.wizard-step-ms.active .wizard-step-label-ms {
    color: var(--ms-primary-700);
    font-weight: 600;
}

.wizard-step-line-ms {
    flex: 1 1 auto;
    height: 2px;
    margin: 21px .75rem 0;
    background: var(--ms-border);
    border-radius: 2px;
    transition: background .2s ease;
}

.wizard-step-line-ms.done {
    background: var(--ms-primary);
}

@media (max-width: 575.98px) {
    .wizard-step-ms {
        min-width: 70px;
        gap: .4rem;
    }

    .wizard-step-circle-ms {
        width: 36px;
        height: 36px;
        font-size: .95rem;
    }

    .wizard-step-line-ms {
        margin-top: 17px;
    }

    .wizard-step-label-ms {
        font-size: .75rem;
    }
}

/* ============ SweetAlert2 — notifications & toasts compacts ============ */
.swal2-popup {
    font-size: 13px;
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
}

.swal2-popup .swal2-title {
    font-size: 1.05rem;
    line-height: 1.4;
    padding: 0 0 .35rem;
}

.swal2-popup .swal2-html-container {
    font-size: 13px;
    line-height: 1.5;
}

.swal2-popup .swal2-icon {
    margin-bottom: .5rem;
}

.swal2-popup .swal2-actions {
    margin-top: .75rem;
}

.swal2-popup .swal2-confirm,
.swal2-popup .swal2-cancel {
    font-size: 13px;
    padding: .35rem .9rem;
    border-radius: 8px;
}

.swal2-popup .swal2-timer-progress-bar {
    background: var(--ms-primary);
}

/* Toasts (notifications success / warning / info) */
.swal2-toast {
    font-size: 13px;
    border-radius: 12px;
    padding: .55rem .85rem;
}

.swal2-toast .swal2-title {
    font-size: 13px;
    line-height: 1.35;
    padding: 0;
    margin-left: .35rem;
}

.swal2-toast .swal2-icon {
    font-size: .8em;
    min-width: 1.6em;
    height: 1.6em;
    margin: 0 .35em 0 0;
}

.swal2-toast .swal2-icon .swal2-icon-content {
    font-size: 1.1em;
}
