.flag-icon {
    width: 22px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    display: block;
}
.country-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
tr.updating {
    background-color: rgba(59, 130, 246, 0.1) !important;
    transition: background-color 0.3s;
}
tr.flash-update {
    animation: flash 1s;
}
@keyframes flash {
    0% { background-color: rgba(16, 185, 129, 0.3); }
    100% { background-color: transparent; }
}
.toast-container { z-index: 10000; }
.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
.toast-body { font-size: 13px; display: flex; align-items: center; gap: 10px; }
:root {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --color-primary: #3b82f6;
}
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
.app-container {
    transition: filter 0.3s;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}
.blur-content { filter: blur(10px); pointer-events: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--bg-input); border-radius: 4px; }
.tools-container {
    height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    padding-bottom: 10px;
}
.table-container {
    flex: 1 1 auto !important;
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    overflow-y: auto !important;
}
thead th {
    background-color: #0f172a;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 8px;
    cursor: pointer;
    user-select: none;
}
thead th:hover { color: white; background-color: #1a253a; }
.table td { vertical-align: middle; border-bottom: 1px solid var(--border-color); height: 40px; padding: 2px 8px; }
.st-active { color: #4ade80 !important; font-weight: bold; text-shadow: 0 0 8px rgba(74, 222, 128, 0.15); }
.st-dead { color: #f87171 !important; font-weight: bold; }
.st-wait { color: #64748b; }
.ping-good { color: #34d399; }
.ping-med { color: #fbbf24; }
.ping-bad { color: #f87171; }
.gateway-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
.gateway-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px currentColor;
}
.gateway-status-dot.alive { background-color: #4ade80; }
.gateway-status-dot.dead { background-color: #f87171; }
.gateway-status-dot.unknown { background-color: #64748b; }
.gateway-ip {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #60a5fa;
    letter-spacing: 0.5px;
}
.gateway-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 1px;
}
tr.gateway-row {
    background-color: rgba(30, 58, 138, 0.3) !important;
    border-left: 3px solid #3b82f6 !important;
}
tr.gateway-row:hover {
    background-color: rgba(30, 58, 138, 0.45) !important;
}
.gateway-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
input.editable, textarea.editable {
    background: transparent; border: 1px solid transparent;
    color: var(--text-main); width: 100%; text-align: center;
    padding: 2px; border-radius: 4px; transition: 0.2s; font-size: 12px;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
    min-height: 24px;
}
input.editable:focus, textarea.editable:focus {
    background: var(--bg-body); outline: none; border-color: var(--color-primary);
}
.nav-tabs .nav-link.active { background-color: var(--bg-card); color: var(--color-primary); border-color: var(--border-color); border-bottom-color: var(--bg-card); font-weight: 600; }
.nav-tabs .nav-link { color: var(--text-muted); cursor: pointer; }
.tab-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 10px;
    border-radius: 0 0 8px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.tab-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.tab-pane.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}
.card { background-color: var(--bg-card); border-color: var(--border-color); }
.stat-item { background: rgba(255,255,255,0.03); padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }
.stat-val { font-weight: 700; font-size: 14px; line-height: 1; }
.progress { height: 2px; background: var(--bg-body); margin-top: -1px; }
.progress-bar { background-color: var(--color-primary); }
