/* ============================================
   门禁管控模块样式 - 指令27
   覆盖: 门禁大屏 / 设备管理 / 车辆管理 / 通行权限
   ============================================ */

/* ========== 门禁大屏布局 ========== */
.access-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.access-dashboard .full-width {
    grid-column: 1 / -1;
}

/* ========== 门禁KPI行 ========== */
.access-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.access-kpi-item {
    flex: 1;
    min-width: 120px;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    border-top: 3px solid #5470c6;
    transition: transform 0.2s;
}

.access-kpi-item:hover {
    transform: translateY(-2px);
}

.access-kpi-item.kpi-green { border-top-color: #91cc75; }
.access-kpi-item.kpi-red { border-top-color: #ee6666; }
.access-kpi-item.kpi-yellow { border-top-color: #fac858; }
.access-kpi-item.kpi-cyan { border-top-color: #73c0de; }

.access-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #e0e0e0;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.access-kpi-label {
    font-size: 12px;
    color: #8b949e;
    margin-top: 4px;
}

/* ========== 通行记录实时滚动列表 ========== */
.access-scroll-list {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    max-height: 340px;
    display: flex;
    flex-direction: column;
}

.access-scroll-header {
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    flex-shrink: 0;
}

.access-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.access-scroll-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
    animation: accessSlideIn 0.3s ease-out;
}

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

.access-scroll-item:last-child {
    border-bottom: none;
}

.access-scroll-time {
    font-size: 11px;
    color: #8b949e;
    font-family: monospace;
    white-space: nowrap;
    min-width: 45px;
}

.access-scroll-location {
    font-size: 12px;
    color: #5470c6;
    background: rgba(84,112,198,0.12);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.access-scroll-credential {
    font-size: 13px;
    color: #c9d1d9;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-scroll-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.access-scroll-badge.granted {
    background: rgba(145,204,117,0.15);
    color: #91cc75;
}

.access-scroll-badge.denied {
    background: rgba(238,102,102,0.15);
    color: #ee6666;
}

.access-vehicle-highlight {
    animation: accessPlateGlow 1.5s ease-out;
    background: rgba(250,200,88,0.15) !important;
    border-left: 3px solid #fac858;
}

@keyframes accessSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes accessPlateGlow {
    0% { background: rgba(250,200,88,0.3); }
    100% { background: rgba(250,200,88,0); }
}

/* ========== 设备状态列表 ========== */
.access-device-list {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    max-height: 340px;
    display: flex;
    flex-direction: column;
}

.access-device-header {
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    flex-shrink: 0;
}

.access-device-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.access-device-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.access-device-item:last-child {
    border-bottom: none;
}

.access-device-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.access-device-status.online {
    background: #91cc75;
    box-shadow: 0 0 6px rgba(145,204,117,0.5);
}

.access-device-status.offline {
    background: #ee6666;
    box-shadow: 0 0 6px rgba(238,102,102,0.5);
}

.access-device-status.error,
.access-device-status.maintenance {
    background: #fac858;
    box-shadow: 0 0 6px rgba(250,200,88,0.5);
}

.access-device-name {
    font-size: 13px;
    color: #c9d1d9;
    flex: 1;
}

.access-device-type {
    font-size: 11px;
    color: #8b949e;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.access-ctrl-btn {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid #5470c6;
    background: rgba(84,112,198,0.12);
    color: #5470c6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.access-ctrl-btn:hover {
    background: #5470c6;
    color: #fff;
}

.access-ctrl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== 告警列表 ========== */
.access-alert-list {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    max-height: 280px;
    display: flex;
    flex-direction: column;
}

.access-alert-header {
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    flex-shrink: 0;
}

.access-alert-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.access-alert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}

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

.access-alert-item:last-child {
    border-bottom: none;
}

.access-alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.access-alert-dot.critical { background: #ee6666; }
.access-alert-dot.warning { background: #fac858; }
.access-alert-dot.info { background: #73c0de; }

.access-alert-type {
    font-size: 12px;
    font-weight: 500;
    flex: 1;
}

.access-alert-type.critical { color: #ee6666; }
.access-alert-type.warning { color: #fac858; }
.access-alert-type.info { color: #73c0de; }

.access-alert-loc {
    font-size: 11px;
    color: #8b949e;
    white-space: nowrap;
}

.access-alert-time {
    font-size: 11px;
    color: #6e7681;
    font-family: monospace;
    white-space: nowrap;
}

/* ========== 远程控制弹窗 ========== */
#accessControlModal .modal {
    max-width: 480px;
}

.access-control-info {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.access-control-info .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.access-control-info .info-row:last-child {
    margin-bottom: 0;
}

.access-control-info .info-label {
    color: #8b949e;
}

.access-control-info .info-value {
    color: #c9d1d9;
    font-weight: 500;
}

.access-cmd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.access-cmd-btn {
    padding: 10px 8px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: #c9d1d9;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.access-cmd-btn:hover {
    border-color: #5470c6;
    background: rgba(84,112,198,0.1);
    color: #5470c6;
}

.access-cmd-btn.selected {
    border-color: #5470c6;
    background: #5470c6;
    color: #fff;
}

/* ========== 通用门禁表格页 ========== */
.access-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.access-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.access-filter-bar select,
.access-filter-bar input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.access-filter-bar select:focus,
.access-filter-bar input:focus {
    border-color: #5470c6;
}

.access-filter-bar .btn-filter {
    padding: 6px 16px;
    background: #5470c6;
    border: none;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.access-filter-bar .btn-filter:hover {
    background: #4361b0;
}

/* ========== 权限标签 ========== */
.access-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.access-tag.active { background: rgba(145,204,117,0.15); color: #91cc75; }
.access-tag.expired { background: rgba(238,102,102,0.15); color: #ee6666; }
.access-tag.revoked { background: rgba(139,148,158,0.15); color: #8b949e; }
.access-tag.vip { background: rgba(250,200,88,0.15); color: #fac858; }
.access-tag.whitelist { background: rgba(145,204,117,0.15); color: #91cc75; }
.access-tag.blacklist { background: rgba(238,102,102,0.15); color: #ee6666; }

/* ========== 安全期限预警标签 ========== */
.access-expiry-ok { color: #91cc75; }
.access-expiry-warn { color: #fac858; }
.access-expiry-danger { color: #ee6666; font-weight: 600; }

/* ========== 权限管理模态框特殊样式 ========== */
.access-perm-device-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.access-perm-device-select label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    color: #c9d1d9;
    cursor: pointer;
}

.access-perm-device-select input[type="checkbox"] {
    accent-color: #5470c6;
}

/* ========== 图表卡片样式 ========== */
.access-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .access-dashboard {
        grid-template-columns: 1fr;
    }

    .access-charts-row {
        grid-template-columns: 1fr;
    }

    .access-kpi-item {
        min-width: 100px;
        padding: 10px 12px;
    }

    .access-kpi-value {
        font-size: 22px;
    }

    .access-cmd-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .access-kpi-row {
        flex-wrap: wrap;
    }

    .access-kpi-item {
        flex: 1 1 45%;
        min-width: 0;
    }

    .access-cmd-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 指令29: 消防疏散联动全屏通知 ========== */

@keyframes pulse-bg {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

@keyframes border-blink {
    0%, 100% { border-color: #91cc75; box-shadow: 0 0 8px rgba(145,204,117,0.4); }
    50% { border-color: transparent; box-shadow: none; }
}

.evacuation-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.evacuation-bg-pulse {
    position: absolute;
    inset: 0;
    background: rgba(220, 20, 60, 0.85);
    animation: pulse-bg 2s ease-in-out infinite;
}

.evacuation-card {
    position: relative;
    z-index: 1;
    background: #1a0a0a;
    border: 2px solid #ee4444;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(238,68,68,0.4);
}

.evacuation-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.evacuation-title {
    font-size: 28px;
    font-weight: 700;
    color: #ff4444;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255,68,68,0.6);
}

.evacuation-subtitle {
    font-size: 15px;
    color: #ff8888;
    margin-bottom: 20px;
}

.evacuation-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.evacuation-info-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 8px;
}

.evacuation-info-label {
    display: block;
    font-size: 11px;
    color: #8b949e;
    margin-bottom: 4px;
}

.evacuation-info-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #ff6666;
}

.evacuation-detail-table {
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.evacuation-detail-table table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.evacuation-detail-table th {
    background: rgba(255,68,68,0.15);
    color: #ff8888;
    padding: 6px 8px;
    text-align: left;
    position: sticky;
    top: 0;
}

.evacuation-detail-table td {
    padding: 4px 8px;
    color: #c9d1d9;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.evacuation-warning {
    font-size: 13px;
    color: #fac858;
    margin-bottom: 16px;
}

.evacuation-dismiss-btn {
    padding: 10px 40px;
    background: #91cc75;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.evacuation-dismiss-btn:hover {
    background: #7cb965;
}

/* 设备疏散模式闪烁边框 */
.fire-evacuation-mode {
    animation: border-blink 1s ease-in-out infinite !important;
    border: 2px solid #91cc75;
    background: rgba(145,204,117,0.08) !important;
}

.access-device-status.evacuation {
    background: #91cc75 !important;
    box-shadow: 0 0 8px rgba(145,204,117,0.6);
}
