:root {
    --bg: #0f1117;
    --surface-0: #161b22;
    --surface-1: #1c2128;
    --surface-2: #21262d;
    --border: #30363d;
    --border-strong: #484f58;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #656d76;
    --text-accent: #58a6ff;
    --text-success: #3fb950;
    --text-warning: #d29922;
    --text-danger: #f85149;
    --fill-accent: #1f6feb;
    --fill-success: #238636;
    --fill-warning: #9e6a03;
    --fill-danger: #da3633;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
}

.shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--surface-0);
    border-right: 1px solid var(--border);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo i { font-size: 20px; color: var(--text-accent); margin-right: 8px; }
.sidebar-logo span { font-size: 16px; font-weight: 600; }
.sidebar-logo small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.nav-section {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 16px 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    font-size: 13px;
}

.nav-item:hover { background: var(--surface-1); color: var(--text-primary); }
.nav-item.active { color: var(--text-accent); border-left-color: var(--fill-accent); background: rgba(31,111,235,0.1); }
.nav-item i { font-size: 17px; }

/* Main */
.main { flex: 1; padding: 24px; overflow-y: auto; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.topbar h1 { font-size: 18px; font-weight: 500; }
.topbar h1 i { margin-right: 8px; }

/* Stats grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.stat label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.stat .val { font-size: 22px; font-weight: 500; }
.stat .sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* Cards */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 0 8px 10px 0; border-bottom: 1px solid var(--border); }
td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--border); color: var(--text-primary); }
tr:last-child td { border-bottom: none; }

/* Badges */
.badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 500; }
.badge-ok { background: rgba(35,134,54,0.2); color: var(--text-success); }
.badge-warn { background: rgba(158,106,3,0.2); color: var(--text-warning); }
.badge-danger { background: rgba(218,54,51,0.2); color: var(--text-danger); }

/* Dots */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot-ok { background: var(--text-success); }
.dot-err { background: var(--text-danger); }
.dot-off { background: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
}

.btn:hover { background: var(--surface-1); }
.btn-primary { background: var(--fill-accent); border-color: var(--fill-accent); color: white; }
.btn-primary:hover { background: #388bfd; }
.btn-danger { background: var(--fill-danger); border-color: var(--fill-danger); color: white; }
.btn-secondary { background: var(--surface-2); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
}
.form-control:focus { outline: none; border-color: var(--fill-accent); }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-control { width: auto; flex: 1; min-width: 150px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box { width: 380px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo i { font-size: 40px; color: var(--text-accent); display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 22px; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--text-muted); }
.login-footer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 20px; }

/* Alert */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.alert-danger { background: rgba(218,54,51,0.15); border: 1px solid var(--fill-danger); color: var(--text-danger); }

/* Mono */
.mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; }

/* Log box */
.log-box { background: var(--surface-0); border-radius: 6px; padding: 12px; max-height: 400px; overflow-y: auto; }
.log-line { font-family: monospace; font-size: 12px; color: var(--text-secondary); padding: 2px 0; border-bottom: 1px solid var(--border); }
.log-line:last-child { border: none; }

/* Config box */
.config-box { background: var(--surface-0); border-radius: 6px; padding: 16px; font-family: monospace; font-size: 12px; color: var(--text-secondary); margin-bottom: 14px; white-space: pre-wrap; }

/* Quick actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Country grid */
.country-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* Text */
.text-muted { color: var(--text-muted); font-size: 13px; }

/* Hamburger tlačítko */
.hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: var(--surface-1);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* Overlay pro mobil */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.overlay.active { display: block; }

/* Tablet */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
}

/* Mobil */
@media (max-width: 768px) {
    .hamburger { display: block; }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .sidebar.open { left: 0; }

    .main {
        padding: 16px;
        padding-top: 56px;
        width: 100%;
    }

    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .two-col { grid-template-columns: 1fr; }

    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .topbar h1 { font-size: 16px; }

    .inline-form { flex-direction: column; }
    .inline-form .form-control { width: 100%; min-width: unset; }

    table { font-size: 12px; }
    th, td { padding: 6px 4px 6px 0; }

    .quick-actions { flex-direction: column; }
    .quick-actions .btn { width: 100%; justify-content: center; }

    .login-box { width: 95%; padding: 24px 16px; }
}

/* Velmi malý mobil */
@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat .val { font-size: 18px; }
}
