/* ========================================
   IOT DASHBOARD - CLEAN CSS STRUCTURE
   Organized, Readable & Maintainable
   ======================================== */

/* ========================================
   1. RESET & ROOT VARIABLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Semantic Colors */
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutral Colors */
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f1f5f9;
    --white: #fff;
    --border: #e2e8f0;
    
    /* Shadows */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --sidebar-width: 250px;
}

body {
    background: var(--light);
    min-height: 100vh;
    display: flex;
}


/* ========================================
   2. SIDEBAR NAVIGATION
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

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

.sidebar-header i {
    font-size: 32px;
    color: var(--primary);
}

.sidebar-header span {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--light);
    color: var(--primary);
}

.menu-item.active {
    background: var(--primary);
    color: var(--white);
}

.menu-item i {
    font-size: 22px;
}

.menu-item.admin-only {
    display: none;
}

body[data-user-role="admin"] .menu-item.admin-only {
    display: flex;
}


/* ========================================
   3. MAIN LAYOUT
   ======================================== */

.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    padding: 30px;
    flex: 1;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================================
   4. TOPBAR & USER DROPDOWN
   ======================================== */

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title h1 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 4px;
}

.topbar-title p {
    font-size: 14px;
    color: var(--secondary);
}

.topbar-actions {
    position: relative;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-dropdown:hover {
    background: var(--border);
}

.user-avatar i {
    font-size: 32px;
    color: var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.user-role {
    font-size: 12px;
    color: var(--secondary);
}

.dropdown-icon {
    font-size: 20px;
    color: var(--secondary);
    transition: transform 0.3s;
}

.user-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.dropdown-header i {
    font-size: 40px;
    color: var(--primary);
}

.dropdown-header strong {
    display: block;
    font-size: 14px;
    color: var(--dark);
}

.dropdown-header small {
    display: block;
    font-size: 12px;
    color: var(--secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s;
}

.dropdown-item:hover {
    background: var(--light);
}

.dropdown-item i {
    font-size: 20px;
    color: var(--secondary);
}

.dropdown-item.logout-item {
    color: var(--danger);
}

.dropdown-item.logout-item i {
    color: var(--danger);
}


/* ========================================
   5. NOTIFICATION SYSTEM
   ======================================== */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: var(--white);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    max-width: 400px;
    transform: translateX(450px);
    opacity: 0;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    position: relative;
    overflow: hidden;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.hide {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(450px);
        opacity: 0;
    }
}

/* Notification Types */
.notification.success {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.notification.success .notification-icon {
    background: var(--success);
    color: var(--white);
}

.notification.warning {
    border-left-color: var(--warning);
    background: #fffbeb;
}

.notification.warning .notification-icon {
    background: var(--warning);
    color: var(--white);
}

.notification.danger {
    border-left-color: var(--danger);
    background: #fef2f2;
}

.notification.danger .notification-icon {
    background: var(--danger);
    color: var(--white);
}

/* Notification Elements */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 3px;
}

.notification-message {
    font-size: 13px;
    color: var(--secondary);
    line-height: 1.4;
}

.notification-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: all 0.2s;
    font-size: 18px;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    animation: progress 5s linear forwards;
}

.notification.success .notification-progress {
    background: var(--success);
}

.notification.warning .notification-progress {
    background: var(--warning);
}

.notification.danger .notification-progress {
    background: var(--danger);
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}


/* ========================================
   6. INFO CARDS
   ======================================== */

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

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

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

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

.info-card.clickable {
    cursor: pointer;
}

.info-card.clickable:hover {
    border-color: var(--primary-light);
}

.info-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.info-icon.notif {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.info-icon.uptime {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: var(--white);
}

.info-icon.data {
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--white);
}

.info-content {
    flex: 1;
}

.info-content h4 {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 4px;
}

.info-desc {
    display: block;
    font-size: 11px;
    color: var(--secondary);
    font-weight: 500;
}


/* ========================================
   7. SENSOR CARDS
   ======================================== */

.sensor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sensor-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    opacity: 0;
    transition: opacity 0.3s;
}

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

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

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
}

.card-icon.temp {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-icon.humid {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.card-info h3 {
    font-size: 17px;
    color: var(--dark);
    margin-bottom: 3px;
}

.card-info p {
    font-size: 13px;
    color: var(--secondary);
}

/* Card Body */
.card-body {
    position: relative;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.sensor-display {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.sensor-display.hidden {
    display: none;
}

.sensor-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.sensor-unit {
    font-size: 22px;
    color: var(--secondary);
    font-weight: 600;
}

.sensor-offline {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 20px;
}

.sensor-offline.show {
    display: flex;
}

.sensor-offline i {
    font-size: 36px;
    color: var(--secondary);
    margin-bottom: 8px;
    opacity: 0.5;
}

.sensor-offline p {
    font-size: 14px;
    color: var(--secondary);
    font-weight: 500;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.status-indicator.normal .status-dot {
    background: var(--success);
}

.status-indicator.warning .status-dot {
    background: var(--warning);
}

.status-indicator.danger .status-dot {
    background: var(--danger);
}

.status-indicator.offline .status-dot {
    background: var(--secondary);
}

.status-text {
    font-weight: 600;
    font-size: 14px;
}

.status-indicator.normal .status-text {
    color: var(--success);
}

.status-indicator.warning .status-text {
    color: var(--warning);
}

.status-indicator.danger .status-text {
    color: var(--danger);
}

.status-indicator.offline .status-text {
    color: var(--secondary);
}

.last-update {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--secondary);
    font-size: 13px;
}


/* ========================================
   8. CHARTS
   ======================================== */

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

.chart-box {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.chart-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

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

.chart-box:hover::before {
    opacity: 1;
}

.chart-header {
    margin-bottom: 16px;
}

.chart-header h3 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header small {
    font-size: 12px;
    color: var(--secondary);
}

.chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 250px;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 2px solid var(--border);
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.3s;
    min-height: 20px;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: translateY(-5px);
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 8px;
    padding: 0 3px;
}

.chart-label {
    font-size: 10px;
    color: var(--secondary);
    text-align: center;
    flex: 1;
}

.text-center {
    text-align: center;
    color: var(--secondary);
    padding: 40px 20px;
}


/* ========================================
   9. ADMIN PANEL
   ======================================== */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dark), var(--dark-light));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

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

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

.admin-card-full {
    grid-column: 1 / -1;
}

.admin-card-header {
    background: var(--dark);
    color: var(--white);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-card-header i {
    font-size: 24px;
}

.admin-card-header h3 {
    font-size: 18px;
}

.admin-card-body {
    padding: 24px;
}

/* System Control */
.system-control {
    text-align: center;
}

.control-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--light);
    border-radius: 12px;
}

.control-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
    flex-shrink: 0;
    transition: all 0.3s;
}

.control-icon.inactive {
    background: linear-gradient(135deg, var(--secondary), var(--dark-light));
}

.control-info {
    flex: 1;
    text-align: left;
}

.control-info h4 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 4px;
}

.control-info p {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
}

.control-info p.inactive {
    color: var(--secondary);
}

.btn-toggle {
    width: 100%;
    padding: 14px 24px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.btn-toggle:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-toggle.inactive {
    background: var(--success);
}

.btn-toggle.inactive:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.control-hint {
    display: block;
    font-size: 12px;
    color: var(--secondary);
}

/* Threshold Settings */
.setting-item {
    margin-bottom: 24px;
}

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

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 14px;
}

.setting-item label i {
    font-size: 18px;
    color: var(--primary);
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s;
}

.input-group input:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.setting-item small {
    display: block;
    margin-top: 8px;
    color: var(--secondary);
    font-size: 12px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--light);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.export-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 16px;
}

.export-info i {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.export-info p {
    font-size: 13px;
    color: var(--dark);
    margin: 0;
}

/* Buttons */
.btn-primary {
    padding: 12px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-full {
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 10px;
}


/* ========================================
   10. MODALS
   ======================================== */

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

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

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-content.modal-large {
    max-width: 600px;
    text-align: left;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 20px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    transform: rotate(90deg);
}

/* Modal Body & Footer */
.modal-body {
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* Modal Icons */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 40px;
}

.modal-icon.warning-icon {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.modal-icon.danger-icon {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.modal-icon.success-icon {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* Modal Text */
.modal-content h2 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 15px;
    color: var(--secondary);
    margin-bottom: 24px;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-cancel {
    background: var(--light);
    color: var(--dark);
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
}

.btn-confirm.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.btn-confirm.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-danger-outline {
    width: 100%;
    padding: 12px 20px;
    background: var(--white);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: var(--white);
}

/* Notification Log */
.notification-log-item {
    padding: 16px;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--warning);
}

.notification-log-item h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.notification-log-item p {
    font-size: 13px;
    color: var(--secondary);
    margin-bottom: 6px;
}

.notification-log-item small {
    font-size: 12px;
    color: var(--secondary);
}

/* Profile Modal */
.profile-info {
    text-align: center;
    padding: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 48px;
    color: var(--primary);
}

.profile-details h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 4px;
}

.profile-details p {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.profile-role {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.profile-stats {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
}

.profile-stat i {
    font-size: 24px;
    color: var(--primary);
}

.profile-stat small {
    display: block;
    font-size: 12px;
    color: var(--secondary);
}

.profile-stat strong {
    display: block;
    font-size: 14px;
    color: var(--dark);
}


/* ========================================
   11. RESPONSIVE DESIGN
   ======================================== */

/* Tablet & Small Desktop */
@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 70px;
    }

    .sidebar {
        width: 70px;
    }

    .sidebar-header span,
    .menu-item span {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
    }

    .menu-item {
        justify-content: center;
        padding: 14px;
    }

    .main-wrapper {
        margin-left: 70px;
    }

    .topbar {
        padding: 15px 20px;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .topbar-title p {
        font-size: 12px;
    }

    .user-name {
        display: none;
    }

    .main-content {
        padding: 20px 15px;
    }

    .info-cards,
    .sensor-cards,
    .chart-container,
    .admin-grid {
        grid-template-columns: 1fr;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .sensor-value {
        font-size: 36px;
    }

    .chart {
        height: 200px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .topbar-title h1 {
        font-size: 16px;
    }

    .user-role,
    .dropdown-icon {
        display: none;
    }

    .info-value {
        font-size: 24px;
    }

    .sensor-value {
        font-size: 32px;
    }

    .modal-content {
        padding: 24px 20px;
    }
}


/* ========================================
   12. PRINT STYLES
   ======================================== */

@media print {
    .sidebar,
    .topbar,
    .notification-container,
    .modal-overlay,
    .dropdown-menu {
        display: none !important;
    }

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

    body {
        background: var(--white);
    }

    .main-content {
        padding: 20px;
    }

    .section {
        display: block !important;
        page-break-after: always;
    }

    .sensor-card,
    .info-card,
    .chart-box,
    .admin-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}