/* ==========================================================================
   Smart Door Access Control Dashboard - Style System
   Design: Modern Cyber Glassmorphism & Security Theme
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #090d16;
    --bg-card: rgba(18, 25, 38, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(26, 36, 54, 0.9);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    /* Accent & Status Colors */
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.15);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.15);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.15);

    /* Fonts & Radii */
    --font-head: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.04) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px 32px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.brand-info h1 {
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.sub-brand {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.sub-brand strong {
    color: var(--accent-cyan);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-pill.online {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.live-clock {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Button Component */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Cards Layout */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
}

.top-summary-grid {
    display: block;
    width: 100%;
    margin-bottom: 24px;
}

/* Door Status Card */
.door-status-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-label {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.badge-mode {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-full);
}

.door-visual-container {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.door-graphic {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    transition: var(--transition);
}

.door-graphic.locked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-danger);
    border: 2px solid var(--status-danger);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.door-graphic.unlocked {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-success);
    border: 2px solid var(--status-success);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    animation: glowSuccess 1.5s infinite alternate;
}

@keyframes glowSuccess {
    from { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    to { box-shadow: 0 0 35px rgba(16, 185, 129, 0.8); }
}

.door-state-details {
    flex: 1;
}

.door-state-details h2 {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.state-locked { color: var(--status-danger); }
.state-unlocked { color: var(--status-success); }

.door-state-details p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.unlock-countdown {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--status-success));
    transition: width 1s linear;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-card-action {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-card-action.success {
    background: var(--status-success-bg);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-card-action.success:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-card-action.warning {
    background: var(--status-warning-bg);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-card-action.warning:hover {
    background: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Metrics Column */
.metrics-column {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 1200px) {
    .metrics-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .metrics-column {
        grid-template-columns: 1fr;
    }
}

/* Premium Responsive Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    width: 100%;
}

.metric-card {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: var(--transition);
}

.metric-card-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.metric-card-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.metric-card-cyan::before { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.metric-card-purple::before { background: linear-gradient(90deg, #a855f7, #c084fc); }

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.metric-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.metric-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.metric-card:hover .metric-icon-wrap {
    transform: scale(1.08);
}

.metric-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.metric-icon-wrap.red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.metric-icon-wrap.cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.metric-icon-wrap.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.metric-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.metric-badge.green { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.metric-badge.green-ok { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.metric-badge.red-alert { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.metric-badge.cyan { background: rgba(6, 182, 212, 0.12); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.25); }
.metric-badge.purple { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: block;
    margin-bottom: 6px;
}

.metric-value {
    font-family: var(--font-head);
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0 10px 0;
    letter-spacing: -0.5px;
}

.metric-value small {
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0.8;
    margin-left: 4px;
}

.metric-value.green { color: #34d399; text-shadow: 0 0 20px rgba(52, 211, 153, 0.25); }
.metric-value.red { color: #f87171; text-shadow: 0 0 20px rgba(248, 113, 113, 0.25); }
.metric-value.cyan { color: #38bdf8; text-shadow: 0 0 20px rgba(56, 189, 248, 0.25); }
.metric-value.purple { color: #c084fc; text-shadow: 0 0 20px rgba(192, 132, 252, 0.25); }

.metric-footer {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-top: 6px;
}

/* Simulation Panel */
.simulation-panel {
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title h3 {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
}

.tag-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.simulation-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.btn-sim {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    text-align: left;
}

.btn-sim.success {
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
}
.btn-sim.success:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-sim.danger {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
}
.btn-sim.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-sim.warning {
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
}
.btn-sim.warning:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

/* Logs Table Section */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.logs-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logs-icon {
    font-size: 1.6rem;
    color: var(--accent-cyan);
}

.logs-title-group h2 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
}

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

.badge-count {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-dim);
}

.search-input-wrapper input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 12px 8px 36px;
    color: #fff;
    font-size: 0.84rem;
    outline: none;
    width: 240px;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.filter-btn-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-filter {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-filter.active {
    background: var(--accent-cyan);
    color: #000;
    font-weight: 700;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

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

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

/* Table Styling */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.logs-table th {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    font-family: var(--font-head);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logs-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
    transition: var(--transition);
}

.logs-table tbody tr {
    transition: var(--transition);
}

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

.user-id-badge {
    font-family: var(--font-head);
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: #38bdf8;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
}

.status-tag.granted {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-tag.denied {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-tag.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Pagination & Date Filter Styles */
button:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px 0 10px 0;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: auto;
}

.app-footer code {
    color: var(--accent-cyan);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Toast Notification Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success { border-left: 4px solid var(--status-success); }
.toast.error { border-left: 4px solid var(--status-danger); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Modal Component Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScale {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-family: var(--font-head);
    font-size: 1.15rem;
    color: #fff;
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

@media (max-width: 580px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group input, .form-group select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.door-checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 6px;
}

@media (max-width: 580px) {
    .door-checkbox-group {
        grid-template-columns: 1fr;
    }
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

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

.checkbox-card input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-info {
    display: flex;
    flex-direction: column;
}

.checkbox-info strong {
    font-size: 0.8rem;
    color: #fff;
}

.checkbox-info small {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.btn-action-sm {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-action-sm.edit {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.3);
}

.btn-action-sm.edit:hover {
    background: rgba(6, 182, 212, 0.3);
}

.btn-action-sm.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-sm.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   Login Screen & Live Audit Activity Styles
   ========================================================================== */
.hidden {
    display: none !important;
}

.login-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    background: #070a12;
}

.login-backdrop-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    opacity: 0.25;
}

.login-backdrop-glow.cyan {
    top: -100px;
    left: -100px;
    background: #06b6d4;
}

.login-backdrop-glow.purple {
    bottom: -100px;
    right: -100px;
    background: #8b5cf6;
}

.login-container {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 32px;
    max-width: 1240px;
    width: 100%;
    z-index: 2;
    align-items: stretch;
}

@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
    }
}

/* Left Section: Live Activity Widget */
.login-live-section {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    height: 100%;
}

.live-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-title .live-icon {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 12px rgba(6, 182, 212, 0.8); }
}

.widget-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

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

.live-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: blinkDot 1.2s infinite;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Hero Log Card (1 Latest Log - Large View) */
.hero-log-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.1);
    position: relative;
    transition: var(--transition);
}

.hero-log-card:hover {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 12px 36px rgba(6, 182, 212, 0.2);
}

.hero-log-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hero-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.hero-door-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
}

.hero-log-body {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.hero-user-avatar {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.3);
    flex-shrink: 0;
}

.hero-user-details {
    flex: 1;
}

.hero-user-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 6px;
}

.hero-meta-grid {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hero-log-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-timestamps {
    display: flex;
    gap: 12px;
}

.ts-box {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}

.ts-box.cyan {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.ts-box.purple {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.ts-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ts-box.cyan strong { color: var(--accent-cyan); font-size: 0.82rem; }
.ts-box.purple strong { color: #a855f7; font-size: 0.82rem; }

.hero-status-pill {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-status-pill.granted {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hero-status-pill.denied {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 5 Recent Logs List */
.recent-logs-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.recent-logs-header h4 {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-around;
}

.recent-log-row {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1.2fr auto;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.recent-log-row:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
}

.recent-log-door {
    font-weight: 600;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-log-user {
    color: #fff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-log-time {
    color: var(--text-muted);
    font-size: 0.76rem;
    display: flex;
    flex-direction: column;
}

.recent-log-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Right Section: Login Card */
.login-form-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.login-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    position: relative;
}

.login-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.35);
}

.login-card-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.login-card-header p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.form-group-custom {
    margin-bottom: 20px;
}

.form-group-custom label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-with-icon input {
    width: 100%;
    background: rgba(9, 13, 22, 0.8);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 42px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.input-with-icon input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.btn-toggle-pwd {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
}

.btn-toggle-pwd:hover {
    color: var(--accent-cyan);
}

.login-options {
    margin-bottom: 24px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-login-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.35);
    transition: var(--transition);
}

.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(6, 182, 212, 0.5);
    background: linear-gradient(135deg, #0891b2, #2563eb);
}

.btn-login-submit:active {
    transform: translateY(0);
}

.login-alert {
    background: var(--status-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* User Navbar Profile & Logout */
.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

.btn-sync-time {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: var(--accent-cyan);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-sync-time:hover {
    background: rgba(6, 182, 212, 0.3);
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-sync-time:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-serverdc-link {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-serverdc-link:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

/* Server DC Cards Section */
.serverdc-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.serverdc-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.serverdc-card.highlight {
    border-color: rgba(168, 85, 247, 0.5);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(139, 92, 246, 0.15));
}

.sdc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.sdc-badge.online {
    color: #34d399;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sdc-ip {
    color: var(--text-muted);
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.sdc-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.sdc-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.sdc-stats {
    margin-top: 4px;
}

.sdc-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sdc-pill.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.3);
}

.sdc-pill.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
}

.sdc-pill.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
