/* ==========================================================================
   YapıGen Design System & Multi-Platform Theme Engine (StitchMCP Integrated)
   1. Platform Themes:
      - Web & Windows App (MDKM-OS v4.2 Pro Institutional Engineering Command)
      - Mobile iOS & Android (YapıGen Saha Industrial High-Contrast Field Ops)
   2. Color Modes: Dark (Gece) vs. Light (Gündüz)
   ========================================================================== */

/* 1. DEFAULT & FALLBACK DARK (GECE - DERİN ANTRASİT & GECE MAVİSİ) */
:root,
body.theme-mode-dark {
    --bg-primary: #060a13;
    --bg-secondary: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.92);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --bg-input: #090e1a;
    --border-color: rgba(59, 130, 246, 0.2);
    --border-color-active: #3b82f6;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-orange: #f59e0b;
    --accent-rose: #f43f5e;

    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(11, 17, 32, 0.94);
    --sidebar-bg: #060a13;
    --nav-active-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.15));

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    --glass-blur: blur(16px);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

/* 2. DEFAULT & FALLBACK LIGHT (GÜNDÜZ - AYDINLIK, KESKİN, GÜNEŞ IŞIĞI UYUMLU) */
body.theme-mode-light {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #cbd5e1;
    --border-color-active: #1d4ed8;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;

    --accent-blue: #1d4ed8;
    --accent-blue-hover: #1e40af;
    --accent-purple: #6d28d9;
    --accent-emerald: #059669;
    --accent-orange: #d97706;
    --accent-rose: #dc2626;

    --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --header-bg: rgba(255, 255, 255, 0.96);
    --sidebar-bg: #ffffff;
    --nav-active-bg: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(37, 99, 235, 0.08));
}

/* 3. PLATFORM SPECIFIC: DESKTOP & WINDOWS APP (MDKM-OS v4.2 Pro - Institutional Midnight Navy) */
body.theme-platform-desktop {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body.theme-platform-desktop.theme-mode-dark {
    --bg-primary: #060a13;
    --bg-secondary: #0b1120;
    --bg-card: #0f172a;
    --bg-card-hover: #1e293b;
    --bg-input: #060a13;
    --border-color: rgba(59, 130, 246, 0.22);
    --border-color-active: #38bdf8;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --header-bg: rgba(11, 17, 32, 0.96);
    --sidebar-bg: #060a13;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
}

body.theme-platform-desktop.theme-mode-light {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #cbd5e1;
    --border-color-active: #1e40af;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent-blue: #1e40af;
    --accent-blue-hover: #1e3a8a;
    --header-bg: rgba(255, 255, 255, 0.98);
    --sidebar-bg: #ffffff;
    --card-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

/* 4. PLATFORM SPECIFIC: MOBILE SAHA (iOS & ANDROID INDUSTRIAL FIELD OPS - High Visibility Safety Orange) */
body.theme-platform-mobile {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Public Sans', 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

body.theme-platform-mobile.theme-mode-dark {
    --bg-primary: #090d16;
    --bg-secondary: #111827;
    --bg-card: #162032;
    --bg-card-hover: #1f2d45;
    --bg-input: #0c1422;
    --border-color: rgba(234, 88, 12, 0.28);
    --border-color-active: #ea580c;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #ea580c;
    --accent-blue-hover: #c2410c;
    --header-bg: rgba(15, 23, 42, 0.96);
    --sidebar-bg: #0f172a;
    --card-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

body.theme-platform-mobile.theme-mode-light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-color-active: #ea580c;
    --text-main: #0f172a;
    --text-muted: #334155;
    --accent-blue: #ea580c;
    --accent-blue-hover: #c2410c;
    --header-bg: rgba(255, 255, 255, 0.98);
    --sidebar-bg: #ffffff;
    --card-shadow: 0 4px 18px rgba(15, 23, 42, 0.09);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* App Layout Grid */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Role Selector Card */
.role-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.role-select {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.role-select:focus {
    border-color: var(--accent-blue);
}

.scope-indicator {
    font-size: 0.75rem;
    color: var(--accent-emerald);
    font-weight: 500;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    border: 1px solid var(--border-color-active);
    color: #ffffff;
}

.nav-item.active svg {
    color: var(--accent-blue);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content Styling */
.main-content {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Header Bar */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.search-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    flex: 1;
    max-width: 650px;
    backdrop-filter: var(--glass-blur);
}

.search-bar-container svg {
    color: var(--text-muted);
}

.search-bar-container input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    width: 100%;
}

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

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-hover));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* Server Status Visual Pulse Animations */
.status-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.server-status-pulse-ring {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 16px var(--accent-emerald);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

/* Modal Overlay for Server Status Visual Extension */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.88);
    backdrop-filter: blur(14px);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.server-status-card-modal {
    width: 100%;
    max-width: 820px;
    border: 1px solid var(--accent-emerald);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Metric Boxes */
.grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.gap-16 { gap: 16px; }

.server-metric-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-box-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-box-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.metric-box-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-blue { color: var(--accent-blue) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-orange { color: var(--accent-orange) !important; }
.flex-center { display: flex; align-items: center; }

/* Tab Pages */
.tab-page {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.tab-page.active {
    display: flex;
}

.page-title-row h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-fast);
}

.metric-card:hover {
    border-color: var(--border-color-active);
    transform: translateY(-2px);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-icon.blue { background: rgba(59, 130, 246, 0.15); }
.metric-icon.purple { background: rgba(139, 92, 246, 0.15); }
.metric-icon.green { background: rgba(16, 185, 129, 0.15); }
.metric-icon.orange { background: rgba(245, 158, 11, 0.15); }

.metric-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Content Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.p-0 { padding: 0 !important; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.text-xs { font-size: 0.75rem; }
.w-full { width: 100%; }

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fde047; }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 18px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Element Explorer Layout */
.element-explorer-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.element-list {
    display: flex;
    flex-direction: column;
    max-height: 520px;
    overflow-y: auto;
}

.element-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.element-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.element-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-left: 4px solid var(--accent-blue);
}

.element-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.element-item-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Timeline Audit Trail */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 1;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.timeline-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.photo-preview-box {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-emerald);
}

/* Forms & Terminal */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    outline: none;
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent-blue);
}

.readonly-field {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: var(--accent-emerald) !important;
    cursor: not-allowed;
}

.font-mono { font-family: var(--font-mono) !important; }
.text-emerald { color: var(--accent-emerald) !important; }

/* Photo Upload Box */
.photo-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.02);
}

.photo-upload-box:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

/* Dynamic Rows */
.dynamic-rows-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nfc-chip-breakdown {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
}

.nfc-chip-breakdown h4 {
    font-size: 0.9rem;
    color: var(--accent-emerald);
    margin-bottom: 8px;
}

.nfc-chip-breakdown ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.console-box {
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #38bdf8;
    height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-status-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.terminal-device-icon {
    font-size: 2.2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* FULL-SCREEN LOGIN GATE SCREEN OVERLAY STYLES */
.login-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 30%, #0f172a 0%, #030712 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(16px);
    overflow-y: auto;
    padding: 20px;
}

.login-card-container {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 32px 28px;
    backdrop-filter: blur(20px);
    animation: loginFadeIn 0.4s ease-out;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo-large {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-emerald));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    margin-bottom: 12px;
}

.login-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-badge-pill {
    display: inline-block;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 10px;
}

/* ==========================================================================
   MOBILE RESPONSIVE DESIGN SYSTEM (TÜM MOBİL DİKEY/YATAY EKRAN UYUMLULUĞU)
   ========================================================================== */

/* Default Desktop State for Mobile Menu Toggle */
.mobile-menu-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mobile-menu-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.25);
}

.mobile-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Tablet & Mobile Layout Adjustments (<= 992px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr !important;
    }

    .mobile-menu-toggle-btn {
        display: inline-flex;
    }

    /* Off-Canvas Drawer Navigation Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 290px;
        max-width: 85vw;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        background: rgba(11, 19, 36, 0.96);
        backdrop-filter: blur(20px);
        box-shadow: 12px 0 35px rgba(0, 0, 0, 0.7);
        border-right: 1px solid var(--border-color);
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        padding: 16px 12px;
        width: 100%;
        overflow-x: hidden;
    }

    .element-explorer-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .element-explorer-sidebar {
        max-height: 320px;
        overflow-y: auto;
    }
}

/* --------------------------------------------------------------------------
   Mobile Phone Screen Optimizations (<= 768px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* Responsive Form & Component Grids */
    .grid-2col, 
    .grid-3col, 
    .grid-4col {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    /* Top Header Bar Mobile Layout */
    .top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .search-bar-container {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-bar-container input {
        width: 100%;
        flex: 1 1 100%;
    }

    .search-bar-container button {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .header-actions button {
        width: 100%;
        padding: 8px 6px;
        font-size: 0.75rem;
        justify-content: center;
    }

    .page-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-title-row button {
        width: 100%;
    }

    /* Mobile Friendly Modals */
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .card.register-user-modal, 
    .card.ministry-approvals-modal, 
    .card.structure-revisions-modal, 
    .card.edit-structure-modal,
    .server-status-card-modal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        max-height: 92vh !important;
        border-radius: 16px 16px 0 0;
        animation: modalMobileSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalMobileSlideUp {
        from { transform: translateY(100%); opacity: 0.5; }
        to { transform: translateY(0); opacity: 1; }
    }

    .card-header {
        padding: 14px 16px;
    }

    .card-body {
        padding: 14px;
    }

    /* Mobile Responsive Tables */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
    }

    .data-table th, 
    .data-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Login Screen Mobile Adjustments */
    .login-gate-overlay {
        padding: 12px;
    }

    .login-card-container {
        padding: 24px 18px;
        max-width: 100%;
    }

    .login-title {
        font-size: 1.8rem;
    }

    .demo-accounts-box .grid-2col {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    /* Touch Friendly Controls */
    .btn, 
    .form-control, 
    .role-select {
        min-height: 42px;
        touch-action: manipulation;
    }
}

/* --------------------------------------------------------------------------
   Extra Small Mobile Devices (<= 480px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .header-actions {
        grid-template-columns: 1fr !important;
    }

    .demo-accounts-box .grid-2col {
        grid-template-columns: 1fr !important;
    }

    .login-title {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   OFFICIAL LIGHT MODE COMPONENT OVERRIDES (GÜNDÜZ AYDINLIK MODU)
   Güneş ışığında yüksek okunabilirlik & T.C. Standartlarında Kurumsal Ciddiyet
   ========================================================================== */
body.theme-mode-light {
    background-color: var(--bg-primary);
    color: var(--text-main);
}

body.theme-mode-light .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}

body.theme-mode-light .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

body.theme-mode-light .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

body.theme-mode-light .brand-text h1 {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-mode-light .nav-item {
    color: #475569;
}

body.theme-mode-light .nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.theme-mode-light .nav-item.active {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(109, 40, 217, 0.08));
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    font-weight: 700;
}

body.theme-mode-light .nav-item.active svg {
    color: #1d4ed8;
}

body.theme-mode-light .top-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

body.theme-mode-light .search-bar-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.theme-mode-light .search-bar-container input {
    color: #0f172a;
}

body.theme-mode-light .search-bar-container input::placeholder {
    color: #94a3b8;
}

body.theme-mode-light .form-control {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

body.theme-mode-light .form-control:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

body.theme-mode-light .data-table th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

body.theme-mode-light .data-table td {
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

body.theme-mode-light .data-table tr:hover {
    background: #f8fafc;
}

body.theme-mode-light .btn-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.theme-mode-light .btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

body.theme-mode-light .metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

body.theme-mode-light .element-item {
    border-bottom: 1px solid #e2e8f0;
}

body.theme-mode-light .element-item:hover {
    background: #f8fafc;
}

body.theme-mode-light .element-item.active {
    background: rgba(29, 78, 216, 0.08);
    border-left: 4px solid #1d4ed8;
}

body.theme-mode-light .terminal-status-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

body.theme-mode-light .login-gate-overlay {
    background: radial-gradient(circle at top, #e2e8f0 0%, #cbd5e1 100%);
}

body.theme-mode-light .login-card-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body.theme-mode-light .login-title {
    color: #0f172a;
}

body.theme-mode-light .role-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.theme-mode-light .demo-account-chip {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.theme-mode-light .demo-account-chip:hover {
    background: #e2e8f0;
    border-color: #1d4ed8;
}

body.theme-mode-light .preset-automation-banner {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(5, 150, 105, 0.06)) !important;
    border-color: #93c5fd !important;
}

body.theme-mode-light .modal-overlay {
    background: rgba(15, 23, 42, 0.65);
}

body.theme-mode-light .server-status-card-modal {
    background: #ffffff;
    border: 1px solid #059669;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}

body.theme-mode-light .server-metric-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.theme-mode-light .text-muted {
    color: #64748b !important;
}

/* ==========================================================================
   THEME SWITCHER CONTROLS (HEADER WIDGET)
   ========================================================================== */
.theme-control-group {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3px;
    gap: 4px;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-control-group .btn {
    padding: 5px 11px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.theme-control-group .btn:hover {
    transform: none;
}

/* ==========================================================================
   PLATFORM THEME 1: WEB & WINDOWS APP (DESKTOP THEME)
   MDKM-OS v4.2 Pro Institutional Ministry & Engineering Command Dashboard
   ========================================================================== */
body.theme-platform-desktop .app-layout {
    grid-template-columns: 280px 1fr;
}

body.theme-platform-desktop .sidebar {
    display: flex !important;
    position: sticky;
    top: 0;
    height: 100vh;
    left: 0;
}

body.theme-platform-desktop .desktop-ministry-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
}

body.theme-platform-desktop .ministry-flag-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.theme-platform-desktop .ministry-dept-text {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--accent-blue);
    line-height: 1.2;
}

body.theme-platform-desktop .ministry-sub-text {
    font-size: 0.68rem;
    color: var(--text-muted);
}

body.theme-platform-desktop .sidebar-site-zone {
    display: block;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

body.theme-platform-desktop .site-zone-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

body.theme-platform-desktop .site-zone-tag {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

body.theme-platform-desktop .live-dot-pulse {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent-emerald);
    font-family: var(--font-mono);
}

body.theme-platform-desktop .site-zone-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.theme-platform-desktop .site-zone-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

body.theme-platform-desktop .sidebar-hsm-box {
    display: block;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 8px 10px;
}

body.theme-platform-desktop .hsm-row-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.theme-platform-desktop .hsm-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

body.theme-platform-desktop .hsm-chip {
    font-size: 0.6rem;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

body.theme-platform-desktop .hsm-subtext {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

body.theme-platform-desktop .desktop-telemetry-strip {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

body.theme-platform-desktop .telemetry-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

body.theme-platform-desktop .telemetry-pill strong {
    color: var(--text-main);
    font-family: var(--font-mono);
}

body.theme-platform-desktop .mobile-top-appbar,
body.theme-platform-desktop .mobile-site-ribbon,
body.theme-platform-desktop .mobile-nfc-scanner-hero,
body.theme-platform-desktop .mobile-bottom-nav,
body.theme-platform-desktop .mobile-menu-toggle-btn {
    display: none !important;
}

body.theme-platform-desktop .main-content {
    padding: 24px 32px;
}

/* ==========================================================================
   PLATFORM THEME 2: MOBILE (iOS & ANDROID INDUSTRIAL FIELD OPS THEME)
   High-Contrast Sunlight-Friendly Touch UI, Radar Pulse Target, Bottom Nav
   ========================================================================== */
body.theme-platform-mobile .app-layout {
    grid-template-columns: 1fr !important;
}

body.theme-platform-mobile .desktop-ministry-badge,
body.theme-platform-mobile .sidebar-site-zone,
body.theme-platform-mobile .sidebar-hsm-box,
body.theme-platform-mobile .desktop-telemetry-strip {
    display: none !important;
}

body.theme-platform-mobile .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

body.theme-platform-mobile .sidebar.mobile-open {
    transform: translateX(0);
}

body.theme-platform-mobile .mobile-menu-toggle-btn {
    display: inline-flex !important;
}

body.theme-platform-mobile .main-content {
    padding: 0 14px calc(80px + env(safe-area-inset-bottom, 16px)) 14px !important;
    gap: 16px;
}

/* Mobile Top App Bar */
.mobile-top-appbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
}

body.theme-platform-mobile .mobile-top-appbar {
    display: flex !important;
}

.mobile-top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ea580c;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(234, 88, 12, 0.4);
}

.mobile-brand-title strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    display: block;
    line-height: 1.1;
}

.mobile-brand-ver {
    font-size: 0.65rem;
    font-weight: 700;
    color: #ea580c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-top-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-chip-sync {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    font-family: var(--font-mono);
}

.mobile-chip-gps {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

/* Mobile Active Site Ribbon */
.mobile-site-ribbon {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.theme-platform-mobile .mobile-site-ribbon {
    display: flex !important;
}

.mobile-site-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mobile-site-pin {
    font-size: 1.2rem;
    color: #f97316;
}

.mobile-site-headline {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-site-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    font-family: var(--font-mono);
}

.mobile-gps-verified-badge {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mobile NFC Scanner Hero Card (From Stitch Design) */
.mobile-nfc-scanner-hero {
    display: none;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid rgba(234, 88, 12, 0.45);
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 18px;
    box-shadow: 0 0 35px -8px rgba(234, 88, 12, 0.4);
    position: relative;
    overflow: hidden;
}

body.theme-platform-mobile .mobile-nfc-scanner-hero {
    display: block !important;
}

.scanner-hero-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.scanner-hero-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 88, 12, 0.2);
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.4);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scanner-hero-freq {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Radar Pulse Animations */
@keyframes pulse-ring {
    0% { transform: scale(0.92); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.25; }
    100% { transform: scale(0.92); opacity: 0.8; }
}

.scanner-tactile-target {
    min-height: 180px;
    background: rgba(6, 10, 19, 0.6);
    border: 2px dashed rgba(234, 88, 12, 0.55);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 16px;
    cursor: pointer;
    touch-action: manipulation;
    transition: var(--transition-fast);
}

.scanner-tactile-target:active {
    transform: scale(0.98);
}

.radar-pulse-ring-outer {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 9999px;
    border: 2px solid rgba(234, 88, 12, 0.35);
    animation: pulse-ring 2.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

.radar-pulse-ring-inner {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 9999px;
    border: 1px solid rgba(234, 88, 12, 0.5);
    pointer-events: none;
}

.scanner-center-circle {
    width: 76px;
    height: 76px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(234, 88, 12, 0.6);
    z-index: 2;
    transition: transform 0.2s ease;
}

.scanner-tactile-target:active .scanner-center-circle {
    transform: scale(0.92);
}

.scanner-target-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 14px;
    text-align: center;
}

.scanner-target-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 2px;
}

.scanner-live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #34d399;
    font-weight: 700;
    margin-top: 8px;
}

.live-dot-ping {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #10b981;
    animation: pulse-ring 1.5s infinite;
}

.scanner-big-cta-btn {
    width: 100%;
    min-height: 52px;
    background: #ea580c;
    color: #ffffff;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
    touch-action: manipulation;
    transition: var(--transition-fast);
}

.scanner-big-cta-btn:active {
    transform: scale(0.97);
    background: #c2410c;
}

/* Verified Chip Telemetry Card */
.scanner-verified-ribbon {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 12px;
    margin-top: 14px;
}

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

.verified-seal-icon {
    font-size: 1.4rem;
}

.verified-seal-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent-emerald);
}

.verified-seal-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.scanner-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
}

.sc-tel-item {
    display: flex;
    flex-direction: column;
}

.sc-tel-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.sc-tel-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Mobile Layout Grids & Cards */
body.theme-platform-mobile .grid-2col,
body.theme-platform-mobile .grid-3col,
body.theme-platform-mobile .grid-4col,
body.theme-platform-mobile .element-explorer-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
}

body.theme-platform-mobile .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

body.theme-platform-mobile .card {
    border-radius: var(--radius-lg);
}

body.theme-platform-mobile .btn,
body.theme-platform-mobile .form-control {
    min-height: 48px;
    touch-action: manipulation;
}

/* iOS & Android Bottom Navigation Bar (Frosted Glass Tab Bar) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 12px));
    padding-bottom: env(safe-area-inset-bottom, 12px);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 9990;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

body.theme-platform-mobile .mobile-bottom-nav {
    display: flex !important;
}

.mobile-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    flex: 1;
    transition: var(--transition-fast);
    touch-action: manipulation;
}

.mobile-nav-tab .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-nav-tab.active {
    color: var(--accent-blue);
    font-weight: 700;
}

.mobile-nav-tab.active .mobile-nav-icon {
    transform: scale(1.15);
}

.mobile-nav-tab.highlight {
    color: var(--accent-emerald);
}

.mobile-nav-tab.highlight.active {
    color: var(--accent-emerald);
}

.mobile-nav-tab:active {
    transform: scale(0.92);
}

/* ==========================================================================
   STRICT LIGHT MODE OVERRIDES FOR PURE VISUAL CONTRAST & SUNLIGHT CLARITY
   No lingering dark boxes on light mode!
   ========================================================================== */
body.theme-mode-light .sidebar {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.theme-mode-light .sidebar-site-zone,
body.theme-mode-light .role-card,
body.theme-mode-light .desktop-ministry-badge,
body.theme-mode-light .sidebar-hsm-box {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.theme-mode-light .sidebar-site-zone .site-zone-title,
body.theme-mode-light .sidebar-hsm-box .hsm-title,
body.theme-mode-light .role-label,
body.theme-mode-light .brand-text h1 {
    color: #0f172a !important;
    background: none !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.theme-mode-light .nav-item {
    color: #475569 !important;
}

body.theme-mode-light .nav-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.theme-mode-light .nav-item.active {
    background: rgba(30, 64, 175, 0.1) !important;
    border-color: #1e40af !important;
    color: #1e40af !important;
}

body.theme-mode-light .card,
body.theme-mode-light .modal-overlay .card,
body.theme-mode-light .login-card-container {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

body.theme-mode-light .card-header {
    border-bottom-color: #e2e8f0 !important;
}

body.theme-mode-light .data-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #cbd5e1 !important;
}

body.theme-mode-light .data-table td {
    border-bottom-color: #f1f5f9 !important;
    color: #1e293b !important;
}

body.theme-mode-light .data-table tr:hover {
    background: #f8fafc !important;
}

body.theme-mode-light .form-control,
body.theme-mode-light .role-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.theme-mode-light [style*="background:rgba(0,0,0"],
body.theme-mode-light [style*="background: rgba(0,0,0"],
body.theme-mode-light [style*="background:rgba(15,23,42"],
body.theme-mode-light [style*="background: rgba(15,23,42"],
body.theme-mode-light [style*="background:rgba(11,19,36"],
body.theme-mode-light [style*="background: rgba(11,19,36"] {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

body.theme-mode-light .mobile-nfc-scanner-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-color: rgba(234, 88, 12, 0.4) !important;
    color: #0f172a !important;
}

body.theme-mode-light .mobile-nfc-scanner-hero .scanner-target-title {
    color: #0f172a !important;
}

body.theme-mode-light .scanner-tactile-target {
    background: #f1f5f9 !important;
    border: 2px dashed rgba(234, 88, 12, 0.5) !important;
}

body.theme-mode-light .mobile-top-appbar {
    background: #ffffff !important;
    border-bottom-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.theme-mode-light .mobile-site-ribbon {
    background: #0f172a !important;
    color: #ffffff !important;
}

