/* 
   Certificate Generator & Enterprise Credential Platform
   Creative, Clean & Light Theme Stylesheet (Vanilla CSS)
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    /* Modern Tech Obsidian & Sapphire Palette */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);
    --primary-deep: #0b0f19;
    --primary-navy: #0f172a;
    --primary-blue: #3b82f6;
    
    /* Modern Accents */
    --accent-indigo: #6366f1;
    --accent-gold: #f59e0b;
    --accent-gold-hover: #fbbf24;
    --accent-gold-dark: #d97706;
    --accent-emerald: #10b981;
    --accent-emerald-dark: #059669;
    --accent-emerald-light: #ecfdf5;
    --accent-amber: #f59e0b;
    
    /* Sleek Midnight Obsidian & Slate Surfaces */
    --bg-page: #0b0f19;
    --bg-surface: #0f172a;
    --bg-subtle: #111827;
    --bg-card: rgba(15, 23, 42, 0.95);
    --bg-card-dark: #0f172a;
    --bg-light: #0b0f19;
    --bg-input: #1e293b;
    
    /* Text Hierarchy */
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    --text-dark: #f8fafc;

    /* Semantic States */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #2869D8;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Cinzel', serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    /* Elevated Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -4px rgba(0, 0, 0, 0.6);
    
    --radius: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: #06231b;
    color: var(--text-light);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ================= TOP NAVIGATION BAR ================= */
header {
    background: rgba(5, 45, 36, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    height: 62px;
    min-height: 62px;
    max-height: 62px;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    box-sizing: border-box;
}

body.dark-mode header {
    background: rgba(3, 28, 22, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.92;
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-logo {
    transform: translateY(-2px) scale(1.08);
}

.corp-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-text h1 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-family: var(--font-title);
    line-height: 1.1;
    margin: 0;
    white-space: nowrap;
}

.brand-word-cert {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-word-gen {
    background: linear-gradient(135deg, #2869D8 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

body.dark-mode .brand-word-cert {
    color: #ffffff;
}

.brand-corporate-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #8faea2;
    text-transform: uppercase;
    margin-top: 2px;
    font-family: var(--font-sans);
}

body.dark-mode .brand-corporate-tag {
    color: #6c8a7f;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d1ded8;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode .nav-btn {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: #d1ded8;
}

.nav-btn:hover {
    border-color: #2869D8;
    background: rgba(40, 105, 216, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

body.dark-mode .nav-btn:hover {
    background: rgba(40, 105, 216, 0.25);
    color: #ffffff;
}

.nav-btn.active {
    background: #2869D8;
    color: #ffffff !important;
    border-color: #2869D8;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(40, 105, 216, 0.4);
}

.theme-toggle {
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d1ded8;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

body.dark-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.theme-toggle:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

/* ================= APP MAIN CONTAINER ================= */
main {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Global Footer */
footer {
    background: #052d24;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #8faea2;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0.4rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.78rem;
    box-sizing: border-box;
    flex-shrink: 0;
}

footer p {
    color: #8faea2;
    margin: 0;
    line-height: 1.25;
}

footer a {
    color: #38bdf8;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Glass Card Design -> Unified Rich Sage-Emerald Theme */
.glass-card {
    background: linear-gradient(170deg, #183c31 0%, #123429 55%, #0e2b22 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 24px !important;
    padding: 2.2rem 2.5rem !important;
    box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.65) !important;
    color: #ffffff !important;
    backdrop-filter: blur(12px) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .glass-card {
    background: linear-gradient(170deg, #183c31 0%, #123429 55%, #0e2b22 100%) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.glass-card:hover {
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.75) !important;
}

/* Portal Views switcher animations */
.portal-view {
    display: none !important;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.portal-view.active {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
}

#portal-verify.active {
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

#portal-admin:not(.admin-logged-in).active {
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

/* Helper Banner */
.helper-banner {
    background: rgba(20, 53, 42, 0.85);
    border: 1px solid #234d3e;
    border-left: 4px solid #2869D8;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.helper-banner-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #9cbdb1;
}

.test-accounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.test-acc-btn {
    background: #14352a;
    border: 1px solid #234d3e;
    color: #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.test-acc-btn:hover {
    background: #2869D8;
    color: #ffffff;
    border-color: #2869D8;
}

/* ================= FORM CONTROLS ================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #9cbdb1;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.15rem;
    border: 1px solid #234d3e;
    border-radius: 12px;
    background: #14352a;
    font-size: 0.92rem;
    color: #ffffff;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control::placeholder {
    color: #6d9688;
}

.form-control:focus {
    outline: none;
    border-color: #2869D8;
    box-shadow: 0 0 0 3px rgba(40, 105, 216, 0.3);
    background: #183e32;
    color: #ffffff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Range Slider Styling */
input[type="range"] {
    accent-color: #2869D8;
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: #2869D8;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(40, 105, 216, 0.4);
}

.btn-primary:hover {
    background: #1e56b8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 105, 216, 0.5);
}

.btn-secondary {
    background: #14352a;
    color: #e2e8f0;
    border: 1px solid #234d3e;
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: #1c483b;
    border-color: #316854;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-icon {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* ================= ALERTS & NOTIFICATIONS ================= */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ================= ZERO-DELAY AUTH & PORTAL ROUTING ================= */
html.admin-authenticated #admin-login-container {
    display: none !important;
}
html.admin-authenticated #admin-dashboard-container {
    display: flex !important;
}
html.admin-authenticated #portal-admin {
    padding: 0.85rem 1.25rem 0.85rem 0.85rem !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

html.portal-admin #portal-admin {
    display: flex !important;
}
html.portal-admin:not(.admin-authenticated) #portal-admin,
#portal-admin:not(.admin-logged-in) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: calc(100vh - 110px) !important;
    padding: 1rem 1.5rem !important;
    margin: auto !important;
    box-sizing: border-box !important;
}

html.portal-admin:not(.admin-authenticated) #admin-login-container,
#portal-admin:not(.admin-logged-in) #admin-login-container {
    margin: auto !important;
}

html.portal-admin #portal-verify {
    display: none !important;
}
html.portal-admin #btn-portal-admin {
    background: #2869D8 !important;
    color: #ffffff !important;
}
html.portal-admin #btn-portal-verify {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #9cbdb1 !important;
}

html.portal-verify #portal-verify {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
html.portal-verify #portal-admin {
    display: none !important;
}
html.portal-verify #btn-portal-verify {
    background: #2869D8 !important;
    color: #ffffff !important;
}
html.portal-verify #btn-portal-admin {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #9cbdb1 !important;
}

/* ================= DASHBOARD & ADMIN LAYOUT ================= */
#portal-admin.admin-logged-in {
    padding: 0.85rem 1.25rem 0.85rem 0.85rem !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 110px) !important;
    min-height: calc(100vh - 110px) !important;
    box-sizing: border-box !important;
}

#admin-dashboard-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
}

.admin-layout-container {
    display: grid !important;
    grid-template-columns: 290px 1fr !important;
    gap: 1.25rem !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    transition: grid-template-columns 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.admin-layout-container.sidebar-collapsed {
    grid-template-columns: 84px 1fr !important;
}

.admin-main-area {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
}

.admin-top-header-card {
    padding: 1.25rem 1.75rem !important;
    border-radius: 20px !important;
    flex-shrink: 0 !important;
}

.admin-tab-content-card {
    flex: 1 !important;
    min-width: 0 !important;
    border-radius: 24px !important;
    padding: 1.8rem 2rem !important;
    overflow-y: auto !important;
}

@media(max-width: 960px) {
    .admin-layout-container {
        grid-template-columns: 1fr !important;
    }
    .admin-layout-container.sidebar-collapsed {
        grid-template-columns: 1fr !important;
    }
}

/* ================= FROSTED GLASS SIDEBAR ================= */
.glass-sidebar {
    background: linear-gradient(170deg, rgba(24, 60, 49, 0.9) 0%, rgba(18, 52, 41, 0.92) 55%, rgba(14, 43, 34, 0.95) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5), 
                inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
    padding: 1.35rem 1.1rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.2rem !important;
    width: 290px !important;
    max-width: 290px !important;
    min-width: 290px !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    user-select: none !important;
    align-self: stretch !important;
    height: 100% !important;
}

/* Sidebar Top Bar: Brand Logo & Title + Collapse Toggle */
.sidebar-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0.1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 8px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    min-width: 0;
    transition: opacity 0.2s ease;
}

.sidebar-brand:hover {
    opacity: 0.9;
}

.sidebar-brand-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand-logo .corp-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-brand-title {
    font-size: 0.84rem;
    font-weight: 800;
    font-family: var(--font-title);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.sidebar-brand-tag {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.75px;
    color: #8faea2;
    text-transform: uppercase;
    margin-top: 2px;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9cbdb1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: #2869D8;
    color: #ffffff;
    border-color: #2869D8;
    transform: scale(1.1);
}

/* Sidebar Section */
.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Menu Navigation Pill Buttons */
.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glass-sidebar .sidebar-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0.72rem 0.95rem !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    color: #d1ded8 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-align: left !important;
    text-decoration: none !important;
    gap: 8px;
    box-sizing: border-box !important;
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-item-icon {
    font-size: 0.98rem;
    width: 18px;
    text-align: center;
    color: #8faea2;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.nav-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glass-sidebar .sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    transform: translateX(2px) !important;
}

.glass-sidebar .sidebar-btn:hover .nav-item-icon {
    color: #38bdf8 !important;
    transform: scale(1.1) !important;
}

/* Active State: Royal Blue Pill */
.glass-sidebar .sidebar-btn.active {
    background: linear-gradient(135deg, #2869D8 0%, #1e5ac0 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 18px rgba(40, 105, 216, 0.4) !important;
    border-radius: 12px !important;
    transform: translateY(0) !important;
}

.glass-sidebar .sidebar-btn.active .nav-item-icon {
    color: #ffffff !important;
}

.glass-sidebar .sidebar-btn.active .nav-item-text {
    color: #ffffff !important;
}

.nav-item-extra-icon {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #d1ded8;
}

.nav-plus-icon {
    font-size: 0.72rem;
    color: #9cbdb1;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-red-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    background: #ef4444;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* ================= COLLAPSED MODE ================= */
.glass-sidebar.collapsed {
    width: 84px !important;
    max-width: 84px !important;
    min-width: 84px !important;
    padding: 1.4rem 0.65rem !important;
    align-items: center !important;
    border-radius: 20px !important;
}

.glass-sidebar.collapsed .sidebar-top-bar {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    border-bottom: none;
    padding-bottom: 0.2rem;
}

.glass-sidebar.collapsed .sidebar-brand-text,
.glass-sidebar.collapsed .nav-item-text,
.glass-sidebar.collapsed .nav-item-badge,
.glass-sidebar.collapsed .nav-item-extra-icon,
.glass-sidebar.collapsed .nav-plus-icon,
.glass-sidebar.collapsed .nav-stacked-badges {
    display: none !important;
}

.glass-sidebar.collapsed .sidebar-btn {
    justify-content: center !important;
    padding: 0.65rem !important;
    border-radius: 12px !important;
}

.glass-sidebar.collapsed .nav-item-left {
    justify-content: center;
    gap: 0;
}

.glass-sidebar.collapsed .nav-item-icon {
    font-size: 1.15rem;
}

/* ================= STATS & METRICS CARDS ================= */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.4rem;
    background: #14352a;
    border: 1px solid #234d3e;
    border-radius: 16px;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2869D8 0%, #38bdf8 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    border-color: #316854;
}

.stat-card-val {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
    font-family: var(--font-title);
    letter-spacing: -0.5px;
}

.stat-card-label {
    font-size: 0.78rem;
    color: #9cbdb1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================= UPLOAD DROPZONE ================= */
.upload-dropzone {
    background: rgba(14, 43, 34, 0.75) !important;
    border: 2px dashed rgba(56, 189, 248, 0.4) !important;
    border-radius: 20px !important;
    padding: 3rem 2rem !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.05) !important;
    position: relative !important;
    margin-top: 1rem !important;
    box-sizing: border-box !important;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    background: rgba(20, 56, 44, 0.9) !important;
    border-color: #38bdf8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(56, 189, 248, 0.25) !important;
}

.upload-dropzone .upload-icon {
    font-size: 3.2rem !important;
    color: #38bdf8 !important;
    margin-bottom: 0.85rem !important;
    filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.45)) !important;
    transition: transform 0.25s ease !important;
    display: inline-block !important;
}

.upload-dropzone:hover .upload-icon {
    transform: scale(1.1) translateY(-3px) !important;
}

.upload-dropzone h4 {
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    font-family: var(--font-title) !important;
    margin: 0.2rem 0 0.4rem !important;
    letter-spacing: -0.2px !important;
}

.upload-dropzone p {
    color: #9cbdb1 !important;
    font-size: 0.85rem !important;
}

/* ================= CLEAN DATA TABLES ================= */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 1rem;
    border-radius: 12px;
    border: 1px solid #234d3e;
    background: #103026;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #234d3e;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

th {
    background: #143b2f;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: #9cbdb1;
    border-bottom: 1px solid #234d3e;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2ece8;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #174235;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ================= DROPZONE FOR FILE UPLOADS ================= */
.dropzone, .upload-dropzone {
    background: rgba(14, 43, 34, 0.75) !important;
    border: 2px dashed rgba(56, 189, 248, 0.4) !important;
    border-radius: 20px !important;
    padding: 2.8rem 2rem !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.05) !important;
    margin-bottom: 1.5rem !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.dropzone:hover, .dropzone.dragover, .upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: #38bdf8 !important;
    background: rgba(20, 56, 44, 0.9) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(56, 189, 248, 0.25) !important;
}

.dropzone-icon, .upload-icon {
    font-size: 3rem !important;
    color: #38bdf8 !important;
    margin-bottom: 0.85rem !important;
    filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.45)) !important;
    transition: transform 0.25s ease !important;
    display: inline-block !important;
}

.dropzone:hover .dropzone-icon, .upload-dropzone:hover .upload-icon {
    transform: translateY(-3px) scale(1.1) !important;
}

.dropzone p, .upload-dropzone p {
    font-size: 0.85rem !important;
    color: #9cbdb1 !important;
}

.dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ================= CLEAN EXECUTIVE CERTIFICATE STYLING ================= */
.certificate-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1.5rem;
}

/* Frame layout matching A4 landscape bounds (1.414 aspect ratio) */
.certificate-wrapper {
    width: 100%;
    max-width: 820px;
    aspect-ratio: 1.414;
    position: relative;
    box-shadow: 0 12px 40px -6px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.08);
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    color: #0f172a;
    container-type: inline-size;
    container-name: cert;
}

/* Base Certificate Body */
.certificate-body {
    width: 100%;
    height: 100%;
    aspect-ratio: 1.414;
    container-type: inline-size;
    container-name: cert;
    padding: 4.5% 5.5%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

/* 1. Template: Modern Minimalist Slate (Clean Crisp) */
.certificate-body.template-classic-gold {
    border: 1.4cqw solid #0f172a;
    background: radial-gradient(circle at center, #ffffff 0%, #fafbfc 65%, #f1f5f9 100%);
}

.certificate-body.template-classic-gold::before {
    content: '';
    position: absolute;
    top: 0.6cqw;
    left: 0.6cqw;
    right: 0.6cqw;
    bottom: 0.6cqw;
    border: 0.22cqw solid #2563eb;
    pointer-events: none;
    z-index: 1;
}

.certificate-body.template-classic-gold::after {
    content: '';
    position: absolute;
    top: 1.1cqw;
    left: 1.1cqw;
    right: 1.1cqw;
    bottom: 1.1cqw;
    border: 0.08cqw dashed rgba(15, 23, 42, 0.2);
    pointer-events: none;
    z-index: 1;
}

/* 2. Template: Modern Corporate Slate & Bronze */
.certificate-body.template-modern-border {
    border: 1.3cqw solid #1e293b;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.certificate-body.template-modern-border::before {
    content: '';
    position: absolute;
    top: 0.6cqw;
    left: 0.6cqw;
    right: 0.6cqw;
    bottom: 0.6cqw;
    border: 0.2cqw solid #0284c7;
    pointer-events: none;
    z-index: 1;
}

/* 3. Template: Elegant Academic Ivory */
.certificate-body.template-elegant-royal {
    border: 1.4cqw solid #0f172a;
    background: radial-gradient(circle at center, #ffffff 0%, #fbfcfd 100%);
}

.certificate-body.template-elegant-royal::before {
    content: '';
    position: absolute;
    top: 0.6cqw;
    left: 0.6cqw;
    right: 0.6cqw;
    bottom: 0.6cqw;
    border: 0.3cqw double #475569;
    outline: 0.08cqw dashed #2563eb;
    outline-offset: -0.3cqw;
    pointer-events: none;
    z-index: 1;
}

/* 4. Template: High-Tech Slate Grid */
.certificate-body.template-tech-obsidian {
    border: 1.4cqw solid #030712;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
    color: #f8fafc;
}

.certificate-body.template-tech-obsidian::before {
    content: '';
    position: absolute;
    top: 0.6cqw;
    left: 0.6cqw;
    right: 0.6cqw;
    bottom: 0.6cqw;
    border: 0.2cqw solid #38bdf8;
    box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.12);
    pointer-events: none;
    z-index: 1;
}

.certificate-body.template-tech-obsidian .cert-title,
.certificate-body.template-tech-obsidian .cert-name,
.certificate-body.template-tech-obsidian .cert-logo-text,
.certificate-body.template-tech-obsidian .cert-signatory-name {
    color: #f8fafc;
}

.certificate-body.template-tech-obsidian .cert-desc,
.certificate-body.template-tech-obsidian .cert-recipient-label {
    color: #94a3b8;
}

.certificate-body.template-tech-obsidian .cert-event-title,
.certificate-body.template-tech-obsidian strong {
    color: #38bdf8;
}

/* 5. Custom Certificate Template Mode */
.certificate-body.template-custom {
    border: none;
    background-color: transparent;
    position: relative;
}

.certificate-body.template-custom:not([style*="background-image"]) {
    border: 1.4cqw solid #0f172a !important;
    background: radial-gradient(circle at center, #ffffff 0%, #fafbfc 100%) !important;
}

.certificate-body.template-custom:not([style*="background-image"])::before {
    content: '';
    position: absolute;
    top: 0.6cqw;
    left: 0.6cqw;
    right: 0.6cqw;
    bottom: 0.6cqw;
    border: 0.22cqw solid #2563eb;
    pointer-events: none;
    z-index: 1;
}

.certificate-body.template-custom .cert-content {
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.6);
    z-index: 3;
}

/* Clean Certificate Header Logo & Verification Stamp */
.certificate-header-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.12cqw solid rgba(15, 23, 42, 0.1);
    padding-bottom: 2%;
    flex-shrink: 0;
    z-index: 3;
}

.cert-logo-mock {
    display: flex;
    align-items: center;
    gap: 1.2cqw;
}

.cert-logo-icon {
    width: 4.5cqw;
    height: 4.5cqw;
    border-radius: 12%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cert-header-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cert-logo-text {
    font-family: var(--font-title);
    font-size: 1.25cqw;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    letter-spacing: 0.08cqw;
}

.cert-logo-text span {
    display: block;
    font-size: 0.72cqw;
    font-weight: 600;
    color: #2563eb;
    letter-spacing: 0.18cqw;
    font-family: var(--font-sans);
    margin-top: 0.15cqw;
}

.cert-header-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.2cqw;
    margin-right: 6cqw;
}

.cert-auth-stamp {
    font-size: 0.68cqw;
    font-weight: 700;
    letter-spacing: 0.1cqw;
    color: #065f46;
    background: #ecfdf5;
    padding: 0.2cqw 0.6cqw;
    border-radius: 0.3cqw;
    border: 0.08cqw solid #a7f3d0;
    display: inline-flex;
    align-items: center;
    gap: 0.3cqw;
}

.cert-serial-tag {
    font-size: 0.6cqw;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.1cqw;
    font-family: monospace;
}

/* Modern Clean Digital Security Seal */
.cert-badge-ribbon {
    position: absolute;
    top: 0;
    right: 4.5%;
    width: 5.4cqw;
    height: 8.5cqw;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #0f172a 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.cert-badge-ribbon-inner {
    width: 4.2cqw;
    height: 4.2cqw;
    border: 0.15cqw dashed rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.1cqw;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Certificate Typography & Content */
.cert-content {
    text-align: center;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.6cqw;
    flex: 1;
    justify-content: center;
    z-index: 2;
    position: relative;
    transition: transform 0.2s ease;
}

.cert-title {
    font-family: var(--font-title);
    font-size: 2.8cqw;
    color: #0f172a;
    letter-spacing: 0.18cqw;
    margin-bottom: 0.2cqw;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
}

.cert-subtitle {
    font-family: var(--font-sans);
    font-size: 1.05cqw;
    text-transform: uppercase;
    letter-spacing: 0.28cqw;
    color: #2563eb;
    font-weight: 700;
    margin-bottom: 0.3cqw;
}

.cert-recipient-label {
    font-size: 1.15cqw;
    font-style: italic;
    color: #64748b;
    margin-bottom: 0.1cqw;
}

.cert-name {
    font-family: var(--font-serif);
    font-size: 3.3cqw;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 0.15cqw solid #2563eb;
    display: inline-block;
    padding: 0 2.5cqw 0.3cqw 2.5cqw;
    margin: 0 auto 0.4cqw auto;
    font-style: italic;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 92%;
    line-height: 1.2;
}

.cert-desc {
    font-size: 1.22cqw;
    line-height: 1.5;
    color: #334155;
    max-width: 86%;
    margin: 0 auto;
}

.cert-desc strong, .cert-event-title {
    color: #0f172a;
    font-weight: 700;
}

/* Certificate Footer & Signatures */
.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 1cqw;
    flex-shrink: 0;
    z-index: 3;
    position: relative;
}

.cert-signatory {
    text-align: center;
    width: 30%;
}

.cert-signature-img {
    height: 3.6cqw;
    margin-bottom: 0.2cqw;
    font-family: 'Playfair Display', cursive;
    font-size: 2cqw;
    color: #0f172a;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.cert-signatory-line {
    border-top: 0.14cqw solid rgba(15, 23, 42, 0.25);
    margin-top: 0.2cqw;
}

.cert-signatory-name {
    font-size: 1.15cqw;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.3cqw;
}

.cert-signatory-title {
    font-size: 0.85cqw;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06cqw;
    font-family: var(--font-sans);
}

.cert-meta {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35cqw;
}

.cert-qr-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2cqw;
    background: #ffffff;
    padding: 0.4cqw;
    border-radius: 0.4cqw;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 0.08cqw solid #e2e8f0;
}

.cert-qr {
    width: 5.5cqw;
    height: 5.5cqw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-qr canvas, .cert-qr img {
    width: 100% !important;
    height: 100% !important;
}

.cert-qr-scan-label {
    font-size: 0.55cqw;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.1cqw;
}

.cert-id {
    font-size: 0.85cqw;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.06cqw;
}

/* ================= MODALS & POPUPS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(170deg, #183c31 0%, #123429 55%, #0e2b22 100%) !important;
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

body.dark-mode .modal-content {
    background: linear-gradient(170deg, #183c31 0%, #123429 55%, #0e2b22 100%) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: #0d2b21;
    color: #ffffff;
    padding: 1.1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2869D8;
}

.modal-header h3 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

/* Social Share Grid */
.share-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 6px;
    border: 1px solid #234d3e;
    border-radius: 12px;
    background: #14352a;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.share-btn i {
    font-size: 1.6rem;
}

.share-btn-linkedin i { color: #0077b5; }
.share-btn-twitter i { color: #1da1f2; }
.share-btn-facebook i { color: #1877f2; }
.share-btn-whatsapp i { color: #25d366; }

.share-btn:hover {
    background: #1a4436;
    transform: translateY(-2px);
    border-color: #2869D8;
}

.share-caption-container {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

body.dark-mode .share-caption-container {
    background: #1e293b;
    border-color: #334155;
}

.share-caption-text {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    font-style: italic;
    color: var(--text-secondary);
}

.share-copy-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.share-copy-btn:hover {
    background: var(--primary-hover);
}

/* Mock Social Media Post Simulator */
.mock-feed-post {
    margin-top: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
    box-shadow: var(--shadow);
    display: none;
}

body.dark-mode .mock-feed-post {
    background: #1e293b;
    border-color: #334155;
}

.mock-feed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mock-feed-avatar {
    width: 38px;
    height: 38px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9rem;
}

.mock-feed-user-details h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.mock-feed-user-details p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.mock-feed-body {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.mock-feed-image {
    width: 100%;
    aspect-ratio: 1.414;
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mock-feed-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Mock Email Inbox Simulator */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.email-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .email-item {
    background: #1e293b;
    border-color: #334155;
}

.email-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
    transform: translateX(3px);
}

.email-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.email-icon-badge {
    background: #eff6ff;
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.email-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.email-details p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.email-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Public Verification badge */
.verification-badge-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.2rem 2rem;
    border: 2px solid var(--success);
    background: #ecfdf5;
    border-radius: 12px;
    text-align: center;
    max-width: 520px;
    margin: 1.5rem auto;
    box-shadow: var(--shadow);
}

.verification-icon {
    font-size: 3.2rem;
    color: var(--success);
    margin-bottom: 0.85rem;
}

.verification-title {
    font-family: var(--font-title);
    font-size: 1.28rem;
    color: #065f46;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

/* Footer Section */
footer {
    text-align: center;
    padding: 1.25rem 2rem;
    color: #8faea2;
    font-size: 0.82rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #052d24;
    margin-top: auto;
}

footer p {
    color: #8faea2;
}

body.dark-mode footer {
    background: #052d24;
    border-top-color: rgba(255, 255, 255, 0.06);
    color: #8faea2;
}

/* Spinner */
.spinner {
    border: 3px solid rgba(40, 105, 216, 0.2);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 22px;
    height: 22px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================= EXACT SAAS EMERALD LOGIN DESIGN ================= */
#portal-admin {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
}

#portal-admin.admin-logged-in {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding: 1.5rem !important;
}

#portal-admin:not(.active) {
    display: none !important;
}

#portal-admin.active {
    display: flex !important;
}

#admin-login-container[style*="display: none"] {
    display: none !important;
}

#admin-dashboard-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    height: 100% !important;
}

/* Main Card - Seamless Integrated Composition */
/* Main Card - Sleek Modern Midnight SaaS Card */
.saas-emerald-login-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 960px;
    height: 530px;
    max-height: calc(100vh - 125px);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Left Certificate Visual Space & Overlays */
.saas-cert-showcase {
    flex: 1.15 !important;
    width: 53% !important;
    height: 100% !important;
    background: radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0.8) 75%), url('../assets/emerald-card-seamless.jpg') center/cover no-repeat !important;
    padding: 1.8rem 2.2rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    position: relative !important;
    z-index: 3 !important;
    pointer-events: none !important;
}

.saas-left-bottom-badge {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    pointer-events: auto !important;
}

.saas-vert-line {
    width: 2.5px !important;
    height: 28px !important;
    background: #38bdf8 !important;
    border-radius: 2px !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5) !important;
}

.saas-badge-texts {
    display: flex !important;
    flex-direction: column !important;
}

.saas-badge-title {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    line-height: 1.25 !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6) !important;
}

.saas-badge-sub {
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    line-height: 1.25 !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6) !important;
}

/* Right Login Area - Layered over seamless backdrop */
.saas-login-area {
    flex: 1 !important;
    width: 47% !important;
    background: rgba(15, 23, 42, 0.95) !important;
    padding: 2rem 2.8rem 1.6rem 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    color: #ffffff !important;
    position: relative !important;
    z-index: 3 !important;
}

.saas-top-lang-bar {
    display: flex !important;
    justify-content: flex-end !important;
}

.saas-lang-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    background: rgba(0, 0, 0, 0.32) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.saas-lang-pill:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.saas-flag {
    font-size: 0.95rem !important;
}

.saas-lang-text {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
}

.saas-lang-chevron {
    font-size: 0.65rem !important;
    color: #94a3b8 !important;
}

.saas-form-center-box {
    width: 100% !important;
    max-width: 350px !important;
    margin: 0 auto !important;
}

.saas-login-heading {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 3.2rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin-bottom: 0.35rem !important;
    letter-spacing: -0.02em !important;
}

.saas-login-subtext {
    font-size: 0.96rem !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
    margin-bottom: 1.6rem !important;
}

.saas-login-form {
    width: 100% !important;
}

.saas-form-group {
    margin-bottom: 1.15rem !important;
    width: 100% !important;
}

.saas-input-label {
    display: block !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    margin-bottom: 0.4rem !important;
}

.saas-input-wrapper {
    position: relative !important;
    width: 100% !important;
}

.saas-input-wrapper .saas-input-icon {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    font-size: 0.95rem !important;
    pointer-events: none !important;
}

.saas-text-input {
    width: 100% !important;
    height: 52px !important;
    padding: 0 16px 0 46px !important;
    border-radius: 12px !important;
    background: #0b0f19 !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    font-size: 0.92rem !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.saas-password-input {
    padding-right: 46px !important;
}

.saas-text-input::placeholder {
    color: #64748b !important;
    font-size: 0.88rem !important;
}

.saas-text-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    background: #111827 !important;
}

.saas-toggle-eye {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
    padding: 4px !important;
    transition: color 0.2s ease !important;
}

.saas-toggle-eye:hover {
    color: #cbd5e1 !important;
}

.saas-primary-blue-btn {
    width: 100% !important;
    height: 52px !important;
    border-radius: 12px !important;
    border: none !important;
    background: linear-gradient(135deg, #2869D8 0%, #1e5ac0 100%) !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px rgba(40, 105, 216, 0.4) !important;
    margin-top: 0.6rem !important;
    transition: all 0.2s ease !important;
}

.saas-primary-blue-btn:hover {
    background: linear-gradient(135deg, #3275e6 0%, #2464cb 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 28px rgba(40, 105, 216, 0.5) !important;
}

.saas-primary-blue-btn:active {
    transform: translateY(0) !important;
}

.saas-bottom-tagline {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 16px !important;
    font-size: 0.76rem !important;
    color: #6c8a7f !important;
    padding-right: 0.5rem !important;
}

.saas-dot {
    color: #4a685f !important;
    font-size: 0.65rem !important;
}

/* Responsive design */
@media (max-width: 860px) {
    .saas-emerald-login-card {
        flex-direction: column !important;
        height: auto !important;
        max-width: 440px !important;
        border-radius: 28px !important;
    }
    .saas-cert-showcase {
        width: 100% !important;
        height: 300px !important;
    }
    .saas-login-area {
        width: 100% !important;
        padding: 2.2rem 1.8rem !important;
    }
}

/* ================= 50+ REAL CERTIFICATE TEMPLATE CARDS ================= */
.template-filter-bar .btn-filter {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #8faea2;
    border-radius: 20px;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.template-filter-bar .btn-filter:hover {
    background: rgba(40, 105, 216, 0.2);
    color: #ffffff;
    border-color: rgba(40, 105, 216, 0.4);
}

.template-filter-bar .btn-filter.active {
    background: #2869D8 !important;
    color: #ffffff !important;
    border-color: #2869D8 !important;
    box-shadow: 0 4px 14px rgba(40, 105, 216, 0.4);
}

.template-card {
    background: linear-gradient(170deg, rgba(20, 52, 42, 0.9) 0%, rgba(14, 38, 30, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 18px !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.template-card:hover {
    transform: translateY(-6px) scale(1.015) !important;
    border-color: rgba(40, 105, 216, 0.6) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(40, 105, 216, 0.35) !important;
}

/* Authentic Miniature Certificate Canvas/Frame */
.mini-cert-frame {
    width: 100%;
    aspect-ratio: 1.414;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 4.5% 5.5%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    transition: transform 0.2s ease;
}

.mini-cert-frame * {
    box-sizing: border-box;
}

/* Ornate Corner Accents */
.mini-cert-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-style: solid;
    pointer-events: none;
    z-index: 2;
}
.mini-cert-corner.top-left { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.mini-cert-corner.top-right { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.mini-cert-corner.bottom-left { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.mini-cert-corner.bottom-right { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

.mini-cert-inner-border {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid;
    pointer-events: none;
    z-index: 1;
}

/* Header in Mini Cert */
.mini-cert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 3;
    padding-bottom: 2%;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.mini-cert-logo-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.mini-cert-logo-icon {
    font-size: 11px;
}
.mini-cert-org-text {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    line-height: 1;
}
.mini-cert-ribbon-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Body in Mini Cert */
.mini-cert-body {
    text-align: center;
    position: relative;
    z-index: 3;
    padding: 2% 0;
}
.mini-cert-award-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 2px;
}
.mini-cert-recipient-sub {
    font-size: 6.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.75;
    margin-bottom: 2px;
}
.mini-cert-recipient-name {
    font-family: 'Playfair Display', Georgia, cursive, serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
    margin: 2px 0;
}
.mini-cert-desc {
    font-size: 6.5px;
    line-height: 1.25;
    max-width: 88%;
    margin: 0 auto;
    opacity: 0.8;
}

/* Footer in Mini Cert */
.mini-cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 3;
    padding-top: 2%;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.mini-cert-sig {
    text-align: center;
    width: 32%;
}
.mini-cert-sig-line {
    font-family: 'Playfair Display', cursive, serif;
    font-style: italic;
    font-size: 8.5px;
    display: block;
    border-bottom: 1px solid;
    padding-bottom: 1px;
    line-height: 1;
}
.mini-cert-sig-label {
    font-size: 5.5px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: block;
    margin-top: 2px;
    opacity: 0.8;
}
.mini-cert-qr {
    text-align: center;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ================= 8 LUXURY THEME PALETTES ================= */

/* 1. Theme: 24K Gold Classic */
.cert-theme-gold {
    background: linear-gradient(145deg, #fffefb 0%, #fdf6e6 50%, #f7e8c3 100%);
    border: 3px solid #b8860b;
    color: #291f05;
}
.cert-theme-gold .mini-cert-corner { border-color: #b8860b; }
.cert-theme-gold .mini-cert-inner-border { border-color: #d4af37; border-style: dashed; }
.cert-theme-gold .mini-cert-award-title { color: #855806; }
.cert-theme-gold .mini-cert-recipient-name { color: #1c1404; }
.cert-theme-gold .mini-cert-ribbon-badge { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); color: #fff; }
.cert-theme-gold .mini-cert-sig-line { border-color: #b8860b; color: #855806; }
.cert-theme-gold .mini-cert-qr { color: #855806; }

/* 2. Theme: Royal Navy & Platinum */
.cert-theme-navy {
    background: linear-gradient(145deg, #07152b 0%, #0d274c 50%, #061326 100%);
    border: 3px solid #38bdf8;
    color: #f1f5f9;
}
.cert-theme-navy .mini-cert-corner { border-color: #facc15; }
.cert-theme-navy .mini-cert-inner-border { border-color: rgba(56, 189, 248, 0.4); }
.cert-theme-navy .mini-cert-award-title { color: #facc15; }
.cert-theme-navy .mini-cert-recipient-name { color: #ffffff; }
.cert-theme-navy .mini-cert-ribbon-badge { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); color: #07152b; }
.cert-theme-navy .mini-cert-sig-line { border-color: #38bdf8; color: #38bdf8; }
.cert-theme-navy .mini-cert-qr { color: #38bdf8; }
.cert-theme-navy .mini-cert-header { border-bottom-color: rgba(255,255,255,0.12); }
.cert-theme-navy .mini-cert-footer { border-top-color: rgba(255,255,255,0.12); }

/* 3. Theme: Bahrain Emerald Heritage */
.cert-theme-emerald {
    background: linear-gradient(145deg, #02231b 0%, #064e3b 50%, #022018 100%);
    border: 3px solid #10b981;
    color: #ecfdf5;
}
.cert-theme-emerald .mini-cert-corner { border-color: #fef08a; }
.cert-theme-emerald .mini-cert-inner-border { border-color: rgba(254, 240, 138, 0.35); border-style: double; border-width: 2px; }
.cert-theme-emerald .mini-cert-award-title { color: #fef08a; }
.cert-theme-emerald .mini-cert-recipient-name { color: #ffffff; }
.cert-theme-emerald .mini-cert-ribbon-badge { background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%); color: #02231b; }
.cert-theme-emerald .mini-cert-sig-line { border-color: #10b981; color: #a7f3d0; }
.cert-theme-emerald .mini-cert-qr { color: #10b981; }
.cert-theme-emerald .mini-cert-header { border-bottom-color: rgba(255,255,255,0.12); }
.cert-theme-emerald .mini-cert-footer { border-top-color: rgba(255,255,255,0.12); }

/* 4. Theme: Obsidian Dark Tech */
.cert-theme-obsidian {
    background: linear-gradient(145deg, #09090b 0%, #18181b 50%, #09090b 100%);
    border: 3px solid #06b6d4;
    color: #f8fafc;
}
.cert-theme-obsidian .mini-cert-corner { border-color: #06b6d4; }
.cert-theme-obsidian .mini-cert-inner-border { border-color: rgba(6, 182, 212, 0.3); }
.cert-theme-obsidian .mini-cert-award-title { color: #06b6d4; }
.cert-theme-obsidian .mini-cert-recipient-name { color: #ffffff; }
.cert-theme-obsidian .mini-cert-ribbon-badge { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); color: #000; }
.cert-theme-obsidian .mini-cert-sig-line { border-color: #06b6d4; color: #a5f3fc; }
.cert-theme-obsidian .mini-cert-qr { color: #06b6d4; }
.cert-theme-obsidian .mini-cert-header { border-bottom-color: rgba(255,255,255,0.1); }
.cert-theme-obsidian .mini-cert-footer { border-top-color: rgba(255,255,255,0.1); }

/* 5. Theme: Oxford Academic Distinction */
.cert-theme-academic {
    background: linear-gradient(145deg, #fefce8 0%, #fef3c7 50%, #fae8b0 100%);
    border: 3px double #78350f;
    color: #292524;
}
.cert-theme-academic .mini-cert-corner { border-color: #991b1b; }
.cert-theme-academic .mini-cert-inner-border { border-color: rgba(120, 53, 15, 0.4); }
.cert-theme-academic .mini-cert-award-title { color: #991b1b; }
.cert-theme-academic .mini-cert-recipient-name { color: #1c1917; }
.cert-theme-academic .mini-cert-ribbon-badge { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); color: #fff; }
.cert-theme-academic .mini-cert-sig-line { border-color: #78350f; color: #78350f; }
.cert-theme-academic .mini-cert-qr { color: #991b1b; }

/* 6. Theme: Sovereign Burgundy */
.cert-theme-burgundy {
    background: linear-gradient(145deg, #2a0812 0%, #4c1122 50%, #25050e 100%);
    border: 3px solid #fb7185;
    color: #fff1f2;
}
.cert-theme-burgundy .mini-cert-corner { border-color: #facc15; }
.cert-theme-burgundy .mini-cert-inner-border { border-color: rgba(251, 113, 133, 0.35); }
.cert-theme-burgundy .mini-cert-award-title { color: #facc15; }
.cert-theme-burgundy .mini-cert-recipient-name { color: #ffffff; }
.cert-theme-burgundy .mini-cert-ribbon-badge { background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); color: #fff; }
.cert-theme-burgundy .mini-cert-sig-line { border-color: #fb7185; color: #fecdd3; }
.cert-theme-burgundy .mini-cert-qr { color: #facc15; }
.cert-theme-burgundy .mini-cert-header { border-bottom-color: rgba(255,255,255,0.12); }
.cert-theme-burgundy .mini-cert-footer { border-top-color: rgba(255,255,255,0.12); }

/* 7. Theme: Modern Minimalist */
.cert-theme-minimalist {
    background: #ffffff;
    border: 3px solid #0f172a;
    color: #0f172a;
}
.cert-theme-minimalist .mini-cert-corner { border-color: #2563eb; }
.cert-theme-minimalist .mini-cert-inner-border { border-color: #e2e8f0; }
.cert-theme-minimalist .mini-cert-award-title { color: #2563eb; }
.cert-theme-minimalist .mini-cert-recipient-name { color: #0f172a; }
.cert-theme-minimalist .mini-cert-ribbon-badge { background: #2563eb; color: #fff; }
.cert-theme-minimalist .mini-cert-sig-line { border-color: #0f172a; color: #0f172a; }
.cert-theme-minimalist .mini-cert-qr { color: #2563eb; }

/* 8. Theme: Imperial Royal */
.cert-theme-royal {
    background: linear-gradient(145deg, #1e1b4b 0%, #1e3a8a 50%, #172554 100%);
    border: 3px solid #eab308;
    color: #f8fafc;
}
.cert-theme-royal .mini-cert-corner { border-color: #eab308; }
.cert-theme-royal .mini-cert-inner-border { border-color: rgba(234, 179, 8, 0.35); }
.cert-theme-royal .mini-cert-award-title { color: #fef08a; }
.cert-theme-royal .mini-cert-recipient-name { color: #ffffff; }
.cert-theme-royal .mini-cert-ribbon-badge { background: linear-gradient(135deg, #eab308 0%, #a16207 100%); color: #fff; }
.cert-theme-royal .mini-cert-sig-line { border-color: #eab308; color: #fef08a; }
.cert-theme-royal .mini-cert-qr { color: #eab308; }
.cert-theme-royal .mini-cert-header { border-bottom-color: rgba(255,255,255,0.12); }
.cert-theme-royal .mini-cert-footer { border-top-color: rgba(255,255,255,0.12); }

/* --- CUSTOM CERTIFICATE STUDIO CSS --- */
#canva-studio-modal .modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#canva-studio-modal .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

#canva-studio-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#canva-studio-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

#canva-studio-modal .btn-primary:hover {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

#canva-studio-modal .btn-icon {
    padding: 8px;
    border-radius: 6px;
}

#studio-canvas-container {
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Scrollbar for sidebar */
#canva-studio-modal [style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
}
#canva-studio-modal [style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: transparent;
}
#canva-studio-modal [style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* =========================================
   CANVA-STYLE STUDIO PRO UI (v10.0)
   ========================================= */
:root {
    --canva-bg: #111214;
    --canva-rail-bg: #18191b;
    --canva-rail-hover: #262729;
    --canva-panel-bg: #1e1f21;
    --canva-workspace-bg: #2b2d31;
    --canva-text: #ffffff;
    --canva-text-muted: #9ca3af;
    --canva-primary: #8b3dff;
    --canva-primary-hover: #7a2ff0;
    --canva-border: rgba(255, 255, 255, 0.08);
}

.canva-ui {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--canva-text);
    user-select: none;
}

/* Studio Header */
.studio-header-bar {
    height: 54px;
    background: var(--canva-bg);
    border-bottom: 1px solid var(--canva-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 10;
}

.studio-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.studio-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.studio-home-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.studio-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
}

.studio-save-badge {
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    transition: all 0.3s ease;
}

.studio-header-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.studio-hdr-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.studio-hdr-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.studio-hdr-btn.active {
    background: rgba(139, 61, 255, 0.25);
    color: #c084fc;
}

.studio-hdr-sep {
    width: 1px;
    height: 20px;
    background: var(--canva-border);
    margin: 0 4px;
}

.studio-zoom-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--canva-border);
    color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

.studio-zoom-select option {
    background: var(--canva-panel-bg);
    color: #fff;
}

.studio-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.studio-export-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--canva-border);
}

.studio-export-btn {
    background: transparent;
    border: none;
    color: #e2e8f0;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s, color 0.2s;
}

.studio-export-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.studio-save-btn {
    background: var(--canva-primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(139, 61, 255, 0.35);
    transition: background 0.2s, transform 0.1s;
}

.studio-save-btn:hover {
    background: var(--canva-primary-hover);
    transform: translateY(-1px);
}

/* Contextual Toolbar */
.studio-ctx-toolbar {
    height: 44px;
    background: #1c1d1f;
    border-bottom: 1px solid var(--canva-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    overflow-x: auto;
    flex-shrink: 0;
    z-index: 9;
}

.ctx-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ctx-label {
    font-size: 0.75rem;
    color: var(--canva-text-muted);
    font-weight: 500;
}

.ctx-color {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.ctx-num {
    width: 60px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--canva-border);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    text-align: center;
    outline: none;
}

.ctx-select-wide {
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--canva-border);
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    max-width: 170px;
    outline: none;
}

.ctx-select-wide optgroup, .ctx-select-wide option {
    background: var(--canva-panel-bg);
    color: #fff;
}

.ctx-btn-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.ctx-toggle-btn {
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: var(--canva-text-muted);
    border-radius: 3px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.ctx-toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ctx-toggle-btn.active {
    color: #fff;
    background: var(--canva-primary);
}

.ctx-range {
    width: 80px;
    accent-color: var(--canva-primary);
    cursor: pointer;
}

.ctx-val {
    font-size: 0.75rem;
    color: var(--canva-text-muted);
    min-width: 36px;
}

.ctx-icon-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.ctx-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ctx-btn-sep {
    width: 1px;
    height: 18px;
    background: var(--canva-border);
    margin: 0 4px;
}

.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Studio Body Layout */
.studio-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Left Nav Rail */
.studio-nav-rail {
    width: 72px;
    background: var(--canva-rail-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    border-right: 1px solid var(--canva-border);
    flex-shrink: 0;
    z-index: 5;
}

.snav-item {
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    color: var(--canva-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.snav-item i {
    font-size: 1.15rem;
}

.snav-item span {
    font-size: 0.65rem;
    font-weight: 500;
}

.snav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.snav-item.active {
    color: #fff;
    background: var(--canva-panel-bg);
    box-shadow: inset 3px 0 0 var(--canva-primary);
}

/* Side Panel */
.studio-side-panel {
    width: 320px;
    background: var(--canva-panel-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--canva-border);
    z-index: 4;
    overflow-y: auto;
    flex-shrink: 0;
}

.spanel {
    display: none;
    padding: 20px;
}

.spanel.active {
    display: block;
}

.spanel-section {
    margin-bottom: 24px;
}

.spanel-heading {
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spanel-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.spanel-label {
    color: var(--canva-text-muted);
    font-size: 0.8rem;
    min-width: 60px;
}

.spanel-color {
    width: 34px;
    height: 34px;
    border: 1px solid var(--canva-border);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.spanel-input, .spanel-select, .spanel-num, .spanel-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--canva-border);
    color: #fff;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.spanel-input:focus, .spanel-select:focus, .spanel-num:focus, .spanel-textarea:focus {
    border-color: var(--canva-primary);
}

.spanel-select option {
    background: var(--canva-panel-bg);
    color: #fff;
}

.spanel-textarea {
    resize: vertical;
    min-height: 60px;
}

.bg-swatch {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.15s, border-color 0.15s;
}

.bg-swatch:hover {
    transform: scale(1.15);
    border-color: #fff;
}

.spanel-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--canva-border);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
}

.spanel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.spanel-btn.primary {
    background: var(--canva-primary);
    border-color: var(--canva-primary);
}

.spanel-btn.primary:hover {
    background: var(--canva-primary-hover);
    border-color: var(--canva-primary-hover);
}

.spanel-icon-btn {
    background: transparent;
    border: none;
    color: var(--canva-text-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.spanel-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.spanel-text-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--canva-border);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    text-align: left;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.spanel-text-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--canva-primary);
}

.spanel-text-btn.heading {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

.spanel-text-btn.subheading {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.spanel-text-btn.body {
    font-size: 0.82rem;
    color: #cbd5e1;
}

.spanel-field-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px dashed rgba(139, 61, 255, 0.4);
    background: rgba(139, 61, 255, 0.05);
    color: #c084fc;
    text-align: left;
    margin-bottom: 8px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.spanel-field-btn:hover {
    background: rgba(139, 61, 255, 0.15);
    border-color: var(--canva-primary);
    color: #fff;
}

.shapes-grid-pro {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.spro-shape-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--canva-border);
    border-radius: 6px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    gap: 4px;
    padding: 6px;
}

.spro-shape-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.spro-shape-btn svg {
    width: 36px;
    height: 36px;
}

.spro-shape-btn span {
    color: #9ca3af;
    font-size: 0.65rem;
    font-weight: 500;
}

.spanel-line-btn {
    width: 100%;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--canva-border);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 4px 8px;
    transition: all 0.2s;
}

.spanel-line-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--canva-primary);
}

.spanel-line-btn span {
    color: #9ca3af;
    font-size: 0.62rem;
    margin-top: 2px;
}

/* Layers List */
.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--canva-border);
    gap: 8px;
    transition: background 0.15s;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.layer-name {
    font-size: 0.8rem;
    color: #e2e8f0;
    font-weight: 500;
}

.layer-action-btn {
    background: transparent;
    border: none;
    color: var(--canva-text-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.layer-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.layer-action-btn.danger:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

/* Workspace & Canvas */
.studio-workspace {
    flex: 1;
    background: var(--canva-workspace-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 40px;
    position: relative;
}

.canvas-page-wrapper {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    position: relative;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* Hide HTML5 number spinners across studio */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none !important; 
    margin: 0 !important; 
}
input[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Right Properties Panel */
.studio-props-panel {
    width: 250px;
    background: var(--canva-panel-bg);
    border-left: 1px solid var(--canva-border);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 4;
}

.props-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.props-field {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--canva-border);
    border-radius: 6px;
    padding: 5px 8px;
    flex: 1;
    transition: border-color 0.2s;
}

.props-field:focus-within {
    border-color: var(--canva-primary);
}

.props-badge {
    color: var(--canva-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 14px;
    user-select: none;
}

.props-unit {
    color: var(--canva-text-muted);
    font-size: 0.7rem;
    user-select: none;
}

.props-num {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.82rem;
    width: 100%;
    text-align: right;
    outline: none;
    font-family: inherit;
}

/* Status Bar */
.studio-statusbar {
    height: 34px;
    background: var(--canva-bg);
    border-top: 1px solid var(--canva-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 0.8rem;
    color: var(--canva-text-muted);
    flex-shrink: 0;
    z-index: 10;
}

.statusbar-left, .statusbar-center, .statusbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.autosave-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.autosave-status.saved { color: #4ade80; }
.autosave-status.saving { color: #fbbf24; }
.autosave-status.unsaved { color: #94a3b8; }

.statusbar-btn {
    background: transparent;
    border: none;
    color: var(--canva-text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.statusbar-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.statusbar-btn.active {
    color: #c084fc;
    background: rgba(139, 61, 255, 0.2);
}

.statusbar-sep {
    width: 1px;
    height: 16px;
    background: var(--canva-border);
    margin: 0 4px;
}

/* Template Gallery within Studio */
.studio-cat-pill {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.studio-cat-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.studio-cat-pill.active {
    background: var(--canva-primary);
    color: #fff;
    border-color: var(--canva-primary);
    box-shadow: 0 0 10px rgba(139, 61, 255, 0.4);
}
.studio-tpl-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.studio-tpl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    border-color: var(--canva-primary) !important;
}


