/*
 * CalibOn UI layer (loaded last). Palette is SB-Admin 2: primary #4e73df
 * (MDB's second blue #4285f4 was removed), gray scale, status colours.
 */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url(../fonts/nunito/nunito-latin.woff2) format("woff2");
}

:root {
    --kam-primary: #4e73df;
    --kam-primary-dark: #224abe;
    --kam-primary-soft: rgba(78, 115, 223, .1);
    --kam-text: #3a3b45;
    --kam-muted: #6e707e; /* gray-700: AA contrast on white (gray-600 was 3.6:1) */
    --kam-border: #e3e6f0;
    --kam-bg: #f5f7fb;
    --kam-radius: .5rem;
    --kam-radius-sm: .35rem;
    --kam-shadow: 0 1px 2px rgba(58, 59, 69, .06), 0 2px 8px rgba(58, 59, 69, .06);
    --kam-shadow-lg: 0 10px 30px rgba(34, 74, 190, .15);
    --kam-nav-h: 64px;
    --kam-font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
body, body#page-top {
    font-family: var(--kam-font);
}
body#page-top {
    background: var(--kam-bg);
    color: var(--kam-text);
    padding-top: 0;
    -webkit-font-smoothing: antialiased;
}
#wrapper #content-wrapper {
    background: var(--kam-bg);
    padding-top: 0;
    min-width: 0;
}
#content > .container-fluid {
    max-width: 1600px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.text-gray-600, .text-muted { color: var(--kam-muted) !important; }
.kam-num, .kam-kpi-value, .table td { font-variant-numeric: tabular-nums; }
a { transition: color .15s ease; }
::selection { background: var(--kam-primary-soft); }

.skip-link {
    position: absolute;
    left: -999px;
    top: .5rem;
    z-index: 2000;
    background: #fff;
    padding: .5rem 1rem;
    border-radius: var(--kam-radius-sm);
    box-shadow: var(--kam-shadow);
}
.skip-link:focus { left: .5rem; }

/* Keyboard focus ring (mouse clicks stay clean). */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--kam-primary) !important;
    outline-offset: 2px;
}

/* ---------- Sidebar ---------- */
.sidebar .sidebar-brand { height: var(--kam-nav-h); }
.sidebar .sidebar-brand-text { font-size: 1.15rem; letter-spacing: .02em; text-transform: none; }
.sidebar .sidebar-brand-icon i { font-size: 1.1rem; }
.sidebar .nav-item .nav-link { display: flex; align-items: center; }
@media (min-width: 768px) { .sidebar:not(.toggled) .nav-item .nav-link { padding-top: .7rem; padding-bottom: .7rem; } }
.sidebar .nav-item .nav-link span:not(.badge) { flex: 1; }
.sidebar .nav-item .nav-link .badge { flex: 0 0 auto; }
@media (min-width: 768px) { .sidebar:not(.toggled) .nav-item .nav-link { width: auto !important; } }
.sidebar .nav-item.active { position: relative; }
.sidebar .nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: .5rem;
    bottom: .5rem;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #fff;
}
.sidebar-dark .nav-item.active .nav-link { background: rgba(255, 255, 255, .1); }
.sidebar .kam-nav-badge {
    background: rgba(255, 255, 255, .95);
    color: var(--kam-primary-dark);
    font-size: .7rem;
    margin-left: .5rem;
}
.sidebar.toggled .kam-nav-badge {
    position: absolute;
    top: .4rem;
    right: 1.4rem;
    margin: 0;
    background: #e74a3b;
    color: #fff;
}
.sidebar .sidebar-heading { letter-spacing: .08em; }
@media (min-width: 768px) {
    .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
    .sidebar.toggled .nav-item .nav-link { flex-direction: column; }
}
@media (max-width: 767.98px) {
    .sidebar .nav-item .nav-link { flex-direction: column; }
    .sidebar .kam-nav-badge { position: absolute; top: .3rem; right: .6rem; margin: 0; background: #e74a3b; color: #fff; }
}

/* ---------- Topbar ---------- */
.kam-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--kam-nav-h);
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--kam-border);
    box-shadow: 0 1px 3px rgba(58, 59, 69, .05);
}
.kam-topbar .kam-icon-btn {
    position: relative;
    color: var(--kam-muted) !important;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}
.kam-topbar .kam-icon-btn:hover { background: var(--kam-primary-soft); color: var(--kam-primary) !important; }
.kam-topbar .badge-counter { position: absolute; top: .15rem; right: .1rem; transform: none; }
.kam-topbar .topbar-divider { height: 2rem; margin: auto .75rem; }

/* Global search */
.kam-search { flex: 1; max-width: 480px; width: auto !important; min-width: 0; margin-right: 1rem; }
.kam-search-box { position: relative; width: 100%; }
.kam-search-box > .fa-search {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kam-muted);
    pointer-events: none;
    z-index: 1;
}
.kam-search-box input {
    width: 100% !important;
    padding-left: 2.4rem;
    padding-right: 4rem;
    border-radius: 10rem;
    background: var(--kam-bg);
    border-color: transparent;
}
.kam-search-box input:focus { background: #fff; }
.kam-search-box input::-webkit-search-cancel-button { display: none; }
.kam-search-kbd {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: var(--kam-muted);
    border: 1px solid var(--kam-border);
    box-shadow: none;
    font-size: .7rem;
    padding: .1rem .35rem;
    pointer-events: none;
}
.kam-search-results {
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    margin-top: .4rem;
}
.kam-search-results .dropdown-header {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--kam-muted);
}
.kam-search-results .dropdown-item { display: flex; align-items: center; white-space: normal; }
.kam-search-results .dropdown-item.active, .kam-search-results .dropdown-item:hover { background: var(--kam-primary-soft); color: var(--kam-text); }
.kam-search-results .kam-sr-title { font-weight: 600; display: block; }
.kam-search-results .kam-sr-sub { font-size: .8rem; color: var(--kam-muted); display: block; }
.kam-search-results mark { padding: 0; background: rgba(246, 194, 62, .35); }
@media (max-width: 575.98px) {
    .kam-topbar { padding: 0 .75rem; }
    .kam-search-kbd { display: none; }
    .kam-search-box input { padding-right: 1rem; }
}

.kam-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--kam-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    flex: 0 0 auto;
}
.kam-user-toggle {
    display: flex !important;
    align-items: center;
    color: var(--kam-text) !important;
}
.kam-user-toggle .kam-user-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-menu {
    border: 1px solid var(--kam-border);
    border-radius: var(--kam-radius);
    box-shadow: var(--kam-shadow-lg);
    padding: .4rem;
}
.dropdown-item {
    border-radius: var(--kam-radius-sm);
    padding: .5rem .85rem;
}
.dropdown-item i { width: 1.25em; margin-right: .35rem; color: var(--kam-muted); }
.dropdown-item:active { background: var(--kam-primary); }
.dropdown-header { padding: .5rem .85rem; }

/* ---------- Page header ---------- */
#content > .container-fluid > .d-sm-flex:first-child {
    margin-bottom: 1.5rem !important;
    gap: .75rem;
}
#content > .container-fluid > .d-sm-flex:first-child h1 {
    font-weight: 700;
    letter-spacing: -.01em;
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--kam-border);
    border-radius: var(--kam-radius);
    box-shadow: var(--kam-shadow) !important;
}
.card.shadow-lg { box-shadow: var(--kam-shadow-lg) !important; }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--kam-border);
    border-radius: var(--kam-radius) var(--kam-radius) 0 0 !important;
}
.card-header h6 { font-size: .95rem; }
.card-header small { color: var(--kam-muted); }

/* KPI tiles (dashboard) */
.kam-kpi { transition: transform .15s ease, box-shadow .15s ease; }
.kam-kpi:hover { transform: translateY(-2px); box-shadow: var(--kam-shadow-lg) !important; }
.kam-kpi .kam-kpi-value { font-size: 1.75rem; line-height: 1.1; font-weight: 700; color: var(--kam-text); }
.kam-kpi .kam-kpi-label { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.kam-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.kam-kpi-icon.bg-soft-dark    { background: rgba(90, 92, 105, .1);  color: #5a5c69; }
.kam-kpi-icon.bg-soft-primary { background: rgba(78, 115, 223, .1); color: #4e73df; }
.kam-kpi-icon.bg-soft-success { background: rgba(28, 200, 138, .12); color: #1cc88a; }
.kam-kpi-icon.bg-soft-info    { background: rgba(54, 185, 204, .12); color: #36b9cc; }
.kam-kpi-icon.bg-soft-warning { background: rgba(246, 194, 62, .15); color: #dda20a; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--kam-radius-sm);
    font-weight: 500;
    letter-spacing: .01em;
    transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary:hover, .btn-primary:focus { box-shadow: 0 4px 12px rgba(78, 115, 223, .35) !important; }
.btn.btn-user { border-radius: 10rem; padding: .8rem 1rem; font-size: .9rem; }
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn .kam-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: .4rem;
    vertical-align: -.125em;
    border: .15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: kam-spin .7s linear infinite;
}
@keyframes kam-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form-control {
    border-color: #d1d3e2;
    border-radius: var(--kam-radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    border-color: var(--kam-primary);
    box-shadow: 0 0 0 .2rem var(--kam-primary-soft);
}
.form-control.parsley-error { border-color: #e74a3b; }
.form-control.parsley-error:focus { box-shadow: 0 0 0 .2rem rgba(231, 74, 59, .15); }
label { font-weight: 500; color: var(--kam-text); }
.parsley-errors-list li { font-size: .8rem; margin-top: .25rem; color: #e74a3b; }
.form-check-input { cursor: pointer; }

/* ---------- Tables / DataTables ---------- */
.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--kam-border);
    color: var(--kam-muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f8f9fc;
}
.table td, .table th { vertical-align: middle; border-color: var(--kam-border); }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(248, 249, 252, .8); }
.table-hover tbody tr:hover, .dataTable tbody tr:hover { background-color: var(--kam-primary-soft) !important; }
div.dataTables_wrapper div.dataTables_filter input {
    min-width: 240px;
    border-radius: 10rem;
    padding-left: 2rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23858796' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat .75rem center;
}
div.dataTables_wrapper div.dataTables_length select { border-radius: var(--kam-radius-sm); }
div.dataTables_wrapper div.dataTables_processing {
    border: 0;
    border-radius: var(--kam-radius);
    box-shadow: var(--kam-shadow-lg);
    background: #fff;
    color: var(--kam-text);
    padding: 1rem;
    z-index: 5;
}
.dataTables_wrapper .dataTables_info { color: var(--kam-muted); font-size: .85rem; }
.page-item .page-link { border-radius: var(--kam-radius-sm) !important; margin: 0 2px; border: 0; color: var(--kam-text); }
.page-item.active .page-link { background: var(--kam-primary); }
@media (max-width: 575.98px) {
    div.dataTables_wrapper div.dataTables_filter input { min-width: 0; width: 100%; }
    div.dataTables_wrapper div.dataTables_filter label { width: 100%; }
}

/* ---------- Lists / empty states ---------- */
.list-group-item { border-color: var(--kam-border); }
.list-group-item-action:hover { background: var(--kam-primary-soft); }
.kam-empty {
    text-align: center;
    color: var(--kam-muted);
    padding: 1.5rem .5rem;
    font-size: .9rem;
}
.kam-empty i { display: block; font-size: 1.75rem; margin-bottom: .5rem; opacity: .5; }
.kam-skeleton {
    height: .9rem;
    border-radius: 4px;
    margin: .6rem 0;
    background: linear-gradient(90deg, #eaecf4 25%, #f5f6fa 37%, #eaecf4 63%);
    background-size: 400% 100%;
    animation: kam-shimmer 1.4s ease infinite;
}
@keyframes kam-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.kam-scroll { max-height: 420px; overflow-y: auto; }

/* ---------- Modals ---------- */
/* Side / full-height panels (ported from MDB, which is no longer loaded). */
.modal.fade.right:not(.show) .modal-dialog { transform: translate3d(25%, 0, 0); }
.modal .modal-dialog.modal-right { right: 0; }
@media (min-width: 992px) {
    .modal .modal-side { position: absolute; bottom: 10px; right: 10px; margin: 0; width: 400px; }
    .modal .modal-dialog.modal-bottom-right { bottom: 10px; right: 10px; }
    .modal .modal-full-height { position: absolute; display: flex; margin: 0; width: 400px; height: auto; min-height: 100%; top: 0; right: 0; }
    .modal .modal-full-height .modal-content { width: 100%; border-radius: 0; }
    .modal .modal-full-height.modal-lg { width: 800px; max-width: 800px; }
}
@media (min-width: 1200px) {
    .modal .modal-full-height.modal-lg { width: 1000px; max-width: 1000px; }
}
/* Confirm dialog (kamConfirm) */
.kam-confirm .modal-content { padding: 1.5rem 1.5rem 1.25rem; text-align: center; }
.kam-confirm .kam-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--kam-primary-soft);
    color: var(--kam-primary);
}
.kam-confirm.is-danger .kam-confirm-icon { background: rgba(231, 74, 59, .12); color: #e74a3b; }
.kam-confirm .kam-confirm-msg { font-size: 1rem; color: var(--kam-text); margin-bottom: 1.25rem; }
.kam-confirm .modal-footer { border: 0; justify-content: center; padding: 0; }
.kam-confirm .btn { min-width: 110px; }
.kam-toast .btn-link { font-weight: 700; padding: 0 .25rem; }

.modal-content { border: 0; border-radius: var(--kam-radius); overflow: hidden; }
.modal-header { border-bottom-color: var(--kam-border); }
.modal-footer { border-top-color: var(--kam-border); }
.modal-backdrop.show { opacity: .4; }

/* ---------- Toasts (replace blocking alert()) ---------- */
.kam-toasts {
    position: fixed;
    top: calc(var(--kam-nav-h) + .75rem);
    right: 1rem;
    z-index: 2050;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}
body:not(#page-top) .kam-toasts { top: 1rem; }
.kam-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    background: #fff;
    color: var(--kam-text);
    border-left: 4px solid var(--kam-primary);
    border-radius: var(--kam-radius);
    box-shadow: var(--kam-shadow-lg);
    padding: .8rem 1rem;
    font-size: .9rem;
    animation: kam-toast-in .2s ease-out;
}
.kam-toast.kam-toast-success { border-left-color: #1cc88a; }
.kam-toast.kam-toast-error   { border-left-color: #e74a3b; }
.kam-toast .kam-toast-icon { font-size: 1.1rem; line-height: 1.3; }
.kam-toast-success .kam-toast-icon { color: #1cc88a; }
.kam-toast-error .kam-toast-icon   { color: #e74a3b; }
.kam-toast-info .kam-toast-icon    { color: var(--kam-primary); }
.kam-toast .kam-toast-msg { flex: 1; white-space: pre-line; word-break: break-word; }
.kam-toast .close { font-size: 1.2rem; line-height: 1; opacity: .4; }
.kam-toast.is-leaving { opacity: 0; transform: translateX(16px); transition: all .2s ease-in; }
@keyframes kam-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- AJAX progress bar ---------- */
.kam-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 2100;
    background: linear-gradient(90deg, var(--kam-primary), #36b9cc);
    box-shadow: 0 0 8px rgba(78, 115, 223, .5);
    opacity: 0;
    transition: width .4s ease, opacity .3s ease;
}
.kam-progress.is-active { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
.kam-progress.is-done { opacity: 0; width: 100%; transition: width .2s ease, opacity .4s ease .2s; }

/* ---------- Footer / misc ---------- */
footer.sticky-footer {
    padding: 1.25rem 0;
    border-top: 1px solid var(--kam-border);
    color: var(--kam-muted);
    font-size: .8rem;
}
.scroll-to-top { border-radius: 50% !important; background: var(--kam-primary); box-shadow: var(--kam-shadow-lg); }

/* ---------- Auth pages (login / forgot password) ---------- */
body.bg-gradient-primary { min-height: 100vh; }
.kam-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}
.kam-auth .card { border: 0; border-radius: 1rem; overflow: hidden; }
.kam-auth .bg-login-image { position: relative; min-height: 520px; }
.kam-auth .bg-login-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(78, 115, 223, .15), rgba(34, 74, 190, .55));
}
.kam-auth .kam-auth-brand {
    position: absolute;
    z-index: 1;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    color: #fff;
    text-align: left;
}
.kam-auth .kam-auth-brand h2 { font-weight: 700; font-size: 1.5rem; margin-bottom: .35rem; }
.kam-auth .kam-auth-brand p { opacity: .9; margin: 0; }
.kam-auth .kam-auth-logo { height: 36px; }
.kam-auth .form-control-user { border-radius: 10rem; padding: 1.4rem 1.1rem; font-size: .9rem; }
.kam-auth .input-icon { position: relative; }
.kam-auth .input-icon > .fa-fw:first-child {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kam-muted);
    pointer-events: none;
}
.kam-auth .input-icon .form-control-user { padding-left: 2.6rem; }
.kam-auth .input-icon .toggle-password {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--kam-muted);
    padding: .35rem .5rem;
    border-radius: 50%;
}
.kam-auth .input-icon .toggle-password:hover { color: var(--kam-primary); }
.kam-auth .input-icon .toggle-password + * , .kam-auth .input-icon.has-toggle .form-control-user { padding-right: 2.75rem; }
.kam-auth .kam-auth-error {
    display: none;
    border-radius: var(--kam-radius);
    font-size: .875rem;
}
.kam-auth .kam-auth-links a { color: var(--kam-muted); }
.kam-auth .kam-auth-links a:hover { color: var(--kam-primary); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Phase 2: detail pages, forms, status pills
   ========================================================= */
.kam-detail > .card-body { padding: 1.5rem; }
.kam-detail-head { margin-bottom: 1rem; }
.kam-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    color: var(--kam-muted);
    margin-bottom: .35rem;
}
.kam-back:hover { color: var(--kam-primary); text-decoration: none; }
.kam-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--kam-text);
    margin: 0 1rem .5rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
}
.kam-detail-title .badge { font-size: .75rem; }
.kam-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.kam-detail-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.kam-detail-meta:empty { display: none; }
.kam-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    font-size: .9rem;
    color: var(--kam-text);
}
.kam-meta-item > i { color: var(--kam-muted); width: 1em; text-align: center; }
.kam-meta-label {
    color: var(--kam-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}
.kam-detail-sub {
    margin-top: .75rem;
    display: inline-block;
    background: var(--kam-primary-soft);
    color: var(--kam-primary-dark);
    border-radius: var(--kam-radius-sm);
    padding: .35rem .75rem;
    font-size: .875rem;
    font-weight: 600;
}
.d-contents { display: contents; }

/* Horizontal tabs (were vertical pills) */
.kam-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid var(--kam-border);
    gap: .25rem;
    scrollbar-width: thin;
}
.kam-tabs .nav-link {
    white-space: nowrap;
    color: var(--kam-muted) !important;
    font-weight: 600 !important;
    padding: .7rem 1rem;
    border-radius: 0 !important;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    background: transparent !important;
}
.kam-tabs .nav-link:hover { color: var(--kam-primary) !important; }
.kam-tabs .nav-link.active {
    color: var(--kam-primary) !important;
    border-bottom-color: var(--kam-primary);
}

/* View mode: disabled edit fields read like text, not grey boxes */
.form-control.editMode:disabled, .form-control.editMode[disabled] {
    background: transparent;
    border-color: transparent;
    padding-left: 0;
    color: var(--kam-text);
    opacity: 1;
    resize: none;
}
.bootstrap-select.disabled > .btn, .bootstrap-select > .btn.disabled {
    background: transparent !important;
    border-color: transparent !important;
    padding-left: 0;
    color: var(--kam-text) !important;
}
.bootstrap-select.disabled .dropdown-toggle::after { display: none; }
.form-control.editMode:not(:disabled) { background: #fff; }
.form-control.editMode:disabled::placeholder { color: transparent; }
.bootstrap-select.disabled, .bootstrap-select > .btn.disabled, .bootstrap-select.disabled > .btn { opacity: 1 !important; }
.bootstrap-select.disabled .filter-option-inner-inner { color: var(--kam-text); }
.input-daterange .input-group-addon { color: var(--kam-muted); padding: 0 .35rem; }
.kam-edit-switch {
    background: #fff;
    border: 1px solid var(--kam-border);
    border-radius: 10rem;
    padding: .35rem .9rem .35rem 2.6rem;
    font-weight: 600;
    font-size: .875rem;
}

/* Field labels */
.kam-auto-label, .form-group > label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--kam-muted);
    margin-bottom: .3rem;
}
.form-group > label.custom-control-label, .form-group > label.form-check-label {
    text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500; color: var(--kam-text);
}
/* Section titles inside forms */
form .col-sm-12.text-primary.font-weight-bold {
    font-size: 1rem !important;
    padding-bottom: .5rem;
    margin: .75rem 0 1rem;
    border-bottom: 1px solid var(--kam-border);
}

/* Save bar sticks to the bottom of the viewport while scrolling long forms */
.kam-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 1rem 0 0 !important;
    padding: .85rem 1rem;
    border-radius: var(--kam-radius) var(--kam-radius) 0 0;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--kam-border);
    box-shadow: 0 -4px 12px rgba(58, 59, 69, .06);
    backdrop-filter: blur(4px);
}
.kam-sticky-actions > [class*="col"] { padding: 0; }
.modal .kam-sticky-actions { margin: 0 !important; }

/* Activity timeline (#logList) */
.kam-timeline { position: relative; padding-left: 1.75rem; }
.kam-timeline::before {
    content: "";
    position: absolute;
    left: .55rem;
    top: .25rem;
    bottom: .25rem;
    width: 2px;
    background: var(--kam-border);
}
.kam-timeline > .row.m-0 { display: block; }
.kam-timeline > .row.m-0 > [class*="col-sm-"]:empty { display: none; }
.kam-timeline > .row.m-0 > .col-sm-2:not(:empty) {
    max-width: none;
    padding: .75rem 0 .5rem;
    font-size: .8rem !important;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--kam-muted) !important;
}
.kam-timeline > .row.m-0 > .col-sm-10 { max-width: none; padding: 0; }
.kam-timeline .card { position: relative; overflow: visible; margin-bottom: .85rem !important; border-left-width: 1px !important; }
.kam-timeline .card::before {
    content: "";
    position: absolute;
    left: calc(-1.75rem + .1rem);
    top: 1rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #5a5c69;
}
.kam-timeline .card.border-left-primary::before { border-color: #4e73df; }
.kam-timeline .card.border-left-success::before { border-color: #1cc88a; }
.kam-timeline .card.border-left-info::before { border-color: #36b9cc; }
.kam-timeline .card.border-left-warning::before { border-color: #f6c23e; }
.kam-timeline .card hr { margin: .5rem 0; }
.kam-timeline .nomore { font-size: .9rem; color: var(--kam-muted); text-align: center; padding: 1rem 0; }

/* Status pills */
.kam-status-pill {
    display: inline-block;
    border-radius: 10rem;
    padding: .3em .75em;
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .02em;
    white-space: nowrap;
}
.kam-tone-success   { background: rgba(28, 200, 138, .14); color: #13855c; }
.kam-tone-danger    { background: rgba(231, 74, 59, .12);  color: #be2617; }
.kam-tone-warning   { background: rgba(246, 194, 62, .2);  color: #8a6400; }
.kam-tone-info      { background: rgba(54, 185, 204, .14); color: #1f6f7b; }
.kam-tone-secondary { background: #eaecf4; color: #5a5c69; }

@media (max-width: 767.98px) {
    .kam-detail > .card-body { padding: 1rem; }
    .kam-detail-title { font-size: 1.3rem; }
}

/* Side panels (create/edit forms): 2 columns, header + footer stay visible */
@media (min-width: 992px) {
    .modal-full-height .modal-body .row > .col-sm-3 { flex: 0 0 50%; max-width: 50%; }
}
.modal-full-height .modal-content { min-height: 100vh; }
.modal-full-height .modal-header { position: sticky; top: 0; z-index: 3; }
.modal-full-height .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(58, 59, 69, .06);
}
.modal-full-height .modal-body .text-primary.font-weight-bold.h5 {
    font-size: .95rem !important;
    padding-bottom: .4rem;
    margin: .5rem 0 1rem;
    border-bottom: 1px solid var(--kam-border);
}

/* Dashboard charts */
.kam-chart { position: relative; height: 260px; }
.kam-renewals .list-group-item { padding: .75rem 1.25rem; }

/* =========================================================
   Phase 3: list tables
   ========================================================= */
tr.kam-row-link { cursor: pointer; }
tr.kam-row-link:hover td:first-child { box-shadow: inset 3px 0 0 var(--kam-primary); }
.table.kam-dt td { padding-top: .7rem; padding-bottom: .7rem; }

/* Phones: each row becomes a card with labelled fields */
@media (max-width: 575.98px) {
    .table.kam-dt thead { display: none; }
    .table.kam-dt, .table.kam-dt tbody, .table.kam-dt tr, .table.kam-dt td { display: block; width: 100% !important; }
    .table.kam-dt tr {
        background: #fff !important;
        border: 1px solid var(--kam-border);
        border-radius: var(--kam-radius);
        margin-bottom: .75rem;
        padding: .5rem .75rem;
        box-shadow: var(--kam-shadow);
    }
    .table.kam-dt td {
        border: 0;
        padding: .3rem 0;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        text-align: right;
    }
    .table.kam-dt td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        color: var(--kam-muted);
        font-size: .75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        padding-top: .15rem;
    }
    .table.kam-dt td[data-label=""]::before { display: none; }
    .table.kam-dt td.dataTables_empty { justify-content: center; }
    .table.kam-dt td.dataTables_empty::before { display: none; }
    .table-responsive { overflow-x: visible; }
}
