:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
}

.layout {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}
.sortable-ghost {
  opacity: 0.4;
  background: #cbd5e1 !important;
}
/* Control Panel */
.control-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.4rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.language-control .form-select {
  min-width: 120px;
}

.logs-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.subtitle {
  margin: 0 0 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.control-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-select {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #ffffff;
  font-size: 0.95rem;
  min-width: 260px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* 2-sloupcový CSS Grid */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Karta widgetu */
.widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Nastavení šířky */
.widget-card.span-half {
  grid-column: span 1;
}

.widget-card.span-full {
  grid-column: 1 / -1;
}

.widget-card-header {
  padding: 0.85rem 1.25rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-card-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.widget-card-body {
  padding: 1.25rem;
  flex: 1;
}

/* Vnitřek AppInfo widgetu */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.label {
  color: var(--text-muted);
}

.value {
  font-weight: 600;
}

.badge {
  background: #e2e8f0;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.api-statuses {
  margin: 1rem 0;
  padding-top: 0.5rem;
}

.widget-action {
  margin-top: 1rem;
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg-card);
}

/* Zobrazení logů */
.logs-console {
  background: #0f172a;
  color: #22c55e;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}
.api-status-section { margin-top: 1rem; }
.api-status-title { margin: 0 0 0.5rem; font-size: 0.95rem; }
.api-status-list { list-style: none; margin: 0; padding: 0; }

.api-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color, #eee);
}
.api-status-row:last-child { border-bottom: none; }

.api-status-name { color: var(--text-muted, #64748b); }

.api-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.api-status-badge.is-ok { color: #15803d; background: rgba(34, 197, 94, 0.12); }
.api-status-badge.is-error { color: #b91c1c; background: rgba(239, 68, 68, 0.12); }

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.api-status-time { font-weight: 400; opacity: 0.75; }
/* Responzivita (mobily a tablety) */
@media (max-width: 768px) {
  .panel-header,
  .logs-header,
  .logs-actions {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .widget-grid {
    grid-template-columns: 1fr;
  }
  .widget-card.span-full,
  .widget-card.span-half {
    grid-column: auto;
  }
}