:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #22d3ee;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --bg-dark: #e8f4f8;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --border-color: rgba(200, 220, 230, 0.5);
    --shadow-glow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f9ff 50%, #e8f4f8 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-icon {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: iconFloat 3s ease-in-out infinite;
}

.login-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    color: var(--danger);
    font-size: 14px;
    text-align: center;
    display: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.dashboard {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.dashboard.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.realtime-clock {
    text-align: right;
}

.clock-time {
    font-size: 28px;
    font-weight: 700;
    font-feature-settings: "tnum";
    background: linear-gradient(135deg, #0891b2, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clock-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, var(--success), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 10px 18px;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.status-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.status-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.status-card-icon.mqtt {
    background: rgba(74, 222, 128, 0.15);
    color: #16a34a;
}

.status-card-icon.device {
    background: rgba(74, 222, 128, 0.15);
    color: #16a34a;
}

.status-card-icon.door {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    animation: pulse 2s infinite;
}

.status-badge.disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.locked {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.unlocked {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.status-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.status-card .status-value {
    font-size: 24px;
    font-weight: 700;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 16px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.control-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn.sending {
    pointer-events: none;
}

.control-btn.sending::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.control-btn-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
    transition: var(--transition);
}

.control-btn:hover .control-btn-icon {
    transform: scale(1.1);
}

.control-btn.unlock .control-btn-icon {
    background: rgba(74, 222, 128, 0.2);
    color: #16a34a;
}

.control-btn.lock .control-btn-icon {
    background: rgba(248, 113, 113, 0.2);
    color: #dc2626;
}

.control-btn.ping .control-btn-icon {
    background: rgba(96, 165, 250, 0.2);
    color: #2563eb;
}

.control-btn.buzz .control-btn-icon {
    background: rgba(167, 139, 250, 0.2);
    color: #7c3aed;
}

.control-btn h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.control-btn p {
    font-size: 12px;
    color: var(--text-secondary);
}

.log-stream {
    height: 450px;
    overflow-y: auto;
    background: transparent;
    border-radius: 0;
    padding: 8px;
}

.log-stream::-webkit-scrollbar {
    width: 5px;
}

.log-stream::-webkit-scrollbar-track {
    background: transparent;
}

.log-stream::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.log-stream::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    animation: logSlide 0.3s ease-out;
    transition: var(--transition);
}

.log-entry:last-child {
    margin-bottom: 0;
}

.log-entry:hover {
    background: rgba(248, 250, 252, 0.9);
    border-color: var(--border-color);
    transform: translateX(3px);
}

@keyframes logSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-entry.send {
    border-left: 3px solid var(--secondary);
}

.log-entry.error {
    border-left: 3px solid var(--danger);
    background: rgba(254, 242, 242, 0.9);
}

.log-entry.system {
    border-left: 3px solid var(--success);
}

.log-entry.receive {
    border-left: 3px solid var(--primary);
}

.log-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(226, 232, 240, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.log-content {
    flex: 1;
    min-width: 0;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.log-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.log-time {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
}

.log-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.history-tabs {
    display: flex;
    gap: 8px;
}

.history-tab {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.history-tab:hover,
.history-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.history-list {
    height: 350px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.5);
}

.history-item:hover {
    background: rgba(248, 250, 252, 0.9);
}

.history-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.history-icon.unlock {
    background: rgba(74, 222, 128, 0.15);
    color: #16a34a;
}

.history-icon.lock {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
}

.history-icon.rfid {
    background: rgba(96, 165, 250, 0.15);
    color: #2563eb;
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.history-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-time {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-clear:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: toastSlide 0.4s ease-out;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    font-size: 24px;
}

.toast-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }

    .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }

    .realtime-clock {
        text-align: left;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 32px 24px;
    }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

.control-btn.stats .control-btn-icon {
    background: rgba(251, 191, 36, 0.2);
    color: #d97706;
}

.stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.stats-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.stats-modal-container {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: slideUp 0.4s ease-out;
}

.stats-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 24px 24px 0 0;
}

.stats-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.stats-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

.stats-modal-body {
    padding: 32px;
}

.stats-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stats-filters label {
    font-weight: 600;
    color: var(--text-primary);
}

.stats-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.stats-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-date-input {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.stats-date-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.unlock {
    background: rgba(74, 222, 128, 0.15);
    color: #16a34a;
}

.stat-icon.lock {
    background: rgba(248, 113, 113, 0.15);
    color: #dc2626;
}

.stat-icon.rfid {
    background: rgba(96, 165, 250, 0.15);
    color: #2563eb;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stats-charts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-container {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-container canvas {
    max-height: 300px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.chart-half canvas {
    max-height: 250px;
}

@media (max-width: 768px) {
    .stats-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .stats-modal-header {
        padding: 20px 24px;
    }

    .stats-modal-header h2 {
        font-size: 20px;
    }

    .stats-modal-body {
        padding: 24px 20px;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .stats-filters {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}