/* CSS Variables - Modern Enhanced */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --caution: #eab308;
    --info: #06b6d4;

    --bg-primary: #0a0e1a;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --bg-card: #1e2433;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #2d3748;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    --sidebar-width: 240px;
    --header-height: 65px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: var(--transition);
}

/* Mobile Menu Toggle - Hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 5px 12px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav li.active a,
.sidebar-nav a:hover {
    background: var(--primary);
    color: var(--text-primary);
}

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

.company-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

/* Mobile only - hidden by default on desktop */
.mobile-only {
    display: none;
}

/* Company info mobile section - hidden on desktop */
.company-info-mobile {
    display: none;
}

/* Desktop only - shown by default */
.company-info.desktop-only {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.company-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.service-subscription {
    display: flex;
    gap: 8px;
}

.service-type-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.service-type-badge.efpd {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.service-type-badge.pdm {
    background: rgba(6, 182, 212, 0.2);
    color: var(--info);
}

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

.subscription-badge.pro {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #000;
}

.subscription-badge.basic {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: var(--text-primary);
    border-color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.main-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-name {
    font-weight: 500;
}

/* Pages */
.page {
    display: none;
    padding: 25px;
}

.page.active {
    display: block;
}

/* Device Cards */
.devices-summary {
    margin-bottom: 25px;
}

.devices-summary h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.device-cards {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.device-card {
    flex: 0 0 180px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.device-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.device-card .device-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.device-card .device-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.device-card .device-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.normal { background: var(--success); }
.status-dot.caution { background: var(--caution); }
.status-dot.warning { background: var(--warning); }
.status-dot.critical { background: var(--danger); animation: pulse 1.5s infinite; }
.status-dot.offline { background: var(--secondary); }

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

/* Device Detail */
.device-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.detail-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.detail-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-info h3 {
    font-size: 1.3rem;
}

.detail-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
}

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

.card-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

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

.type-badge.efpd { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.type-badge.pdm { background: rgba(6, 182, 212, 0.2); color: var(--info); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge.normal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-badge.normal::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-badge.caution {
    background: rgba(234, 179, 8, 0.15);
    color: var(--caution);
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.status-badge.caution::before {
    background: var(--caution);
    box-shadow: 0 0 8px var(--caution);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-badge.warning::before {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse-badge 2s infinite;
}

.status-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-badge.critical::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: pulse-badge 1.5s infinite;
}

.status-badge.resolved {
    background: rgba(100, 116, 139, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(100, 116, 139, 0.3);
}
.status-badge.resolved::before {
    background: var(--secondary);
}

.status-badge.active {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-badge.active::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.badge-pro {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #000;
}

.badge-basic-pro {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Temperature Grid */
.realtime-section, .trend-section, .events-section {
    padding: 20px;
}

.temperature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.temp-cell {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: var(--transition);
}

.temp-cell.hot {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
}

.temp-cell.warm {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
}

.temp-cell .cell-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.temp-cell .cell-temp {
    font-size: 1.1rem;
    font-weight: 600;
}

.temperature-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.summary-item .value {
    font-size: 1.2rem;
    font-weight: 700;
}

.summary-item .cell {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chart */
.chart-container {
    height: 200px;
    margin-bottom: 15px;
}

.chart-placeholder {
    height: 100%;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    position: relative;
}

.chart-line {
    height: 60%;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), transparent);
    border-top: 2px solid var(--primary);
    border-radius: 4px 4px 0 0;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.time-range-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.time-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.time-btn:hover,
.time-btn.active {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Tables */
.data-table,
.events-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td,
.events-table th,
.events-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th,
.events-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.data-table tbody tr:hover,
.events-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px !important;
}

/* Devices Grid */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.device-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.device-detail-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-detail-card .device-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.device-detail-card .device-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
}

.device-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.device-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

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

/* Alerts */
.alerts-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* History */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range input[type="date"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-primary);
}

.date-range label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.export-btns {
    display: flex;
    gap: 10px;
}

.history-chart {
    height: 250px;
    margin-bottom: 20px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.form-group.checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Subscription Info */
.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-type-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.service-type-info .plan-label {
    font-size: 0.8rem;
}

.service-type-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.service-type-info.efpd .service-type-name {
    color: var(--warning);
}

.service-type-info.pdm .service-type-name {
    color: var(--info);
}

.service-type-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.current-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border: 1px solid var(--warning);
    border-radius: 8px;
}

.plan-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning);
}

.plan-features h5 {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.plan-features ul {
    list-style: none;
}

.plan-features li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plan-features li::before {
    content: 'OK ';
    color: var(--success);
    font-weight: 600;
    margin-right: 8px;
}

/* Buttons */
.btn {
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Filter Select */
.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

/* Service Indicator */
.service-indicator {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-indicator .service-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.service-indicator.efpd .service-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.service-indicator.pdm .service-badge {
    background: rgba(6, 182, 212, 0.2);
    color: var(--info);
}

.service-indicator .service-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Back Arrow */
.back-arrow {
    margin-right: 8px;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 12px;
}

.nav-section-title {
    padding: 12px 18px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Service Nav */
.service-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Services Section */
.services-section {
    margin-bottom: 30px;
}

.services-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Service Cards (Overview) */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.service-card {
    display: block;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.4);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card.efpd:hover::before {
    background: var(--gradient-warning);
}

.service-card.pdm:hover::before {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.service-card.efpd:hover {
    border-color: var(--warning);
}

.service-card.pdm:hover {
    border-color: var(--info);
}

.service-card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon.efpd {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.service-icon.pdm {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-info h4 {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.service-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.service-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
}

.service-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.service-status.normal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.service-status.normal::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.service-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.service-status.warning::before {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse-badge 2s infinite;
}

.service-status.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.service-status.critical::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: pulse-badge 1.5s infinite;
}

.service-card-body {
    padding: 20px;
}

.service-stats {
    display: flex;
    justify-content: space-around;
}

.service-stat {
    text-align: center;
}

.service-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

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

.service-card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
}

.enter-service {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
}

.service-card.efpd .enter-service {
    color: var(--warning);
}

.service-card.pdm .enter-service {
    color: var(--info);
}

.service-card-footer svg {
    color: var(--text-muted);
}

/* Summary Section */
.summary-section {
    margin-bottom: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.2);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-icon svg {
    width: 24px;
    height: 24px;
}

.summary-icon.devices {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.summary-icon.alerts {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.summary-icon.health {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.summary-icon.sync {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-value.warning {
    color: var(--warning);
}

.summary-value.success {
    color: var(--success);
}

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

/* Recent Alerts Section */
.recent-alerts-section {
    margin-bottom: 30px;
}

.view-all {
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
}

.view-all:hover {
    text-decoration: underline;
}

/* Subscribed Services */
.subscribed-services {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subscribed-service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.subscribed-service .service-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
}

.subscribed-service.efpd .service-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.subscribed-service.pdm .service-badge {
    background: rgba(6, 182, 212, 0.2);
    color: var(--info);
}

.subscribed-service .service-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.subscribed-service .service-name {
    font-weight: 500;
}

.subscribed-service .service-plan {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.subscribed-service .service-active {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Device Card Enhancements */
.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.device-card-body {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.device-card-body .device-stat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.device-card-body .device-stat .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.device-card-body .device-stat .value {
    font-size: 1rem;
    font-weight: 600;
}

.device-card-body .device-stat .value.warning {
    color: var(--warning);
}

.device-card-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   HEATMAP STYLES - Continuous Gradient Style
   (Reference: temp.nblbeta.site)
   ============================================ */

/* Heatmap Card */
.heatmap-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
}

.heatmap-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.heatmap-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.heatmap-info .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.heatmap-info .info-label {
    color: var(--text-muted);
}

.heatmap-info .info-divider {
    color: var(--text-muted);
    opacity: 0.5;
}

.heatmap-info .status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heatmap-info .status-pill.normal {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.heatmap-info .status-pill.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.heatmap-info .status-pill.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Heatmap Container */
.heatmap-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

/* Heatmap Grid - 4x4 */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
    max-width: 600px;
}

/* Heatmap Cell - Continuous Color */
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 100px;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.heatmap-cell .cell-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

.heatmap-cell .cell-min,
.heatmap-cell .cell-max {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.heatmap-cell .cell-max {
    font-weight: 600;
}

/* Temperature Scale Bar */
.heatmap-scale {
    display: flex;
    gap: 8px;
    width: 60px;
    flex-shrink: 0;
}

.scale-bar {
    width: 20px;
    border-radius: 4px;
    background: linear-gradient(
        to bottom,
        #ff0000 0%,
        #ff4500 8%,
        #ff6600 15%,
        #ff8c00 23%,
        #ffa500 31%,
        #ffc000 38%,
        #c9a227 46%,
        #8b7355 54%,
        #6b8e8e 62%,
        #4a9ea1 69%,
        #3498db 77%,
        #2980b9 85%,
        #1e5f8a 92%,
        #1a4a6e 100%
    );
}

.scale-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 2px 0;
}

.scale-labels span {
    line-height: 1;
}

/* Legacy temp-cell support (for backwards compatibility) */
.temp-cell {
    position: relative;
    border: 1px solid transparent;
    transition: var(--transition);
}

.temp-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.temp-cell .cell-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.temp-cell .cell-temp {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Vibration Styles */
.vibration-display {
    margin-bottom: 20px;
}

.axis-data {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.axis {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
}

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

.axis-label {
    font-weight: 600;
    font-size: 1rem;
}

.axis-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.axis-status.normal {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.axis-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.axis-status.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.axis-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.axis-values .value-item {
    display: flex;
    justify-content: space-between;
}

.axis-values .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.axis-values .value {
    font-weight: 600;
}

.axis-values .value.warning {
    color: var(--warning);
}

.vibration-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.vibration-summary .axis-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 5px;
}

/* Spectrum Chart */
.spectrum-section {
    padding: 20px;
}

.spectrum-chart {
    height: 200px;
    margin-bottom: 15px;
}

.spectrum-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    padding: 10px;
}

.spectrum-bars .bar {
    width: 8%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
}

.spectrum-bars .bar.warning {
    background: var(--warning);
}

.axis-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.axis-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.axis-btn:hover,
.axis-btn.active {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Axis Badge */
.axis-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.axis-badge.x { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.axis-badge.y { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.axis-badge.z { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.axis-badge.all { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Mini Vibration Display */
.vibration-mini-display {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mini-axis-display {
    display: flex;
    justify-content: space-around;
}

.mini-axis {
    text-align: center;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    min-width: 70px;
}

.mini-axis .axis-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mini-axis .axis-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.mini-axis.normal { border: 1px solid var(--success); }
.mini-axis.warning { border: 1px solid var(--warning); background: rgba(245, 158, 11, 0.1); }
.mini-axis.critical { border: 1px solid var(--danger); background: rgba(239, 68, 68, 0.1); }

/* Mini Temperature Grid */
.mini-temp-grid {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.mini-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.mini-cell.normal { background: rgba(16, 185, 129, 0.3); }
.mini-cell.caution { background: rgba(234, 179, 8, 0.3); }
.mini-cell.warning { background: rgba(245, 158, 11, 0.4); }
.mini-cell.critical { background: rgba(239, 68, 68, 0.5); }

/* Device Detail Card Enhancements */
.device-detail-card .device-detail-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.device-detail-card .device-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-detail-card .device-info h3 {
    font-size: 1.1rem;
}

.device-detail-card .device-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.device-detail-card .device-detail-body {
    padding: 0;
}

.device-detail-card .device-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.device-detail-card .stat {
    text-align: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.device-detail-card .stat .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.device-detail-card .stat .value {
    font-size: 1.1rem;
    font-weight: 600;
}

.device-detail-card .stat .value.warning {
    color: var(--warning);
}

.device-detail-card .device-detail-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Status Badge Info */
.status-badge.info {
    background: rgba(6, 182, 212, 0.2);
    color: var(--info);
}

/* Form Input Number */
.form-group input[type="number"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .temperature-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .devices-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .axis-data {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Base font size adjustment for mobile */
    body {
        font-size: 14px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        z-index: 1000;
        transition: max-height 0.3s ease-out;
        flex-direction: column;
    }

    .sidebar.active {
        max-height: 100vh;
        overflow-y: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 32px;
        height: 32px;
        background: var(--bg-tertiary);
        border-radius: 6px;
        z-index: 1001;
        flex-shrink: 0;
        order: -1;
    }

    .sidebar-header {
        padding: 12px 15px;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    /* Sidebar font sizes */
    .logo {
        font-size: 1.5rem;
    }

    .sidebar-nav {
        padding: 10px 0;
    }

    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
    }

    .sidebar-nav li {
        margin: 2px 10px;
    }

    .sidebar-nav a {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

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

    /* Show mobile-only elements, hide desktop-only */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Company info mobile section - below header */
    .company-info-mobile {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-tertiary);
    }

    .company-info-mobile .company-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .company-info-mobile .subscription-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .company-name {
        font-size: 1rem;
    }

    /* Header font sizes */
    .page-title {
        font-size: 1.1rem;
    }

    .current-time {
        font-size: 0.75rem;
    }

    .user-name {
        font-size: 0.85rem;
    }

    /* Card font sizes */
    .card-header h3,
    .card-header h4 {
        font-size: 0.9rem;
    }

    /* Service card titles */
    .service-card h3 {
        font-size: 1rem;
    }

    .service-card p {
        font-size: 0.8rem;
    }

    /* Status badges */
    .status-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    /* Device detail */
    #selectedDeviceName {
        font-size: 1.1rem;
    }

    .detail-meta span {
        font-size: 0.8rem;
    }

    /* Score summary */
    .score-summary .value {
        font-size: 1.1rem;
    }

    .score-summary .label {
        font-size: 0.7rem;
    }

    /* Threshold legend */
    .threshold-legend .legend-item span {
        font-size: 0.7rem;
    }

    /* Events table - Mobile optimized */
    .events-table th,
    .events-table td {
        font-size: 0.8rem;
        padding: 12px 10px;
        vertical-align: middle;
        line-height: 1.4;
    }

    .events-table th {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Data tables - Mobile optimized */
    .data-table th,
    .data-table td {
        font-size: 0.85rem;
        padding: 12px 10px;
        vertical-align: middle;
        line-height: 1.4;
    }

    .data-table th {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .btn-logout {
        font-size: 0.85rem;
    }

    /* Form elements */
    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select {
        font-size: 0.85rem;
    }

    .filter-select {
        font-size: 0.85rem;
    }

    /* Info rows */
    .info-row .info-label {
        font-size: 0.8rem;
    }

    .info-row .info-value {
        font-size: 0.85rem;
    }

    /* Fixed Mobile Toggle Button */
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        width: 44px;
        height: 44px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-primary);
        margin: 3px 0;
        transition: var(--transition);
        border-radius: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-header {
        padding: 0 15px 0 70px;
    }

    .page {
        padding: 15px;
    }

    .device-cards {
        flex-direction: column;
        overflow-x: visible;
    }

    .device-card {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .temperature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .temperature-summary {
        flex-direction: column;
        gap: 15px;
    }

    .history-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-range {
        flex-wrap: wrap;
    }

    .alerts-filter {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    /* =============================================
       EFPD Heatmap Mobile Styles
       ============================================= */

    /* Heatmap card header */
    .heatmap-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .heatmap-card .card-header h4 {
        font-size: 1rem;
    }

    /* Heatmap info - stack vertically */
    .heatmap-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .heatmap-info .info-divider {
        display: none;
    }

    .heatmap-info .info-item {
        font-size: 0.8rem;
    }

    .heatmap-info .status-pill {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Heatmap container - stack grid and scale */
    .heatmap-container {
        flex-direction: column;
        gap: 15px;
    }

    /* Heatmap grid - full width */
    .heatmap-grid {
        max-width: 100%;
        gap: 6px;
    }

    /* Heatmap cells - smaller for mobile */
    .heatmap-cell {
        min-height: 70px;
        padding: 8px;
        border-radius: 6px;
    }

    .heatmap-cell .cell-label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .heatmap-cell .cell-min,
    .heatmap-cell .cell-max {
        font-size: 0.65rem;
    }

    /* Heatmap scale - hide on mobile */
    .heatmap-scale {
        display: none;
    }

    /* Device detail section */
    .device-detail {
        padding: 10px 0;
    }

    .detail-header {
        padding: 10px;
        gap: 10px;
    }

    .detail-info h3 {
        font-size: 1.1rem;
    }

    .detail-meta span {
        font-size: 0.75rem;
    }

    /* Realtime section */
    .realtime-section {
        margin-top: 15px;
    }

    /* Events section */
    .events-section {
        margin-top: 15px;
    }

    .events-table {
        font-size: 0.8rem;
    }

    .events-table th,
    .events-table td {
        padding: 10px 8px;
        line-height: 1.4;
    }

    .events-table th {
        font-size: 0.7rem;
    }

    /* Devices summary */
    .devices-summary h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    /* Device cards in summary */
    .device-card-header {
        padding: 10px;
    }

    .device-card-header .device-name {
        font-size: 0.9rem;
    }

    .device-card-body {
        padding: 10px;
    }

    .device-card-body .device-stat .label {
        font-size: 0.7rem;
    }

    .device-card-body .device-stat .value {
        font-size: 0.9rem;
    }

    .device-card-footer {
        padding: 8px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screen font sizes */
    body {
        font-size: 13px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .page-title {
        font-size: 1rem;
    }

    .sidebar-nav a {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .card-header h3,
    .card-header h4 {
        font-size: 0.85rem;
    }

    #selectedDeviceName {
        font-size: 1rem;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .score-summary .value {
        font-size: 1rem;
    }

    .events-table th,
    .events-table td {
        font-size: 0.75rem;
        padding: 8px 6px;
        line-height: 1.3;
    }

    .events-table th {
        font-size: 0.65rem;
    }

    .data-table th,
    .data-table td {
        font-size: 0.8rem;
        padding: 10px 8px;
        line-height: 1.3;
    }

    .data-table th {
        font-size: 0.7rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .time-range-selector {
        flex-wrap: wrap;
    }

    .time-btn {
        flex: 1;
        min-width: 60px;
        font-size: 0.75rem;
    }

    .export-btns {
        width: 100%;
    }

    .export-btns .btn {
        flex: 1;
    }

    .status-cards {
        flex-direction: column;
    }

    /* RUL Section mobile */
    .rul-number {
        font-size: 2rem;
    }

    .rul-unit {
        font-size: 1rem;
    }

    .rul-label {
        font-size: 0.7rem;
    }

    .rul-info-card .info-label {
        font-size: 0.65rem;
    }

    .rul-info-card .info-value {
        font-size: 0.85rem;
    }

    /* EFPD Heatmap - Extra small screens */
    .heatmap-cell {
        min-height: 60px;
        padding: 6px;
    }

    .heatmap-cell .cell-label {
        font-size: 0.7rem;
    }

    .heatmap-cell .cell-min,
    .heatmap-cell .cell-max {
        font-size: 0.6rem;
    }

    .heatmap-info .info-item {
        font-size: 0.75rem;
    }

    .scale-labels {
        font-size: 0.55rem;
    }

    /* Device cards extra small */
    .device-card-header .device-name {
        font-size: 0.85rem;
    }

    .device-card-body .device-stat .value {
        font-size: 0.85rem;
    }

    .device-card-body .device-stat .label {
        font-size: 0.65rem;
    }
}

/* PDM Status Cards */
.vibration-status-display {
    margin-bottom: 20px;
}

.status-cards {
    display: flex;
    gap: 15px;
}

.status-card {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
}

.status-card.warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.status-card.critical {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.status-card.caution {
    border-color: var(--caution);
    background: rgba(234, 179, 8, 0.1);
}

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

.status-card-header .axis-name {
    font-weight: 600;
    font-size: 1rem;
}

.status-card-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.status-card-value .value {
    font-size: 2.5rem;
    font-weight: 700;
}

.status-card-value .unit {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Info Row Styles */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

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

.info-value {
    font-weight: 500;
}

/* Status text colors */
.value.normal { color: var(--success); }
.value.caution { color: var(--caution); }
.value.warning { color: var(--warning); }
.value.critical { color: var(--danger); }

/* IF Score Display */
.score-display {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.score-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.gauge-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--success);
    transition: var(--transition);
}

.gauge-circle.normal {
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.gauge-circle.warning {
    border-color: var(--warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.gauge-circle.critical {
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    animation: pulse-gauge 1.5s infinite;
}

@keyframes pulse-gauge {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.6); }
}

.gauge-value {
    font-size: 2.5rem;
    font-weight: 700;
}

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

.gauge-status .status-text {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
}

.status-text.normal {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-text.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-text.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.score-chart {
    flex: 1;
    min-width: 200px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 120px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    gap: 8px;
}

.chart-bar {
    flex: 1;
    max-width: 30px;
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
}

.chart-bar.normal {
    background: var(--success);
}

.chart-bar.warning {
    background: var(--warning);
}

.chart-bar.critical {
    background: var(--danger);
}

.score-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

/* Mini Score Display for Devices Page */
.score-mini-display {
    padding: 20px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.mini-gauge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--success);
}

.mini-gauge.normal {
    border-color: var(--success);
}

.mini-gauge.warning {
    border-color: var(--warning);
}

.mini-gauge.critical {
    border-color: var(--danger);
}

.mini-score {
    font-size: 1.5rem;
    font-weight: 700;
}

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

/* Responsive for score display */
@media (max-width: 768px) {
    .score-display {
        flex-direction: column;
    }

    .score-chart {
        width: 100%;
    }

    .gauge-circle {
        width: 120px;
        height: 120px;
    }

    .gauge-value {
        font-size: 2rem;
    }
}

/* ===================== */
/* Flexible Device Cards */
/* ===================== */
.device-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.device-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.device-card:only-child {
    flex: 1 1 100%;
    max-width: 400px;
}

.device-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.device-card:hover {
    border-color: var(--primary);
}

/* Score Line Graph */
.score-graph-container {
    margin-bottom: 20px;
}

.score-graph {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    height: 220px;
}

.graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 35px;
}

.graph-area {
    flex: 1;
    position: relative;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.threshold-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    border-top: 1px dashed;
}

.threshold-line.warning-line {
    border-color: var(--warning);
    opacity: 0.5;
}

.threshold-line.danger-line {
    border-color: var(--danger);
    opacity: 0.5;
}

.score-line-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.graph-points {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.graph-point {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, 50%);
    cursor: pointer;
    z-index: 10;
}

.graph-point.normal {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.graph-point.warning {
    background: var(--warning);
    box-shadow: 0 0 6px var(--warning);
}

.graph-point.critical {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.graph-x-axis {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 0 45px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Card Header with Status */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-status {
    display: flex;
    align-items: center;
}

/* Threshold Legend */
.threshold-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.normal {
    background: var(--success);
}

.legend-color.warning {
    background: var(--warning);
}

.legend-color.critical {
    background: var(--danger);
}

/* Mini Score Graph for Devices Page */
.mini-score-graph {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mini-graph-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 60px;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 8px;
}

.mini-bar {
    flex: 1;
    max-width: 20px;
    border-radius: 2px 2px 0 0;
    transition: var(--transition);
}

.mini-bar.normal {
    background: var(--success);
}

.mini-bar.warning {
    background: var(--warning);
}

.mini-bar.critical {
    background: var(--danger);
}

/* Devices page grid - also flex */
.devices-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.device-detail-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 300px;
    max-width: 100%;
}

.device-detail-card:only-child {
    flex: 1 1 100%;
    max-width: 500px;
}

/* Responsive for graph */
@media (max-width: 768px) {
    .score-graph {
        height: 180px;
    }

    .graph-y-axis {
        font-size: 0.65rem;
        min-width: 30px;
    }

    .graph-x-axis {
        padding-left: 35px;
        font-size: 0.65rem;
    }

    .threshold-legend {
        flex-wrap: wrap;
        gap: 10px;
    }

    .device-card {
        flex: 1 1 100%;
    }

    .device-detail-card {
        flex: 1 1 100%;
    }
}

/* =============================================
   RUL Predictive Maintenance Section
   ============================================= */
.rul-section {
    margin-top: 25px;
}

.rul-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rul-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rul-status-badge.healthy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.rul-status-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.rul-status-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* RUL Content */
.rul-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rul-main {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    align-items: start;
}

/* RUL Gauge */
.rul-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rul-gauge {
    position: relative;
    width: 200px;
    text-align: center;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.rul-arc {
    transition: stroke-dashoffset 0.8s ease;
}

.rul-value {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.rul-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.rul-number.healthy { color: var(--success); }
.rul-number.warning { color: var(--warning); }
.rul-number.critical { color: var(--danger); }

.rul-unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.rul-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* RUL Info Grid */
.rul-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.rul-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.rul-info-card .info-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rul-info-card .info-icon svg {
    width: 24px;
    height: 24px;
}

.rul-info-card .info-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rul-info-card .info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rul-info-card .info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* RUL Trend Section */
.rul-trend-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    overflow: visible;
}

.rul-trend-section .trend-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.rul-trend-graph {
    margin-bottom: 15px;
    overflow: visible;
}

.trend-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}

.trend-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.trend-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.trend-legend .legend-line {
    width: 25px;
    height: 3px;
    border-radius: 2px;
}

.trend-legend .legend-line.historical {
    background: var(--success);
}

.trend-legend .legend-line.prediction {
    background: var(--primary);
    background: repeating-linear-gradient(
        90deg,
        var(--primary) 0px,
        var(--primary) 6px,
        transparent 6px,
        transparent 10px
    );
}

/* RUL Recommendation */
.rul-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid;
}

.rul-recommendation.healthy {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.rul-recommendation.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.rul-recommendation.critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.rul-recommendation .recommendation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rul-recommendation .recommendation-icon svg {
    width: 28px;
    height: 28px;
}

.rul-recommendation .recommendation-content h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.rul-recommendation.healthy .recommendation-content h5 { color: var(--success); }
.rul-recommendation.warning .recommendation-content h5 { color: var(--warning); }
.rul-recommendation.critical .recommendation-content h5 { color: var(--danger); }

.rul-recommendation .recommendation-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* RUL Responsive */
@media (max-width: 900px) {
    .rul-main {
        grid-template-columns: 1fr;
    }

    .rul-gauge-container {
        order: -1;
    }

    .rul-info-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Charts Section for Overview Dashboard
   ============================================= */
.charts-section {
    margin-bottom: 30px;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.chart-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-md);
}

.chart-card .card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chart-card .card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.chart-legend {
    display: flex;
    gap: 15px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.efpd {
    background: var(--warning);
}

.legend-color.pdm {
    background: var(--info);
}

.chart-card .card-body {
    padding: 20px;
}

.chart-card canvas {
    max-height: 300px;
}

@media (max-width: 1024px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
}

/* Heatmap Legend */
.heatmap-legend {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.heatmap-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.heatmap-legend .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* =============================================
   Mobile Touch Target Optimization
   ============================================= */
@media (max-width: 768px) {
    /* Events Table - Improved Touch Targets */
    .events-table tbody tr {
        min-height: 60px;
    }

    .events-table th,
    .events-table td {
        font-size: 0.85rem;
        padding: 14px 12px;
        vertical-align: middle;
        line-height: 1.5;
    }

    /* Data Table - Improved Touch Targets */
    .data-table tbody tr {
        min-height: 60px;
    }

    .data-table th,
    .data-table td {
        font-size: 0.9rem;
        padding: 14px 12px;
        vertical-align: middle;
        line-height: 1.5;
    }

    /* Device Cards - Better Touch Targets */
    .device-card {
        padding: 18px;
        min-height: 90px;
        cursor: pointer;
    }

    .device-card .device-name {
        font-size: 1rem;
    }

    .device-card .device-status {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    /* Status Badges - Larger Touch Area */
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-height: 30px;
        display: inline-flex;
        align-items: center;
    }

    /* Filter Selects - Better Touch Targets */
    .filter-select {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    /* Alerts Filter Section */
    .alerts-filter {
        gap: 12px;
        flex-wrap: wrap;
    }

    .alerts-filter .filter-select {
        flex: 1;
        min-width: 140px;
    }

    /* Form Buttons */
    .btn,
    .btn-primary,
    .btn-logout {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Sidebar Navigation - Better Touch Targets */
    .sidebar-nav ul li a {
        min-height: 48px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
    }

    .sidebar-nav ul li.service-nav a {
        padding-left: 28px;
    }

    /* Settings Form - Improved Touch Targets */
    .settings-form .form-group.checkbox {
        min-height: 48px;
        padding: 12px 0;
    }

    .settings-form .form-group.checkbox label {
        padding-left: 12px;
        font-size: 0.95rem;
    }

    .settings-form .form-group.checkbox input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    /* Info Rows in Settings */
    .subscription-info .info-row {
        padding: 14px 0;
        min-height: 48px;
    }

    /* RUL Info Cards */
    .rul-info-card {
        padding: 16px;
        min-height: 70px;
    }

    /* Score Summary Items */
    .score-summary .summary-item {
        padding: 12px 16px;
        min-height: 60px;
    }

    /* Threshold Legend Items */
    .threshold-legend .legend-item {
        padding: 8px 12px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    /* Extra Small Screens - Stack Elements */
    .events-table th,
    .events-table td {
        font-size: 0.8rem;
        padding: 12px 8px;
    }

    .data-table th,
    .data-table td {
        font-size: 0.85rem;
        padding: 12px 8px;
    }

    /* Device Cards Stack Better */
    .device-cards {
        gap: 12px;
    }

    .device-card {
        padding: 16px;
    }

    /* Filter Section - Full Width */
    .alerts-filter {
        flex-direction: column;
    }

    .alerts-filter .filter-select {
        width: 100%;
    }

    /* Buttons - Full Width on Extra Small */
    .settings-form .btn {
        width: 100%;
        min-height: 48px;
    }

    /* Score Summary - Stack on Extra Small */
    .score-summary {
        flex-wrap: wrap;
    }

    .score-summary .summary-item {
        flex: 1 1 45%;
        min-width: 100px;
    }

    /* Threshold Legend - Stack */
    .threshold-legend {
        flex-direction: column;
        align-items: flex-start;
    }

    .threshold-legend .legend-item {
        width: 100%;
    }
}
