:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dce4ee;
  --border-strong: #c6d2e1;
  --primary: #0b63ce;
  --primary-soft: #eaf3ff;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  --ok-text: #065f46;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  --err-text: #991b1b;
  --radius: 12px;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #eef5ff 0%, var(--bg) 35%, #f6f8fc 100%);
  color: var(--text);
  line-height: 1.45;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.topbar {
  background: linear-gradient(180deg, #0b1220 0%, #111c30 100%);
  color: #dbe7ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #3b82f6 0%, #0b63ce 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px rgba(11, 99, 206, 0.35);
}

.brand-text strong {
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-muted {
  color: #94a3b8;
  font-weight: 600;
  margin-left: 4px;
}

.top-links {
  display: flex;
  gap: 16px;
}

.top-links a {
  color: #d3ddf0;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.top-links a:hover {
  color: #ffffff;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 24px 36px;
}

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

.login-panel {
  max-width: 380px;
  margin: 52px auto;
}

.login-form,
.config-form {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-row label {
  min-width: 140px;
}

.filter-row select {
  min-width: 120px;
}

.config-form textarea {
  width: 100%;
  max-width: 100%;
  min-height: 116px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  display: block;
  resize: vertical;
  background: #fff;
}

.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: #334155;
}

input,
select,
button {
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
button:focus,
textarea:focus {
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
  border-color: #93c5fd;
}

button {
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  transition: 0.15s ease;
}

button:hover {
  border-color: #9fb6d3;
}

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

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

.flash {
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.flash.ok {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.flash.err {
  border-color: var(--err-border);
  background: var(--err-bg);
  color: var(--err-text);
}

.flash.warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.muted {
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.tab-list {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  border: 1px solid var(--border-strong);
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
}

.tab-btn[aria-selected="true"] {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

th,
td {
  border-bottom: 1px solid #e9eef5;
  text-align: left;
  padding: 12px 11px;
  vertical-align: top;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover td {
  background: #f6faff;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.btn-open {
  display: inline-block;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  text-decoration: none;
  color: #0f172a;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  width: 34px;
  height: 34px;
  justify-content: center;
  padding: 0;
}

.btn-open:hover {
  background: var(--primary-soft);
  border-color: #aac8ee;
}

.btn-open-icon {
  font-size: 12px;
  line-height: 1;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.exclude-form-inline {
  margin: 0;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #25d366;
  color: #fff;
  flex-shrink: 0;
}

.btn-wa:hover {
  background: #20bd5a;
  color: #fff;
}

.btn-wa svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inner {
  display: grid;
  gap: 8px;
}

.msg {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip {
  background: #e8f1ff;
  color: #184f99;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
}

.inline-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.upload-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin-top: 12px;
}

button.secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

button.secondary:hover {
  border-color: var(--muted);
}
