/* search */
.search-box {
    position: relative; display: flex; align-items: center;
    background: var(--bg-input); border-radius: var(--radius);
    padding: 6px 12px; transition: var(--transition);
    border: 1px solid transparent;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.search-icon { flex-shrink: 0; color: var(--text-muted); margin-right: 8px; }
.search-box input {
    width: 100%; background: none; border: none; outline: none;
    color: var(--text); font-size: 0.875rem;
}
.search-box input::placeholder { color: var(--text-muted); }

/* service card */
.service-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none;
}
.service-card[data-health="up"] { border-left-color: var(--green); }
.service-card[data-health="down"] { border-left-color: var(--red); }
.service-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--border-hover);
}
.service-card[data-health="up"]:hover {
    border-left-color: var(--green);
    box-shadow: var(--shadow), 0 0 12px var(--green-dim);
}
.service-card[data-health="down"]:hover {
    border-left-color: var(--red);
    box-shadow: var(--shadow), 0 0 12px var(--red-dim);
}
.service-card .svc-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--bg-icon, var(--bg-input)); display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0; overflow: hidden;
    transition: var(--transition);
}
.service-card:hover .svc-icon { background: rgba(30, 40, 68, 0.65); }
.service-card .svc-icon img { width: 32px; height: 32px; object-fit: contain; }
.service-card .svc-body { flex: 1; min-width: 0; }
.service-card .svc-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-card .svc-desc { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-card .svc-status {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.svc-status.up { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.svc-status.down { background: var(--red); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.svc-status.unknown { background: var(--text-muted); opacity: 0.5; }

/* system widgets */
.sys-widget {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border);
    backdrop-filter: blur(12px); min-width: 140px;
    flex: 1; transition: var(--transition);
}
.sys-widget:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.sys-info { display: flex; flex-direction: column; }
.sys-val { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); }
.sys-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.ring { width: 46px; height: 46px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }

/* topbar buttons */
.topbar-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); transition: var(--transition);
    position: relative;
}
.topbar-btn:hover { background: var(--bg-input); color: var(--text); }
.topbar-btn span { font-size: 0.75rem; font-weight: 600; }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--red); color: #fff; font-size: 0.6rem;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* user menu */
.user-menu { position: relative; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; cursor: pointer;
    transition: var(--transition);
}
.user-avatar:hover { box-shadow: var(--shadow-glow); }
.user-dropdown {
    display: none; position: absolute; right: 0; top: 44px;
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius);
    min-width: 180px; padding: 8px 0; box-shadow: var(--shadow);
    z-index: 200;
}
.user-dropdown.open { display: block; }
.user-info { padding: 10px 16px; }
.user-info strong { display: block; font-size: 0.9rem; }
.user-info small { color: var(--text-muted); font-size: 0.75rem; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-item { width: 100%; text-align: left; padding: 8px 16px; font-size: 0.85rem; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-input); }

/* loading */
.loading-text { text-align: center; color: var(--text-muted); padding: 40px; }

/* drag & drop */
.service-card.dragging { opacity: 0.4; transform: scale(0.95); }
.drag-placeholder {
    border: 2px dashed var(--accent-glow); border-radius: var(--radius);
    background: rgba(99, 102, 241, 0.05);
}

/* notifications dropdown */
.notif-dropdown {
    display: none; position: absolute; right: 0; top: 44px;
    width: 300px; max-height: 400px; overflow-y: auto;
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); z-index: 200;
    scrollbar-width: thin;
}
.notif-dropdown.open { display: block; }
.notif-empty, .notif-loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.notif-item {
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--bg-input); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-text { font-size: 0.82rem; line-height: 1.3; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.4); }

/* icon letter fallback */
.icon-letter {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    color: var(--text); font-weight: 700; font-size: 17px;
    border-radius: inherit;
}
