/* Dashboard CSS */
:root {
    --dash-primary: #0ea5e9;
    --dash-success: #10b981;
    --dash-warning: #f59e0b;
    --dash-danger: #ef4444;
    --dash-card-bg: rgba(255, 255, 255, 0.8);
    --dash-text: #1e293b;
}

/* 2-column top info grid (reviews + node status) */
.top-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .top-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Node Status Widget */
.node-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.ns-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.ns-dot.online { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.ns-dot.offline { background: #ef4444; }

.node-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.3rem;
}
.node-list::-webkit-scrollbar { width: 5px; }
.node-list::-webkit-scrollbar-track { background: transparent; }
.node-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.node-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    transition: background 0.2s;
}
.node-item:hover { background: #f1f5f9; }

.node-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.node-type-icon.http  { background: rgba(14,165,233,0.12); color: #0ea5e9; }
.node-type-icon.https { background: rgba(16,185,129,0.12); color: #10b981; }
.node-type-icon.tcp   { background: rgba(245,158,11,0.12); color: #f59e0b; }
.node-type-icon.udp   { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.node-type-icon.ping  { background: rgba(239,68,68,0.12);  color: #ef4444; }

.node-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.node-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--dash-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.node-host {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}
.node-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #64748b;
    background: #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
}
.node-status-dot {
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
.node-status-dot::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.node-status-dot.online  { color: #10b981; }
.node-status-dot.online::before  { background: #10b981; box-shadow: 0 0 5px rgba(16,185,129,0.6); animation: pulse-green 1.8s infinite; }
.node-status-dot.offline { color: #ef4444; }
.node-status-dot.offline::before { background: #ef4444; }

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 5px rgba(16,185,129,0.6); }
    50% { box-shadow: 0 0 10px rgba(16,185,129,0.9); }
}

.dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dash-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--dash-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.stat-info .stat-label {
    font-size: 0.9rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dash-text);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dash-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dash-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.security-reminders {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reminder-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border-left: 4px solid var(--dash-primary);
}

.reminder-item.warning { border-left-color: var(--dash-warning); background: #fffbeb; }
.reminder-item.danger { border-left-color: var(--dash-danger); background: #fef2f2; }

.reminder-icon {
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.reminder-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.reminder-content p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem; /* space for scrollbar */
}

/* Custom Scrollbar for activity lists */
.activity-list::-webkit-scrollbar {
    width: 6px;
}
.activity-list::-webkit-scrollbar-track {
    background: transparent;
}
.activity-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.activity-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.activity-item {
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #f1f5f9;
}

.activity-main {
    display: flex;
    flex-direction: column;
}

.activity-comment {
    font-size: 0.9rem;
    font-weight: 500;
}

.activity-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.activity-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.tag-deposit { background: #dcfce7; color: #166534; }
.tag-order { background: #e0f2fe; color: #075985; }
.tag-system { background: #f1f5f9; color: #475569; }

/* Recent Reviews Widget */
.recent-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.recent-reviews-list::-webkit-scrollbar { width: 5px; }
.recent-reviews-list::-webkit-scrollbar-track { background: transparent; }
.recent-reviews-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.recent-reviews-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.rr-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
    transition: background 0.2s;
}

.rr-item:hover {
    background: #f1f5f9;
}

.rr-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rr-body {
    flex: 1;
    min-width: 0;
}

.rr-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}

.rr-username {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--dash-text);
    letter-spacing: 0.5px;
}

.rr-stars {
    display: flex;
    gap: 2px;
    color: #f59e0b;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.rr-comment {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rr-product {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rr-product i {
    color: var(--dash-primary);
    font-size: 0.7rem;
}

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
