/**
 * Notary Dr. Galad - Official Theme & Stylesheet
 * Advanced, Modern Legal & Property Registry Design System
 * Features: Plus Jakarta Sans & Outfit Typography, Glassmorphism, 
 * Micro-interactions, Luxury Gold Gradients, Bento Cards & Dark Mode
 */

/* ==========================================================================
   1. DESIGN SYSTEM TOKENS & CSS VARIABLES
   ========================================================================== */
:root {
    /* Premium Typography Stacks */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
    --font-ar: 'Cairo', 'Tajawal', system-ui, sans-serif;

    /* Core Executive Color Palette */
    --notary-primary: #0f2942;
    --notary-primary-dark: #081726;
    --notary-primary-light: #1b3d5f;
    --notary-primary-subtle: #edf3f8;
    --notary-primary-gradient: linear-gradient(135deg, #081726 0%, #0f2942 55%, #1d456d 100%);
    
    /* Regal Metallic Gold Palette */
    --notary-gold: #c5a059;
    --notary-gold-light: #dfbe7d;
    --notary-gold-dark: #9e7d38;
    --notary-gold-subtle: #fbf7ee;
    --notary-gold-gradient: linear-gradient(135deg, #f5dfa8 0%, #c5a059 50%, #9e7d38 100%);
    
    /* Status & Accent Colors */
    --notary-emerald: #059669;
    --notary-emerald-light: #e8f5f0;
    --notary-emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --notary-sapphire: #4f46e5;
    --notary-sapphire-light: #eef2ff;
    --notary-cyan: #0284c7;
    --notary-cyan-light: #38bdf8;
    --notary-danger: #dc2626;
    --notary-warning: #d97706;

    /* Backgrounds & Surfaces (Light Mode) */
    --notary-bg: #f8fafc;
    --notary-card-bg: #ffffff;
    --notary-card-border: rgba(15, 41, 66, 0.08);
    --notary-text: #1e293b;
    --notary-text-secondary: #475569;
    --notary-muted: #64748b;
    
    /* Glassmorphism Surfaces */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    
    /* Modern Border Radius System */
    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 9999px;

    /* Multi-stop Ambient Elevation Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 41, 66, 0.04);
    --shadow-sm: 0 2px 4px rgba(15, 41, 66, 0.05), 0 1px 2px rgba(15, 41, 66, 0.03);
    --shadow-md: 0 4px 14px -2px rgba(15, 41, 66, 0.08), 0 2px 6px -1px rgba(15, 41, 66, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 41, 66, 0.1), 0 4px 10px -2px rgba(15, 41, 66, 0.05);
    --shadow-xl: 0 22px 48px -8px rgba(15, 41, 66, 0.16), 0 8px 18px -4px rgba(15, 41, 66, 0.07);
    --shadow-gold-glow: 0 0 25px rgba(197, 160, 89, 0.35);
    --shadow-primary-glow: 0 0 25px rgba(15, 41, 66, 0.35);

    /* Dimensions */
    --sidebar-width: 268px;
    --topbar-height: 68px;
}

/* ==========================================================================
   2. GLOBAL RESET & MODERN TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 15.5px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 576px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 16.5px;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 17px;
    }
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: -0.011em;
    background-color: var(--notary-bg);
    color: var(--notary-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings with Modern Geometric Hierarchy */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--notary-primary);
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

h1, .h1 { font-size: 1.85rem; }
h2, .h2 { font-size: 1.55rem; }
h3, .h3 { font-size: 1.35rem; }
h4, .h4 { font-size: 1.15rem; }
h5, .h5 { font-size: 1.02rem; }
h6, .h6 { font-size: 0.9rem; }

/* Prestige Notary & Crest Headings */
.font-serif, .legal-title, .cert-title {
    font-family: var(--font-serif) !important;
    letter-spacing: 0.03em;
}

/* Crisp Tabular Figures & Codes */
.font-monospace, code, pre, .badge-code, .id-number, .transaction-num, .currency-amount {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Smooth Links */
a {
    color: var(--notary-primary);
    text-decoration: none;
    transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

a:hover {
    color: var(--notary-gold-dark);
}

/* Smooth Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 41, 66, 0.18);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--notary-gold);
}

/* ==========================================================================
   3. SIDEBAR NAVIGATION COMPONENT (FROSTED GLASS & MODERN PILL STATES)
   ========================================================================== */
.notary-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #06121f 0%, #0a1c2e 50%, #081726 100%);
    color: #ffffff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(197, 160, 89, 0.18);
}

.notary-sidebar .sidebar-brand {
    padding: 1.25rem 1.25rem 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-brand .brand-crest {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
    padding: 3px;
    transition: transform 0.3s ease;
}

.sidebar-brand:hover .brand-crest {
    transform: scale(1.05);
}

.sidebar-brand .brand-crest img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.sidebar-brand .brand-title {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand .brand-subtitle {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--notary-gold-light);
    letter-spacing: 0.3px;
    margin: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0.85rem 0.65rem 2rem 0.65rem;
    margin: 0;
}

.sidebar-nav .nav-header {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.42);
    padding: 0.9rem 0.85rem 0.35rem 0.85rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.62rem 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 3px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.sidebar-nav .nav-link:hover i {
    color: var(--notary-gold-light);
    transform: scale(1.12);
}

/* Active Nav Link with Glowing Gold Pill */
.sidebar-nav .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, rgba(197, 160, 89, 0.28) 0%, rgba(197, 160, 89, 0.08) 100%) !important;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.35);
}

.sidebar-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--notary-gold-gradient);
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.8);
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    color: var(--notary-gold);
    width: 22px;
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

/* ==========================================================================
   4. TOPBAR NAVIGATION COMPONENT (FROSTED GLASS & AMBIENT BLUR)
   ========================================================================== */
.notary-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notary-topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(15, 41, 66, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 20px rgba(15, 41, 66, 0.03);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.topbar-search {
    position: relative;
    max-width: 460px;
    width: 100%;
}

.topbar-search .form-control {
    border-radius: var(--radius-pill);
    padding-left: 2.55rem;
    padding-right: 1.25rem;
    background-color: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(15, 41, 66, 0.08);
    font-size: 0.88rem;
    height: 40px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-search .form-control:focus {
    background-color: #ffffff;
    border-color: var(--notary-gold);
    box-shadow: 0 0 0 3.5px rgba(197, 160, 89, 0.22);
}

.topbar-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--notary-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

/* User Avatar Ring */
.user-avatar-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--notary-primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    border: 2px solid var(--notary-gold);
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
    transition: transform 0.2s ease;
}

.user-avatar-ring:hover {
    transform: scale(1.06);
}

/* ==========================================================================
   5. CARDS & BENTO-GRID ARCHITECTURE
   ========================================================================== */
.card {
    border: 1px solid var(--notary-card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: var(--notary-card-bg);
    margin-bottom: 1.5rem;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(15, 41, 66, 0.06);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    padding: 1.1rem 1.4rem;
}

.card-header.legal-header {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    border-left: 4px solid var(--notary-gold);
}

.card-body {
    padding: 1.4rem;
}

.card-footer {
    background-color: rgba(248, 250, 252, 0.6);
    border-top: 1px solid rgba(15, 41, 66, 0.06);
    padding: 0.9rem 1.4rem;
}

/* ==========================================================================
   6. KPI & ANALYTICS METRIC CARDS
   ========================================================================== */
.kpi-elevated-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--notary-card-border);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.4rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-elevated-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(197, 160, 89, 0.3);
}

.kpi-icon-pill {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.kpi-val, .kpi-value {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
    color: var(--notary-primary);
}

.kpi-label {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--notary-muted);
    margin: 0;
}

/* ==========================================================================
   7. BUTTONS & INTERACTIVE MICRO-INTERACTIONS
   ========================================================================== */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    padding: 0.55rem 1.15rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    font-size: 0.82rem;
    padding: 0.38rem 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-lg);
}

/* Primary Executive Button */
.btn-notary-primary, .btn-primary {
    background: var(--notary-primary-gradient) !important;
    border: 1px solid var(--notary-primary-light) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(15, 41, 66, 0.25);
}

.btn-notary-primary:hover, .btn-primary:hover {
    background: linear-gradient(135deg, #0f2942 0%, #173e66 100%) !important;
    box-shadow: 0 6px 20px rgba(15, 41, 66, 0.35);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* Regal Metallic Gold Button */
.btn-notary-gold {
    background: var(--notary-gold-gradient) !important;
    border: 1px solid var(--notary-gold-dark) !important;
    color: #0b1724 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.35);
}

.btn-notary-gold:hover {
    background: linear-gradient(135deg, #dfbe7d 0%, #c5a059 100%) !important;
    box-shadow: 0 6px 22px rgba(197, 160, 89, 0.5);
    transform: translateY(-1px);
    color: #08121d !important;
}

/* Clean Secondary & Outline Buttons */
.btn-outline-primary {
    border-color: var(--notary-primary);
    color: var(--notary-primary);
}

.btn-outline-primary:hover {
    background: var(--notary-primary-gradient);
    border-color: var(--notary-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 41, 66, 0.2);
}

.btn-outline-gold {
    border-color: var(--notary-gold);
    color: var(--notary-gold-dark);
}

.btn-outline-gold:hover {
    background: var(--notary-gold-gradient);
    border-color: var(--notary-gold-dark);
    color: #0b1724;
}

/* ==========================================================================
   8. FORM CONTROLS & MODERN INPUT FIELDS
   ========================================================================== */
.form-control, .form-select {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 41, 66, 0.15);
    padding: 0.62rem 0.95rem;
    color: var(--notary-text);
    background-color: #ffffff;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-control:focus, .form-select:focus {
    border-color: var(--notary-gold);
    box-shadow: 0 0 0 3.5px rgba(197, 160, 89, 0.22);
    background-color: #ffffff;
}

.form-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--notary-text);
    margin-bottom: 0.4rem;
}

.form-label .text-danger {
    font-size: 0.95rem;
}

.input-group-text {
    border-radius: var(--radius-md);
    background-color: #f1f5f9;
    border: 1px solid rgba(15, 41, 66, 0.15);
    color: var(--notary-muted);
}

/* ==========================================================================
   9. TABLES & DATA GRIDS
   ========================================================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--notary-text);
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--notary-muted);
    border-bottom: 1px solid rgba(15, 41, 66, 0.08);
    padding: 0.95rem 1rem;
    background-color: rgba(248, 250, 252, 0.7);
}

.table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(15, 41, 66, 0.05);
    font-size: 0.91rem;
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover td {
    background-color: rgba(197, 160, 89, 0.05);
}

/* Status Badges with Glowing Status Dots */
.badge {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.38rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
}

/* ==========================================================================
   10. BIOMETRIC SCANNER (OPTICAL PLATEN & HARDWARE BRIDGE CONSOLE)
   ========================================================================== */
.fingerprint-scanner-box {
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.fingerprint-scanner-box:hover {
    border-color: #38bdf8;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
    transform: translateY(-2px);
}

.scanner-platen-viewport {
    width: 175px;
    height: 175px;
    margin: 0 auto 1.25rem auto;
    border-radius: 50%;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border: 4px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.35), inset 0 0 25px rgba(56, 189, 248, 0.25);
    transition: all 0.3s ease;
    overflow: hidden;
}

.scanner-platen-viewport .platen-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0, transparent 14px, rgba(56, 189, 248, 0.08) 15px, rgba(56, 189, 248, 0.08) 16px);
    pointer-events: none;
}

.platen-finger-icon {
    font-size: 5.4rem;
    color: #38bdf8;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.7));
    transition: all 0.3s ease;
    z-index: 2;
}

.scanner-laser-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #22d3ee, #10b981, #22d3ee, transparent);
    box-shadow: 0 0 16px 4px rgba(34, 211, 238, 0.95);
    z-index: 3;
    top: 10%;
    opacity: 0;
    pointer-events: none;
}

.scanner-pulse-glow {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.6);
    animation: platenPulseAnim 2.2s infinite ease-in-out;
    pointer-events: none;
}

/* Scanning Active State */
.fingerprint-scanner-box.scanning {
    border-color: #10b981 !important;
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%) !important;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.25) !important;
}

.fingerprint-scanner-box.scanning .scanner-platen-viewport {
    border-color: #10b981 !important;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.75), inset 0 0 25px rgba(16, 185, 129, 0.45) !important;
}

.fingerprint-scanner-box.scanning .platen-finger-icon {
    color: #34d399 !important;
    filter: drop-shadow(0 0 16px rgba(52, 211, 153, 0.95)) !important;
}

.fingerprint-scanner-box.scanning .scanner-laser-line {
    opacity: 1 !important;
    animation: scannerLaserScan 1.1s infinite alternate ease-in-out !important;
}

.fingerprint-scanner-box.scanning .scanner-pulse-glow {
    border-color: rgba(16, 185, 129, 0.8) !important;
    animation: platenPulseAnim 1s infinite ease-in-out !important;
}

/* Verified Success State */
.fingerprint-scanner-box.success {
    border-color: #10b981 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.fingerprint-scanner-box.success .scanner-platen-viewport {
    border-color: #10b981 !important;
    background: radial-gradient(circle at center, #064e3b 0%, #022c22 100%) !important;
    box-shadow: 0 0 45px rgba(16, 185, 129, 0.85) !important;
}

.fingerprint-scanner-box.success .platen-finger-icon {
    color: #10b981 !important;
    filter: drop-shadow(0 0 22px rgba(16, 185, 129, 1)) !important;
}

@keyframes scannerLaserScan {
    0% { top: 8%; }
    100% { top: 88%; }
}

@keyframes platenPulseAnim {
    0% { transform: scale(0.98); opacity: 0.9; }
    50% { transform: scale(1.06); opacity: 0.3; }
    100% { transform: scale(0.98); opacity: 0.9; }
}

/* Signature Pad Canvas */
.signature-canvas-wrapper {
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #fafbfc;
    position: relative;
    overflow: hidden;
}

.signature-canvas {
    width: 100%;
    height: 180px;
    touch-action: none;
    cursor: crosshair;
}

/* ==========================================================================
   11. OFFICIAL CERTIFICATE & DEED STYLES (PRESTIGIOUS LEGAL FORMAT)
   ========================================================================== */
.official-certificate {
    background: #ffffff;
    border: 8px double var(--notary-gold);
    padding: 2.75rem 3rem;
    position: relative;
    max-width: 900px;
    margin: 0 auto 2.5rem auto;
    box-shadow: var(--shadow-xl);
}

.official-certificate::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid var(--notary-gold-light);
    pointer-events: none;
}

.cert-header {
    text-align: center;
    border-bottom: 2px solid var(--notary-gold);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.cert-emblem {
    width: 74px;
    height: 74px;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.15));
}

.cert-title {
    font-family: var(--font-serif) !important;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--notary-primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.cert-subtitle {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--notary-gold-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-stamp-box {
    width: 125px;
    height: 125px;
    border: 2px dashed #94a3b8;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin: 0 auto;
}

/* ==========================================================================
   12. DARK MODE (RICH OLED MIDNIGHT PALETTE)
   ========================================================================== */
[data-bs-theme="dark"] {
    --notary-bg: #070f1a;
    --notary-card-bg: #0d1b2e;
    --notary-card-border: rgba(255, 255, 255, 0.08);
    --notary-text: #e2e8f0;
    --notary-text-secondary: #94a3b8;
    --notary-muted: #8392a5;
    
    background-color: var(--notary-bg) !important;
    color: var(--notary-text) !important;
}

[data-bs-theme="dark"] body {
    background-color: var(--notary-bg) !important;
    color: var(--notary-text) !important;
}

[data-bs-theme="dark"] .notary-topbar {
    background: rgba(13, 27, 46, 0.88) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .topbar-search .form-control {
    background-color: #14243b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .topbar-search .form-control:focus {
    background-color: #172a45 !important;
    border-color: var(--notary-gold) !important;
}

[data-bs-theme="dark"] .card {
    background-color: var(--notary-card-bg) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #102138 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .card-header.legal-header {
    background: linear-gradient(90deg, #102138 0%, #0d1b2e 100%) !important;
    border-left: 4px solid var(--notary-gold);
}

[data-bs-theme="dark"] .card-footer {
    background-color: #102138 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .kpi-elevated-card {
    background: #0d1b2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .kpi-val,
[data-bs-theme="dark"] .kpi-value {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e2e8f0;
    --bs-table-hover-bg: #14243b;
    --bs-table-hover-color: #ffffff;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .table th {
    background-color: #102138 !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .table td {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #102138 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #142640 !important;
    border-color: var(--notary-gold) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #14243b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #102138 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #172a45 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #0d1b2e !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #0d1b2e !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: #102138 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #8392a5 !important;
}

[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] footer.bg-white {
    background-color: #0d1b2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #8392a5 !important;
}

/* ==========================================================================
   13. RIGHT-TO-LEFT (RTL) LOCALIZATION
   ========================================================================== */
[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] body {
    font-family: var(--font-ar), var(--font-sans);
}

[dir="rtl"] .notary-sidebar {
    left: auto !important;
    right: 0 !important;
    border-right: none !important;
    border-left: 1px solid rgba(197, 160, 89, 0.18) !important;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25) !important;
}

[dir="rtl"] .notary-main {
    margin-left: 0 !important;
    margin-right: var(--sidebar-width) !important;
}

[dir="rtl"] .sidebar-nav .nav-link:hover {
    transform: translateX(-4px) !important;
}

[dir="rtl"] .sidebar-nav .nav-link.active::before {
    left: auto !important;
    right: 0 !important;
    border-radius: 4px 0 0 4px !important;
}

[dir="rtl"] .topbar-search .search-icon {
    left: auto !important;
    right: 1rem !important;
}

[dir="rtl"] .topbar-search .form-control {
    padding-left: 1rem !important;
    padding-right: 2.55rem !important;
}

[dir="rtl"] .card-header.legal-header {
    border-left: none !important;
    border-right: 4px solid var(--notary-gold) !important;
    background: linear-gradient(270deg, #f8fafc 0%, #ffffff 100%) !important;
}

[dir="rtl"][data-bs-theme="dark"] .card-header.legal-header {
    background: linear-gradient(270deg, #102138 0%, #0d1b2e 100%) !important;
}

[dir="rtl"] .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

/* ==========================================================================
   14. MOBILE & TABLET RESPONSIVENESS OVERRIDES
   ========================================================================== */
@media (max-width: 991.98px) {
    .notary-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .notary-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1060;
    }

    [dir="rtl"] .notary-sidebar {
        transform: translateX(100%);
    }

    body.sidebar-open .notary-sidebar {
        transform: translateX(0) !important;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.7) !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1055;
        transition: opacity 0.3s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block !important;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .notary-topbar {
        padding: 0 1rem;
    }

    .topbar-search {
        max-width: 250px;
    }
}

@media (max-width: 575.98px) {
    .notary-topbar {
        height: auto;
        padding: 0.75rem 0.85rem;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .topbar-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 0.25rem;
    }

    .topbar-search .form-control {
        font-size: 0.84rem;
        height: 38px;
    }
}

/* ==========================================================================
   15. PRINT SPECIFICATION
   ========================================================================== */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .notary-sidebar, .notary-topbar, .btn-print, .no-print, .modal, .toast {
        display: none !important;
    }
    .notary-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .official-certificate {
        box-shadow: none !important;
        border: 2px solid #000000 !important;
        padding: 1.5rem !important;
        margin: 0 !important;
        max-width: 100% !important;
        page-break-after: always;
    }
}
