/* ==========================================================================
   CDK Theme — Apple Vision Pro Glassmorphism
   Complete theme stylesheet for Perfex CRM client portal
   ========================================================================== */

/* ---------- CSS Custom Properties (fallbacks – runtime vars injected via PHP) ---------- */
:root {
    --cdk-primary: #1a73e8;
    --cdk-primary-rgb: 26, 115, 232;
    --cdk-secondary: #6c757d;
    --cdk-auth-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --cdk-radius: 16px;
    --cdk-radius-sm: 10px;
    --cdk-radius-xs: 6px;
    --cdk-glass-bg: rgba(243, 243, 243, 0.65);
    --cdk-glass-border: rgba(255, 255, 255, 0.5);
    --cdk-glass-blur: 40px;
    --cdk-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --cdk-glass-bg-dark: rgba(0, 0, 0, 0.05);
    --cdk-glass-border-dark: rgba(0, 0, 0, 0.06);
    --cdk-text-on-glass: #1d1d1f;
    --cdk-text-muted-on-glass: rgba(0, 0, 0, 0.55);
    --cdk-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --cdk-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Apple-like spring animation curves */
    --cdk-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --cdk-spring-soft: cubic-bezier(0.34, 1.56, 0.64, 1);
    --cdk-spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --cdk-ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}


/* ==========================================================================
   1. AUTH PAGES — In-flow glass-over-video/image (navbar & footer visible)
   ========================================================================== */

/* --- Scene (in-flow wrapper, not fixed) --- */
.cdk-auth-scene {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 60px);
    overflow: hidden;
    background: var(--cdk-auth-gradient);
    font-family: var(--cdk-font-family);
}

/* Prevent horizontal scroll on auth pages */
/* Prevent horizontal scroll and grey gaps on auth pages */
body.cdk-theme:has(.cdk-auth-scene) {
    overflow-x: hidden;
    background: #1a1a2e; /* Match auth scene dark background - eliminates grey gaps */
}

body.cdk-theme:has(.cdk-auth-scene) #wrapper,
body.cdk-theme:has(.cdk-auth-scene) .content,
body.cdk-theme:has(.cdk-auth-scene) #content {
    overflow-x: hidden;
    background: transparent;
}

/* Remove ALL spacing between navbar and auth scene */
body.cdk-theme:has(.cdk-auth-scene) #content {
    padding: 0 !important;
    margin: 0 !important;
}

body.cdk-theme:has(.cdk-auth-scene) #content > .container {
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

body.cdk-theme:has(.cdk-auth-scene) #content > .container > .row {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide the first alerts container completely — :has() + explicit body-class fallbacks */
body.cdk-theme:has(.cdk-auth-scene) #content > .container:first-child,
body.cdk-theme.register #content > .container:first-child,
body.cdk-theme.customers_login #content > .container:first-child,
body.cdk-theme.forgot_password #content > .container:first-child,
body.cdk-theme.reset_password #content > .container:first-child {
    display: none !important;
}

/* Remove top padding/margin from #content on auth pages */
body.cdk-theme.register #content,
body.cdk-theme.customers_login #content,
body.cdk-theme.forgot_password #content,
body.cdk-theme.reset_password #content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Kill Bootstrap navbar bottom margin + wrapper top spacing on auth pages
   (this is what produces the white strip between the navbar and the auth scene) */
body.cdk-theme:has(.cdk-auth-scene) .navbar,
body.cdk-theme:has(.cdk-auth-scene) .navbar-default,
body.cdk-theme.register .navbar,
body.cdk-theme.customers_login .navbar,
body.cdk-theme.forgot_password .navbar,
body.cdk-theme.reset_password .navbar {
    margin-bottom: 0 !important;
}

body.cdk-theme:has(.cdk-auth-scene) #wrapper,
body.cdk-theme.register #wrapper,
body.cdk-theme.customers_login #wrapper,
body.cdk-theme.forgot_password #wrapper,
body.cdk-theme.reset_password #wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Kill the 20px line-box (from whitespace text node) above the scene inside .row */
body.cdk-theme.register #content > .container > .row,
body.cdk-theme.customers_login #content > .container > .row,
body.cdk-theme.forgot_password #content > .container > .row,
body.cdk-theme.reset_password #content > .container > .row {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Background layers need their own clip context */
.cdk-auth-bg-video,
.cdk-auth-bg-image,
.cdk-auth-bg-overlay {
    clip-path: inset(0);
}

/* Full-bleed: remove padding/container constraints when auth scene is present */
body.cdk-theme.customers_login .content,
body.cdk-theme.register .content {
    padding: 0 !important;
}

body.cdk-theme.customers_login #content > .container,
body.cdk-theme.register #content > .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Forgot/reset pages don't have body classes — target via scene parent */
body.cdk-theme .content:has(.cdk-auth-scene) {
    padding: 0 !important;
}

body.cdk-theme #content > .container:has(.cdk-auth-scene) {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

body.cdk-theme .row:has(> .cdk-auth-scene) {
    margin: 0;
    /* Kill line-box created by whitespace text nodes between <div class="row"> and the scene */
    font-size: 0;
    line-height: 0;
}

/* Footer styling on auth pages */
body.cdk-theme:has(.cdk-auth-scene) .footer {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 0;
    text-align: center;
}

body.cdk-theme:has(.cdk-auth-scene) .footer a {
    color: rgba(255, 255, 255, 0.85);
}

body.cdk-theme:has(.cdk-auth-scene) .footer a:hover {
    color: #fff;
}

/* --- Background layers --- */
.cdk-auth-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.cdk-auth-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.cdk-auth-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

/* --- Centering container --- */
.cdk-auth-center {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 40px 20px;
}

.cdk-auth-center-wide {
    padding: 30px 20px;
}

/* --- Glass Card (Apple Vision Pro light frosted glass) --- */
.cdk-glass-card {
    background: var(--cdk-glass-bg);
    -webkit-backdrop-filter: blur(var(--cdk-glass-blur)) saturate(180%);
    backdrop-filter: blur(var(--cdk-glass-blur)) saturate(180%);
    border: 1px solid var(--cdk-glass-border);
    border-radius: 24px;
    box-shadow: var(--cdk-glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cdk-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    color: var(--cdk-text-on-glass);
}

.cdk-auth-card-wide {
    max-width: 820px;
    padding: 40px 48px;
}

/* --- Brand / Logo --- */
.cdk-auth-card-brand {
    text-align: center;
    margin-bottom: 8px;
}

.cdk-auth-card-brand img,
.cdk-auth-card-brand .cdk-auth-logo {
    max-height: 46px;
    width: auto;
}

/* --- Card header --- */
.cdk-auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.cdk-auth-card-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--cdk-text-on-glass);
    margin: 8px 0 6px;
    letter-spacing: -0.02em;
}

.cdk-auth-card-header p {
    font-size: 14px;
    color: var(--cdk-text-muted-on-glass);
    margin: 0;
    line-height: 1.5;
}

/* --- Icon circle (forgot / reset pages) --- */
.cdk-auth-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: var(--cdk-text-on-glass);
}

/* --- Form fields with Apple-like spring animations --- */
.cdk-auth-form .cdk-field {
    margin-bottom: 18px;
}

.cdk-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cdk-text-on-glass);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    transition: color 0.2s var(--cdk-spring);
}

.cdk-field-label i {
    margin-right: 4px;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s var(--cdk-spring);
}

.cdk-field-input,
.cdk-auth-form .form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--cdk-text-on-glass);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--cdk-radius-sm);
    outline: none;
    transition: all 0.3s var(--cdk-spring-soft), box-shadow 0.25s var(--cdk-ease-out-expo);
    transform: translateZ(0);
}

.cdk-field-input:hover,
.cdk-auth-form .form-control:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.15);
}

.cdk-field-input:focus,
.cdk-auth-form .form-control:focus {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgb(var(--cdk-primary-rgb));
    box-shadow: 0 0 0 4px rgba(var(--cdk-primary-rgb), 0.12),
                0 2px 8px rgba(var(--cdk-primary-rgb), 0.08);
    transform: translateY(-1px) translateZ(0);
}

/* Label highlight when input is focused */
.cdk-field:focus-within .cdk-field-label {
    color: rgb(var(--cdk-primary-rgb));
}

.cdk-field:focus-within .cdk-field-label i {
    opacity: 1;
}

.cdk-field-input::placeholder,
.cdk-auth-form .form-control::placeholder {
    color: rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s var(--cdk-spring);
}

.cdk-field-input:focus::placeholder,
.cdk-auth-form .form-control:focus::placeholder {
    opacity: 0.5;
}

/* Select / dropdowns in auth forms */
.cdk-auth-form .bootstrap-select,
.cdk-auth-scene .bootstrap-select {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    line-height: normal !important;
}

.cdk-auth-form .bootstrap-select.form-control,
.cdk-auth-scene .bootstrap-select.form-control {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    min-height: 38px !important;
    height: 38px !important;
}

/* Hide ALL native selects in auth forms - very aggressive */
.cdk-auth-form select,
.cdk-auth-scene select,
.cdk-auth-form .bootstrap-select select,
.cdk-auth-scene .bootstrap-select select,
.cdk-auth-form .bootstrap-select > select,
.cdk-auth-scene .bootstrap-select > select {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Hide any visible input that follows a bootstrap-select (stray element) */
.cdk-auth-scene .bootstrap-select + input[type="text"],
.cdk-auth-scene .bootstrap-select + .form-control,
.cdk-auth-form .bootstrap-select + input[type="text"],
.cdk-auth-form .bootstrap-select + .form-control {
    display: none !important;
}

/* Ensure bootstrap-select wrapper has proper z-index */
.cdk-auth-scene .bootstrap-select,
.cdk-auth-form .bootstrap-select {
    position: relative !important;
    z-index: 10 !important;
}

.cdk-auth-scene .bootstrap-select.open,
.cdk-auth-form .bootstrap-select.open {
    z-index: 1050 !important;
}

.cdk-auth-scene .bootstrap-select.form-control .dropdown-toggle,
.cdk-auth-form .bootstrap-select.form-control .dropdown-toggle {
    padding: 0 16px !important;
    min-height: 38px !important;
    height: 38px !important;
    border-radius: var(--cdk-radius-sm);
    display: flex !important;
    align-items: center !important;
}

.cdk-auth-scene .bootstrap-select.form-control .dropdown-toggle .filter-option,
.cdk-auth-scene .bootstrap-select.form-control .dropdown-toggle .filter-option-inner,
.cdk-auth-form .bootstrap-select.form-control .dropdown-toggle .filter-option,
.cdk-auth-form .bootstrap-select.form-control .dropdown-toggle .filter-option-inner {
    padding: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.cdk-auth-form .bootstrap-select .btn,
.cdk-auth-scene .bootstrap-select .btn {
    background: rgba(255, 255, 255, 0.55) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--cdk-text-on-glass) !important;
    border-radius: var(--cdk-radius-sm);
    padding: 0 16px !important;
    font-size: 14px;
    line-height: 38px !important;
    min-height: 38px !important;
    box-shadow: none;
    height: 38px !important;
    transition: all 0.3s var(--cdk-spring-soft), box-shadow 0.25s var(--cdk-ease-out-expo) !important;
    transform: translateZ(0);
}

.cdk-auth-form .bootstrap-select .btn:hover,
.cdk-auth-scene .bootstrap-select .btn:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) translateZ(0);
}

.cdk-auth-form .bootstrap-select.open .btn,
.cdk-auth-scene .bootstrap-select.open .btn {
    background: rgba(255, 255, 255, 0.75) !important;
    border-color: rgb(var(--cdk-primary-rgb)) !important;
    box-shadow: 0 0 0 4px rgba(var(--cdk-primary-rgb), 0.12),
                0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.cdk-auth-form .bootstrap-select .btn,
.cdk-auth-scene .bootstrap-select .btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}
.cdk-auth-form .bootstrap-select .btn .filter-option,
.cdk-auth-form .bootstrap-select .btn .filter-option-inner,
.cdk-auth-scene .bootstrap-select .btn .filter-option,
.cdk-auth-scene .bootstrap-select .btn .filter-option-inner {
    width: 100%;
}
.cdk-auth-form .bootstrap-select .btn .filter-option-inner-inner,
.cdk-auth-scene .bootstrap-select .btn .filter-option-inner-inner {
    display: block;
    width: 100%;
    color: var(--cdk-text-on-glass) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0;
    line-height: 20px;
}

.cdk-auth-form .bootstrap-select .btn .filter-option,
.cdk-auth-form .bootstrap-select .btn .filter-option-inner,
.cdk-auth-form .bootstrap-select .btn .filter-option-inner-inner,
.cdk-auth-scene .bootstrap-select .btn .filter-option,
.cdk-auth-scene .bootstrap-select .btn .filter-option-inner,
.cdk-auth-scene .bootstrap-select .btn .filter-option-inner-inner {
    text-decoration: none !important;
    color: var(--cdk-text-on-glass) !important;
}

.cdk-auth-form .bootstrap-select .btn .bs-caret,
.cdk-auth-form .bootstrap-select .btn .caret,
.cdk-auth-scene .bootstrap-select .btn .bs-caret,
.cdk-auth-scene .bootstrap-select .btn .caret {
    color: var(--cdk-text-on-glass) !important;
}

.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder:active,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder:focus,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder:hover,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner,
.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
    color: var(--cdk-text-on-glass) !important;
    opacity: 1 !important;
}

.cdk-auth-scene .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdk-auth-scene .bootstrap-select .dropdown-toggle {
    justify-content: space-between;
    text-align: left;
}

.cdk-auth-form .bootstrap-select .dropdown-menu,
.cdk-auth-scene .bootstrap-select .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--cdk-radius-sm);
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12),
                0 2px 10px rgba(0, 0, 0, 0.06);
    transform-origin: top center;
    transition: all 0.25s var(--cdk-spring-soft);
}

/* Closed: completely remove from rendering (display:none prevents backdrop-filter bleed) */
.cdk-auth-form .bootstrap-select .dropdown-menu,
.cdk-auth-scene .bootstrap-select .dropdown-menu {
    display: none !important;
}

/* Open: show with animation */
.cdk-auth-form .bootstrap-select.open .dropdown-menu,
.cdk-auth-scene .bootstrap-select.open .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) translateY(0);
}

.cdk-auth-form .bootstrap-select .dropdown-menu .bs-searchbox .form-control,
.cdk-auth-scene .bootstrap-select .dropdown-menu .bs-searchbox .form-control {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--cdk-text-on-glass) !important;
    transition: all 0.2s var(--cdk-spring);
}

.cdk-auth-form .bootstrap-select .dropdown-menu .bs-searchbox .form-control:focus,
.cdk-auth-scene .bootstrap-select .dropdown-menu .bs-searchbox .form-control:focus {
    border-color: rgb(var(--cdk-primary-rgb)) !important;
    box-shadow: 0 0 0 3px rgba(var(--cdk-primary-rgb), 0.1) !important;
}

.cdk-auth-form .bootstrap-select .dropdown-menu li a,
.cdk-auth-scene .bootstrap-select .dropdown-menu li a {
    color: var(--cdk-text-on-glass);
    text-decoration: none !important;
    padding: 10px 16px;
    transition: all 0.15s var(--cdk-spring);
    border-radius: 6px;
    margin: 2px 6px;
}

.cdk-auth-form .bootstrap-select .dropdown-menu li a:hover,
.cdk-auth-scene .bootstrap-select .dropdown-menu li a:hover {
    background: rgba(var(--cdk-primary-rgb), 0.08);
    color: rgb(var(--cdk-primary-rgb));
    transform: translateX(2px);
}

.cdk-auth-form .bootstrap-select .dropdown-menu li.selected a,
.cdk-auth-scene .bootstrap-select .dropdown-menu li.selected a {
    background: rgba(var(--cdk-primary-rgb), 0.12);
    color: rgb(var(--cdk-primary-rgb));
    font-weight: 500;
}

/* --- Remember / Forgot row --- */
.cdk-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Checkboxes --- */
.cdk-check label,
.cdk-auth-form .checkbox label {
    color: var(--cdk-text-muted-on-glass);
    font-size: 13px;
}

/* --- Subtle links --- */
.cdk-link-subtle,
.cdk-auth-form a {
    color: var(--cdk-text-muted-on-glass);
    font-size: 13px;
    text-decoration: none;
    transition: var(--cdk-transition);
}

.cdk-link-subtle:hover,
.cdk-auth-form a:hover {
    color: var(--cdk-text-on-glass);
    text-decoration: underline;
}

/* --- Glass Buttons with Apple-like spring animations --- */
.cdk-btn-glass {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--cdk-radius-sm);
    cursor: pointer;
    transition: all 0.35s var(--cdk-spring-soft), 
                box-shadow 0.3s var(--cdk-ease-out-expo);
    letter-spacing: 0.01em;
    text-decoration: none;
    margin-bottom: 10px;
    transform: translateZ(0);
    position: relative;
    overflow: hidden;
}

.cdk-btn-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s var(--cdk-spring);
}

.cdk-btn-glass:hover::before {
    opacity: 1;
}

.cdk-btn-glass i {
    margin-right: 8px;
    transition: transform 0.3s var(--cdk-spring);
}

.cdk-btn-glass:hover i {
    transform: translateX(2px);
}

.cdk-btn-glass:active {
    transform: scale(0.97) translateZ(0);
    transition-duration: 0.1s;
}

.cdk-btn-primary-glass {
    background: rgb(var(--cdk-primary-rgb));
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(var(--cdk-primary-rgb), 0.25),
                0 1px 2px rgba(0,0,0,0.1);
}

.cdk-btn-primary-glass:hover {
    background: rgb(var(--cdk-primary-rgb));
    box-shadow: 0 8px 24px rgba(var(--cdk-primary-rgb), 0.35),
                0 4px 8px rgba(0,0,0,0.12);
    transform: translateY(-2px) translateZ(0);
    color: #fff;
    text-decoration: none;
}

.cdk-btn-primary-glass:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--cdk-primary-rgb), 0.2),
                0 8px 24px rgba(var(--cdk-primary-rgb), 0.35);
}

.cdk-btn-outline-glass {
    background: rgba(255, 255, 255, 0.4);
    color: var(--cdk-text-on-glass);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.cdk-btn-outline-glass:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.18);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    color: var(--cdk-text-on-glass);
    text-decoration: none;
}

.cdk-btn-outline-glass:active {
    transform: scale(0.97) translateZ(0);
}

/* --- Alt action link below buttons --- */
.cdk-auth-alt {
    text-align: center;
    font-size: 13px;
    color: var(--cdk-text-muted-on-glass);
    margin-top: 16px;
}

.cdk-auth-alt a {
    color: var(--cdk-text-on-glass);
    font-weight: 600;
}


/* --- Registration two-column layout --- */
.cdk-reg-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 20px;
}

.cdk-reg-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--cdk-text-on-glass);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cdk-reg-section-title i {
    margin-right: 8px;
    opacity: 0.6;
}

/* --- Validation errors --- */
.cdk-auth-form .text-danger,
.cdk-auth-form .form-error,
.cdk-auth-form .help-block {
    color: #d32f2f !important;
    font-size: 12px;
    margin-top: 4px;
}

/* Honeypot */
.honey-element {
    display: none !important;
}

/* Form error flash messages */
.cdk-auth-scene .alert {
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--cdk-radius-sm);
    color: var(--cdk-text-on-glass);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

.cdk-auth-scene .alert-danger {
    border-color: rgba(211, 47, 47, 0.3);
    background: rgba(211, 47, 47, 0.08);
}

.cdk-auth-scene .alert-success {
    border-color: rgba(40, 200, 120, 0.3);
    background: rgba(40, 200, 120, 0.08);
}


/* ==========================================================================
   2. AUTH RESPONSIVE
   ========================================================================== */

@media (max-width: 860px) {
    .cdk-auth-card-wide {
        max-width: 95%;
        padding: 28px 24px;
    }
    .cdk-reg-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .cdk-reg-col:first-child {
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 480px) {
    .cdk-auth-card {
        padding: 32px 24px;
        border-radius: 18px;
    }
    .cdk-auth-card-wide {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .cdk-auth-card-header h1 {
        font-size: 22px;
    }
    /* Tighter spacing on mobile registration */
    .cdk-auth-form .cdk-field {
        margin-bottom: 14px;
    }
    .cdk-field-input,
    .cdk-auth-form .form-control {
        padding: 10px 14px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    .cdk-btn-glass {
        padding: 12px 20px;
        font-size: 14px;
    }
    .cdk-reg-section-title {
        font-size: 14px;
        margin-bottom: 14px;
        padding-bottom: 8px;
    }
    .cdk-auth-center {
        padding: 24px 16px;
    }
}


/* ==========================================================================
   3. GLOBAL THEME — Navigation, Layout, Dashboard
   ========================================================================== */

/* --- Body & base --- */
body.cdk-theme {
    font-family: var(--cdk-font-family);
    background: var(--cdk-body-bg, #ffffff);
    color: #374151;
}

/* --- Top Navbar --- */
body.cdk-theme .navbar-default {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    min-height: 60px;
    /* Raise navbar stacking context so dropdowns always appear above page content */
    position: relative;
    z-index: 1050;
}

/* Nav dropdowns — must be above the navbar's own stacking context */
body.cdk-theme .navbar .dropdown-menu {
    z-index: 1051 !important;
    overflow: visible;
}

/* Sub-dropdowns (e.g. language picker fly-out) */
body.cdk-theme .dropdown-submenu {
    position: relative;
}
body.cdk-theme .dropdown-submenu > .dropdown-menu {
    z-index: 1052 !important;
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    border-radius: var(--cdk-radius-sm);
}

body.cdk-theme.cdk-navbar-glass .navbar-default {
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.cdk-theme .navbar-default .navbar-brand {
    padding: 12px 15px;
    height: auto;
}

body.cdk-theme .navbar-default .navbar-brand img {
    max-height: 36px;
    width: auto;
}

body.cdk-theme .navbar-default .navbar-nav > li > a {
    color: #333;
    font-size: 13px;
    font-weight: 500;
    padding: 15px 10px;
    transition: var(--cdk-transition);
}

body.cdk-theme .navbar-default .navbar-nav > li > a:hover,
body.cdk-theme .navbar-default .navbar-nav > .active > a {
    color: rgb(var(--cdk-primary-rgb));
    background: transparent;
}

body.cdk-theme .navbar-default .navbar-nav > .active > a {
    border-bottom: 2px solid rgb(var(--cdk-primary-rgb));
}

/* --- Navbar mobile toggle --- */
body.cdk-theme .navbar-default .navbar-toggle {
    border-color: rgba(0, 0, 0, 0.1);
}

body.cdk-theme .navbar-default .navbar-toggle .icon-bar {
    background-color: #555;
}

/* --- Page wrapper --- */
body.cdk-theme #wrapper {
    padding-top: 0;
}

body.cdk-theme .content {
    padding: 24px;
}


/* ==========================================================================
   4. CARDS & PANELS
   ========================================================================== */

body.cdk-theme .panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

body.cdk-theme .panel-heading {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    font-weight: 600;
    border-radius: var(--cdk-radius) var(--cdk-radius) 0 0;
}

body.cdk-theme .panel-body {
    padding: 20px;
}

body.cdk-theme .panel-footer {
    background: #fafbfc;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0 0 var(--cdk-radius) var(--cdk-radius);
    padding: 12px 20px;
}


/* ==========================================================================
   5. TABLES
   ========================================================================== */

/* General data tables (dt-table, not invoice items) */
body.cdk-theme .dt-table > thead > tr > th,
body.cdk-theme .table-invoices > thead > tr > th,
body.cdk-theme .table-estimates > thead > tr > th,
body.cdk-theme .table-contracts > thead > tr > th,
body.cdk-theme .table-proposals > thead > tr > th,
body.cdk-theme .table-tickets > thead > tr > th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cdk-table-header-color, #6b7280);
    border-bottom: 2px solid #e5e7eb;
    padding: 12px 16px;
    background: var(--cdk-table-header-bg, #fafbfc);
}

/* Invoice items table: preserve Perfex default appearance */
body.cdk-theme .table.items > thead > tr > th {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgb(var(--cdk-primary-rgb));
    border-bottom: none;
    padding: 10px 14px;
}

body.cdk-theme .table > tbody > tr > td {
    padding: 10px 14px;
    vertical-align: middle;
    border-top: 1px solid #f0f1f3;
    font-size: 14px;
}

body.cdk-theme .table > tbody > tr:hover > td {
    background: rgba(var(--cdk-primary-rgb), 0.03);
}

body.cdk-theme .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfc;
}


/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

body.cdk-theme .btn {
    border-radius: var(--cdk-radius-xs);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    transition: var(--cdk-transition);
    letter-spacing: 0.01em;
}

body.cdk-theme .btn-primary,
body.cdk-theme .btn-info {
    background: rgb(var(--cdk-primary-rgb));
    border-color: rgb(var(--cdk-primary-rgb));
    color: #fff;
}

body.cdk-theme .btn-primary:hover,
body.cdk-theme .btn-info:hover {
    background: rgba(var(--cdk-primary-rgb), 0.85);
    border-color: rgba(var(--cdk-primary-rgb), 0.85);
    box-shadow: 0 2px 8px rgba(var(--cdk-primary-rgb), 0.3);
}

body.cdk-theme .btn-default {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

body.cdk-theme .btn-default:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

body.cdk-theme .btn-success {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

body.cdk-theme .btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

/* Invoice / estimate pay buttons — use dedicated Invoice Pay Btn variable (defaults to green) */
body.cdk-theme .invoice-html-pay-now-top,
body.cdk-theme #pay_now,
body.cdk-theme .viewinvoice .btn-success,
body.cdk-theme .viewinvoice input[type="submit"].btn-success,
body.cdk-theme .viewestimate .btn-success,
body.cdk-theme .viewestimate input[type="submit"].btn-success {
    background: var(--cdk-invoice-pay-btn-bg, #10b981) !important;
    border-color: var(--cdk-invoice-pay-btn-bg, #10b981) !important;
    color: var(--cdk-invoice-pay-btn-text, #fff) !important;
}

body.cdk-theme .invoice-html-pay-now-top:hover,
body.cdk-theme #pay_now:hover,
body.cdk-theme .viewinvoice .btn-success:hover,
body.cdk-theme .viewestimate .btn-success:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    color: var(--cdk-invoice-pay-btn-text, #fff) !important;
}

body.cdk-theme .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
}

body.cdk-theme .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}


/* ==========================================================================
   7. FORMS (general, outside auth)
   ========================================================================== */

body.cdk-theme .form-control {
    border-radius: var(--cdk-radius-xs);
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    font-size: 14px;
    transition: var(--cdk-transition);
    box-shadow: none;
}

body.cdk-theme .form-control:focus {
    border-color: rgb(var(--cdk-primary-rgb));
    box-shadow: 0 0 0 3px rgba(var(--cdk-primary-rgb), 0.12);
}

body.cdk-theme .form-group label {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 5px;
    color: #374151;
}


/* ==========================================================================
   8. BADGES & LABELS
   ========================================================================== */

body.cdk-theme .label,
body.cdk-theme .badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}


/* ==========================================================================
   9. TABS & NAV
   ========================================================================== */

body.cdk-theme .nav-tabs {
    border-bottom: 2px solid #e5e7eb;
}

body.cdk-theme .nav-tabs > li > a {
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 18px;
    margin-bottom: -2px;
    transition: var(--cdk-transition);
}

body.cdk-theme .nav-tabs > li > a:hover {
    border-color: rgb(var(--cdk-primary-rgb));
    background: transparent;
    color: rgb(var(--cdk-primary-rgb));
}

body.cdk-theme .nav-tabs > li.active > a,
body.cdk-theme .nav-tabs > li.active > a:hover,
body.cdk-theme .nav-tabs > li.active > a:focus {
    border: none;
    border-bottom: 2px solid rgb(var(--cdk-primary-rgb));
    color: rgb(var(--cdk-primary-rgb));
    background: transparent;
}


/* ==========================================================================
   10. DROPDOWNS
   ========================================================================== */

body.cdk-theme .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--cdk-radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 6px;
    z-index: 1051;
}

/* Bootstrap-select in portal (25/50/100 per-page selectors, etc.) */
body.cdk-theme .bootstrap-select {
    position: relative;
}
body.cdk-theme .bootstrap-select > .dropdown-toggle {
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    border-radius: var(--cdk-radius-xs);
    padding: 6px 28px 6px 12px !important;
    font-size: 13px;
    font-weight: 400;
    box-shadow: none !important;
    min-width: 80px;
}
body.cdk-theme .bootstrap-select > .dropdown-toggle .caret {
    color: #6b7280 !important;
    border-top-color: #6b7280 !important;
}
body.cdk-theme .bootstrap-select.open > .dropdown-toggle {
    border-color: rgb(var(--cdk-primary-rgb)) !important;
    box-shadow: 0 0 0 3px rgba(var(--cdk-primary-rgb), 0.1) !important;
}
body.cdk-theme .bootstrap-select .dropdown-menu {
    min-width: 100%;
    z-index: 1060 !important;
}
body.cdk-theme .bootstrap-select .dropdown-menu li > a {
    color: #374151 !important;
    font-size: 13px;
    padding: 7px 14px;
}
body.cdk-theme .bootstrap-select .dropdown-menu li.selected > a,
body.cdk-theme .bootstrap-select .dropdown-menu li > a:hover {
    background: rgba(var(--cdk-primary-rgb), 0.06) !important;
    color: rgb(var(--cdk-primary-rgb)) !important;
}

body.cdk-theme .dropdown-menu > li > a {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--cdk-radius-xs);
    color: #374151;
    transition: var(--cdk-transition);
}

body.cdk-theme .dropdown-menu > li > a:hover {
    background: rgba(var(--cdk-primary-rgb), 0.06);
    color: rgb(var(--cdk-primary-rgb));
}


/* ==========================================================================
   11. FOOTER
   ========================================================================== */

body.cdk-theme .footer {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 24px;
    font-size: 13px;
    color: #6b7280;
}


/* ==========================================================================
   12. CDK DASHBOARD (home.php)
   ========================================================================== */

.cdk-greeting-card {
    background: var(--cdk-auth-gradient);
    color: #fff;
    border-radius: var(--cdk-radius);
    padding: 32px;
    margin-bottom: 24px;
}

.cdk-greeting-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
}

.cdk-greeting-card p {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
}

.cdk-stat-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.cdk-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(var(--cdk-primary-rgb), 0.08);
    color: rgb(var(--cdk-primary-rgb));
}

.cdk-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--cdk-heading-color, #374151);
    line-height: 1;
}

.cdk-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}


/* ==========================================================================
   13. SCROLLBAR
   ========================================================================== */

body.cdk-theme ::-webkit-scrollbar {
    width: 6px;
}

body.cdk-theme ::-webkit-scrollbar-track {
    background: transparent;
}

body.cdk-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

body.cdk-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}


/* ==========================================================================
   14. UTILITIES
   ========================================================================== */

.cdk-glass-panel {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--cdk-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.cdk-text-gradient {
    background: var(--cdk-auth-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation for glass cards on load - Apple-like spring */
@keyframes cdk-glass-in {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(24px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cdk-auth-scene .cdk-glass-card,
.cdk-admin-glass-scene .cdk-glass-card {
    animation: cdk-glass-in 0.6s var(--cdk-spring-soft);
}


/* ==========================================================================
   15. ADMIN LOGIN GLASS STYLING
   ========================================================================== */

body.login_admin .cdk-admin-glass-scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--cdk-auth-gradient);
    font-family: var(--cdk-font-family);
    z-index: 9990;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-center {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

body.login_admin .cdk-admin-glass-scene .cdk-glass-card {
    background: var(--cdk-glass-bg);
    -webkit-backdrop-filter: blur(var(--cdk-glass-blur)) saturate(180%);
    backdrop-filter: blur(var(--cdk-glass-blur)) saturate(180%);
    border: 1px solid var(--cdk-glass-border);
    border-radius: 24px;
    box-shadow: var(--cdk-glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    color: var(--cdk-text-on-glass);
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card-brand {
    text-align: center;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card-brand img {
    max-height: 46px;
    width: auto;
    display: block;
    margin: 0 auto;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--cdk-text-on-glass);
    margin: 8px 0 6px;
    letter-spacing: -0.02em;
}

body.login_admin .cdk-admin-glass-scene .cdk-auth-card-header p {
    font-size: 14px;
    color: var(--cdk-text-muted-on-glass);
    margin: 0;
    line-height: 1.5;
}

/* Admin login form fields */
body.login_admin .cdk-admin-glass-scene .cdk-field {
    margin-bottom: 18px;
}

body.login_admin .cdk-admin-glass-scene .cdk-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cdk-text-on-glass);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    transition: color 0.2s var(--cdk-spring);
}

body.login_admin .cdk-admin-glass-scene .cdk-field-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--cdk-text-on-glass);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--cdk-radius-sm);
    outline: none;
    transition: all 0.3s var(--cdk-spring-soft), box-shadow 0.25s var(--cdk-ease-out-expo);
    transform: translateZ(0);
}

body.login_admin .cdk-admin-glass-scene .cdk-field-input:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.15);
}

body.login_admin .cdk-admin-glass-scene .cdk-field-input:focus {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgb(var(--cdk-primary-rgb));
    box-shadow: 0 0 0 4px rgba(var(--cdk-primary-rgb), 0.12),
                0 2px 8px rgba(var(--cdk-primary-rgb), 0.08);
    transform: translateY(-1px) translateZ(0);
}

body.login_admin .cdk-admin-glass-scene .cdk-field-input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

body.login_admin .cdk-admin-glass-scene .cdk-field:focus-within .cdk-field-label {
    color: rgb(var(--cdk-primary-rgb));
}

body.login_admin .cdk-admin-glass-scene .cdk-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

body.login_admin .cdk-admin-glass-scene .cdk-check label {
    color: var(--cdk-text-muted-on-glass);
    font-size: 13px;
    cursor: pointer;
}

body.login_admin .cdk-admin-glass-scene .cdk-link-subtle {
    color: var(--cdk-text-muted-on-glass);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s var(--cdk-spring);
}

body.login_admin .cdk-admin-glass-scene .cdk-link-subtle:hover {
    color: rgb(var(--cdk-primary-rgb));
}

/* Admin login buttons */
body.login_admin .cdk-admin-glass-scene .cdk-btn-glass {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--cdk-radius-sm);
    cursor: pointer;
    transition: all 0.35s var(--cdk-spring-soft), 
                box-shadow 0.3s var(--cdk-ease-out-expo);
    letter-spacing: 0.01em;
    text-decoration: none;
    margin-bottom: 10px;
    transform: translateZ(0);
    position: relative;
    overflow: hidden;
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-glass i {
    margin-right: 8px;
    transition: transform 0.3s var(--cdk-spring);
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-glass:hover i {
    transform: translateX(2px);
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-glass:active {
    transform: scale(0.97) translateZ(0);
    transition-duration: 0.1s;
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-primary-glass {
    background: rgb(var(--cdk-primary-rgb));
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--cdk-primary-rgb), 0.25),
                0 1px 2px rgba(0,0,0,0.1);
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-primary-glass:hover {
    background: rgb(var(--cdk-primary-rgb));
    box-shadow: 0 8px 24px rgba(var(--cdk-primary-rgb), 0.35),
                0 4px 8px rgba(0,0,0,0.12);
    transform: translateY(-2px) translateZ(0);
    color: #fff;
}

body.login_admin .cdk-admin-glass-scene .cdk-btn-primary-glass:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--cdk-primary-rgb), 0.2),
                0 8px 24px rgba(var(--cdk-primary-rgb), 0.35);
}

/* Admin login alerts */
body.login_admin .cdk-admin-glass-scene .alert {
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--cdk-radius-sm);
    color: var(--cdk-text-on-glass);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

body.login_admin .cdk-admin-glass-scene .alert-danger {
    border-color: rgba(211, 47, 47, 0.3);
    background: rgba(211, 47, 47, 0.08);
}

/* Admin login responsive */
@media (max-width: 480px) {
    body.login_admin .cdk-admin-glass-scene .cdk-auth-card {
        padding: 32px 24px;
        border-radius: 18px;
    }
    body.login_admin .cdk-admin-glass-scene .cdk-auth-card-header h1 {
        font-size: 22px;
    }
}


/* ==========================================================================
   16. PRINT
   ========================================================================== */

@media print {
    .cdk-auth-scene,
    .navbar-default {
        display: none !important;
    }
}


/* ==========================================================================
   17. INVOICE / ESTIMATE / PROPOSAL PREVIEW PAGES
   ========================================================================== */

/* Base font size for invoice/estimate detail pages — controlled by settings */
body.cdk-theme .viewinvoice,
body.cdk-theme .viewestimate,
body.cdk-theme .viewproposal {
    font-size: var(--cdk-invoice-font-size, 14px);
}

body.cdk-theme .viewinvoice p,
body.cdk-theme .viewinvoice span:not(.label):not(.badge):not(.input-group-addon),
body.cdk-theme .viewinvoice td,
body.cdk-theme .viewinvoice th,
body.cdk-theme .viewestimate p,
body.cdk-theme .viewestimate span:not(.label):not(.badge):not(.input-group-addon),
body.cdk-theme .viewestimate td,
body.cdk-theme .viewestimate th {
    font-size: var(--cdk-invoice-font-size, 14px);
}

/* Top wrapper: contains logo + sticky action bar */
body.cdk-theme .preview-top-wrapper {
    margin-bottom: 0;
}

/* Sticky action bar */
body.cdk-theme .preview-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 10px 0;
}

body.cdk-theme .preview-sticky-container {
    max-width: 100%;
    padding: 0 20px;
}

/* Action buttons in invoice preview header — scope to button/anchor only, NOT form wrappers */
body.cdk-theme button.action-button,
body.cdk-theme a.action-button,
body.cdk-theme input.action-button {
    border-radius: var(--cdk-radius-xs);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 18px;
    transition: var(--cdk-transition);
}

/* Form wrappers with action-button class must not get button padding */
body.cdk-theme form.action-button {
    display: inline-block;
    padding: 0;
    margin: 0;
    vertical-align: bottom;
}

body.cdk-theme .action-button.btn-default {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

body.cdk-theme .action-button.btn-default:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

/* "Pay Now" / "Accept" sticky button — uses invoice pay btn variable */
body.cdk-theme .action-button.btn-success,
body.cdk-theme .invoice-html-pay-now-top.btn-success {
    background: var(--cdk-invoice-pay-btn-bg, #10b981);
    border-color: var(--cdk-invoice-pay-btn-bg, #10b981);
    color: var(--cdk-invoice-pay-btn-text, #fff);
}

body.cdk-theme .action-button.btn-success:hover,
body.cdk-theme .invoice-html-pay-now-top.btn-success:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--cdk-invoice-pay-btn-text, #fff);
}

/* Invoice card panel */
body.cdk-theme .panel_s {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

/* Invoice info section */
body.cdk-theme .transaction-html-info-col-left,
body.cdk-theme .transaction-html-info-col-right {
    padding-bottom: 12px;
}

body.cdk-theme .invoice-html-company-info,
body.cdk-theme .invoice-html-customer-billing-info,
body.cdk-theme .invoice-html-customer-shipping-info {
    font-size: 14px;
    line-height: 1.7;
}

/* Items table — restore clean Perfex look */
body.cdk-theme .table.items {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0;
}

body.cdk-theme .table.items > thead > tr > th {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgb(var(--cdk-primary-rgb)) !important;
    border: none;
    padding: 10px 14px;
}

body.cdk-theme .table.items > tbody > tr > td {
    padding: 10px 14px;
    border-top: 1px solid #f0f1f3;
    vertical-align: top;
    font-size: 14px;
}

body.cdk-theme .table.items > tbody > tr:hover > td {
    background: rgba(var(--cdk-primary-rgb), 0.03);
}

/* Totals table (subtotal/total/etc) — right-aligned */
body.cdk-theme .table.text-right > tbody > tr > td {
    padding: 8px 14px;
    border-top: 1px solid #f0f1f3;
    font-size: 14px;
}

body.cdk-theme .table.text-right > tbody > tr:last-child > td {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

/* Payment records table */
body.cdk-theme .invoice-payments-table > thead > tr > th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 10px 14px;
}

/* Online payment radio buttons */
body.cdk-theme .online-payment-radio label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Pay form heading */
body.cdk-theme .invoice-html-offline-payments p.tw-mb-2\.5,
body.cdk-theme [class*="col"] p.tw-mb-2\.5.tw-font-medium {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

/* Overdue alert */
body.cdk-theme .viewinvoice .alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--cdk-radius-xs);
    color: #991b1b;
}

/* Invoice status badges — keep Perfex inline style */
body.cdk-theme .invoice-html-status .label {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Invoice number in sticky area */
body.cdk-theme .invoice-html-number {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Notes / terms blocks */
body.cdk-theme .invoice-html-note,
body.cdk-theme .invoice-html-terms-and-conditions {
    font-size: 14px;
    color: #374151;
}

/* Watermark / signature areas */
body.cdk-theme .invoice-html-signature img {
    max-height: 80px;
    width: auto;
}

/* Total-to-words */
body.cdk-theme .invoice-html-total-to-words {
    font-size: 13px;
    color: #6b7280;
    margin: 12px 0;
}

/* Print: restore backgrounds for invoice items */
@media print {
    body.cdk-theme .table.items > thead > tr > th {
        background: rgb(var(--cdk-primary-rgb)) !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.cdk-theme .preview-sticky-header,
    body.cdk-theme .navbar-default,
    body.cdk-theme button.action-button,
    body.cdk-theme a.action-button,
    body.cdk-theme #pay_button {
        display: none !important;
    }

    body.cdk-theme .panel_s {
        box-shadow: none !important;
        border: none !important;
    }
}


/* ==========================================================================
   18. CUSTOMER AREA — LOGGED-IN SECTIONS
   ========================================================================== */

/* Body content area — fix #content padding (Perfex uses id="content", not .content) */
body.cdk-theme #content,
body.cdk-theme .content {
    padding-top: 12px;
}

/* --- CDK Sections (home.php dashboard wrappers) --- */
.cdk-section {
    margin-bottom: 28px;
}

.cdk-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.cdk-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--cdk-heading-color, #374151);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdk-section-header h3 i {
    font-size: 15px;
    color: rgb(var(--cdk-primary-rgb));
    opacity: 0.85;
}

.cdk-section-link {
    font-size: 13px;
    font-weight: 500;
    color: rgb(var(--cdk-primary-rgb));
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--cdk-transition);
}

.cdk-section-link:hover {
    color: rgba(var(--cdk-primary-rgb), 0.8);
    text-decoration: underline;
}

.cdk-section-link i {
    font-size: 12px;
}

/* --- CDK Cards --- */
.cdk-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.cdk-card-body {
    padding: 20px;
}

/* --- CDK Divider --- */
.cdk-divider {
    border: none;
    border-top: 1px solid #f0f1f3;
    margin: 16px 0;
}

/* --- CDK Input override (selects/inputs in portal) --- */
.cdk-input.form-control,
.cdk-input {
    border-radius: var(--cdk-radius-xs);
    border-color: #d1d5db;
    font-size: 14px;
}

/* --- Greeting card sub-elements --- */
.cdk-greeting-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.cdk-greeting-content {
    flex: 1 1 auto;
}

.cdk-greeting-text {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
}

.cdk-greeting-sub {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.cdk-greeting-date {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--cdk-radius-sm);
    padding: 8px 14px;
}

.cdk-greeting-date i {
    font-size: 14px;
}

/* --- Navbar variant styles --- */
body.cdk-theme.cdk-navbar-dark .navbar-default {
    background: rgba(26, 26, 46, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.cdk-theme.cdk-navbar-dark .navbar-default .navbar-brand,
body.cdk-theme.cdk-navbar-dark .navbar-default .navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.9);
}

body.cdk-theme.cdk-navbar-dark .navbar-default .navbar-nav > li > a:hover,
body.cdk-theme.cdk-navbar-dark .navbar-default .navbar-nav > .active > a {
    color: #fff;
    background: transparent;
}

body.cdk-theme.cdk-navbar-dark .navbar-default .navbar-toggle .icon-bar {
    background-color: rgba(255, 255, 255, 0.8);
}

body.cdk-theme.cdk-navbar-dark .dropdown-menu {
    background: rgba(26, 26, 46, 0.97);
    border-color: rgba(255, 255, 255, 0.08);
}

body.cdk-theme.cdk-navbar-dark .dropdown-menu > li > a {
    color: rgba(255, 255, 255, 0.85);
}

body.cdk-theme.cdk-navbar-dark .dropdown-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.cdk-theme.cdk-navbar-colored .navbar-default {
    background: rgb(var(--cdk-primary-rgb));
    border-bottom: none;
}

body.cdk-theme.cdk-navbar-colored .navbar-default .navbar-brand,
body.cdk-theme.cdk-navbar-colored .navbar-default .navbar-nav > li > a {
    color: #fff !important;
}

body.cdk-theme.cdk-navbar-colored .navbar-default .navbar-nav > li > a:hover,
body.cdk-theme.cdk-navbar-colored .navbar-default .navbar-nav > .active > a {
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.6) !important;
}

body.cdk-theme.cdk-navbar-colored .navbar-default .navbar-toggle .icon-bar {
    background-color: #fff;
}

body.cdk-theme.cdk-navbar-colored .navbar-default .dropdown-menu {
    background: rgb(var(--cdk-primary-rgb));
    border-color: rgba(255, 255, 255, 0.15);
}

body.cdk-theme.cdk-navbar-colored .dropdown-menu > li > a {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.cdk-theme.cdk-navbar-colored .dropdown-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

body.cdk-theme.cdk-navbar-transparent .navbar-default {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

body.cdk-theme.cdk-navbar-transparent .navbar-default .navbar-brand,
body.cdk-theme.cdk-navbar-transparent .navbar-default .navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.9);
}

/* --- Customer top submenu (Files, Calendar links) --- */
body.cdk-theme .submenu.customer-top-submenu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    border-bottom: 2px solid #e5e7eb;
}

body.cdk-theme .submenu.customer-top-submenu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--cdk-transition);
}

body.cdk-theme .submenu.customer-top-submenu > li > a:hover,
body.cdk-theme .submenu.customer-top-submenu > li.active > a {
    color: rgb(var(--cdk-primary-rgb));
    border-bottom-color: rgb(var(--cdk-primary-rgb));
    background: transparent;
}

/* --- Profile image in nav dropdown --- */
body.cdk-theme .client-profile-image-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.08);
    display: inline-block;
    vertical-align: middle;
}

/* --- Panel_s on public (non-logged-in) invoice/estimate pages --- */
body.cdk-theme .panel_s {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* --- Section headings in portal --- */
body.cdk-theme .section-heading {
    font-family: var(--cdk-heading-font, var(--cdk-font-family));
}

/* --- Alerts in portal --- */
body.cdk-theme #content .alert {
    border-radius: var(--cdk-radius-xs);
    font-size: 14px;
}

/* --- Tickets summary status cards --- */
body.cdk-theme .tickets-summary-heading {
    margin-top: 0;
    margin-bottom: 12px;
}

/* --- Statement page --- */
body.cdk-theme .statement-table > thead > tr > th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cdk-table-header-color, #6b7280);
    background: var(--cdk-table-header-bg, #fafbfc);
    border-bottom: 2px solid #e5e7eb;
}

/* --- Company profile & profile forms --- */
body.cdk-theme .section-profile .panel_s,
body.cdk-theme .section-company-profile .panel_s {
    margin-bottom: 24px;
}

/* --- Contracts / Proposals table --- */
body.cdk-theme .table-contracts > tbody > tr > td,
body.cdk-theme .table-proposals > tbody > tr > td {
    vertical-align: middle;
}

/* --- Knowledge base --- */
body.cdk-theme .knowledge-base-category-box {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cdk-radius);
    padding: 20px;
    transition: var(--cdk-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.cdk-theme .knowledge-base-category-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* --- Responsive adjustments for customer area --- */
/* 768-991px: nav items can't fit in 750px container — show hamburger toggle instead */
@media (min-width: 768px) and (max-width: 991px) {
    body.cdk-theme .navbar-toggle {
        display: block !important;
        float: right;
        margin: 10px 0 10px 10px;
    }
    body.cdk-theme .navbar-header {
        float: none;
    }
    body.cdk-theme .navbar-nav,
    body.cdk-theme .navbar-nav > li {
        float: none !important;
    }
    body.cdk-theme .navbar-collapse.collapse:not(.in) {
        display: none !important;
        height: auto !important;
        overflow: visible !important;
    }
    body.cdk-theme .navbar-collapse.in {
        display: block !important;
    }
    body.cdk-theme .navbar-collapse {
        border-top: 1px solid rgba(0,0,0,0.06);
        box-shadow: none;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
}

@media (max-width: 767px) {
    .cdk-greeting-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .cdk-greeting-date {
        align-self: flex-start;
    }

    body.cdk-theme #content,
    body.cdk-theme .content {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.cdk-theme .cdk-card-body {
        padding: 16px;
    }

    body.cdk-theme .submenu.customer-top-submenu > li > a {
        padding: 6px 12px;
        font-size: 12px;
    }
}
