/**
 * Compliance Manager — admin design system overrides
 * Visual language adapted from the salon_app admin template.
 * No salon business styling/terminology.
 */

:root {
    --cm-primary: #4f46e5;
    --cm-primary-soft: rgba(79, 70, 229, 0.12);
    --cm-success: #10b981;
    --cm-warning: #f59e0b;
    --cm-danger: #ef4444;
    --cm-info: #06b6d4;
    --cm-surface: #ffffff;
    --cm-muted: #64748b;
    --cm-border: #e8edf5;
    --cm-radius: 16px;
    --cm-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    --cm-page: #f4f6fb;
    --cm-ink: #1e1b4b;
}

body,
body.cm-soft-shell {
    background: var(--cm-page);
    color: #334155;
    font-family: "Plus Jakarta Sans", Outfit, sans-serif;
}

body.cm-soft-shell .main-content,
body.cm-soft-shell .page-content {
    background: var(--cm-page);
}

body.cm-soft-shell #page-topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

body[data-sidebar="light"] .vertical-menu {
    background: #fff;
    border-right: 1px solid var(--cm-border);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.03);
}

body[data-sidebar="light"] #sidebar-menu ul li a {
    color: #475569;
}

body[data-sidebar="light"] #sidebar-menu ul li a.active,
body[data-sidebar="light"] #sidebar-menu ul li.mm-active > a {
    background: rgba(79, 70, 229, 0.08);
    color: var(--cm-primary);
    box-shadow: inset 3px 0 0 var(--cm-primary);
}

body[data-sidebar="light"] .logo-text {
    color: var(--cm-ink);
}

/* Page header / breadcrumb card pattern */
.breadcrumb-one.card {
    border: 0;
    box-shadow: var(--cm-shadow);
    border-radius: var(--cm-radius);
    margin-bottom: 1.25rem;
}

.breadcrumb-one .page-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
}

.breadcrumb-one .page-title-box h4 {
    margin: 0;
    font-weight: 600;
}

.cards-one .card,
.cards-two .card,
.cm-card {
    border: 0;
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
}

.avatar-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-xs .avatar-title {
    width: 2rem;
    height: 2rem;
    font-size: 0.9rem;
}

.avatar-md .avatar-title {
    width: 3rem;
    height: 3rem;
}

.bg-primary-subtle {
    background-color: var(--cm-primary-soft) !important;
}

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

/* Tables */
.table-responsive {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--cm-radius);
    padding: 0.75rem;
}

.table thead th {
    font-weight: 600;
    border-bottom: 2px solid #d1d9e6;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(31, 88, 199, 0.04);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px rgba(31, 88, 199, 0.18);
}

.btn {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(45deg, #3b82f6, #1f58c7);
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(45deg, #2563eb, #1d4ed8);
    border: none;
}

.btn-soft-primary {
    background: rgba(31, 88, 199, 0.12);
    color: #1f58c7;
    border: none;
}

.btn-soft-primary:hover {
    background: rgba(31, 88, 199, 0.2);
    color: #1d4ed8;
}

.bg-success-subtle { background-color: rgba(40, 183, 101, 0.15) !important; }
.bg-warning-subtle { background-color: rgba(244, 194, 56, 0.18) !important; }
.bg-info-subtle { background-color: rgba(82, 198, 234, 0.18) !important; }
.bg-danger-subtle { background-color: rgba(237, 85, 85, 0.15) !important; }

/* Search */
.search-box .form-control {
    padding-left: 2.35rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
}

.search-box .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--cm-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* Status badges for future compliance states */
.badge-status-valid {
    background: rgba(40, 183, 101, 0.15);
    color: #15803d;
}

.badge-status-expiring {
    background: rgba(244, 194, 56, 0.2);
    color: #a16207;
}

.badge-status-expired {
    background: rgba(237, 85, 85, 0.15);
    color: #b91c1c;
}

/* Empty / loading states */
.cm-empty-state,
.cm-loading-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--cm-muted);
}

.cm-empty-state i,
.cm-loading-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* Select2 alignment with theme */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 4px 8px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Sidebar polish (product family feel) */
.vertical-menu {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar-menu ul li a {
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

#sidebar-menu ul li a:hover {
    padding-left: 1.35rem;
}

/* Expiry / attention alert badges (sidebar) — pill style like HRMS alerts */
#sidebar-menu .nav-alert-badge,
.nav-alert-badge {
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    line-height: 1;
    margin-right: 0.15rem;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.28);
}

#sidebar-menu ul li a.active .nav-alert-badge,
#sidebar-menu ul li.mm-active > a .nav-alert-badge {
    background: #ef4444;
    color: #fff;
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    align-items: center;
    justify-content: center;
    background: var(--cm-primary);
    color: #fff;
    font-weight: 700;
    margin-right: 0.5rem;
}

body[data-sidebar="dark"] .logo-text {
    color: #fff;
}

body:not([data-sidebar="dark"]) .logo-text {
    color: #0f172a;
}

/* Auth / guest */
.authentication-bg {
    background: linear-gradient(145deg, #0f172a, #1f58c7 55%, #3b82f6);
}

.authentication-bg .card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Design system demo sections */
.cm-section-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cm-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cm-swatch {
    width: 100%;
    height: 72px;
    border-radius: 10px;
    display: flex;
    align-items: flex-end;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Soft dashboard (HRMS-inspired light UI) */
.cm-soft-dash {
    padding-bottom: 1rem;
}

.cm-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--cm-shadow);
    padding: 1.35rem 1.5rem;
}

.cm-welcome-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.cm-welcome-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.cm-welcome-title {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 800;
    color: var(--cm-ink);
    letter-spacing: -0.03em;
}

.cm-welcome-sub {
    color: var(--cm-muted);
    font-size: 0.92rem;
}

.cm-welcome-dot {
    margin: 0 0.35rem;
    opacity: 0.55;
}

.cm-welcome-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.cm-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

.cm-live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
    animation: cm-live-pulse 1.8s infinite;
}

@keyframes cm-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.cm-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--cm-shadow);
    padding: 1.1rem 1.15rem 0.85rem;
    color: inherit;
    min-height: 148px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.cm-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    color: inherit;
}

.cm-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.cm-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cm-muted);
}

.cm-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cm-ink);
    line-height: 1.1;
}

.cm-stat-meta {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--cm-muted);
}

.cm-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.cm-stat-spark {
    width: 100%;
    height: 28px;
    opacity: 0.85;
}

.cm-stat-green { color: #10b981; }
.cm-stat-green .cm-stat-icon { background: rgba(16, 185, 129, 0.14); color: #059669; }
.cm-stat-red { color: #ef4444; }
.cm-stat-red .cm-stat-icon { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.cm-stat-orange { color: #f59e0b; }
.cm-stat-orange .cm-stat-icon { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.cm-stat-teal { color: #14b8a6; }
.cm-stat-teal .cm-stat-icon { background: rgba(20, 184, 166, 0.14); color: #0d9488; }
.cm-stat-blue { color: #3b82f6; }
.cm-stat-blue .cm-stat-icon { background: rgba(59, 130, 246, 0.14); color: #2563eb; }
.cm-stat-purple,
.cm-stat-indigo { color: #6366f1; }
.cm-stat-purple .cm-stat-icon,
.cm-stat-indigo .cm-stat-icon { background: rgba(99, 102, 241, 0.14); color: #4f46e5; }
.cm-stat-pink { color: #ec4899; }
.cm-stat-pink .cm-stat-icon { background: rgba(236, 72, 153, 0.14); color: #db2777; }
.cm-stat-cyan { color: #06b6d4; }
.cm-stat-cyan .cm-stat-icon { background: rgba(6, 182, 212, 0.14); color: #0891b2; }

.cm-soft-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--cm-shadow);
    padding: 1.15rem 1.25rem;
}

.cm-soft-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cm-soft-panel-head h5 {
    font-weight: 750;
    color: var(--cm-ink);
}

.cm-soft-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.cm-soft-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cm-soft-row-main {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.cm-soft-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.cm-tone-orange { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.cm-tone-blue { background: rgba(59, 130, 246, 0.14); color: #2563eb; }

.cm-soft-link {
    font-weight: 700;
    color: var(--cm-ink);
    text-decoration: none;
}

.cm-soft-link:hover {
    color: var(--cm-primary);
}

.cm-dash-panel {
    border: 0;
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
}

/* Responsive helpers */
@media (max-width: 991.98px) {
    .breadcrumb-one .page-title-box {
        align-items: flex-start;
    }

    .table-responsive {
        padding: 0.35rem;
    }
}

@media (max-width: 575.98px) {
    .breadcrumb-one .page-title-box .btn {
        width: 100%;
    }

    .admin-user-meta {
        display: none !important;
    }
}
