/* ============================================================================
   DIGITALIMZA.COM - MODERN GLASSMORPHISM DESIGN SYSTEM
   ============================================================================ */

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(22, 28, 45, 0.7);
    --bg-card-hover: rgba(30, 39, 62, 0.85);
    --bg-sidebar: rgba(15, 20, 34, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(99, 102, 241, 0.3);

    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --secondary-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(16px);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glow Orbs background */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1 0%, #8b5cf6 100%);
}

.orb-2 {
    bottom: -15%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #06b6d4 0%, #3b82f6 100%);
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    backdrop-filter: var(--backdrop-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;

    span {
        background: var(--primary-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

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

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

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    border-color: var(--border-color-glow);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--secondary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.topbar-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.topbar-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(10, 185, 129, 0.2);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--accent-emerald);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(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); }
}

/* Glass Card Component */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

/* Tabs Toggle */
.tab-page {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.icon-purple { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.icon-cyan { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.icon-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

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

.stat-data h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.positive { color: var(--accent-emerald); }
.stat-trend.warning { color: var(--accent-amber); }
.stat-trend.negative { color: var(--accent-rose); }
.stat-trend.neutral { color: var(--text-muted); }

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

.btn-gradient {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-gradient:hover {
    opacity: 0.92;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.col-span-2 { grid-column: span 2; }

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

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

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="datetime-local"], 
select, 
textarea {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #ffffff !important;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    transition: background-color 5000s ease-in-out 0s;
}

input::placeholder, 
select::placeholder, 
textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 0.85;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
}

/* Helper Utilities */
.border-bottom { border-bottom: 1px solid var(--border-color); }
.pad-bottom-1 { padding-bottom: 0.75rem; }
.margin-bottom-1 { margin-bottom: 1rem; }
.text-sm { font-size: 0.85rem; }

/* 2-Column Grid Layout */
.manual-checkin-grid, .two-col-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 992px) {
    .manual-checkin-grid, .two-col-grid {
        grid-template-columns: 1fr;
    }
}

/* QR Mode Selector Options */
.qr-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.qr-option-card {
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.qr-option-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.qr-option-card.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.qr-option-card .option-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.qr-option-card .option-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.qr-option-card .option-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.qr-option-card .badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Map Picker & Controls */
.map-picker-container {
    height: 320px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    z-index: 1;
}

.radius-control {
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radius-control input[type="range"] {
    accent-color: var(--primary);
    width: 100%;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

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

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

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}

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

/* Modal Windows */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-close-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Fullscreen Projection Modal */
.modal-projection-content {
    width: 95vw;
    height: 92vh;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color-glow);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    box-shadow: 0 0 100px rgba(99, 102, 241, 0.2);
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
}

.projection-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
}

.proj-badge-row {
    display: flex;
    gap: 1rem;
    margin-top: 8px;
}

.projection-body {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    flex: 1;
}

.qr-canvas-wrapper {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#projection-qrcode-container img, #projection-qrcode-container canvas {
    width: 280px !important;
    height: 280px !important;
}

.qr-scan-instruction {
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.projection-realtime-feed {
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.live-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 55vh;
}

.feed-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
}

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

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.margin-auto { margin: 0 auto; }
.margin-top-1 { margin-top: 1rem; }
.margin-top-2 { margin-top: 2rem; }

/* Map Location Search Wrapper */
.map-search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.map-search-wrapper input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color-glow);
}

.search-status-text {
    font-size: 0.85rem;
    margin-bottom: 8px;
    min-height: 18px;
}

/* Auth Modal Styles */
.auth-modal-card {
    max-width: 440px;
}

.auth-brand-logo {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    box-shadow: var(--shadow-glow);
    margin-bottom: 1rem;
}

input[type="password"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

/* Sidebar Role Switcher Select */
.role-switcher-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color-glow);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 3px 6px;
    margin-top: 4px;
    cursor: pointer;
    outline: none;
    max-width: 170px;
}

.role-switcher-select:focus {
    border-color: var(--primary);
    color: var(--text-main);
}

/* Modern Glassmorphism Toast Notification System */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 90%;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.toast.toast-exit {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-main);
}

/* Toast Themes */
.toast-success {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}
.toast-success .toast-icon { color: var(--accent-emerald); }
.toast-success .toast-title { color: #6ee7b7; }

.toast-error {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.2);
}
.toast-error .toast-icon { color: var(--accent-rose); }
.toast-error .toast-title { color: #fda4af; }

.toast-info {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}
.toast-info .toast-icon { color: var(--primary); }
.toast-info .toast-title { color: #a5b4fc; }

.toast-warning {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2);
}
.toast-warning .toast-icon { color: var(--accent-amber); }
.toast-warning .toast-title { color: #fde047; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}


