* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Theme: Coral Pink - 珊瑚粉 */
[data-theme="coral"] {
    --bg-primary: #FFF0F0;
    --bg-secondary: #FFE5E5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 240, 240, 0.6);
    --border-color: rgba(255, 127, 127, 0.2);
    --text-primary: #4A3333;
    --text-secondary: #6B4D4D;
    --text-muted: #9A7A7A;
    --accent: #FF7F7F;
    --accent-hover: #FF6B6B;
    --accent-light: #FFD4D4;
    --accent-gradient: linear-gradient(135deg, #FF7F7F 0%, #FFA5A5 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #E5A55A;
}

/* Theme: Caramel - 焦糖棕 */
[data-theme="caramel"] {
    --bg-primary: #FDF6EE;
    --bg-secondary: #F5E6D3;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(253, 246, 238, 0.6);
    --border-color: rgba(166, 124, 82, 0.2);
    --text-primary: #3D2E1F;
    --text-secondary: #5C4A38;
    --text-muted: #8B7355;
    --accent: #A67C52;
    --accent-hover: #8B6642;
    --accent-light: #E8D5C0;
    --accent-gradient: linear-gradient(135deg, #A67C52 0%, #C9A67A 100%);
    --success: #7CB98B;
    --danger: #C97B7B;
    --warning: #D4A55A;
}

/* Theme: Sunset - 日落橙黄 */
[data-theme="sunset"] {
    --bg-primary: #FFF4E6;
    --bg-secondary: #FFE4CC;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 244, 230, 0.6);
    --border-color: rgba(255, 140, 66, 0.2);
    --text-primary: #4A3325;
    --text-secondary: #6B5040;
    --text-muted: #9A7E66;
    --accent: #FF8C42;
    --accent-hover: #E67532;
    --accent-light: #FFD9BE;
    --accent-gradient: linear-gradient(135deg, #FF8C42 0%, #FFAA70 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #F5A55A;
}

/* Theme: Peach - 蜜桃杏色 */
[data-theme="peach"] {
    --bg-primary: #FFF5ED;
    --bg-secondary: #FFECD9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 245, 237, 0.6);
    --border-color: rgba(255, 166, 125, 0.2);
    --text-primary: #4A3530;
    --text-secondary: #6B524A;
    --text-muted: #9A7D73;
    --accent: #FFA67D;
    --accent-hover: #FF8C5A;
    --accent-light: #FFE0CC;
    --accent-gradient: linear-gradient(135deg, #FFA67D 0%, #FFBF9E 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #F5B55A;
}

/* ========== COOL THEMES ========== */

/* Theme: Ocean Blue - 海洋蓝 */
[data-theme="ocean"] {
    --bg-primary: #EEF4FA;
    --bg-secondary: #E0ECF5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(238, 244, 250, 0.6);
    --border-color: rgba(59, 130, 200, 0.2);
    --text-primary: #1E3A5F;
    --text-secondary: #3D5A80;
    --text-muted: #6B8CAE;
    --accent: #3B82C8;
    --accent-hover: #2563A8;
    --accent-light: #BFDBF7;
    --accent-gradient: linear-gradient(135deg, #3B82C8 0%, #60A5E8 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #E5A55A;
}

/* Theme: Mint Green - 薄荷绿 */
[data-theme="mint"] {
    --bg-primary: #EEFAF5;
    --bg-secondary: #E0F5EC;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(238, 250, 245, 0.6);
    --border-color: rgba(72, 187, 148, 0.2);
    --text-primary: #1E4D3D;
    --text-secondary: #3D7A64;
    --text-muted: #6BA88E;
    --accent: #48BB94;
    --accent-hover: #38A07D;
    --accent-light: #BEF0DC;
    --accent-gradient: linear-gradient(135deg, #48BB94 0%, #6DD5B0 100%);
    --success: #48BB94;
    --danger: #E07B7B;
    --warning: #E5A55A;
}

/* Theme: Lavender - 薰衣草紫 */
[data-theme="lavender"] {
    --bg-primary: #F5F0FA;
    --bg-secondary: #EBE4F5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(245, 240, 250, 0.6);
    --border-color: rgba(139, 92, 200, 0.2);
    --text-primary: #3D2E5C;
    --text-secondary: #5C4A7A;
    --text-muted: #8B7AAE;
    --accent: #8B5CC8;
    --accent-hover: #7342B5;
    --accent-light: #D9CCF0;
    --accent-gradient: linear-gradient(135deg, #8B5CC8 0%, #A87DE0 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #E5A55A;
}

/* Theme: Sky Cyan - 天空青 */
[data-theme="sky"] {
    --bg-primary: #EEF8FA;
    --bg-secondary: #E0F2F5;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(238, 248, 250, 0.6);
    --border-color: rgba(56, 189, 210, 0.2);
    --text-primary: #1E4A52;
    --text-secondary: #3D7580;
    --text-muted: #6BA3AE;
    --accent: #38BDD2;
    --accent-hover: #28A3B8;
    --accent-light: #BEF0F7;
    --accent-gradient: linear-gradient(135deg, #38BDD2 0%, #5DD5E8 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #E5A55A;
}

/* Default theme fallback */
:root {
    --bg-primary: #FFF4E6;
    --bg-secondary: #FFE4CC;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 244, 230, 0.6);
    --border-color: rgba(255, 140, 66, 0.2);
    --text-primary: #4A3325;
    --text-secondary: #6B5040;
    --text-muted: #9A7E66;
    --accent: #FF8C42;
    --accent-hover: #E67532;
    --accent-light: #FFD9BE;
    --accent-gradient: linear-gradient(135deg, #FF8C42 0%, #FFAA70 100%);
    --success: #7CB98B;
    --danger: #E07B7B;
    --warning: #F5A55A;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    gap: 8px;
}

.theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-btn:hover {
    transform: scale(1.15);
}

.theme-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.theme-btn[data-theme="coral"] {
    background: linear-gradient(135deg, #FF7F7F 0%, #FFA5A5 100%);
}

.theme-btn[data-theme="caramel"] {
    background: linear-gradient(135deg, #A67C52 0%, #C9A67A 100%);
}

.theme-btn[data-theme="sunset"] {
    background: linear-gradient(135deg, #FF8C42 0%, #FFAA70 100%);
}

.theme-btn[data-theme="peach"] {
    background: linear-gradient(135deg, #FFA67D 0%, #FFBF9E 100%);
}

/* Cool theme buttons */
.theme-btn[data-theme="ocean"] {
    background: linear-gradient(135deg, #3B82C8 0%, #60A5E8 100%);
}

.theme-btn[data-theme="mint"] {
    background: linear-gradient(135deg, #48BB94 0%, #6DD5B0 100%);
}

.theme-btn[data-theme="lavender"] {
    background: linear-gradient(135deg, #8B5CC8 0%, #A87DE0 100%);
}

.theme-btn[data-theme="sky"] {
    background: linear-gradient(135deg, #38BDD2 0%, #5DD5E8 100%);
}

/* Theme group separator */
.theme-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 24px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 14px;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

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

/* Stats Cards */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card:nth-child(1) .stat-value { color: var(--accent); }
.stat-card:nth-child(2) .stat-value { color: var(--success); }
.stat-card:nth-child(3) .stat-value { color: var(--text-muted); }
.stat-card:nth-child(4) .stat-value { color: var(--warning); }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Device List */
.device-list {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Device Card */
.device-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.device-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.device-card:last-child {
    margin-bottom: 0;
}

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

.device-id {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.device-status {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.device-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.device-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    font-size: 13px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

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

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-warning:hover {
    background: #d97706;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.detail-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: var(--text-primary);
    font-size: 14px;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-info span {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 6px;
    color: var(--success);
    font-weight: 600;
}

.balance-display svg {
    color: var(--success);
}

/* Modal Large */
.modal-large {
    max-width: 800px;
}

/* Account Tabs */
.account-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.account-tab-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.account-tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.account-tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    color: white;
}

.balance-card .balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.balance-card .balance-label {
    font-size: 14px;
    opacity: 0.8;
}

/* Recharge Options */
.recharge-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.recharge-option {
    background: var(--bg-glass);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recharge-option:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.recharge-option.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.15);
}

.recharge-option .amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.recharge-option .unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.recharge-option .description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Records Table */
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.records-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.records-table td {
    color: var(--text-secondary);
}

.records-table tr:hover td {
    background: var(--bg-glass);
}

.records-table .amount-positive {
    color: var(--success);
}

.records-table .amount-negative {
    color: var(--danger);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Admin User List */
.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

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

.user-list-item .user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-list-item .user-role {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-secondary);
}

.user-list-item .user-role.admin {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.user-list-item .user-balance {
    color: var(--success);
    font-weight: 600;
}

.user-list-item .user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 用户禁用状态 */
.user-list-item.user-disabled {
    opacity: 0.7;
    background: var(--bg-secondary);
}

.user-list-item .user-info-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-list-item .user-status-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.user-list-item .user-status-badge.disabled {
    background: rgba(224, 123, 123, 0.2);
    color: var(--danger);
}

.user-list-item .admin-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(124, 185, 139, 0.2);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(224, 123, 123, 0.2);
    color: var(--danger);
}

/* Config Item */
.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
}

.config-item .config-label {
    font-weight: 500;
    color: var(--text-primary);
}

.config-item .config-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.config-item .config-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-item input {
    width: 100px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: right;
}

/* Empty State Small */
.empty-state-small {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-buttons a {
    text-decoration: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px 16px;
    }

    header h1 {
        font-size: 16px;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px 10px;
    }

    .user-info .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .status-indicator {
        display: none;
    }

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

    .stat-card {
        padding: 12px;
    }

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

    .stat-label {
        font-size: 11px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 12px;
        flex: 1;
        justify-content: center;
    }

    .device-list {
        padding: 12px;
        min-height: 300px;
    }

    .device-card {
        padding: 12px 14px;
    }

    .device-id {
        font-size: 13px;
    }

    .device-status {
        padding: 4px 8px;
        font-size: 10px;
    }

    .device-info {
        grid-template-columns: 1fr;
        gap: 6px;
        font-size: 12px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }

    .modal-content h2 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .modal-large {
        max-width: 100%;
    }

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

    .control-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .account-tabs {
        gap: 6px;
    }

    .account-tab-btn {
        padding: 6px 10px;
        font-size: 11px;
        flex: 1;
        text-align: center;
    }

    .balance-card {
        padding: 16px;
    }

    .balance-card .balance-amount {
        font-size: 28px;
    }

    .recharge-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .recharge-option {
        padding: 12px;
    }

    .recharge-option .amount {
        font-size: 20px;
    }

    .records-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
    }

    .records-table th,
    .records-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .user-list-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .user-list-item .user-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .config-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .config-item .config-value {
        width: 100%;
    }

    .config-item input {
        flex: 1;
    }

    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    body {
        padding: 8px;
    }

    header h1 {
        font-size: 14px;
    }

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

    .stat-value {
        font-size: 20px;
    }

    .recharge-options {
        grid-template-columns: 1fr 1fr;
    }

    .account-tab-btn {
        font-size: 10px;
        padding: 5px 8px;
    }
}

/* QR Scanner */
.qr-scanner-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
}

#qr-reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#qr-reader video {
    width: 100%;
    border-radius: 12px;
}

.scan-result {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.scan-result.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.scan-result.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.add-device-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.add-device-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.add-device-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .add-device-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }

    .add-device-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Manual input */
.manual-input-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.manual-input-section h4 {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.input-with-btn input:focus {
    outline: none;
    border-color: var(--accent);
}

.input-with-btn input::placeholder {
    color: var(--text-muted);
}
