:root {
    /* Elegant dark palette */
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --secondary-color: #6366f1;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    font-size: 0.9375rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Keyboard shortcuts */
kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 -1px 0 var(--gray-200);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--primary-color);
    padding-top: 0;
    z-index: 1000;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.sidebar-brand i {
    color: var(--secondary-color);
    font-size: 1.25rem;
}

/* Sidebar Navigation */
.sidebar .nav-link {
    color: var(--gray-400);
    padding: 0.625rem 1.25rem;
    margin: 2px 0;
    border-radius: var(--radius);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    width: calc(100% - 1.5rem);
    box-sizing: border-box;
}

.sidebar .nav-link:hover {
    color: var(--gray-200);
    background-color: rgba(255,255,255,0.04);
}

.sidebar .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Settings submenu */
li.nav-group {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    margin: 2px 0;
    border-radius: var(--radius);
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.nav-menu-toggle:hover {
    color: var(--gray-200);
    background-color: rgba(255,255,255,0.04);
}

.nav-caret {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

li.nav-group.open .nav-caret {
    transform: rotate(180deg);
}

#settings-menu,
.nav-submenu {
    display: block;
    list-style: none;
    padding: 0.25rem 0.75rem;
    margin: 0;
    position: relative;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
    box-sizing: border-box;
    background: var(--primary-color);
    border-radius: var(--radius);
}

#settings-menu.open,
li.nav-group.open #settings-menu,
li.nav-group.open .nav-submenu {
    max-height: 45vh;
    overflow-y: auto;
}

#settings-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

#settings-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem 0.5rem 2.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 2px 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius);
}

#settings-menu .nav-link:hover {
    color: var(--gray-200);
    background-color: rgba(255,255,255,0.04);
}

#settings-menu .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

body.sidebar-collapsed #settings-menu {
    display: none !important;
}

.nav-label { 
    white-space: nowrap;
    overflow: hidden;
}

body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .nav-caret { display: none; }

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem;
    margin: 2px 0.5rem;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin: 0;
}

.sidebar > .nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem 1rem 0.75rem;
    max-height: calc(100vh - 72px);
    align-items: stretch;
    width: 100%;
}

.sidebar .nav,
.sidebar .nav-item {
    width: 100%;
}

.sidebar > .nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar > .nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar > .nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

body.sidebar-collapsed .sidebar .sidebar-brand {
    padding: 1.25rem 0.75rem;
    justify-content: center;
}

body.sidebar-collapsed .sidebar .sidebar-brand i {
    font-size: 1.5rem;
}

body.sidebar-collapsed .brand-text { display: none; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem 2rem;
    min-height: 100vh;
    transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gray-100);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Cards */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    background: white;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-ghost {
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem;
}

/* Widgets - Enhanced */
.widget-card-wrapper {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget-card-wrapper:hover {
    z-index: 10;
}

.widget-card-wrapper:active,
.drag-handle:active {
    cursor: grabbing;
}

.drag-handle {
    cursor: grab;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.drag-handle:hover {
    opacity: 1;
}

.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    align-items: start;
    grid-auto-flow: dense;
    grid-auto-rows: 12px;
}

.widget-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.25s ease;
    background: white;
}

.widget-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.widget-card .card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--secondary-color);
}

.widget-card .card-body {
    padding: 1rem;
}

.widget-card .card-header strong {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
}

/* Widget value display */
.widget-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    transition: color 0.3s ease;
}

.widget-value-sm {
    font-size: 1.75rem;
}

.widget-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-400);
    margin-left: 0.25rem;
}

.widget-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.widget-timestamp {
    font-size: 0.6875rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.widget-timestamp::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Widget trend indicator */
.widget-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
}

.widget-trend.up {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.widget-trend.down {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.widget-trend.stable {
    color: var(--gray-500);
    background: var(--gray-100);
}

/* Enhanced Gauge */
.gauge-container {
    position: relative;
    width: 160px;
    height: 80px;
    margin: 0.5rem auto;
}

.gauge-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.gauge-bg {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease, stroke 0.3s ease;
}

.gauge-value-text {
    font-size: 1.75rem;
    font-weight: 700;
    fill: var(--gray-800);
    text-anchor: middle;
}

.gauge-label-text {
    font-size: 0.6875rem;
    fill: var(--gray-500);
    text-anchor: middle;
}

.gauge-minmax {
    font-size: 0.625rem;
    fill: var(--gray-400);
}

/* Enhanced Chart */
.chart-container {
    position: relative;
    width: 100%;
    height: 100px;
    margin: 0.5rem 0;
}

.chart-container svg {
    width: 100%;
    height: 100%;
}

.chart-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    opacity: 0.15;
}

.chart-grid line {
    stroke: var(--gray-100);
    stroke-dasharray: 2, 4;
}

.chart-dot {
    fill: white;
    stroke-width: 2;
    transition: r 0.15s ease;
}

.chart-dot:hover {
    r: 6;
}

.chart-tooltip {
    position: absolute;
    background: var(--gray-900);
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    white-space: nowrap;
}

.chart-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 0.5rem;
}

.chart-stat {
    text-align: center;
}

.chart-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.chart-stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
}

/* Enhanced Switch */
.switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.switch-item:last-child {
    margin-bottom: 0;
}

.switch-item:hover {
    background: white;
    border-color: var(--gray-200);
}

.switch-item.active {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.switch-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.switch-status {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
}

.switch-status.on {
    background: var(--success-color);
    color: white;
}

.switch-status.off {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Custom switch toggle */
.switch-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--gray-300);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.25s ease;
}

.switch-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease;
}

.switch-toggle.on {
    background: var(--success-color);
}

.switch-toggle.on::after {
    transform: translateX(22px);
}

/* Multi-value widget */
.multi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.multi-row:last-child {
    border-bottom: none;
}

.multi-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.multi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.multi-value {
    font-size: 1rem;
    font-weight: 600;
}

.multi-unit {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-left: 0.2rem;
}

/* Presence/Leak widgets */
.sensor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-100);
}

.sensor-item:last-child {
    margin-bottom: 0;
}

.sensor-item.alert {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.sensor-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sensor-icon.ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.sensor-icon.alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.sensor-info {
    flex: 1;
    margin-left: 0.75rem;
}

.sensor-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.sensor-time {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

.sensor-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sensor-badge.ok {
    background: var(--success-color);
    color: white;
}

.sensor-badge.alert {
    background: var(--danger-color);
    color: white;
    animation: pulse-alert 1.5s infinite;
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Blinds Widget */
.blinds-widget {
    text-align: center;
    padding: 0.5rem;
}

.blinds-visual {
    position: relative;
    width: 80px;
    height: 100px;
    margin: 0 auto 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--gray-300);
}

.blinds-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--gray-400) 0%, var(--gray-500) 100%);
    transition: height 0.3s ease;
}

.blinds-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--gray-600);
    border-radius: 0 0 2px 2px;
}

.blinds-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.3) 8px,
        rgba(255,255,255,0.3) 10px
    );
}

.blinds-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.blinds-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.blinds-btn:hover {
    background: var(--gray-50);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.blinds-btn:active {
    transform: scale(0.95);
}

.blinds-position {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Climate Widget */
.climate-widget {
    padding: 0.5rem;
}

.climate-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.climate-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.climate-temp span {
    font-size: 1rem;
    color: var(--gray-400);
}

.climate-mode-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.climate-mode-icon.cool { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.climate-mode-icon.heat { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.climate-mode-icon.fan { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.climate-mode-icon.auto { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.climate-mode-icon.off { background: var(--gray-100); color: var(--gray-400); }

.climate-modes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.climate-mode-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.climate-mode-btn:hover {
    border-color: var(--secondary-color);
}

.climate-mode-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Lock Widget */
.lock-widget {
    text-align: center;
    padding: 1rem;
}

.lock-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.lock-icon.locked {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.lock-icon.unlocked {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.lock-status {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lock-status.locked { color: var(--success-color); }
.lock-status.unlocked { color: var(--danger-color); }

.lock-btn {
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lock-btn.lock {
    background: var(--success-color);
    color: white;
}

.lock-btn.unlock {
    background: var(--danger-color);
    color: white;
}

/* Scene Widget */
.scene-widget {
    text-align: center;
    padding: 1rem;
}

.scene-btn {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
}

.scene-btn:hover {
    border-color: var(--secondary-color);
    background: rgba(99, 102, 241, 0.05);
}

.scene-btn:active {
    transform: scale(0.98);
}

.scene-btn.running {
    border-style: solid;
    border-color: var(--secondary-color);
    background: rgba(99, 102, 241, 0.1);
}

.scene-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scene-name {
    font-weight: 600;
    color: var(--gray-800);
}

.scene-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Fan Widget */
.fan-widget {
    text-align: center;
    padding: 0.5rem;
}

.fan-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    position: relative;
}

.fan-icon-wrapper i {
    font-size: 3rem;
    color: var(--gray-400);
    transition: color 0.3s ease;
}

.fan-icon-wrapper.on i {
    color: var(--secondary-color);
    animation: fan-spin 1s linear infinite;
}

.fan-icon-wrapper.speed-1 i { animation-duration: 2s; }
.fan-icon-wrapper.speed-2 i { animation-duration: 1s; }
.fan-icon-wrapper.speed-3 i { animation-duration: 0.5s; }

@keyframes fan-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fan-speeds {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fan-speed-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    background: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fan-speed-btn:hover {
    border-color: var(--secondary-color);
}

.fan-speed-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Door/Window Widget */
.door-widget {
    text-align: center;
    padding: 0.75rem;
}

.door-visual {
    width: 60px;
    height: 80px;
    margin: 0 auto 0.75rem;
    position: relative;
    perspective: 200px;
}

.door-frame {
    width: 100%;
    height: 100%;
    border: 3px solid var(--gray-400);
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    position: relative;
}

.door-panel {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: var(--gray-300);
    border-radius: 2px;
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.door-panel.open {
    transform: rotateY(-45deg);
    background: var(--gray-200);
}

.door-handle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 12px;
    background: var(--gray-500);
    border-radius: 2px;
}

.door-status {
    font-weight: 600;
    font-size: 0.875rem;
}

.door-status.closed { color: var(--success-color); }
.door-status.open { color: var(--warning-color); }

/* Energy Widget */
.energy-widget {
    padding: 0.5rem;
}

.energy-current {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.energy-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.energy-unit {
    font-size: 1rem;
    color: var(--gray-400);
}

.energy-stats {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.energy-stat {
    text-align: center;
}

.energy-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.energy-stat-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Weather Widget */
.weather-widget {
    padding: 0.5rem;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.weather-icon {
    font-size: 3rem;
}

.weather-icon.sunny { color: #f59e0b; }
.weather-icon.cloudy { color: #9ca3af; }
.weather-icon.rainy { color: #3b82f6; }
.weather-icon.snowy { color: #93c5fd; }

.weather-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.weather-details {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.weather-detail {
    text-align: center;
}

.weather-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.weather-detail-label {
    font-size: 0.65rem;
    color: var(--gray-500);
}

/* Timer Widget */
.timer-widget {
    text-align: center;
    padding: 1rem;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.timer-display.running {
    color: var(--secondary-color);
}

.timer-display.finished {
    color: var(--danger-color);
    animation: pulse-alert 1s infinite;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.timer-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timer-btn.start {
    background: var(--success-color);
    color: white;
}

.timer-btn.pause {
    background: var(--warning-color);
    color: white;
}

.timer-btn.stop {
    background: var(--danger-color);
    color: white;
}

.timer-btn.reset {
    background: var(--gray-200);
    color: var(--gray-600);
}

.timer-presets {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.timer-preset {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 0.7rem;
    cursor: pointer;
}

.timer-preset:hover {
    border-color: var(--secondary-color);
}

/* ========== FLOORPLAN - ENHANCED ========== */
.floorplan-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.floorplan-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.floorplan-floor-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.floorplan-floor-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floorplan-floor-tab:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.floorplan-floor-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.floorplan-floor-tab .floor-icon {
    font-size: 1rem;
}

.floorplan-floor-tab .floor-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

.floorplan-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.floorplan-zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.floorplan-zoom-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

.floorplan-zoom-btn:active {
    transform: scale(0.95);
}

.floorplan-zoom-level {
    font-size: 0.75rem;
    color: var(--gray-500);
    min-width: 40px;
    text-align: center;
}

.floorplan-canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.floorplan-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.1s ease;
    cursor: grab;
}

.floorplan-canvas.is-dragging {
    cursor: grabbing;
}

.floorplan-canvas.is-zoomed {
    cursor: move;
}

/* Minimap */
.floorplan-minimap {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 150px;
    height: 100px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
    pointer-events: none;
}

.floorplan-canvas-wrapper:hover .floorplan-minimap,
.floorplan-minimap.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.floorplan-minimap-view {
    position: absolute;
    border: 2px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    cursor: move;
}

/* Fullscreen controls */
.floorplan-fullscreen-controls {
    display: none;
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-lg);
    gap: 1rem;
    align-items: center;
}

.floorplan-canvas-wrapper:fullscreen .floorplan-fullscreen-controls {
    display: flex;
}

.floorplan-fs-floors {
    display: flex;
    gap: 0.25rem;
}

.floorplan-fs-floor-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.floorplan-fs-floor-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.floorplan-fs-floor-btn.active {
    background: var(--primary-color);
    color: white;
}

.floorplan-fs-zoom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.floorplan-fs-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--gray-700);
}

.floorplan-fs-btn:hover {
    background: var(--gray-200);
}

/* Grid */
.floorplan-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    display: none;
}

.floorplan-grid-line-v,
.floorplan-grid-line-h {
    position: absolute;
    background: rgba(99, 102, 241, 0.15);
}

.floorplan-grid-line-v {
    width: 1px;
    top: 0;
    bottom: 0;
}

.floorplan-grid-line-h {
    height: 1px;
    left: 0;
    right: 0;
}

/* Enhanced Markers */
.floorplan-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    color: var(--gray-800);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: default;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    z-index: 10;
}

.floorplan-marker:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

.floorplan-marker.is-draggable {
    cursor: grab;
}

.floorplan-marker.is-draggable:active {
    cursor: grabbing;
}

.floorplan-marker.is-rect {
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.floorplan-marker.is-rect .marker-icon {
    border-radius: var(--radius-sm);
}

.floorplan-marker.is-clickable {
    cursor: pointer;
}

.floorplan-marker.is-alert {
    animation: marker-pulse 1.5s ease-in-out infinite;
    border-color: var(--danger-color);
}

.floorplan-marker.is-warning {
    border-color: var(--warning-color);
}

@keyframes marker-pulse {
    0%, 100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: var(--shadow-md), 0 0 0 8px rgba(239, 68, 68, 0); }
}

.floorplan-marker .marker-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--marker-color, var(--gray-500));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.floorplan-marker:hover .marker-icon {
    transform: scale(1.1);
}

.floorplan-marker .marker-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.floorplan-marker .marker-label {
    font-weight: 600;
    color: var(--gray-800);
}

.floorplan-marker .marker-value {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.floorplan-marker .marker-value-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 3px;
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.floorplan-marker .marker-value-row {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
    justify-content: space-between;
}

.floorplan-marker .marker-value-row i {
    font-size: 12px;
    color: var(--marker-color, var(--gray-500));
}

.floorplan-marker .marker-value-label {
    flex: 1;
}

.floorplan-marker .marker-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.floorplan-marker .marker-control input[type="range"] {
    width: 80px;
    accent-color: var(--secondary-color);
}

.floorplan-marker .marker-control input[type="color"] {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
}

/* Marker Status Badge */
.marker-status-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 5;
}

.marker-status-badge.online { background: var(--success-color); }
.marker-status-badge.offline { background: var(--gray-400); }
.marker-status-badge.alert { background: var(--danger-color); animation: pulse-alert 1s infinite; }
.marker-status-badge.warning { background: var(--warning-color); }

/* Marker Tooltip */
.floorplan-marker .marker-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    z-index: 100;
}

.floorplan-marker .marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
}

.floorplan-marker:hover .marker-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Zone/Room Areas */
.floorplan-zone {
    position: absolute;
    border: 2px dashed var(--zone-color, var(--primary-color));
    background: var(--zone-bg, rgba(99, 102, 241, 0.05));
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.floorplan-zone:hover {
    background: var(--zone-bg-hover, rgba(99, 102, 241, 0.1));
    border-style: solid;
}

.floorplan-zone .zone-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--zone-color, var(--primary-color));
    box-shadow: var(--shadow-sm);
}

/* Camera Preview Marker */
.floorplan-marker.is-camera {
    padding: 0;
    overflow: hidden;
    width: 120px;
}

.floorplan-marker.is-camera .camera-preview {
    width: 100%;
    height: 70px;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.floorplan-marker.is-camera .camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floorplan-marker.is-camera .camera-info {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
}

/* Thermostat Marker */
.floorplan-marker.is-thermostat {
    flex-direction: column;
    padding: 0.75rem;
    min-width: 100px;
}

.floorplan-marker.is-thermostat .thermostat-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marker-color, var(--primary-color));
    line-height: 1;
}

.floorplan-marker.is-thermostat .thermostat-target {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.floorplan-marker.is-thermostat .thermostat-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.floorplan-marker.is-thermostat .thermostat-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.floorplan-marker.is-thermostat .thermostat-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

/* Blinds Marker */
.floorplan-marker.is-blinds {
    flex-direction: column;
    padding: 0.5rem;
    min-width: 80px;
}

.floorplan-marker.is-blinds .blinds-visual-mini {
    width: 40px;
    height: 50px;
    background: linear-gradient(to bottom, var(--gray-300) 0%, var(--gray-200) 100%);
    border: 2px solid var(--gray-400);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.floorplan-marker.is-blinds .blinds-cover-mini {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--gray-600);
    transition: height 0.3s ease;
}

.floorplan-marker.is-blinds .blinds-percent-mini {
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Scene/Quick Action Marker */
.floorplan-marker.is-scene {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
}

.floorplan-marker.is-scene .marker-icon {
    background: rgba(255,255,255,0.2);
}

.floorplan-marker.is-scene .marker-label {
    color: white;
}

.floorplan-marker.is-scene:hover {
    filter: brightness(1.1);
}

.floorplan-marker.is-scene:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* RGB Light Marker */
.floorplan-marker.is-rgb {
    position: relative;
}

.floorplan-marker.is-rgb .rgb-glow {
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-lg);
    background: var(--rgb-color, #fff);
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}

.floorplan-marker.is-rgb .marker-icon {
    background: var(--rgb-color, var(--gray-500));
}

/* Floorplan List in Sidebar */
.floorplan-markers-list {
    max-height: 300px;
    overflow-y: auto;
}

.floorplan-marker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.floorplan-marker-item:hover {
    background: var(--gray-50);
}

.floorplan-marker-item .marker-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.floorplan-marker-item .marker-item-info {
    flex: 1;
    min-width: 0;
}

.floorplan-marker-item .marker-item-name {
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floorplan-marker-item .marker-item-value {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.floorplan-marker-item .marker-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.floorplan-marker-item:hover .marker-item-actions {
    opacity: 1;
}

/* Group items */
.floorplan-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s ease;
}

.floorplan-group-item:hover {
    background: var(--gray-50);
}

.floorplan-group-item .group-item-color {
    width: 8px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

.floorplan-group-item .group-item-info {
    flex: 1;
    min-width: 0;
}

.floorplan-group-item .group-item-name {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--gray-800);
}

.floorplan-group-item .group-item-count {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.floorplan-group-item .group-item-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.floorplan-group-item:hover .group-item-actions {
    opacity: 1;
}

/* Focus animation for markers */
@keyframes focus-pulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: var(--shadow-md); }
    50% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.3), var(--shadow-lg); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: var(--shadow-md); }
}

.floorplan-marker.is-focused {
    z-index: 100;
    box-shadow: 0 0 0 3px var(--primary-color), var(--shadow-lg);
}

/* Delete confirmation */
.floorplan-marker.is-deleting {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
}

.floorplan-list-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
}

.widgets-grid .card {
    margin-bottom: 0;
}

.widget-size-small {
    grid-column: span 1;
}

.widget-size-medium {
    grid-column: span 1;
}

.widget-size-large {
    grid-column: span 2;
}

/* Status Cards - Refined */
.status-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.status-card.online {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.status-card.offline {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.status-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.status-card.info {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #4f46e5 100%);
}

.text-orange {
    color: var(--warning-color) !important;
}

.status-card .status-icon {
    font-size: 2rem;
    opacity: 0.7;
}

.status-card .status-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.status-card .status-label {
    opacity: 0.85;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Hero Banner - Elegant Dark */
.hero-banner {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    transform: translate(30%, -30%);
}

.hero-banner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    transform: translate(-30%, 30%);
}

.hero-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.kpi-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    color: white;
    backdrop-filter: blur(8px);
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.kpi-label {
    opacity: 0.6;
    font-size: 0.8125rem;
    font-weight: 500;
}

.badge-soft {
    background: rgba(99,102,241,0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(99,102,241,0.2);
    font-weight: 500;
}

.metric-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.metric-value {
    font-weight: 600;
    color: var(--gray-900);
}

.glow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s ease-in-out infinite;
}

.glow-dot.offline { 
    background: var(--danger-color); 
}
.glow-dot.online { 
    background: var(--success-color); 
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Tables - Clean Design */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table th {
    border-top: none;
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    border-color: var(--gray-100);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

.badge-online {
    background-color: var(--success-color);
}

.badge-offline {
    background-color: var(--danger-color);
}

/* Forms - Refined */
.form-control, .form-select {
    border-radius: var(--radius);
    padding: 0.5rem 0.875rem;
    border-color: var(--gray-300);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.form-switch .form-check-input {
    height: 1.25rem;
    width: 2.25rem;
}

/* Buttons - Refined */
.btn {
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border: none;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5558e8, #7c4dff);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary {
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Modals - Clean */
.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 0.875rem 1.25rem;
    background: var(--gray-50);
}

/* Tabs in modals */
.modal .nav-tabs {
    border-bottom-color: var(--gray-200);
}

.modal .nav-tabs .nav-link {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.modal .nav-tabs .nav-link:hover {
    color: var(--gray-800);
    border-color: transparent;
}

.modal .nav-tabs .nav-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    background: transparent;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.spinner-border {
    color: var(--secondary-color);
}

/* Device Values */
.device-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.device-unit {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* Alerts */
.alert {
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

/* Progress bars */
.progress {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
}

.progress-bar {
    background: var(--secondary-color);
    border-radius: 3px;
}

.progress-bar.bg-success {
    background: var(--success-color) !important;
}

.progress-bar.bg-warning {
    background: var(--warning-color) !important;
}

/* Thermostat widget - Premium */
.thermo-card {
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow: hidden;
}

.thermo-dial {
    position: relative;
    width: 180px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 1rem;
    --dial-angle: 240deg;
    --setpoint-angle: 200deg;
    --accent: var(--secondary-color);
    cursor: pointer;
    touch-action: none;
}

.thermo-dial.locked {
    cursor: default;
}

.thermo-arc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 135deg,
        var(--gray-200) 0deg,
        var(--accent) calc(var(--dial-angle) * 0.75),
        var(--gray-200) calc(var(--dial-angle) * 0.75) 270deg
    );
    mask: radial-gradient(circle at center, transparent 62%, #000 64%);
    -webkit-mask: radial-gradient(circle at center, transparent 62%, #000 64%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.thermo-setpoint {
    position: absolute;
    inset: 0;
    transform: rotate(var(--setpoint-angle));
    pointer-events: none;
}

.thermo-setpoint .dot {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translate(-50%, 0);
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--accent);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease;
}

.thermo-dial:not(.locked):hover .thermo-setpoint .dot {
    transform: translate(-50%, 0) scale(1.15);
}

.thermo-dial.locked .thermo-setpoint .dot {
    opacity: 0.5;
    border-color: var(--gray-400);
}

.thermo-center {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-lg), inset 0 2px 8px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem;
}

.thermo-status {
    font-weight: 700;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
}

.thermo-status.on {
    color: white;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.thermo-status.off {
    color: var(--gray-500);
    background: var(--gray-100);
}

.thermo-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -0.03em;
}

.thermo-temp span {
    font-size: 1.25rem;
    color: var(--gray-400);
    font-weight: 500;
    margin-left: 0.1em;
}

.thermo-sub {
    color: var(--gray-400);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.thermo-meta {
    color: var(--gray-400);
    font-size: 0.7rem;
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
}

.thermo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.thermo-actions .btn {
    border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.thermo-toggle-btn {
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 600;
}

/* Light widget - Premium */
.light-card {
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.light-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.75rem;
}

.color-wheel {
    position: relative;
    width: 140px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 50%),
        conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.1),
        0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    touch-action: none;
    border: 3px solid white;
}

.color-wheel .wheel-pointer {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.1);
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
}

.color-wheel:active .wheel-pointer {
    transform: translate(-50%, -50%) scale(1.2);
}

.swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.swatch-row button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.swatch-row button:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.swatch-row.compact button {
    width: 18px;
    height: 18px;
}

.light-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.light-slider-label span:last-child {
    font-weight: 600;
    color: var(--gray-700);
}

/* Status tiles for dashboard */
.status-tile {
    padding: 1rem;
    border-radius: var(--radius-md);
    color: white;
    background: var(--gray-600);
}

.status-tile.online {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.status-tile.offline {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
}

/* Page header */
#pageTitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

#currentTime {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

#connectionStatus {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Empty states */
.text-muted {
    color: var(--gray-500) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-banner {
        padding: 1.25rem;
    }

    .hero-kpi {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Settings Page Tabs ===== */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.settings-tab:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.settings-tab.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.settings-tab i {
    font-size: 1rem;
}

/* ===== Settings Page Content ===== */
.settings-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.settings-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 50%;
    opacity: 0.1;
}

.settings-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.08;
}

.settings-header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.settings-header-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.settings-header-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin: 0;
}

.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.settings-section-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.settings-section-title i {
    color: var(--secondary-color);
}

.settings-section-body {
    padding: 1.25rem;
}

.settings-section-body:empty {
    padding: 0;
}

/* Settings Form Styles */
.settings-form-group {
    margin-bottom: 1.25rem;
}

.settings-form-group:last-child {
    margin-bottom: 0;
}

.settings-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.settings-form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

/* Settings Status Cards */
.settings-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.settings-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem;
}

.settings-stat-icon.primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
}

.settings-stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.settings-stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.settings-stat-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.settings-stat-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.settings-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.settings-stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Settings Toggle Row */
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.settings-toggle-row:last-child {
    border-bottom: none;
}

.settings-toggle-row:hover {
    background: var(--gray-50);
}

.settings-toggle-info {
    flex: 1;
}

.settings-toggle-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800);
}

.settings-toggle-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.settings-toggle-desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 1.25rem;
}

/* Settings List */
.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.settings-list-item:last-child {
    border-bottom: none;
}

.settings-list-item:hover {
    background: var(--gray-50);
}

.settings-list-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 1rem;
    flex-shrink: 0;
}

.settings-list-content {
    flex: 1;
    min-width: 0;
}

.settings-list-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.settings-list-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.settings-list-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    flex: 1;
}

.settings-list-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    text-align: right;
}

/* Settings Code Block */
.settings-code {
    background: var(--gray-900);
    color: var(--gray-100);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.settings-code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.settings-code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Settings Empty State */
.settings-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}

.settings-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.settings-empty-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.settings-empty-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.settings-empty-desc {
    font-size: 0.875rem;
}

/* Settings Alert */
.settings-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.settings-alert.info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.settings-alert.info i {
    color: var(--info-color);
}

.settings-alert.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.settings-alert.success i {
    color: var(--success-color);
}

.settings-alert.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.settings-alert.warning i {
    color: var(--warning-color);
}

.settings-alert i {
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.settings-alert-content {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
}

@media (max-width: 768px) {
    .settings-tabs {
        gap: 0.125rem;
        padding: 0.375rem;
    }
    
    .settings-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .settings-tab span {
        display: none;
    }
    
    .settings-tab i {
        margin: 0;
    }
    
    .settings-header {
        padding: 1.25rem;
    }
    
    .settings-header-title {
        font-size: 1.25rem;
    }
    
    .settings-stat-card {
        padding: 1rem;
    }
    
    .settings-stat-value {
        font-size: 1.5rem;
    }
}
