/* Phase 12.2 — Calibri Compact Typography Hotfix
   UI/theme only. No payroll, commission, PNL, import or database logic changes. */
:root {
    --tm-font-main: Calibri, "Segoe UI", Arial, sans-serif;
}

html {
    font-size: 14px;
}

body,
body.glass-theme,
body.login-bg.glass-theme,
button,
input,
select,
textarea,
.table,
.dropdown-menu,
.btn,
.form-control,
.form-select {
    font-family: var(--tm-font-main) !important;
    font-size: .92rem;
    font-weight: 400;
    letter-spacing: 0;
}

body.glass-theme {
    line-height: 1.42;
}

/* Reduce over-bold styling from premium glass theme */
.glass-theme .brand-text,
.glass-theme .navbar-brand,
.glass-theme .card-header,
.glass-theme .page-header-title,
.glass-theme .totel-kpi-value,
.glass-theme .totel-kpi-label,
.glass-theme .table thead th,
.glass-theme .btn,
.glass-theme .badge,
.glass-theme .sidenav-menu-heading,
.glass-theme .sidenav-light .sidenav-menu .nav-link.active,
.glass-theme .timeline .timeline-item-marker-text,
.glass-theme .login-logo,
.glass-theme .auth-title,
.glass-theme .auth-eyebrow,
.glass-theme .login-card label,
.fw-bold,
.fw-800,
.fw-bolder {
    font-weight: 600 !important;
}

/* Global heading scale — compact, finance-friendly */
.glass-theme h1,
.glass-theme .h1 { font-size: 1.45rem !important; font-weight: 600 !important; }
.glass-theme h2,
.glass-theme .h2 { font-size: 1.25rem !important; font-weight: 600 !important; }
.glass-theme h3,
.glass-theme .h3 { font-size: 1.12rem !important; font-weight: 600 !important; }
.glass-theme h4,
.glass-theme .h4 { font-size: 1.02rem !important; font-weight: 600 !important; }
.glass-theme h5,
.glass-theme .h5 { font-size: .95rem !important; font-weight: 600 !important; }
.glass-theme h6,
.glass-theme .h6 { font-size: .88rem !important; font-weight: 600 !important; }

/* Navbar */
.glass-theme .topnav.navbar {
    min-height: 3.35rem;
}
.glass-theme .navbar-brand {
    font-size: .96rem !important;
}
.glass-theme .brand-mark {
    width: 1.72rem !important;
    height: 1.72rem !important;
    border-radius: .62rem !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
}
.glass-theme .topnav .small,
.glass-theme .topnav .badge {
    font-size: .74rem !important;
}

/* Sidebar */
.glass-theme .sidenav-light .sidenav-menu .nav-link {
    font-size: .88rem !important;
    padding: .60rem .76rem !important;
    border-radius: .72rem !important;
    margin: .04rem .62rem !important;
    font-weight: 400 !important;
}
.glass-theme .sidenav-light .sidenav-menu .nav-link.active {
    font-weight: 500 !important;
}
.glass-theme .sidenav-menu-heading {
    font-size: .60rem !important;
    letter-spacing: .08em !important;
    font-weight: 600 !important;
    padding-top: .9rem !important;
    padding-bottom: .35rem !important;
}
.glass-theme .sidenav-footer {
    font-size: .82rem !important;
}

/* Page hero */
.glass-theme .page-header {
    padding-bottom: 7.25rem !important;
}
.glass-theme .page-header-content {
    padding-top: 1.45rem !important;
}
.glass-theme .page-header-title {
    font-size: 1.48rem !important;
    line-height: 1.18 !important;
    letter-spacing: -.018em !important;
    font-weight: 600 !important;
}
.glass-theme .page-header-subtitle {
    font-size: .88rem !important;
    font-weight: 400 !important;
    margin-top: .28rem;
}
.glass-theme .page-header-icon {
    width: 2.05rem !important;
    height: 2.05rem !important;
    border-radius: .72rem !important;
    margin-right: .55rem !important;
}
.glass-theme .page-header .badge.bg-white {
    font-size: .72rem !important;
    padding: .42rem .72rem !important;
    font-weight: 500 !important;
}

/* Cards and content */
.glass-theme .card,
.glass-theme .filter-card,
.glass-theme .quick-action-card,
.glass-theme .alert {
    border-radius: 1rem !important;
}
.glass-theme .card-header {
    font-size: .92rem !important;
    font-weight: 600 !important;
    padding: .82rem 1rem !important;
}
.glass-theme .card-body {
    padding: 1rem !important;
}
.glass-theme .small,
.glass-theme small {
    font-size: .78rem !important;
}
.glass-theme p,
.glass-theme .text-muted,
.glass-theme .list-group-item {
    font-size: .88rem;
}

/* KPI cards */
.glass-theme .totel-kpi-label {
    font-size: .64rem !important;
    letter-spacing: .045em !important;
    font-weight: 500 !important;
}
.glass-theme .totel-kpi-value {
    font-size: 1.18rem !important;
    line-height: 1.18 !important;
    letter-spacing: -.015em !important;
    font-weight: 600 !important;
}
.glass-theme .totel-kpi-card .card-body {
    padding: .95rem 1rem !important;
}

/* Tables — keep readable, but less shouty */
.glass-theme .table {
    font-size: .86rem !important;
}
.glass-theme .table thead th {
    font-size: .66rem !important;
    letter-spacing: .035em !important;
    font-weight: 600 !important;
    padding: .62rem .72rem !important;
}
.glass-theme .table td,
.glass-theme .table th {
    padding: .62rem .72rem !important;
}

/* Forms and buttons */
.glass-theme .btn {
    font-size: .84rem !important;
    font-weight: 500 !important;
    border-radius: .65rem !important;
    padding: .44rem .78rem !important;
}
.glass-theme .btn-sm {
    font-size: .76rem !important;
    padding: .32rem .58rem !important;
}
.glass-theme .form-label,
.glass-theme label {
    font-size: .84rem !important;
    font-weight: 500 !important;
}
.glass-theme .form-control,
.glass-theme .form-select {
    font-size: .88rem !important;
    border-radius: .65rem !important;
    padding: .48rem .68rem !important;
}
.glass-theme .badge {
    font-size: .70rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

/* Login page — reduce huge title and heavy weight */
.glass-theme .auth-shell {
    padding: 1.25rem 0 !important;
}
.glass-theme .auth-eyebrow {
    font-size: .72rem !important;
    font-weight: 500 !important;
    letter-spacing: .08em !important;
    margin-bottom: .75rem !important;
}
.glass-theme .auth-title {
    font-size: clamp(1.85rem, 4vw, 3.15rem) !important;
    line-height: 1.03 !important;
    letter-spacing: -.035em !important;
    font-weight: 600 !important;
    margin-bottom: .85rem !important;
}
.glass-theme .auth-subtitle {
    font-size: .92rem !important;
    font-weight: 400 !important;
}
.glass-theme .auth-feature-grid {
    margin-top: 1.2rem !important;
}
.glass-theme .auth-feature {
    padding: .72rem !important;
}
.glass-theme .auth-feature strong {
    font-size: .92rem !important;
    font-weight: 600 !important;
}
.glass-theme .login-logo {
    width: 2.55rem !important;
    height: 2.55rem !important;
    border-radius: .95rem !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
}
.glass-theme .login-card .card-header,
.glass-theme .login-card .card-footer {
    padding: .85rem 1rem !important;
}
.glass-theme .login-card label {
    font-weight: 500 !important;
}
.glass-theme .login-meta-card {
    font-size: .84rem !important;
    padding: .75rem !important;
}

/* Prevent oversized number/text utilities */
.glass-theme .display-1,
.glass-theme .display-2,
.glass-theme .display-3,
.glass-theme .display-4,
.glass-theme .display-5,
.glass-theme .display-6 {
    font-size: 1.45rem !important;
    font-weight: 600 !important;
}
.glass-theme .fs-1 { font-size: 1.45rem !important; }
.glass-theme .fs-2 { font-size: 1.28rem !important; }
.glass-theme .fs-3 { font-size: 1.12rem !important; }
.glass-theme .fs-4 { font-size: 1rem !important; }
.glass-theme .fs-5 { font-size: .92rem !important; }
.glass-theme .fs-6 { font-size: .86rem !important; }

@media (max-width: 991.98px) {
    html { font-size: 13.5px; }
    .glass-theme .page-header-title { font-size: 1.25rem !important; }
    .glass-theme .page-header-subtitle { font-size: .82rem !important; }
    .glass-theme .auth-title { font-size: 1.8rem !important; }
    .glass-theme .card-body { padding: .9rem !important; }
    .glass-theme .table-responsive table { min-width: 700px !important; }
}

@media (max-width: 575.98px) {
    html { font-size: 13px; }
    .glass-theme .btn { width: 100%; margin-bottom: .32rem; }
    .glass-theme .page-header { padding-bottom: 6.5rem !important; }
}

/* Phase 12.3 — Readability + Highlight Balance Hotfix
   Keep Calibri compact. Improve contrast on glass surfaces and enlarge important figures only. */

/* Login hero: avoid dark text on dark gradient */
body.login-bg.glass-theme .auth-copy,
body.login-bg.glass-theme .auth-copy p,
body.login-bg.glass-theme .auth-subtitle {
    color: rgba(241, 245, 249, .88) !important;
}
body.login-bg.glass-theme .auth-title {
    color: #f8fafc !important;
    text-shadow: 0 .8rem 2.1rem rgba(0,0,0,.28) !important;
}
body.login-bg.glass-theme .auth-title .gradient-text {
    background: linear-gradient(135deg, #93c5fd 0%, #c4b5fd 45%, #f0abfc 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}
body.login-bg.glass-theme .auth-eyebrow,
body.login-bg.glass-theme .auth-eyebrow span:not(.login-logo) {
    color: rgba(226, 232, 240, .88) !important;
}
body.login-bg.glass-theme .auth-feature {
    background: rgba(255,255,255,.12) !important;
    border-color: rgba(255,255,255,.22) !important;
}
body.login-bg.glass-theme .auth-feature strong {
    color: #ffffff !important;
    font-size: .96rem !important;
}
body.login-bg.glass-theme .auth-feature .small {
    color: rgba(241,245,249,.82) !important;
}

/* Login card: force readable white header/labels and readable input text */
body.login-bg.glass-theme .login-card,
body.login-bg.glass-theme .login-card .card-header,
body.login-bg.glass-theme .login-card .card-body,
body.login-bg.glass-theme .login-card .card-footer {
    color: #f8fafc !important;
}
body.login-bg.glass-theme .login-card .card-header h1,
body.login-bg.glass-theme .login-card .card-header h2,
body.login-bg.glass-theme .login-card .card-header h3,
body.login-bg.glass-theme .login-card .card-header h4,
body.login-bg.glass-theme .login-card .card-header .fw-bold {
    color: #ffffff !important;
    font-weight: 600 !important;
}
body.login-bg.glass-theme .login-card .card-header .small,
body.login-bg.glass-theme .login-card .login-meta-card,
body.login-bg.glass-theme .login-card .small.opacity-75 {
    color: rgba(241,245,249,.82) !important;
    opacity: 1 !important;
}
body.login-bg.glass-theme .login-card label,
body.login-bg.glass-theme .login-card .form-label {
    color: rgba(248,250,252,.92) !important;
    font-size: .86rem !important;
    font-weight: 500 !important;
}
body.login-bg.glass-theme .login-card .form-control {
    background: rgba(248,250,252,.94) !important;
    border-color: rgba(255,255,255,.46) !important;
    color: #111827 !important;
    font-size: .95rem !important;
}
body.login-bg.glass-theme .login-card .form-control::placeholder {
    color: rgba(31,41,55,.55) !important;
}

/* Main app: keep body text compact, but make important numbers clearer */
.glass-theme .totel-kpi-value {
    font-size: clamp(1.34rem, 1.8vw, 1.72rem) !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.08 !important;
}
.glass-theme .totel-kpi-label {
    color: rgba(15,23,42,.70) !important;
    font-size: .68rem !important;
    font-weight: 600 !important;
}
.glass-theme .totel-kpi-card .small,
.glass-theme .totel-kpi-card .text-muted {
    color: rgba(51,65,85,.72) !important;
}

/* Summary cards that use Bootstrap h3 instead of KPI class */
.glass-theme .card.border-start-lg .h3,
.glass-theme .card.border-start-lg h3,
.glass-theme .card .h3.mb-0,
.glass-theme .card .h3.mb-1 {
    font-size: clamp(1.22rem, 1.55vw, 1.52rem) !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.12 !important;
}
.glass-theme .card.border-start-lg .small,
.glass-theme .card.border-start-lg .text-muted {
    color: rgba(51,65,85,.72) !important;
}

/* Keep table/report readability strong */
.glass-theme .card,
.glass-theme .table-responsive {
    color: #172033 !important;
}
.glass-theme .table thead th {
    color: #475569 !important;
}
.glass-theme .table td {
    color: #1f2937 !important;
}
.glass-theme .card-header {
    color: #172033 !important;
}

/* Do not over-shrink important page titles; still compact */
.glass-theme .page-header-title {
    color: #ffffff !important;
    font-size: 1.58rem !important;
    font-weight: 600 !important;
}
.glass-theme .page-header-subtitle {
    color: rgba(226,232,240,.82) !important;
}

@media (max-width: 991.98px) {
    .glass-theme .totel-kpi-value,
    .glass-theme .card.border-start-lg .h3,
    .glass-theme .card .h3.mb-0,
    .glass-theme .card .h3.mb-1 {
        font-size: 1.24rem !important;
    }
    body.login-bg.glass-theme .auth-title {
        font-size: 2rem !important;
    }
}
