/**
 * Water Tank Monitor - Main Stylesheet
 * Modern dark theme with water-inspired accents
 * 
 * Author: Gary
 * Project: ESP32 Water Tank Monitor
 */

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-hover: #243047;
    
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #00d4aa;
    --accent-secondary: #4facfe;
    --accent-gradient: linear-gradient(135deg, #00d4aa, #4facfe);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --border-color: #2d3748;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s ease;
    
    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-secondary);
}

/* ===== Navigation ===== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.nav-link .badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Main Content ===== */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.auth-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.page-header h1 i {
    color: var(--accent-primary);
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-nav {
    margin-bottom: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent-primary);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-card.alert {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-card), rgba(239, 68, 68, 0.1));
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.devices { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-icon.online { background: linear-gradient(135deg, #10b981, #14b8a6); }
.stat-icon.readings { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.stat-icon.alerts { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Section ===== */
.section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: var(--accent-primary);
}

/* ===== Device Grid ===== */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.device-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.device-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
}

.device-card.offline {
    opacity: 0.7;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.device-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.device-location {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
}

.device-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.device-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== Gauge ===== */
.device-gauge {
    text-align: center;
    padding: 1rem 0;
}

.gauge-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-svg.large {
    width: 130px;
    height: 130px;
}

.gauge-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke: var(--accent-primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 314;
    transition: stroke-dashoffset 0.5s ease;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.gauge-value .unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.gauge-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Device Details ===== */
.device-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
}

.device-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.625rem;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.device-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

.btn-acknowledge {
    background: var(--success);
    color: white;
}

.btn-acknowledge:hover {
    background: #059669;
}

/* ===== Alerts List ===== */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-color);
}

.alert-item.severity-critical { border-left-color: var(--danger); }
.alert-item.severity-warning { border-left-color: var(--warning); }
.alert-item.severity-info { border-left-color: var(--info); }

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
}

.severity-critical .alert-icon { color: var(--danger); }
.severity-warning .alert-icon { color: var(--warning); }
.severity-info .alert-icon { color: var(--info); }

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Tables ===== */
.table-container,
.devices-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

.data-table .offline-row {
    opacity: 0.6;
}

/* ===== Level Bar ===== */
.level-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.level-bar {
    width: 100px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.level-bar.small {
    width: 60px;
    height: 6px;
}

.level-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.level-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.online { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-badge.offline { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-badge.status-in_range { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-badge.status-no_detection { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-badge.status-overflow,
.status-badge.status-out_of_range { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ===== Alert Badge ===== */
.alert-badge {
    background: var(--danger);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-alerts {
    color: var(--success);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--danger);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Auth Pages ===== */
.auth-container {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--bg-primary);
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Flash Messages ===== */
.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 3px solid;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash-success { border-color: var(--success); }
.flash-danger { border-color: var(--danger); }
.flash-warning { border-color: var(--warning); }
.flash-info { border-color: var(--info); }

.flash-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.page-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.page-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.filter-group select {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
}

/* ===== Time Selector ===== */
.time-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.time-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.time-btn:hover,
.time-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* ===== Detail Stats ===== */
.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.detail-card.primary {
    border-color: var(--accent-primary);
}

.detail-gauge {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto;
}

.detail-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Stats Row ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.stat-box .stat-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-box .stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-box .stat-value.low { color: var(--danger); }
.stat-box .stat-value.high { color: var(--success); }

/* ===== Info Grid ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* ===== Chart Container ===== */
.chart-container {
    height: 300px;
    position: relative;
}

/* ===== Alert Cards ===== */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border-left: 4px solid var(--border-color);
}

.alert-card.severity-critical { border-left-color: var(--danger); }
.alert-card.severity-warning { border-left-color: var(--warning); }
.alert-card.severity-info { border-left-color: var(--info); }
.alert-card.acknowledged { opacity: 0.6; }

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.alert-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.alert-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.alert-body {
    margin-bottom: 1rem;
}

.alert-device a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.alert-level {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.alert-footer {
    display: flex;
    justify-content: flex-end;
}

.acknowledged-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--success);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-row .empty-state {
    padding: 2rem;
}

/* ===== Error Page ===== */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-content h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* ===== Auth Decoration ===== */
.auth-decoration {
    position: absolute;
    bottom: -100px;
    left: -100px;
    right: -100px;
    height: 200px;
    overflow: hidden;
    opacity: 0.1;
    pointer-events: none;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: var(--accent-primary);
    border-radius: 45%;
    animation: wave 10s linear infinite;
}

.wave-1 { bottom: -150%; left: -50%; animation-delay: 0s; }
.wave-2 { bottom: -155%; left: -50%; animation-delay: -2s; opacity: 0.5; }
.wave-3 { bottom: -160%; left: -50%; animation-delay: -4s; opacity: 0.3; }

@keyframes wave {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.show { display: flex; }
    
    .nav-user {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== No Data ===== */
.no-data {
    color: var(--text-muted);
    font-style: italic;
}

