body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: #333333;
  padding: 10px;
  margin: 0;
  box-sizing: border-box;
}

.container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
}

.top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.top-header-bar h2 {
  color: #1e293b;
  margin: 0;
  font-size: 16px;
  border: none;
  padding: 0;
}

.btn-admin-mode {
  background: #475569;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  font-weight: bold;
  width: auto;
  margin: 0;
}

.btn-admin-mode.logged-in {
  background: #10b981;
  color: #fff;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  padding: 10px 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 11px;
  border-radius: 5px 5px 0 0;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.tab-content {
  display: none;
  background: #ffffff;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 12px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #475569;
  font-size: 13px;
  text-align: left;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 13px;
  display: block;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

textarea {
  height: 220px;
  font-family: monospace;
  resize: vertical;
}

button {
  border: none;
  padding: 11px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  margin-top: 5px;
  box-sizing: border-box;
  display: block;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

.btn-blue {
  background: #2563eb;
  color: #fff;
}

.btn-green {
  background: #16a34a;
  color: #fff;
}

.btn-orange {
  background: #ea580c;
  color: #fff;
}

.btn-purple {
  background: #9333ea;
  color: #fff;
}

.btn-red {
  background: #dc2626;
  color: #fff;
}

.btn-teal {
  background: #0d9488;
  color: #fff;
}

.btn-amber {
  background: #d97706;
  color: #fff;
}

.cred-box {
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  border: 1px dashed #94a3b8;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.flex-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.flex-inputs input,
.flex-inputs select {
  flex: 1;
  min-width: 0;
}

.list-card-item {
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.card-dns-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-dns-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-all;
}

.card-dns-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-mini {
  padding: 6px 12px;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block;
  text-align: center;
}

.worker-list-container {
  max-height: 250px;
  overflow-y: auto;
  background: #ffffff;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.result-box {
  background: #f0fdf4;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  border: 1px solid #22c55e;
  color: #166534;
  text-align: left;
  display: none;
}

.acc-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  background: #ffffff;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.acc-badge {
  background: #e2e8f0;
  color: #1e293b;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  border: 1px solid #cbd5e1;
}

.acc-badge.active {
  background: #3b82f6;
  color: #fff;
  border-color: #2563eb;
}

.acc-badge .del-acc {
  color: #ef4444;
  font-weight: bold;
  cursor: pointer;
  margin-left: 5px;
  font-size: 14px;
}

.btn-top-add {
  background: #0284c7;
  color: #fff;
  margin-bottom: 10px;
  font-size: 13px;
  padding: 10px;
  border-radius: 5px;
}

#input-account-form {
  display: none;
  margin-top: 10px;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.status-box-routing {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: bold;
}

.cf-runtime-card {
  background: #f8fafc;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-top: 15px;
  text-align: left;
}

.cf-runtime-card h4 {
  margin: 0 0 12px 0;
  color: #1e293b;
  font-size: 14px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.help-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

.lower-input {
  text-transform: lowercase;
}

.token-display-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  display: block;
  text-align: left;
}

.btn-copy {
  background: #16a34a;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  width: auto;
  display: inline-block;
  margin-top: 4px;
}

.api-guide-box-red {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #991b1b;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 12px;
  text-align: left;
  line-height: 1.5;
}

.api-guide-box-red a {
  color: #dc2626;
  text-decoration: underline;
  font-weight: bold;
}

.preset-pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.preset-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  border: 1px solid #cbd5e1;
}

.preset-pill:hover {
  background: #e2e8f0;
}

.preset-pill .del-preset {
  color: #ef4444;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 2px;
}

.preset-add-btn {
  background: #10b981;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-weight: bold;
  border: none;
  width: auto;
  margin: 0;
}

.admin-only-item {
  display: none !important;
}

body.is-admin .admin-only-item {
  display: inline-block !important;
}

.footer-visitor-container {
  border-top: 1px solid #e2e8f0;
  padding-top: 15px;
  margin-top: 25px;
  box-sizing: border-box;
}

.visitor-stat-inline {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-scroll-box {
  max-height: 160px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  margin-top: 4px;
  box-sizing: border-box;
}

.mini-log-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: #475569;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
  word-break: break-all;
}

.mini-log-item:last-child {
  border-bottom: none;
}

.ssl-scroll-wrapper {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 15px;
}

.ssl-target-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  text-align: left;
}

.ip-table-wrapper {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: auto;
  margin-top: 5px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-sizing: border-box;
}

.ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.ip-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  padding: 8px;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  z-index: 2;
}

.ip-table td {
  padding: 8px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.ip-table tr:nth-child(even) {
  background: #f8fafc;
}

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 15px;
  box-sizing: border-box;
}

.modal-box {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  color: #1e293b;
  word-break: break-all;
}

.modal-close-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-weight: bold;
  cursor: pointer;
  width: auto;
  margin: 0;
}

.modal-body {
  padding: 12px 15px;
  overflow-y: auto;
  flex: 1;
  text-align: left;
}

.modal-body textarea {
  width: 100%;
  height: 320px;
  font-family: monospace;
  font-size: 12px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}
