@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local('Inter Light'), local('Inter-Light');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Inter Regular'), local('Inter-Regular');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Inter Medium'), local('Inter-Medium');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: local('Inter SemiBold'), local('Inter-SemiBold');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Inter Bold'), local('Inter-Bold');
}

:root {
    --bg-primary: #0f1923;
    --bg-secondary: #1a2332;
    --bg-card: #161d2a;
    --bg-card-hover: #1e2a3d;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --accent-blue: #00d4ff;
    --accent-green: #00ff88;
    --accent-yellow: #ffcc00;
    --accent-red: #ff4757;
    --accent-purple: #a855f7;
    --accent-orange: #ff7f50;
    
    --status-running: #00ff88;
    --status-standby: #ffcc00;
    --status-fault: #ff4757;
    --status-offline: #6c757d;
    --status-maintenance: #00d4ff;
    --status-online: #00d4ff;
    
    --gradient-blue: linear-gradient(135deg, #0066ff 0%, #00d4ff 100%);
    --gradient-green: linear-gradient(135deg, #00b894 0%, #00ff88 100%);
    --gradient-yellow: linear-gradient(135deg, #fdcb6e 0%, #ffcc00 100%);
    --gradient-red: linear-gradient(135deg, #e17055 0%, #ff4757 100%);
    --gradient-purple: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
    
    --shadow-glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
    --shadow-glow-red: 0 0 20px rgba(255, 71, 87, 0.4);
    --shadow-glow-yellow: 0 0 20px rgba(255, 204, 0, 0.4);
    --shadow-glow-blue: 0 0 20px rgba(0, 212, 255, 0.4);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

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

.sidebar {
    min-height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-blue);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    order: 1;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    order: 2;
    flex: 1;
}

.sidebar-header .sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    order: 3;
}

.sidebar-header .sidebar-toggle:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 24px 15px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 0 10px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.sidebar-menu li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar-menu li a:hover {
    color: var(--text-primary);
}

.sidebar-menu li a.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.sidebar-menu li a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu {
    padding: 20px 5px;
}

.sidebar.collapsed .sidebar-menu li {
    margin: 0 5px;
}

.sidebar.collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 14px 10px;
}

.sidebar.collapsed .sidebar-menu li a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu li a.active {
    border-left: none;
}

.sidebar.collapsed .sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.sidebar.collapsed .sidebar-menu li a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 24px;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

.top-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.top-bar .page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar .page-title h2 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar .page-title .subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar .user-info .notification-badge {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 71, 87, 0.1);
    transition: all var(--transition-fast);
}

.top-bar .user-info .notification-badge:hover {
    background: rgba(255, 71, 87, 0.2);
    transform: scale(1.05);
}

.top-bar .user-info .notification-badge i {
    font-size: 18px;
    color: var(--accent-red);
}

.top-bar .user-info .notification-badge .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-glow-red);
}

.top-bar .user-info .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.top-bar .user-info .user-avatar:hover {
    transform: scale(1.1);
}

.top-bar .user-info .user-name {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.alarm-ticker {
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.alarm-ticker-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.alarm-ticker i {
    font-size: 18px;
    color: var(--accent-red);
    margin-right: 14px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.alarm-ticker-scroll {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.alarm-ticker-item {
    display: inline-block;
    padding: 0 24px;
    color: var(--text-secondary);
    font-size: 14px;
    animation: tickerScroll 30s linear infinite;
}

.alarm-ticker-item.alarm-critical {
    color: var(--accent-red);
    font-weight: 600;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(22, 29, 42, 0.9), rgba(26, 35, 50, 0.7));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    backdrop-filter: blur(20px);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.stat-primary::before { background: var(--gradient-blue); }
.stat-card.stat-success::before { background: var(--gradient-green); }
.stat-card.stat-warning::before { background: var(--gradient-yellow); }
.stat-card.stat-danger::before { background: var(--gradient-red); }
.stat-card.stat-info::before { background: var(--gradient-purple); }

.stat-card .stat-glow-effect {
    position: absolute;
    top: -20%;
    right: -20%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    transition: all var(--transition-normal);
}

.stat-card:hover .stat-glow-effect {
    opacity: 0.5;
    transform: scale(1.2);
}

.stat-card.stat-primary .stat-glow-effect { background: var(--accent-blue); }
.stat-card.stat-success .stat-glow-effect { background: var(--accent-green); }
.stat-card.stat-warning .stat-glow-effect { background: var(--accent-yellow); }
.stat-card.stat-danger .stat-glow-effect { background: var(--accent-red); }
.stat-card.stat-info .stat-glow-effect { background: var(--accent-purple); }

.stat-card .stat-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.stat-card .stat-progress-fill {
    height: 100%;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transition: width 1.5s ease-out, opacity 0.5s ease;
    opacity: 0;
}

.stat-card.stat-primary .stat-progress-fill { background: var(--gradient-blue); }
.stat-card.stat-success .stat-progress-fill { background: var(--gradient-green); }
.stat-card.stat-warning .stat-progress-fill { background: var(--gradient-yellow); }
.stat-card.stat-danger .stat-progress-fill { background: var(--gradient-red); }
.stat-card.stat-info .stat-progress-fill { background: var(--gradient-purple); }

.stat-card .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform var(--transition-fast);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-card.stat-primary .stat-icon { background: rgba(0, 212, 255, 0.15); color: var(--accent-blue); }
.stat-card.stat-success .stat-icon { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.stat-card.stat-warning .stat-icon { background: rgba(255, 204, 0, 0.15); color: var(--accent-yellow); }
.stat-card.stat-danger .stat-icon { background: rgba(255, 71, 87, 0.15); color: var(--accent-red); }
.stat-card.stat-info .stat-icon { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.stat-card .stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.stat-card .stat-trend.up { color: var(--accent-green); background: rgba(0, 255, 136, 0.1); }
.stat-card .stat-trend.down { color: var(--accent-red); background: rgba(255, 71, 87, 0.1); }

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.device-card {
    background: linear-gradient(145deg, rgba(22, 29, 42, 0.95), rgba(26, 35, 50, 0.8));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.device-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.device-card .status-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0.1;
    transition: opacity var(--transition-normal);
}

.device-card:hover .status-glow {
    opacity: 0.2;
}

.device-card.status-running .status-glow { background: var(--status-running); box-shadow: var(--shadow-glow-green); }
.device-card.status-standby .status-glow { background: var(--status-standby); box-shadow: var(--shadow-glow-yellow); }
.device-card.status-fault .status-glow { background: var(--status-fault); box-shadow: var(--shadow-glow-red); animation: pulse-glow 2s infinite; }
.device-card.status-offline .status-glow { background: var(--status-offline); }
.device-card.status-maintenance .status-glow { background: var(--status-maintenance); box-shadow: var(--shadow-glow-blue); }
.device-card.status-online .status-glow { background: var(--status-online); box-shadow: var(--shadow-glow-blue); }

.device-card .device-corner-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 0 var(--radius-lg) 0 0;
    overflow: hidden;
}

.device-card .device-corner-decoration::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
}

.device-card.status-running .device-corner-decoration::after { background: linear-gradient(90deg, transparent, var(--status-running)); }
.device-card.status-standby .device-corner-decoration::after { background: linear-gradient(90deg, transparent, var(--status-standby)); }
.device-card.status-fault .device-corner-decoration::after { background: linear-gradient(90deg, transparent, var(--status-fault)); }
.device-card.status-maintenance .device-corner-decoration::after { background: linear-gradient(90deg, transparent, var(--status-maintenance)); }

.device-card .device-status-label {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 0;
    transition: all var(--transition-normal);
    transform: translateY(10px);
}

.device-card:hover .device-status-label {
    opacity: 1;
    transform: translateY(0);
}

.device-card.status-running .device-status-label { background: rgba(0, 255, 136, 0.15); color: var(--status-running); }
.device-card.status-standby .device-status-label { background: rgba(255, 204, 0, 0.15); color: var(--status-standby); }
.device-card.status-fault .device-status-label { background: rgba(255, 71, 87, 0.15); color: var(--status-fault); }
.device-card.status-offline .device-status-label { background: rgba(108, 117, 125, 0.15); color: var(--status-offline); }
.device-card.status-maintenance .device-status-label { background: rgba(0, 212, 255, 0.15); color: var(--status-maintenance); }
.device-card.status-online .device-status-label { background: rgba(0, 212, 255, 0.15); color: var(--status-online); }

@keyframes pulse-glow {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.2); }
}

.device-card .device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.device-card .device-code {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.device-card .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.device-card.status-running .status-indicator { background: var(--status-running); box-shadow: var(--shadow-glow-green); }
.device-card.status-standby .status-indicator { background: var(--status-standby); box-shadow: var(--shadow-glow-yellow); }
.device-card.status-fault .status-indicator { background: var(--status-fault); box-shadow: var(--shadow-glow-red); animation: pulse-dot 1.5s infinite; }
.device-card.status-offline .status-indicator { background: var(--status-offline); }
.device-card.status-maintenance .status-indicator { background: var(--status-maintenance); box-shadow: var(--shadow-glow-blue); }
.device-card.status-online .status-indicator { background: var(--status-online); box-shadow: var(--shadow-glow-blue); }

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.device-card .device-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.device-card .device-type {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.device-card .device-location {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.alarm-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.alarm-panel .alarm-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.alarm-panel .alarm-header .view-all {
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.alarm-panel .alarm-header .view-all:hover {
    color: var(--text-primary);
}

.alarm-item {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.alarm-item:last-child {
    margin-bottom: 0;
}

.alarm-item.alarm-critical {
    background: rgba(255, 71, 87, 0.1);
    border-left-color: var(--accent-red);
}

.alarm-item.alarm-warning {
    background: rgba(255, 204, 0, 0.1);
    border-left-color: var(--accent-yellow);
}

.alarm-item.alarm-info {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--accent-blue);
}

.alarm-item:hover {
    transform: translateX(4px);
}

.alarm-item .alarm-content {
    flex: 1;
}

.alarm-item .alarm-device {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alarm-item .alarm-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.alarm-item .alarm-time {
    font-size: 11px;
    color: var(--text-muted);
}

.alarm-item .alarm-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.alarm-item .alarm-actions button {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.alarm-item .alarm-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.quick-action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

.quick-action-btn i {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--accent-blue);
    transition: color var(--transition-fast);
}

.quick-action-btn:hover i {
    color: var(--text-primary);
}

.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-action-btn:hover span {
    color: var(--text-primary);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-running { background: rgba(0, 255, 136, 0.15); color: var(--status-running); }
.status-badge.status-standby { background: rgba(255, 204, 0, 0.15); color: var(--status-standby); }
.status-badge.status-fault { background: rgba(255, 71, 87, 0.15); color: var(--status-fault); }
.status-badge.status-offline { background: rgba(108, 117, 125, 0.15); color: var(--status-offline); }
.status-badge.status-maintenance { background: rgba(0, 212, 255, 0.15); color: var(--status-maintenance); }
.status-badge.status-online { background: rgba(0, 212, 255, 0.15); color: var(--status-online); }

.status-badge.status-pending { background: rgba(255, 204, 0, 0.15); color: var(--accent-yellow); }
.status-badge.status-processing { background: rgba(0, 212, 255, 0.15); color: var(--accent-blue); }
.status-badge.status-completed { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.status-badge.status-cancelled { background: rgba(108, 117, 125, 0.15); color: var(--text-muted); }
.status-badge.status-in_progress { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.priority-badge {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.priority-badge.priority-urgent { background: rgba(255, 71, 87, 0.15); color: var(--accent-red); }
.priority-badge.priority-high { background: rgba(255, 204, 0, 0.15); color: var(--accent-yellow); }
.priority-badge.priority-medium { background: rgba(0, 212, 255, 0.15); color: var(--accent-blue); }
.priority-badge.priority-low { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 150, 200, 0.4) rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    margin: 4px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(100, 150, 200, 0.4);
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 150, 200, 0.7);
}

.inline-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
}

.inline-status-badge.status-running {
    background: rgba(0, 255, 136, 0.15);
    color: var(--status-running);
}

.inline-status-badge.status-offline {
    background: rgba(108, 117, 125, 0.15);
    color: var(--status-offline);
}

.inline-status-badge i {
    font-size: 10px;
}

@keyframes modalIn {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    padding: 4px;
}

.modal-header .close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}

.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

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

.filter-bar .form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-bar .form-group select,
.filter-bar .form-group input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    min-width: 160px;
}

.filter-bar .form-group select:focus,
.filter-bar .form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.filter-bar .form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-bar button {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

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

.table-container .table-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-container .table-header .count {
    font-size: 13px;
    color: var(--text-muted);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table-container th,
.table-container td {
    padding: 16px 12px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.table-container th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

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

.table-container td {
    color: var(--text-secondary);
}

.table-container td a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.table-container td a:hover {
    color: var(--text-primary);
}

.table-container .action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.table-container .action-buttons button {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-container .action-buttons button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.table-container .action-buttons button.btn-primary {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--accent-blue);
}

.table-container .action-buttons button.btn-primary:hover {
    background: rgba(0, 212, 255, 0.25);
}

.table-container .action-buttons button.btn-success {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.3);
    color: var(--accent-green);
}

.table-container .action-buttons button.btn-success:hover {
    background: rgba(0, 255, 136, 0.25);
}

.table-container .action-buttons button.btn-danger {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--accent-red);
}

.table-container .action-buttons button.btn-danger:hover {
    background: rgba(255, 71, 87, 0.25);
}

.pagination {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination button {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
}

.pagination button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .current-page {
    padding: 10px 20px;
    background: var(--gradient-blue);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chart-container h4 {
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container h4 i {
    color: var(--accent-blue);
}

.chart-wrapper {
    height: 320px;
}

.form-control {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-select {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.btn-outline-primary {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.btn-outline-primary:hover {
    background: rgba(0, 212, 255, 0.15);
}

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

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-outline-info {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.btn-outline-info:hover {
    background: rgba(0, 212, 255, 0.15);
}

.btn-outline-success {
    background: transparent;
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.btn-outline-success:hover {
    background: rgba(0, 255, 136, 0.15);
}

.btn-outline-danger {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-outline-danger:hover {
    background: rgba(255, 71, 87, 0.15);
}

.alarm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 120px;
}

.alarm-popup-overlay.show {
    display: flex;
}

.alarm-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

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

.alarm-popup-header.alarm-critical {
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.2);
}

.alarm-popup-header.alarm-warning {
    background: rgba(255, 204, 0, 0.1);
    border-color: rgba(255, 204, 0, 0.2);
}

.alarm-popup-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alarm-popup-header.alarm-critical h4 { color: var(--accent-red); }
.alarm-popup-header.alarm-warning h4 { color: var(--accent-yellow); }

.alarm-popup-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.alarm-popup-header .close-btn:hover {
    color: var(--text-primary);
}

.alarm-popup-body {
    padding: 24px;
}

.alarm-popup-body .alarm-device {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.alarm-popup-body .alarm-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.alarm-popup-body .alarm-time {
    font-size: 12px;
    color: var(--text-muted);
}

.alarm-popup-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-control-plaintext {
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.row {
    display: flex;
    gap: 20px;
}

.row .col-md-4 {
    flex: 0 0 calc(33.333% - 13.33px);
}

.row .col-md-6 {
    flex: 0 0 calc(50% - 10px);
}

.row .col-md-8 {
    flex: 0 0 calc(66.666% - 6.67px);
}

.row .col-md-12 {
    flex: 0 0 100%;
}

.row .col-md-6 .form-group {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 16px;
}

.device-detail-container {
    color: var(--text-primary);
    padding: 8px 0;
}

.device-detail-container .device-status-row {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.device-detail-container .status-badge-large.status-running {
    background: rgba(0, 255, 136, 0.15);
    color: var(--status-running);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.device-detail-container .status-badge-large.status-offline {
    background: rgba(108, 117, 125, 0.15);
    color: var(--status-offline);
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.device-detail-container .status-badge-large {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 600;
}

.device-detail-container .status-badge-large .status-icon {
    font-size: 24px;
}

.device-detail-container .detail-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 16px;
}

.device-detail-container .detail-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.device-detail-container .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.device-detail-container .detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-detail-container .detail-item label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.device-detail-container .detail-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.device-detail-container .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.device-detail-container .status-dot.green {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.device-detail-container .status-dot.red {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.device-detail-container .text-warning {
    color: var(--accent-yellow);
}

.edit-form {
    color: var(--text-primary);
}

.edit-form .edit-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.edit-form .edit-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.edit-form .edit-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.edit-form .edit-label .required {
    color: var(--accent-red);
}

.edit-form .edit-input-wrapper {
    position: relative;
}

.edit-form .edit-input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.edit-form .edit-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.edit-form .edit-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(67, 133, 244, 0.1);
}

.edit-form .edit-input::placeholder {
    color: var(--text-muted);
}

.edit-form .edit-input option {
    background: var(--bg-card);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .sidebar-header h3 {
        display: none;
    }
    
    .sidebar .sidebar-toggle {
        display: none;
    }
    
    .sidebar .sidebar-menu li a span {
        display: none;
    }
    
    .sidebar .sidebar-menu li a {
        justify-content: center;
        padding: 14px 10px;
    }
    
    .sidebar .sidebar-menu li {
        margin: 0 5px;
    }
    
    .sidebar .sidebar-menu {
        padding: 20px 5px;
    }
    
    .sidebar .sidebar-menu li a.active {
        border-left: none;
    }
    
    .sidebar .sidebar-menu li a.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 20px;
        background: var(--accent-blue);
        border-radius: 0 3px 3px 0;
    }
    
    .sidebar .sidebar-menu li a:hover::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 10px;
        padding: 6px 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 13px;
        white-space: nowrap;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        margin-left: 70px;
        padding: 16px;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-12 {
        width: 100%;
        flex: none;
    }
    
    .table-container th,
    .table-container td {
        padding: 12px 16px;
        font-size: 12px;
    }
}