@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --bg: #edf4f3;
  --panel: #ffffff;
  --panel-soft: #f5fbfa;
  --border: #d7e6e4;
  --text: #132321;
  --muted: #3f5f5c;
  --brand: #1fa4b4;
  --brand-dark: #12737f;
  --accent: #f4b740;
  --ok: #31bf78;
  --warn: #f59e0b;
  --alert: #ef4444;
  --shadow: 0 12px 28px rgba(11, 41, 42, 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(31, 164, 180, 0.18), transparent 35%),
    radial-gradient(circle at 96% 14%, rgba(244, 183, 64, 0.18), transparent 34%),
    linear-gradient(180deg, #f4f9f8 0%, var(--bg) 100%);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(18, 115, 127, 0.28);
}

.brand-title { font-size: 18px; font-weight: 700; }
.brand-subtitle { font-size: 12px; color: var(--brand-dark); text-transform: uppercase; letter-spacing: 1px; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f1f8f7;
  color: var(--muted);
  font-size: 12px; font-weight: 700;
}

.content { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.panel-head h2 { font-size: 15px; margin: 0; }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-row .input { flex: 1 1 180px; }
.filter-select { max-width: 260px; }

.input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 164, 180, 0.15); }

.btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f1f8f7;
  color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: #b9d6d2; background: #e8f5f3; color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(18, 115, 127, 0.25);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }

.btn-danger { color: var(--alert); border-color: #f6d1d1; background: #fff3f3; }
.btn-danger:hover { color: #fff; background: var(--alert); border-color: var(--alert); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--panel-soft); vertical-align: middle; }
.table tr:hover td { background: var(--panel-soft); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.on { color: #0d6b3f; background: #e9fbf2; border: 1px solid #bdebd2; }
.badge.off { color: #8a1c1c; background: #fff3f3; border: 1px solid #f6d1d1; }

.mono { font-family: "JetBrains Mono", monospace; }

.msg { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.msg.error { color: var(--alert); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 41, 42, 0.45);
  display: grid; place-items: center;
  padding: 20px; z-index: 50;
}
.modal {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 560px; width: 100%;
}
.modal h3 { margin: 0 0 6px; }
.modal-note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.key-box {
  background: #0f1f1d; color: #d6f5ef;
  border-radius: 10px; padding: 12px 14px;
  word-break: break-all; font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
