/* ===== WELLCORE CUSTOM CSS ===== */

/* ===== GENERAL STYLES ===== */
.container-fluid {
    padding: 15px;
}

/* ===== CARD STYLES ===== */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* ===== DEVICE TYPE CARDS ===== */
.device-type-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 320px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.device-type-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.device-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-type-card:hover::before {
    opacity: 1;
}

/* Device Type Color Themes */
.device-type-water {
    --theme-color: #2196F3;
    --theme-light: #E3F2FD;
    --theme-gradient: linear-gradient(135deg, #2196F3, #21CBF3);
}

.device-type-depot {
    --theme-color: #03A9F4;
    --theme-light: #E1F5FE;
    --theme-gradient: linear-gradient(135deg, #03A9F4, #4FC3F7);
}

.device-type-generator {
    --theme-color: #FF9800;
    --theme-light: #FFF3E0;
    --theme-gradient: linear-gradient(135deg, #FF9800, #FFB74D);
}

.device-type-meter {
    --theme-color: #4CAF50;
    --theme-light: #E8F5E8;
    --theme-gradient: linear-gradient(135deg, #4CAF50, #81C784);
}

.device-type-alarm {
    --theme-color: #F44336;
    --theme-light: #FFEBEE;
    --theme-gradient: linear-gradient(135deg, #F44336, #EF5350);
}

.device-type-hydrophore {
    --theme-color: #9C27B0;
    --theme-light: #F3E5F5;
    --theme-gradient: linear-gradient(135deg, #9C27B0, #BA68C8);
}

.device-type-icm {
    --theme-color: #37474F;
    --theme-light: #ECEFF1;
    --theme-gradient: linear-gradient(135deg, #455A64, #78909C);
}

.device-type-default {
    --theme-color: #607D8B;
    --theme-light: #ECEFF1;
    --theme-gradient: linear-gradient(135deg, #607D8B, #90A4AE);
}

/* Card Header */
.card-header-custom {
    padding: 20px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.device-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--theme-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.device-icon i {
    font-size: 24px;
    color: #ffffff;
}

.device-type-card:hover .device-icon {
    transform: scale(1.1) rotate(5deg);
}

.device-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--theme-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--theme-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.status-text {
    color: var(--theme-color);
    font-weight: 600;
}

/* Card Content */
.card-content {
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.device-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.device-description {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.device-stats {
    display: flex;
    gap: 20px;
    margin-top: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #95a5a6;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Card Footer */
.card-footer-custom {
    padding: 15px 20px 20px;
    margin-top: auto;
}

.btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--theme-gradient);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    text-decoration: none;
}

.btn-view-details i {
    transition: transform 0.3s ease;
}

.btn-view-details:hover i {
    transform: translateX(4px);
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.device-type-card.loading .card-overlay {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    color: var(--theme-color);
}

.overlay-content i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.overlay-content span {
    font-size: 14px;
    font-weight: 500;
}

/* No Devices Card */
.no-devices-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    text-align: center;
    padding: 40px 20px;
}

.no-devices-icon {
    width: 80px;
    height: 80px;
    background: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #856404;
    font-size: 32px;
}

.no-devices-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

.no-devices-message {
    color: #6c757d;
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .device-type-card {
        min-height: 280px;
        height: auto;
    }
    
    .device-stats {
        gap: 15px;
    }
    
    .stat-number {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .device-type-card {
        min-height: 260px;
        height: auto;
    }
    
    .card-header-custom {
        padding: 15px 15px 10px;
    }
    
    .card-content {
        padding: 0 15px;
    }
    
    .card-footer-custom {
        padding: 10px 15px 15px;
    }
}

.card-header {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    color: #333333;
    padding: 12px 15px;
}

.card-title {
    color: #2196F3;
    font-weight: 600;
    margin-bottom: 0;
}

.card-body {
    padding: 15px;
}

/* ===== ALERT STYLES ===== */
.alert-info-custom {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #0d47a1;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* ===== DEVEXTREME GRID CUSTOM STYLING ===== */
.dx-datagrid {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e0e0e0 !important;
}

.dx-datagrid-headers {
    background: #f5f5f5 !important;
    color: #333333 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.dx-datagrid-content .dx-datagrid-table .dx-row {
    background: #ffffff !important;
    color: #333333 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.dx-datagrid-content .dx-datagrid-table .dx-row:nth-child(even) {
    background: #fafafa !important;
}

.dx-datagrid-content .dx-datagrid-table .dx-row:hover {
    background: #f0f0f0 !important;
}

/* ===== POPUP STYLING ===== */
.dx-popup-wrapper .dx-popup {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.dx-popup-title {
    background: #f5f5f5 !important;
    color: #333333 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 12px 16px !important;
    border-radius: 6px 6px 0 0 !important;
}

.dx-popup-content {
    background: #ffffff !important;
    color: #333333 !important;
    padding: 20px !important;
}

/* ===== FORM GROUP STYLING ===== */
.dx-form .dx-group-item {
    margin-bottom: 20px !important;
}

.dx-form .dx-group-item .dx-group-item-caption {
    background: #f9f9f9 !important;
    color: #333333 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    border-radius: 4px !important;
    border-left: 3px solid #2196F3 !important;
    margin-bottom: 12px !important;
}

/* ===== FORM FIELD LABELS ===== */
.dx-form .dx-field-label {
    color: #333333 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    margin-bottom: 6px !important;
}

.dx-form .dx-field-item {
    margin-bottom: 15px !important;
}

/* ===== INPUT CONTROLS STYLING ===== */
.dx-textbox, .dx-selectbox, .dx-numberbox, .dx-textarea {
    background: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    color: #333333 !important;
    transition: all 0.2s ease !important;
}

.dx-textbox.dx-state-focused, .dx-selectbox.dx-state-focused, .dx-numberbox.dx-state-focused, .dx-textarea.dx-state-focused {
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
    background: #ffffff !important;
}

.dx-textbox .dx-texteditor-input, .dx-selectbox .dx-texteditor-input, .dx-numberbox .dx-texteditor-input, .dx-textarea .dx-texteditor-input {
    color: #333333 !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
}

.dx-textbox .dx-placeholder::before, .dx-selectbox .dx-placeholder::before, .dx-numberbox .dx-placeholder::before, .dx-textarea .dx-placeholder::before {
    color: #999999 !important;
}

/* ===== CHECKBOX STYLING ===== */
.dx-checkbox {
    background: transparent !important;
}

.dx-checkbox-icon {
    border: 1px solid #c0c0c0 !important;
    background: #ffffff !important;
}

.dx-checkbox.dx-checkbox-checked .dx-checkbox-icon {
    background: #2196F3 !important;
    border-color: #2196F3 !important;
}

/* ===== BADGE STYLING ===== */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* ===== BUTTONS ===== */
.dx-button.dx-button-mode-contained.dx-button-default {
    background: #2196F3 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.dx-button.dx-button-mode-contained.dx-button-default:hover {
    background: #1976D2 !important;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3) !important;
}

/* ===== TOOLBAR AND PAGER ===== */
.dx-toolbar {
    background: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
}

.dx-pager {
    background: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
    color: #333333 !important;
}

/* ===== LEGACY TABLE STYLES ===== */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}

.table-striped tbody tr:hover {
    background-color: #f0f0f0;
}

.table thead th {
    background-color: #f5f5f5;
    color: #333333;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
}

.table td, .table th {
    padding: 10px;
    vertical-align: middle;
    border-top: 1px solid #e0e0e0;
}

/* ===== ACTION BUTTONS ===== */
.btn-action {
    margin-right: 5px;
    margin-bottom: 5px;
}

.action-column {
    white-space: nowrap;
    text-align: right;
}

/* ===== DEVEXTREME DATAGRID LAYOUT FIXES ===== */
.dx-datagrid {
    width: 100% !important;
    min-height: 400px !important;
}

/* Fix search panel width and positioning */
.dx-datagrid-search-panel {
    width: 300px !important;
    max-width: 300px !important;
    margin-right: 10px !important;
}

.dx-datagrid-search-panel .dx-texteditor-input {
    width: 100% !important;
    min-width: 250px !important;
}

/* Fix toolbar layout */
.dx-datagrid-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 15px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.dx-datagrid-toolbar .dx-toolbar-before {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
}

.dx-datagrid-toolbar .dx-toolbar-after {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Fix add button positioning */
.dx-datagrid-toolbar .dx-button {
    margin-left: 10px !important;
}

/* Fix column headers */
.dx-datagrid-headers .dx-header-row {
    background: #f5f5f5 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

.dx-datagrid-headers .dx-header-row .dx-datagrid-table .dx-row > td {
    padding: 12px 8px !important;
    border-right: 1px solid #e0e0e0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Fix filter row */
.dx-datagrid-filter-row .dx-datagrid-table .dx-row > td {
    padding: 8px !important;
    border-right: 1px solid #e0e0e0 !important;
}

.dx-datagrid-filter-row .dx-texteditor {
    width: 100% !important;
    min-width: 80px !important;
}

/* Fix data rows */
.dx-datagrid-content .dx-datagrid-table .dx-row > td {
    padding: 10px 8px !important;
    border-right: 1px solid #f0f0f0 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Fix action buttons column */
.dx-datagrid-content .dx-datagrid-table .dx-row > td:first-child {
    text-align: center !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

.dx-datagrid-content .dx-datagrid-table .dx-row > td:first-child .dx-button {
    margin: 0 2px !important;
    padding: 4px 8px !important;
    min-width: 32px !important;
    height: 28px !important;
}

/* Fix ID column */
.dx-datagrid-content .dx-datagrid-table .dx-row > td:nth-child(2) {
    text-align: center !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    font-weight: 600 !important;
}

/* Fix date columns */
.dx-datagrid-content .dx-datagrid-table .dx-row > td:nth-last-child(-n+2) {
    text-align: center !important;
    font-size: 12px !important;
}

/* Fix pager */
.dx-datagrid-pager {
    background: #f8f9fa !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 10px 15px !important;
}

.dx-pager .dx-pages .dx-page {
    margin: 0 2px !important;
}

/* Fix scrollbar */
.dx-datagrid-content {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* Fix popup form */
.dx-popup-content .dx-form {
    max-height: 500px !important;
    overflow-y: auto !important;
}

/* Fix form groups */
.dx-form .dx-group-item-caption {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    margin-bottom: 10px !important;
    padding: 8px 12px !important;
    background: #f8f9fa !important;
    border-left: 3px solid #2196F3 !important;
    border-radius: 4px !important;
}

/* Fix form fields */
.dx-form .dx-field-item {
    margin-bottom: 15px !important;
}

.dx-form .dx-field-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #555555 !important;
    margin-bottom: 5px !important;
}

/* Fix text editors */
.dx-texteditor {
    border-radius: 4px !important;
    border: 1px solid #d0d0d0 !important;
    transition: all 0.2s ease !important;
}

.dx-texteditor.dx-state-focused {
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
}

.dx-texteditor .dx-texteditor-input {
    padding: 8px 12px !important;
    font-size: 13px !important;
    color: #333333 !important;
}

/* Fix selectbox and lookup */
.dx-selectbox, .dx-lookup {
    border-radius: 4px !important;
    border: 1px solid #d0d0d0 !important;
}

.dx-selectbox.dx-state-focused, .dx-lookup.dx-state-focused {
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
}

/* Fix numberbox */
.dx-numberbox {
    border-radius: 4px !important;
    border: 1px solid #d0d0d0 !important;
}

.dx-numberbox.dx-state-focused {
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
}

/* Fix textarea */
.dx-textarea {
    border-radius: 4px !important;
    border: 1px solid #d0d0d0 !important;
}

.dx-textarea.dx-state-focused {
    border-color: #2196F3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
}

/* Fix buttons in popup */
.dx-popup-content .dx-button {
    margin: 5px !important;
}

/* Fix validation messages */
.dx-invalid-message {
    color: #d32f2f !important;
    font-size: 12px !important;
    margin-top: 4px !important;
}

/* Fix loading indicator */
.dx-loadindicator {
    color: #2196F3 !important;
}

/* Fix empty state */
.dx-datagrid-nodata {
    color: #666666 !important;
    font-size: 14px !important;
    padding: 40px !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .card-body {
        padding: 15px 10px;
    }
    
    .action-column {
        display: flex;
        flex-direction: column;
    }
    
    .btn-action {
        margin-bottom: 5px;
        width: 100%;
    }
    
    /* Mobile DataGrid adjustments */
    .dx-datagrid-search-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .dx-datagrid-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .dx-datagrid-toolbar .dx-toolbar-after {
        margin-top: 10px !important;
        justify-content: center !important;
    }
    
    .dx-datagrid-content .dx-datagrid-table .dx-row > td {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
        padding: 8px 4px !important;
        font-size: 11px !important;
    }
}

/* ===== LOCATION CARDS ===== */
.location-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 320px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.location-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.location-card .card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    position: relative;
}

.location-card .location-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1E7FE0 0%, #0F2A44 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(30, 127, 224, 0.3);
    transition: all 0.3s ease;
}

.location-card:hover .location-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(30, 127, 224, 0.4);
}

.location-card .location-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #28a745;
}

.location-card .status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.location-card .card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.location-card .location-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.location-card .location-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.location-card .location-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.location-card .stat-item {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.location-card .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.location-card .stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.location-card .card-footer-custom {
    padding: 0 1.5rem 1.5rem;
}

.location-card .btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1E7FE0 0%, #0F2A44 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.location-card .btn-view-details:hover {
    background: linear-gradient(135deg, #1565C0 0%, #0F2A44 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 127, 224, 0.3);
}

.location-card .btn-view-details i {
    transition: transform 0.3s ease;
}

.location-card .btn-view-details:hover i {
    transform: translateX(3px);
}

/* Loading State for Location Cards */
.location-card.loading {
    pointer-events: none;
}

.location-card.loading .card-overlay {
    opacity: 1;
    visibility: visible;
}

.location-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.location-card .overlay-content {
    text-align: center;
    color: #6c757d;
}

.location-card .overlay-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.location-card .overlay-content span {
    display: block;
    font-weight: 500;
}

/* No Locations Card */
.no-locations-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    box-shadow: none;
}

.no-locations-card .no-locations-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-locations-card .no-locations-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-locations-card .no-locations-message {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Location Cards - Responsive Design */
@media (max-width: 768px) {
    .location-card {
        min-height: 280px;
        height: auto;
        margin-bottom: 1rem;
    }
    
    .location-title {
        font-size: 1.1rem;
    }
    
    .location-stats {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .stat-item {
        text-align: center;
    }
}

/* ===== DEVICE CARDS ===== */
.device-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.device-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Device Type Specific Colors */
.pump-device::before {
    background: linear-gradient(90deg, #17a2b8, #138496);
}

.tank-device::before {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

.generator-device::before {
    background: linear-gradient(90deg, #ffc107, #e0a800);
}

.device-card .card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    position: relative;
}

.device-card .device-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.pump-device .device-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.tank-device .device-icon {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.generator-device .device-icon {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.device-card:hover .device-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.device-card .device-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.device-card .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.device-card .status-online {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.device-card .status-online .status-dot {
    background: #28a745;
}

.device-card .status-offline {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.device-card .status-offline .status-dot {
    background: #dc3545;
}

.device-card .card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.device-card .device-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.device-card .device-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.device-card .device-info {
    margin-bottom: 1rem;
}

.device-card .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.device-card .info-item i {
    color: #17a2b8;
}

.device-card .device-alarms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.device-card .alarm-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.device-card .alarm-active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.device-card .alarm-inactive {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.device-card .alarm-item i {
    font-size: 0.9rem;
}

/* Tank Level Indicator */
.device-card .tank-level {
    margin-bottom: 1rem;
}

.device-card .level-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-card .level-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.device-card .level-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 10px;
    transition: height 0.5s ease;
    position: relative;
}

.device-card .level-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

.device-card .level-text {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Generator Gauge */
.device-card .generator-gauge {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.device-card .gauge-container {
    text-align: center;
}

.device-card .gauge-circle {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 0.5rem;
    background: conic-gradient(from 0deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
}

.device-card .gauge-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 20px;
    background: #2c3e50;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(45deg);
    border-radius: 1px;
}

.device-card .gauge-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.device-card .card-footer-custom {
    padding: 0 1.5rem 1.5rem;
}

.device-card .device-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.device-card .btn-control {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.device-card .btn-start {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.device-card .btn-stop {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.device-card .btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.device-card .btn-control.btn-hover {
    transform: scale(1.05);
}

.device-card .device-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.device-card .stat-item {
    text-align: center;
    flex: 1;
}

.device-card .stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.device-card .stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.device-card .device-state {
    text-align: center;
}

.device-card .form-check-input {
    width: 2rem;
    height: 1rem;
}

.device-card .form-check-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
}

/* Loading State for Device Cards */
.device-card.loading {
    pointer-events: none;
}

.device-card.loading .card-overlay {
    opacity: 1;
    visibility: visible;
}

.device-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.device-card .overlay-content {
    text-align: center;
    color: #6c757d;
}

.device-card .overlay-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.device-card .overlay-content span {
    display: block;
    font-weight: 500;
}

/* No Devices Card */
.no-devices-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    box-shadow: none;
}

.no-devices-card .no-devices-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-devices-card .no-devices-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-devices-card .no-devices-message {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Device Cards - Responsive Design */
@media (max-width: 768px) {
    .device-card {
        height: 350px;
        margin-bottom: 1rem;
    }
    
    .device-title {
        font-size: 1.1rem;
    }
    
    .device-alarms {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .device-controls {
        flex-direction: column;
    }
    
    .device-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-item {
        text-align: center;
    }
}

/* ===== iOS STYLE DEVICE CARDS ===== */
.device-card.ios-style {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.device-card.ios-style:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: #d1d1d6;
}

/* iOS Header */
.card-header-ios {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f2f2f7;
    background: #fafafa;
}

.device-icon-ios {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pump-device .device-icon-ios {
    background: linear-gradient(135deg, #007AFF, #0051D5);
}

.tank-device .device-icon-ios {
    background: linear-gradient(135deg, #34C759, #28A745);
}

.generator-device .device-icon-ios {
    background: linear-gradient(135deg, #FF9500, #FF6B00);
}

.meter-device .device-icon-ios {
    background: linear-gradient(135deg, #5AC8FA, #007AFF);
}

.hydrophore-device .device-icon-ios {
    background: linear-gradient(135deg, #007AFF, #0051D5);
}

.icm-device .device-icon-ios {
    background: linear-gradient(135deg, #5856D6, #3634A3);
}

.icm-device .device-connection {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icm-device .icm-rssi {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6e6e73;
    white-space: nowrap;
}

.icm-device .icm-rssi.rssi-q5 { color: #34c759; }
.icm-device .icm-rssi.rssi-q4 { color: #30b0c7; }
.icm-device .icm-rssi.rssi-q3 { color: #ff9f0a; }
.icm-device .icm-rssi.rssi-q2 { color: #ff6b00; }
.icm-device .icm-rssi.rssi-q1 { color: #ff3b30; }
.icm-device .icm-rssi.rssi-q0 { color: #8e8e93; }

/* ICM card: Relays (clickable) vs Inputs (status-only) */
.icm-device .icm-io-section-title {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6e6e73;
    margin: 0 0 6px 2px;
}

.icm-device .icm-io-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #8e8e93;
    margin-left: 4px;
}

.icm-device .icm-relay-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 52px;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1.5px solid #0a84ff;
    background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
    color: #0a84ff;
    box-shadow: 0 2px 0 #0a84ff33, 0 2px 6px rgba(10, 132, 255, 0.12);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.15;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.icm-device .icm-relay-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #0a84ff44, 0 4px 10px rgba(10, 132, 255, 0.18);
}

.icm-device .icm-relay-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #0a84ff33;
}

.icm-device .icm-relay-btn .icm-relay-icon {
    font-size: 0.85rem;
    opacity: 0.9;
}

.icm-device .icm-relay-btn .icm-relay-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icm-device .icm-relay-btn.is-on {
    border-color: #1f8a4c;
    background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
    color: #ffffff;
    box-shadow: 0 2px 0 #1a6b38, 0 2px 8px rgba(52, 199, 89, 0.35);
}

.icm-device .icm-relay-btn.is-on:hover {
    box-shadow: 0 3px 0 #1a6b38, 0 4px 12px rgba(52, 199, 89, 0.4);
}

.icm-device .icm-din-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.icm-device .icm-din-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-height: 42px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px dashed #c7c7cc;
    background: #f5f5f7;
    color: #3a3a3c;
    font-size: 0.74rem;
    font-weight: 550;
    line-height: 1.2;
    cursor: default;
    pointer-events: auto;
    user-select: none;
}

.icm-device .icm-din-badge {
    flex: 0 0 auto;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #636366;
    background: #e5e5ea;
    border-radius: 4px;
    padding: 1px 4px;
}

.icm-device .icm-din-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.icm-device .icm-din-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7c7cc;
}

.icm-device .icm-din-chip.is-active {
    border-style: solid;
    border-color: #d4a017;
    background: #fff8e6;
    color: #6b4f00;
}

.icm-device .icm-din-chip.is-active .icm-din-badge {
    background: #ffe08a;
    color: #6b4f00;
}

.icm-device .icm-din-chip.is-active .icm-din-dot {
    background: #ff9f0a;
    box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.25);
}

.icm-device .icm-relay-btn.has-automation {
    border-color: #d4a017;
    box-shadow: 0 2px 0 #d4a01755, 0 2px 6px rgba(212, 160, 23, 0.2);
}

.icm-device .icm-relay-btn.has-automation.is-on {
    border-color: #1f8a4c;
    box-shadow: 0 2px 0 #1a6b38, 0 2px 8px rgba(52, 199, 89, 0.35), inset 0 0 0 1px rgba(255, 204, 0, 0.35);
}

.icm-device .icm-auto-icons {
    position: absolute;
    top: 3px;
    right: 4px;
    display: flex;
    gap: 3px;
    font-size: 0.62rem;
    line-height: 1;
    color: #c98900;
    z-index: 1;
}

.icm-device .icm-relay-btn.is-on .icm-auto-icons {
    color: #ffe08a;
}

.icm-device .icm-din-chip.has-rule {
    border-color: #c98900;
}

.icm-device .icm-rule-icon {
    flex: 0 0 auto;
    font-size: 0.65rem;
    color: #c98900;
}

.icm-device .icm-ain-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icm-device .icm-ain-row.has-rule .icm-rule-icon {
    color: #c98900;
}

.device-title-ios {
    flex: 1;
}

.device-title-ios h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.device-timestamp {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.2;
}

.device-timestamp.online-text {
    color: #8e8e93;
}

.device-timestamp.offline-text {
    color: #ff3b30;
    font-weight: 500;
}

.device-connection {
    margin-left: 12px;
}

.device-connection i {
    font-size: 1.1rem;
}

.device-connection .online-icon {
    color: #34c759;
}

.device-connection .offline-icon {
    color: #ff3b30;
}

/* iOS Content */
.card-content-ios {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Equal height cards container */
.row.equal-height {
    display: flex;
    flex-wrap: wrap;
}

.row.equal-height > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.ios-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    min-height: 0;
}

.ios-status-grid > * {
    min-width: 0;
}

.tank-visualization {
    grid-column: 1 / -1;
    order: -1;
    margin-bottom: 16px;
}

.status-indicators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.status-item:hover {
    background: #f1f3f4;
    transform: translateX(2px);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-item.status-active .status-dot {
    background: #34c759;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

.status-item.status-active .status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.status-item.status-inactive .status-dot {
    background: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

.status-item.status-inactive .status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.status-item span {
    color: #1d1d1f;
    font-weight: 600;
}

.status-item.status-active {
    border-color: rgba(52, 199, 89, 0.2);
    background: rgba(52, 199, 89, 0.05);
}

.status-item.status-inactive {
    border-color: rgba(255, 59, 48, 0.2);
    background: rgba(255, 59, 48, 0.05);
}

/* Tank Visualization */
.tank-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.tank-container {
    width: 80px;
    height: 140px;
    background: #ffffff;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 3px solid #d1d1d6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tank-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #007AFF 0%, #0051D5 100%);
    border-radius: 0 0 9px 9px;
    transition: height 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tank-percentage {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Tank Parameters */
.tank-parameters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.param-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    min-height: 50px;
    text-align: center;
}

.param-item:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.param-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.2;
}

.param-value {
    font-size: 0.9rem;
    color: #1d1d1f;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-all;
}

/* Pump Controls */
.pump-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.ios-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px;
}

.ios-btn-start {
    background: #34c759;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.ios-btn-stop {
    background: #ff3b30;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.ios-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* iOS Footer */
.card-footer-ios {
    padding: 16px 20px 20px;
    border-top: 1px solid #f2f2f7;
    background: #fafafa;
}

.device-state-ios {
    display: flex;
    justify-content: center;
}

.state-toggle {
    position: relative;
}

.state-toggle input[type="checkbox"] {
    display: none;
}

.state-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f2f2f7;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #8e8e93;
}

.state-toggle input[type="checkbox"]:checked + label {
    background: #34c759;
    color: white;
}

.state-toggle input[type="checkbox"]:checked + label .toggle-text {
    color: white;
}

.state-toggle input[type="checkbox"]:checked + label i {
    color: white;
}

.toggle-text {
    font-weight: 600;
}

.state-toggle i {
    font-size: 0.8rem;
    color: #8e8e93;
}

/* Responsive Design for iOS Cards */
@media (max-width: 1200px) {
    .device-card.ios-style {
        min-height: 450px;
    }
}

@media (max-width: 992px) {
    .device-card.ios-style {
        min-height: 500px;
    }
    
    .ios-status-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tank-visualization {
        order: -1;
        margin-bottom: 16px;
    }
    
    .tank-parameters {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .param-item {
        padding: 6px 4px;
        min-height: 45px;
    }
}

@media (max-width: 768px) {
    .device-card.ios-style {
        min-height: 420px;
    }
    
    .ios-status-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tank-visualization {
        order: -1;
        margin-bottom: 16px;
        padding: 12px;
    }
    
    .tank-container {
        width: 70px;
        height: 120px;
    }
    
    .pump-controls {
        flex-direction: row;
        gap: 8px;
    }
    
    .ios-btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    
    .tank-parameters {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .param-item {
        padding: 6px 4px;
        min-height: 40px;
    }
    
    .param-label {
        font-size: 0.65rem;
    }
    
    .param-value {
        font-size: 0.8rem;
    }
    
    .status-indicators {
        gap: 8px;
    }
    
    .status-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .device-card.ios-style {
        min-height: 380px;
        margin-bottom: 16px;
    }
    
    .card-header-ios {
        padding: 16px;
    }
    
    .card-content-ios {
        padding: 16px;
    }
    
    .card-footer-ios {
        padding: 12px 16px 16px;
    }
    
    .device-title-ios h3 {
        font-size: 1rem;
    }
    
    .tank-container {
        width: 50px;
        height: 100px;
    }
    
    .ios-status-grid {
        gap: 12px;
    }
    
    .tank-visualization {
        padding: 8px;
    }
    
    .tank-container {
        width: 60px;
        height: 100px;
    }
    
    .tank-parameters {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    .param-item {
        padding: 4px 2px;
        min-height: 35px;
    }
    
    .param-label {
        font-size: 0.6rem;
    }
    
    .param-value {
        font-size: 0.7rem;
    }
    
    .status-item {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .ios-btn {
        font-size: 0.75rem;
        padding: 8px 10px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .device-card.ios-style {
        min-height: 350px;
    }
    
    .card-header-ios {
        padding: 12px;
    }
    
    .card-content-ios {
        padding: 12px;
    }
    
    .card-footer-ios {
        padding: 10px 12px 12px;
    }
    
    .device-icon-ios {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .device-title-ios h3 {
        font-size: 0.9rem;
    }
    
    .device-timestamp {
        font-size: 0.75rem;
    }
    
    .tank-visualization {
        padding: 6px;
    }
    
    .tank-container {
        width: 50px;
        height: 80px;
    }
    
    .tank-percentage {
        font-size: 0.7rem;
    }
    
    .tank-parameters {
        grid-template-columns: 1fr 1fr;
        gap: 3px;
    }
    
    .param-item {
        padding: 3px 2px;
        min-height: 30px;
    }
    
    .param-label {
        font-size: 0.55rem;
    }
    
    .param-value {
        font-size: 0.65rem;
    }
}

/* ===== GENERATOR DEVICE STYLES ===== */
.generator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.generator-gauge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Circular Gauge */
.circular-gauge {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-background {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f0f0;
    position: relative;
    border: 3px solid #e0e0e0;
    overflow: hidden;
}

.gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--fill-percentage, 55%);
    background: linear-gradient(to top, #ff3b30 0%, #ff9500 50%, #34c759 100%);
    border-radius: 0 0 50% 50%;
    transition: height 0.3s ease;
}

.gauge-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 40px;
    background: #ff3b30;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(45deg);
    border-radius: 1px;
    z-index: 2;
}

.gauge-needle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #ff3b30;
    border-radius: 50%;
}

.gauge-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.gauge-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8e8e93;
}

.gauge-label.gauge-e {
    bottom: 8px;
    left: 8px;
}

.gauge-label.gauge-f {
    bottom: 8px;
    right: 8px;
}

.gauge-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.gauge-level, .gauge-height {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.level-label, .height-label {
    font-size: 0.7rem;
    color: #8e8e93;
    font-weight: 500;
}

.level-value, .height-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d1d1f;
}

/* Generator Responsive */
@media (max-width: 768px) {
    .generator-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .generator-gauge-section {
        order: -1;
        margin-bottom: 16px;
    }
    
    .circular-gauge {
        width: 100px;
        height: 100px;
    }
    
    .gauge-needle {
        height: 35px;
    }
}

@media (max-width: 576px) {
    .circular-gauge {
        width: 80px;
        height: 80px;
    }
    
    .gauge-needle {
        height: 30px;
    }
    
    .level-value, .height-value {
        font-size: 1rem;
    }
}

/* ===== METER DEVICE STYLES ===== */
.meter-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.meter-header {
    text-align: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.meter-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.meter-serial {
    font-size: 0.9rem;
    color: #007AFF;
    font-weight: 600;
}

.meter-data-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-section {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 12px;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.data-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.data-value {
    font-size: 0.8rem;
    color: #1d1d1f;
    font-weight: 600;
    text-align: right;
}

.error-section {
    background: #fff5f5;
    border-color: #fed7d7;
}

.error-title {
    color: #e53e3e;
}

.error-code {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-text {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #e53e3e;
    background: #fed7d7;
    padding: 4px 6px;
    border-radius: 4px;
    word-break: break-all;
    line-height: 1.2;
}

/* ===== METER iOS STYLE (aesthetic, clean) ===== */
.meter-device.ios-style {
    min-height: 480px;
}

.meter-content-modern {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.meter-id-badge {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1d1d1f;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e7;
}

.meter-scroll-area {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
}

.meter-scroll-area::-webkit-scrollbar {
    width: 4px;
}

.meter-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.meter-scroll-area::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 2px;
}

.meter-section-modern {
    margin-top: 16px;
}

.meter-section-modern:first-child {
    margin-top: 16px;
}

.meter-section-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8e8e93;
    margin: 0 0 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.meter-values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e5e5ea;
    border-radius: 12px;
    overflow: hidden;
}

.meter-value-box {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: #ffffff;
    gap: 4px;
}

.meter-value-box.meter-value-full {
    grid-column: 1 / -1;
}

.meter-value-label {
    display: block;
    font-size: 0.72rem;
    color: #8e8e93;
    font-weight: 500;
}

.meter-value-num {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    word-break: break-word;
    overflow-wrap: break-word;
}

.meter-pmax-date {
    font-size: 0.8rem;
    color: #8e8e93;
    margin-top: 8px;
    padding: 8px 14px 0;
}

/* Error section - full width, text wraps to next lines */
.meter-error-section {
    margin-top: 16px;
    min-width: 0;
    max-width: 100%;
}

.meter-error-heading {
    color: #ff3b30 !important;
    margin-bottom: 6px;
}

.meter-error-text {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #ff3b30;
    line-height: 1.6;
    word-wrap: break-word !important;
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
    white-space: normal !important;
    padding: 12px 14px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Meter Modern Responsive */
@media (max-width: 768px) {
    .meter-values-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .meter-content-modern {
        padding: 0 !important;
    }

    .meter-id-badge {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .meter-scroll-area {
        padding: 0 16px 16px;
    }

    .meter-value-box {
        padding: 10px 12px;
    }

    .meter-value-num {
        font-size: 0.88rem;
    }

    .meter-error-text {
        font-size: 0.72rem;
        padding: 10px 12px;
    }
}

/* Meter Responsive */
@media (max-width: 768px) {
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .meter-header {
        padding: 12px;
    }
    
    .meter-name {
        font-size: 1.1rem;
    }
    
    .meter-serial {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .data-item {
        padding: 4px 6px;
    }
    
    .data-label {
        font-size: 0.7rem;
    }
    
    .data-value {
        font-size: 0.75rem;
    }
    
    .error-text {
        font-size: 0.65rem;
    }
}

/* ===== ALARM DEVICE STYLES ===== */
.alarm-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alarm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.alarm-icon-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alarm-icon-large {
    width: 40px;
    height: 40px;
    background: #ff3b30;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.alarm-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alarm-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1d1d1f;
}

.alarm-subtitle {
    font-size: 0.8rem;
    color: #8e8e93;
    font-weight: 500;
}

.alarm-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.alarm-wifi-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.alarm-wifi-icon.online {
    background: #34c759;
    color: white;
}

.alarm-wifi-icon.offline {
    background: #ff3b30;
    color: white;
}

.alarm-message-count {
    font-size: 0.7rem;
    color: #8e8e93;
    font-weight: 500;
}

.alarm-content {
    text-align: center;
    padding: 20px;
}

.alarm-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 20px;
    text-align: left;
}

.alarm-status-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.alarm-status-icon {
    width: 60px;
    height: 60px;
    background: #34c759;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.alarm-status-text {
    font-size: 0.9rem;
    color: #8e8e93;
    font-weight: 500;
}

.alarm-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.alarm-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #ff3b30;
}

.alarm-item-icon {
    width: 24px;
    height: 24px;
    color: #ff3b30;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alarm-item-body {
    flex: 1;
    min-width: 0;
}

.alarm-item-message {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.alarm-item-time {
    font-size: 0.75rem;
    color: #8e8e93;
}

/* Alarm Responsive */
@media (max-width: 768px) {
    .alarm-header {
        padding: 12px;
    }
    
    .alarm-icon-large {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .alarm-title {
        font-size: 0.9rem;
    }
    
    .alarm-subtitle {
        font-size: 0.75rem;
    }
    
    .alarm-status-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .alarm-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .alarm-icon-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .alarm-status-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .alarm-status-text {
        font-size: 0.8rem;
    }
}

/* ===== HYDROPHORE iOS STYLE ===== */
.hydrophore-layout-ios {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.hydrophore-status-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hydrophore-gauge-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hydrophore-pressure-header {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}

.hydrophore-p-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1d1d1f;
}

.hydrophore-circular-gauge {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hydrophore-gauge-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #e5e5ea;
    border: 4px solid #e5e5ea;
    box-sizing: border-box;
}

.hydrophore-gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from -90deg, #007AFF 0deg calc(var(--pressure-pct, 50) * 3.6deg), transparent calc(var(--pressure-pct, 50) * 3.6deg) 360deg);
    mask: radial-gradient(farthest-side, transparent 68%, black 68%);
    -webkit-mask: radial-gradient(farthest-side, transparent 68%, black 68%);
}

.hydrophore-gauge-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hydrophore-gauge-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1;
}

.hydrophore-gauge-unit {
    font-size: 0.8rem;
    color: #8e8e93;
    font-weight: 500;
    margin-top: 2px;
}

/* Hydrophore Responsive */
@media (max-width: 768px) {
    .hydrophore-layout-ios {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .hydrophore-status-section {
        order: 2;
    }

    .hydrophore-gauge-section {
        order: 1;
    }

    .hydrophore-circular-gauge {
        width: 120px;
        height: 120px;
    }

    .hydrophore-gauge-center {
        width: 75px;
        height: 75px;
    }

    .hydrophore-gauge-number {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .hydrophore-layout-ios {
        padding: 12px;
    }

    .hydrophore-circular-gauge {
        width: 100px;
        height: 100px;
    }

    .hydrophore-gauge-ring {
        border-width: 3px;
    }

    .hydrophore-gauge-fill {
        mask: radial-gradient(farthest-side, transparent 70%, black 70%);
        -webkit-mask: radial-gradient(farthest-side, transparent 70%, black 70%);
    }

    .hydrophore-gauge-center {
        width: 60px;
        height: 60px;
    }

    .hydrophore-gauge-number {
        font-size: 1.1rem;
    }
}

/* ===== GENERATOR iOS STYLE ===== */
.generator-layout-ios {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.generator-status-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-indicators-ios {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item-ios {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.status-item-ios.status-active {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.status-item-ios.status-inactive {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.status-dot-ios {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    transition: all 0.2s ease;
}

.status-item-ios.status-active .status-dot-ios {
    background: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.status-item-ios.status-inactive .status-dot-ios {
    background: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.status-item-ios span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.generator-gauge-section-ios {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.circular-gauge-ios {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.gauge-background-ios {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f8f9fa;
    position: relative;
    border: 4px solid #e9ecef;
    overflow: visible;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gauge-measurements-ios {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
}

.gauge-tick {
    position: absolute;
    background: #6c757d;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.gauge-tick-0 {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    --rotation: -90deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-10 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: -72deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-20 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: -54deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-30 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: -36deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-40 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: -18deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-50 {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    --rotation: 0deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
    background: #495057;
}

.gauge-tick-60 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: 18deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-70 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: 36deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-80 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: 54deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-90 {
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1.5px;
    --rotation: 72deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
}

.gauge-tick-100 {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    --rotation: 90deg;
    transform: translate(-50%, -50%) rotate(var(--rotation)) translateY(-50px);
    transform-origin: center;
    background: #495057;
}

.gauge-fill-ios {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--fill-percentage, 55%);
    background: linear-gradient(to top, #ff3b30 0%, #ff9500 30%, #ffcc02 60%, #34c759 100%);
    border-radius: 0 0 50% 50%;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.gauge-needle-ios {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 50px;
    background: linear-gradient(to bottom, #2c3e50, #34495e);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(var(--needle-rotation, -90deg));
    border-radius: 2px;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-needle-ios::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 8px solid #2c3e50;
}

.gauge-labels-ios {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 12px;
}

.gauge-label-ios {
    font-size: 0.9rem;
    font-weight: 700;
    color: #495057;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.gauge-label-ios.gauge-e {
    bottom: 12px;
    left: 12px;
}

.gauge-label-ios.gauge-f {
    bottom: 12px;
    right: 12px;
}

.gauge-info-ios {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
}

.gauge-level-ios, .gauge-height-ios {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.gauge-level-ios:hover, .gauge-height-ios:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.level-label-ios, .height-label-ios {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-value-ios, .height-value-ios {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* Generator iOS Responsive */
@media (max-width: 768px) {
    .generator-layout-ios {
        flex-direction: column;
        gap: 20px;
    }
    
    .generator-status-section {
        order: 2;
    }
    
    .generator-gauge-section-ios {
        order: 1;
    }
    
    .circular-gauge-ios {
        width: 120px;
        height: 120px;
    }
    
    .gauge-tick {
        box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 576px) {
    .generator-layout-ios {
        padding: 16px;
        gap: 16px;
    }
    
    .circular-gauge-ios {
        width: 100px;
        height: 100px;
    }
    
    .gauge-tick {
        box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.1);
    }
    
    .gauge-tick-0, .gauge-tick-50, .gauge-tick-100 {
        width: 6px;
        height: 1.5px;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) translateY(-40px);
    }
    
    .gauge-tick-10, .gauge-tick-20, .gauge-tick-30, .gauge-tick-40,
    .gauge-tick-60, .gauge-tick-70, .gauge-tick-80, .gauge-tick-90 {
        width: 4px;
        height: 1px;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) translateY(-40px);
    }
    
    .status-item-ios {
        padding: 8px 12px;
    }
    
    .gauge-level-ios, .gauge-height-ios {
        padding: 10px 14px;
    }
    
    .level-value-ios, .height-value-ios {
        font-size: 1rem;
    }
}
