* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
    color: #e5e7eb;
}

/* Telegram WebApp может подставлять свой фон, но мы оставляем свой как дефолт */

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.app-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1f2937;
}

.app-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.app-header p {
    font-size: 0.9rem;
    color: #9ca3af;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.card {
    background: #020617;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
    border: 1px solid #1f2937;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
    border-color: #3b82f6;
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: #e5e7eb;
}

.card .value {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card .sub {
    font-size: 0.85rem;
    color: #9ca3af;
}

.services h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.services-list {
    background: #020617;
    border-radius: 14px;
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #1f2937;
}

/* Тёмный аккуратный скролл */
.services-list::-webkit-scrollbar {
    width: 6px;
}
.services-list::-webkit-scrollbar-track {
    background: #020617;
}
.services-list::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 999px;
}
.services-list::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.service-item {
    border-bottom: 1px solid #1f2937;
    padding: 6px 0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-name {
    font-weight: 500;
}

.service-status {
    font-size: 0.85rem;
    margin-top: 2px;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 999px;
    margin-right: 4px;
}

.badge-enabled {
    background: #064e3b;
    color: #bbf7d0;
}

.badge-disabled {
    background: #7f1d1d;
    color: #fecaca;
}

.badge-active {
    background: #065f46;
    color: #a7f3d0;
}

.badge-inactive {
    background: #4b5563;
    color: #e5e7eb;
}

.badge-failed {
    background: #7f1d1d;
    color: #fecaca;
}

.badge-other {
    background: #1f2937;
    color: #e5e7eb;
}

.muted {
    font-size: 0.8rem;
    color: #9ca3af;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.8rem;
    padding-top: 8px;
    border-top: 1px solid #1f2937;
}

#refresh-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.45);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
}

#refresh-btn:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.65);
    background: #1d4ed8;
}

#refresh-btn:active {
    transform: scale(0.97);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.8);
}

.status {
    font-size: 0.8rem;
    margin-right: 8px;
}

.status.ok {
    color: #22c55e; /* зелёный */
}

.status.err {
    color: #ef4444; /* красный */
}
