:root {
    /* Dark Theme (Default) */
    --bg-primary: #050810;     /* Ultra dark blue/black */
    --bg-secondary: #0A101D;   /* Dark sleek blue */
    --bg-tertiary: #111A2E;
    
    --accent-blue: #3B82F6;
    --accent-teal: #2DD4BF;
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8; /* Slate 400 */
    --text-muted: #64748B;
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --glass-bg: rgba(255, 255, 255, 0.02);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --font-main: 'Outfit', -apple-system, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme {
    --bg-primary: #F8FAFC;     /* Slate 50 */
    --bg-secondary: #FFFFFF;   /* White */
    --bg-tertiary: #F1F5F9;    /* Slate 100 */
    
    --accent-blue: #2563EB;
    --accent-teal: #0D9488;
    --accent-glow: rgba(37, 99, 235, 0.1);
    
    --text-primary: #0F172A;   /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94A3B8;     /* Slate 400 */
    
    --border-light: rgba(0, 0, 0, 0.05);
    --border-strong: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 4px 20px 0 rgba(15, 23, 42, 0.08);
}

body.light-theme .logo,
body.light-theme .footer-logo,
body.light-theme .modal-logo,
.cert-logo {
    filter: invert(1) brightness(0.2); /* Converts white logo to high-contrast black */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6; overflow-x: hidden; position: relative;
}
a { transition: var(--transition-fast); }

.bg-gradient-1 {
    position: absolute; top: -20%; left: -10%; width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(5, 8, 16, 0) 70%);
    z-index: -1; pointer-events: none; filter: blur(80px);
}
.bg-gradient-2 {
    position: absolute; top: 40%; right: -20%; width: 50%; height: 70%;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.1) 0%, rgba(5, 8, 16, 0) 70%);
    z-index: -1; pointer-events: none; filter: blur(100px);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.section-padding { padding: 100px 0; }

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.03em; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; font-weight: 600; }
p { color: var(--text-secondary); }

.highlight {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.navbar {
    position: fixed; top: 0; width: 100%; height: 80px; display: flex; align-items: center;
    background: var(--bg-primary); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light); z-index: 1000;
}
.nav-container { display: flex; align-items: center; width: 100%; }
.logo { height: 45px; filter: brightness(0) invert(1); margin-right: 1.5rem; }
.nav-links { display: flex; align-items: center; flex: 1; }
.nav-main-group { display: flex; align-items: center; gap: 2rem; margin-left: 2.5rem; }
.nav-auth-group { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.95rem; white-space: nowrap; }
.nav-links a:hover { color: var(--text-primary); }

/* Dropdown Styles */
.nav-dropdown { position: relative; display: inline-block; cursor: pointer; padding-bottom: 0.5rem; margin-bottom: -0.5rem; }
.dropdown-trigger { color: var(--text-secondary); font-weight: 500; font-size: 0.95rem; white-space: nowrap; transition: var(--transition-fast); }
.nav-dropdown:hover .dropdown-trigger { color: var(--text-primary); }
.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
    padding: 0.8rem 0; background: var(--bg-secondary); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); box-shadow: 0 10px 25px rgba(0,0,0,0.5); z-index: 1001; 
}
.nav-dropdown:hover .dropdown-content { display: block; animation: dropdownFade 0.2s ease-out; }
.dropdown-content a { display: block; padding: 0.8rem 1.5rem; color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: background 0.2s; }
.dropdown-content a:hover { background: rgba(59, 130, 246, 0.1); color: var(--text-primary); }

@keyframes dropdownFade { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Dashboard Specific Styles */
.metric-card { transition: var(--transition-smooth); border-bottom: 2px solid transparent; }
.metric-card:hover { transform: translateY(-4px); border-bottom-color: var(--accent-blue); }
.activity-item { display: flex; gap: 1rem; align-items: flex-start; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-light); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 0.4rem; flex-shrink: 0; }

.nav-login-btn {
    padding: 0.6rem 1.4rem; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50px; color: var(--text-primary) !important;
}
.nav-login-btn:hover { background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 15px rgba(255,255,255,0.05); }

.mobile-menu-toggle {
    display: none; background: none; border: none; flex-direction: column; gap: 5px; cursor: pointer;
}
.mobile-menu-toggle span { display: block; width: 24px; height: 2px; background-color: var(--text-primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.8rem; border-radius: var(--radius-sm); font-weight: 600;
    text-decoration: none; transition: var(--transition-smooth); cursor: pointer; border: none; font-size: 1rem;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563EB); color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6); transform: translateY(-2px); }
.btn-secondary {
    background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--text-primary); transform: translateY(-2px); }
.arrow { margin-left: 8px; transition: transform 0.3s; }
.btn-primary:hover .arrow { transform: translateX(4px); }
.w-100 { width: 100%; }
.mt-4 { margin-top: 1.5rem; }

.hero { padding-top: 180px; padding-bottom: 80px; text-align: center; position: relative; }
.badge {
    display: inline-block; padding: 0.4rem 1rem; background: rgba(45, 212, 191, 0.1);
    color: var(--accent-teal); border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 50px; font-size: 0.85rem; font-weight: 600; margin-bottom: 1.5rem; text-transform: uppercase;
}
.hero-content { max-width: 900px; margin: 0 auto; }
.subheadline { font-size: clamp(1.1rem, 2vw, 1.3rem); margin: 0 auto 2.5rem; max-width: 700px; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; }

.hero-dashboard-preview { max-width: 1000px; margin: 0 auto; perspective: 1000px; }
.dashboard-mockup {
    width: 100%; height: 300px; background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-light); border-bottom: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.1);
    transform: rotateX(10deg); transform-origin: bottom center; position: relative; overflow: hidden;
}
.dashboard-mockup::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%); pointer-events: none;
}
.mockup-header {
    height: 40px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; padding: 0 1rem; gap: 6px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-hover); }
.mockup-body { padding: 2rem; }
.mockup-line { height: 12px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; margin-bottom: 1rem; }
.w-75 { width: 75%; } .w-50 { width: 50%; }
.mockup-chart {
    height: 120px; background: linear-gradient(90deg, rgba(59,130,246,0.1), rgba(45,212,191,0.1));
    border-radius: 8px; margin-top: 2rem; border: 1px solid rgba(59,130,246,0.2);
}

.section-header { text-align: center; margin-bottom: 4rem; }
.section-header p { font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.feature-grid, .steps-grid, .use-case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.feature-card { padding: 2rem; transition: var(--transition-smooth); cursor: default; }
.feature-card:hover {
    transform: translateY(-8px); border-color: rgba(255,255,255,0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,255,255,0.02);
}
.icon-wrapper {
    width: 44px; height: 44px; background: var(--bg-tertiary); border: 1px solid var(--border-strong);
    border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem;
    position: relative;
}
.icon-wrapper::after {
    content: ''; position: absolute; width: 10px; height: 10px; background: var(--accent-blue);
    border-radius: 2px; top: -2px; right: -2px; opacity: 0.6;
}
.feature-icon { font-size: 1.2rem; display: none; }

.step { padding: 2.5rem 2rem; position: relative; overflow: hidden; }
.step::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
}
.step-glowing-number {
    font-size: 3.5rem; font-weight: 800; color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.1); margin-bottom: 1rem; line-height: 1;
}

.premium-solid-card {
    background: var(--bg-tertiary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 2.5rem 2rem; position: relative; overflow: hidden;
    transition: var(--transition-smooth);
}
.premium-solid-card:hover { border-color: rgba(45, 212, 191, 0.3); }
.premium-solid-card:hover .card-glow { opacity: 0.3; }

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    width: 38px; height: 38px; border-radius: 50%; background: var(--bg-tertiary);
    border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition-fast); margin-left: 1rem;
}
.theme-toggle-btn:hover { border-color: var(--text-primary); transform: scale(1.05); }
.theme-toggle-btn-icon { font-size: 1rem; }

/* Metrics Preview Section */
.metrics-preview-box {
    margin-top: 4rem; padding: 2rem; background: var(--bg-secondary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); position: relative; overflow: hidden;
}
.metrics-preview-box::before {
    content: 'COMING SOON - ANALYTICS V2'; position: absolute; top: 1.5rem; right: -2rem;
    background: var(--accent-blue); color: #fff; font-size: 0.65rem; font-weight: 800;
    padding: 0.2rem 3rem; transform: rotate(45deg); letter-spacing: 1px;
}
.metrics-grid-placeholder {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; opacity: 0.4; pointer-events: none;
}
.metric-tile { height: 100px; background: var(--bg-tertiary); border-radius: 8px; border: 1px dashed var(--text-muted); }

/* FAQ Accordion Styles */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item { padding: 0 !important; overflow: hidden; cursor: pointer; transition: var(--transition-smooth); }
.faq-question { padding: 1.5rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.faq-question span { font-size: 1.5rem; transition: transform 0.3s ease; }
.faq-answer { padding: 0 1.5rem; max-height: 0; opacity: 0; overflow: hidden; transition: all 0.3s ease; color: var(--text-secondary); line-height: 1.6; }
.faq-item.active .faq-answer { padding-bottom: 1.5rem; max-height: 200px; opacity: 1; }

/* Premium Action Buttons */
.icon-actions-group { display: flex; gap: 0.75rem; justify-content: flex-end; }
.btn-icon {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-light); background: rgba(255, 255, 255, 0.03); cursor: pointer;
    transition: all 0.2s ease; color: var(--text-secondary); font-size: 0.9rem;
}
.btn-icon:hover { 
    background: rgba(255, 255, 255, 0.1); border-color: var(--text-primary); 
    color: var(--text-primary); transform: translateY(-2px);
}
.btn-icon-edit:hover { background: rgba(59, 130, 246, 0.15); border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-icon-status:hover { background: rgba(239, 68, 68, 0.1); border-color: #EF4444; color: #EF4444; }

.status-badge.status-deactivated { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border-color: var(--border-light); opacity: 0.6; }
.faq-item.active .faq-question span { transform: rotate(45deg); }
.faq-item:hover { border-color: var(--accent-blue); }

/* Visual Sections & Device Mockups */
.visual-section h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.1; margin-bottom: 1.5rem; }
.device-mockup { transition: var(--transition-smooth); box-shadow: 0 50px 100px -20px rgba(0,0,0,0.5); }
.device-mockup:hover { transform: translateY(-10px) rotateX(2deg); }

.floating-mockup-card {
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2) !important;
}
.floating-mockup-card:nth-child(even) { animation-delay: -3s; animation-duration: 7s; }

.visual-mockup-large {
    transition: var(--transition-smooth);
    transform: perspective(1000px) rotateX(2deg);
}
.visual-mockup-large:hover { transform: perspective(1000px) rotateX(0deg); }

/* Interactive Demo Modal Styles */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px) rotateX(0); }
    50% { transform: translateY(-15px) rotateX(2deg); }
    100% { transform: translateY(0px) rotateX(0); }
}

.footer { border-top: 1px solid var(--border-light); background: var(--bg-secondary); padding: 4rem 0 2rem; }
.footer-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; margin-bottom: 3rem; }
.footer-logo { height: 40px; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom { border-top: 1px solid var(--border-light); padding-top: 2rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000;
    display: none; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
}
.modal-content {
    position: relative; width: 100%; max-width: 400px; padding: 2.5rem; margin: 1rem;
    transform: scale(0.95); opacity: 0; transition: var(--transition-smooth);
    background: var(--bg-secondary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); box-shadow: var(--card-shadow);
}
.modal-content.large-modal { max-width: 900px; padding: 0; }
.modal.show .modal-content { opacity: 1; transform: scale(1); }
.close-btn {
    position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none;
    color: var(--text-secondary); font-size: 1.8rem; cursor: pointer; line-height: 1;
}
.close-btn:hover { color: var(--text-primary); }
.modal-header { text-align: center; margin-bottom: 2rem; }
.modal-logo { height: 50px; filter: brightness(0) invert(1); margin-bottom: 1.5rem; }
.input-group { margin-bottom: 1.2rem; }
.input-group label { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.input-wrapper input {
    width: 100%; padding: 0.8rem 1rem; background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: 1rem; transition: var(--transition-fast);
}
.input-wrapper input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.error-msg { color: #ef4444; font-size: 0.85rem; margin-top: 0.5rem; text-align: center; }
.modal-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }

/* Interactive Demo Layout */
.demo-container { display: flex; height: 100%; min-height: 500px; }
.demo-sidebar { border-right: 1px solid var(--border-light); }
.demo-step-indicator {
    padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 0.5rem;
    font-size: 0.9rem; color: var(--text-muted); cursor: default;
    transition: all 0.3s ease; border: 1px solid transparent;
}
.demo-step-indicator.active {
    background: rgba(59, 130, 246, 0.1); color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.2); font-weight: 600;
}
.demo-view { animation: fadeIn 0.4s ease-out; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.demo-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.modal-footer a { color: var(--accent-blue); text-decoration: none; }

@media (max-width: 900px) {
    .nav-links { display: none; }
    .mobile-menu-toggle { display: flex; }
    .hero { padding-top: 140px; }
    .hero-actions { flex-direction: column; max-width: 300px; margin: 0 auto 3rem; }
}
@media (max-width: 500px) { .dashboard-mockup { height: 180px; } h1 { font-size: 2.2rem; } }

/* Dashboard & Table Styles */
.premium-table { width: 100%; border-collapse: collapse; text-align: left; }
.premium-table th, .premium-table td { padding: 1rem; border-bottom: 1px solid var(--border-light); }
.premium-table th { color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; letter-spacing: 0.5px; text-transform: uppercase; }
.premium-table tr:hover { background: rgba(255, 255, 255, 0.05); }
.premium-table.clickable-row tbody tr { cursor: pointer; transition: background 0.2s; }
.premium-table.clickable-row tbody tr:hover { background: rgba(59, 130, 246, 0.1); }
.status-badge { padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600; display: inline-block; }
.status-active, .status-green { background: rgba(45, 212, 191, 0.1); color: var(--accent-teal); border: 1px solid rgba(45, 212, 191, 0.2); }
.status-quarantined, .status-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.status-orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.asset-table tbody tr { cursor: pointer; transition: background 0.2s ease; }
.asset-table tbody tr:hover { background: rgba(255, 255, 255, 0.05); }

.dashboard-header { margin-bottom: 3rem; width: 100%; display: flex; flex-direction: column; }
.text-center { text-align: center; align-items: center; }

/* Advanced Form Grid & Flex Modal */
.large-modal { max-width: 950px; max-height: 90vh; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.modal-flex-container { padding: 2rem; display: block; }
.modal-form-side { width: 100%; }
.modal-chart-section { margin-top: 2rem; background: rgba(0,0,0,0.2); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-light); }
.styled-select { 
    width: 100%; padding: 0.8rem 1rem; background: rgba(0, 0, 0, 0.2); 
    border: 1px solid var(--border-light); border-radius: var(--radius-sm); 
    color: var(--text-primary); font-family: inherit; font-size: 1rem; 
}
.styled-select:focus { outline: none; border-color: var(--accent-blue); }

.matrix-input {
    width: 100%; padding: 0.5rem; background: rgba(0, 0, 0, 0.2); 
    border: 1px solid var(--border-light); border-radius: var(--radius-sm); 
    color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
}
.matrix-input:focus { outline: none; border-color: var(--accent-blue); }

/* Inline Error Styles */
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important; }
.inline-error { color: #ef4444; font-size: 0.8rem; margin-top: 0.3rem; display: none; }

/* Calibration Certificate Print Layout */
.certificate-modal { 
    width: 100%; max-width: 1000px; background: #fff; color: #1e293b; 
    border-radius: 4px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); 
    font-family: 'Inter', 'Outfit', sans-serif; 
    max-height: 90vh; overflow-y: auto; 
    padding: 3rem;
}
#printArea {
    background: #fdfcf8;
    position: relative;
    padding-bottom: 2rem;
    /* Force background colours to print — required for cream/stripe rows */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}
.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.04;
    pointer-events: none;
    width: 70%;
    z-index: 0;
}
.cert-header-blk { 
    border-bottom: 5px solid #1e3a8a; padding-bottom: 2rem; margin-bottom: 2.5rem; border-top: 15px solid #0f172a; padding-top: 2rem;
    display: flex; justify-content: space-between; align-items: flex-end; 
    position: relative; z-index: 1;
}
.cert-header-blk h1 { color: #1e3a8a; font-size: 2.8rem; margin-bottom: 0.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: -1px; font-family: 'Outfit', sans-serif;}
.cert-meta-tag { font-size: 1rem; color: #334155; font-weight: 600;}
.cert-section-title { 
    font-size: 1.15rem; color: #1e3a8a; background: #f1f5f9; border-left: 5px solid #1e3a8a; 
    padding: 0.6rem 1rem; margin-bottom: 1.2rem; margin-top: 2.5rem; 
    font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    position: relative; z-index: 1;
}
.cert-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; position: relative; z-index: 1; }
.cert-info-group { margin-bottom: 0.85rem; display: flex; flex-direction: column; }
.cert-info-label { font-weight: 700; font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.2rem; }
.cert-info-value { font-size: 1.1rem; color: #020617; font-weight: 600; padding: 0.3rem 0; border-bottom: 1px solid #cbd5e1; font-family: 'Inter', sans-serif;}
.cert-table { width: 100%; border-collapse: collapse; margin-top: 1rem; border: 2px solid #0f172a; position: relative; z-index: 1; }
.cert-table th, .cert-table td { border: 1px solid #cbd5e1; padding: 1rem; text-align: center; font-size: 0.95rem; }
.cert-table th { background: #1e3a8a; color: #ffffff; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.8rem; border-color: #0f172a; }
.cert-table tr:nth-child(even) td { background: #f8fafc; }
.cert-table td { background: #fff; font-weight: 500; color: #0f172a;}
.cert-table td.pass-cell { color: #16a34a; font-weight: 800; background: rgba(22, 163, 74, 0.05); }
.cert-table td.fail-cell { color: #dc2626; font-weight: 800; background: rgba(220, 38, 38, 0.05); }
.wizard-step { display: none; }
.wizard-step.active { display: block; }

.cert-styled-table tr:nth-child(even) td { background: #f8fafc; }
.cert-styled-table td { border: 1px solid #0f172a; padding: 5px 8px; text-align: center; font-size: 0.78rem; }
.cert-styled-table td.pass-cell { color: #16a34a; font-weight: bold; background: rgba(22, 163, 74, 0.05); }
.cert-styled-table td.fail-cell { color: #dc2626; font-weight: bold; background: rgba(220, 38, 38, 0.05); }

/* New cert result table — injected dynamically */
#certMainResultTable td { border: 1px solid #0f172a; padding: 5px 8px; text-align: center; font-size: 0.78rem; }
#certMainResultTable tr:nth-child(even) td { background: #f8fafc; }
#certMainResultTable td.pass-cell { color: #16a34a; font-weight: 800; }
#certMainResultTable td.fail-cell { color: #dc2626; font-weight: 800; }

.archive-toggle-btn {
    width: 100%; padding: 1rem; margin-top: 2rem; background: rgba(0,0,0,0.2); 
    border: 1px dashed var(--border-light); border-radius: 8px; color: var(--text-muted);
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
    text-transform: uppercase; letter-spacing: 1px;
}
.archive-toggle-btn:hover { background: rgba(0,0,0,0.3); color: var(--text-secondary); border-style: solid; }
.archive-section { display: none; margin-top: 2rem; opacity: 0.8; }
.archive-section.show { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 0.8; transform: translateY(0); } }


/* Premium Role Selector (Pill Toggle) */
.role-selector {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.auth-glider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(33.33% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, var(--accent-blue), #2563EB);
    border-radius: 10px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    z-index: 1;
}

.role-btn {
    position: relative;
    flex: 1;
    padding: 0.9rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 2;
}

.role-btn.active {
    color: #FFFFFF !important;
}

.role-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Facility Readiness Custom Scale */
.client-hero-stat {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

@media (max-width: 768px) {
    .client-kpi-grid { grid-template-columns: 1fr; }
}

@media print {
    @page { size: A4 portrait; margin: 0; }

    /* ① Hide all body-level siblings of the modal */
    html, body { background: #fdfcf8 !important; }
    body > * { display: none !important; }

    /* ② Show the modal itself, stripped of overlay styling */
    #certificateModal {
        display: block !important;
        position: static !important;
        background: transparent !important;
        width: auto !important;
        height: auto !important;
        z-index: auto !important;
        padding: 10mm 12mm !important;
    }

    /* ③ Kill the dark backdrop */
    #certificateModal .modal-backdrop { display: none !important; }

    /* ④ Clean up the modal content box */
    #certificateModal .certificate-modal {
        position: static !important;
        display: block !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        background: #fdfcf8 !important;
    }

    /* ⑤ Hide the Close + Print buttons */
    #certificateModal .certificate-modal > div:first-child { display: none !important; }
    button { display: none !important; }

    /* ⑥ Auto-fit content: zoom is applied AFTER A4-width reflow, shrinks to fit */
    #printArea {
        zoom: 0.82 !important;
        transform-origin: top left !important;
        background: #fdfcf8 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Force warm stripe rows to print */
    #printArea tr, #printArea td, #printArea th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ⑥ Suppress chart canvas */
    #certGraph { display: none !important; }
}


.org-logo-wrapper svg {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}
