:root {
  --bg: #f3f6ff;
  --card-bg: #ffffff;
  --blue-main: #3b82f6;
  --blue-soft: #dbeafe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #e0f2fe, transparent 60%),
    radial-gradient(circle at bottom right, #e5e7eb, transparent 60%),
    #eff4ff;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
}

.page {
  width: 100%;
  max-width: 980px;
  background: rgba(255,255,255,0.9);
  border-radius: 26px;
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 24px 70px rgba(15,23,42,0.14);
  padding: 20px 26px 24px;
  position: relative;
  overflow: hidden;
}

/* HEADER */

.top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.top-bar img.logo {
  height: 80px;
  object-fit: contain;
}

.title-wrap h1 {
  margin: 4px 0 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.title-wrap p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.badge {
  margin-top: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.65);
  color: var(--text-muted);
  background: rgba(248,250,252,0.8);
}

/* PANELS */

.panel {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  padding: 18px 18px 16px;
  margin-top: 8px;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--text-main);
}

/* CAMERA PILL */

.camera-row {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.camera-pill {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 70px;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* When camera is LIVE → pill is fully transparent (only dot visible) */
.camera-pill.camera-live {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Video: faint when paused, full when live */
.camera-pill video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
}

.camera-pill.camera-live video {
  opacity: 1;
}

/* Overlay: dot on far left */
.pill-overlay {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding-left: 12px;
  justify-content: flex-start;
  gap: 0;
}

.pill-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ef4444; /* red when paused */
}

.camera-live .pill-dot {
  background: #16a34a; /* green when live */
}

/* Hide text completely, in case the element still exists */
.pill-text {
  display: none;
}


/* SEARCH */

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-row input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.search-row button {
  border-radius: 999px;
  border: none;
  padding: 11px 18px;
  font-weight: 600;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(59,130,246,0.25);
}

/* TABLE */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

thead {
  background: #f1f5f9;
}

thead th {
  text-align: left;
  padding: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

tbody td {
  padding: 10px;
  border-top: 1px solid var(--border);
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:hover {
  background: #eef2ff;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(15,23,42,0.25);
  padding: 20px;
  width: 100%;
  max-width: 420px;
}

.modal-content h3 {
  margin-top: 0;
  color: var(--text-main);
}

.modal-row {
  margin-bottom: 10px;
}

.modal-row label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.modal-row input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.modal-actions button {
  border-radius: 999px;
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

#modal-ok {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  color: white;
}


/* ==== HOME / TOOL CARDS ==== */

.tool-section {
  margin-top: 6px;
}

.tool-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.tool-hero-text h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--text-main);
}

.tool-hero-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tool-card {
  display: block;
  padding: 16px 18px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #f9fbff);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 14px 35px rgba(15,23,42,0.14);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(15,23,42,0.2);
  border-color: rgba(59,130,246,0.55);
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.tool-card-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: #dbeafe;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.tool-card-pill-soft {
  background: #e5e7eb;
  color: #4b5563;
}

.tool-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--text-main);
}

.tool-card p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tool-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tool-card-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

/* mobile tweaks */
@media (max-width: 720px) {
  body { padding: 16px; }
  .page { padding: 18px 16px 20px; }
  .top-bar img.logo { height: 60px; }
  .tool-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ==== FOOTER ==== */

.app-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
