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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1f2937;
  font-size: 14px;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 20px;
}

/* Topbar */
.topbar {
  background: #111827;
  color: #fff;
  padding: 14px 0;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-nav {
  display: flex;
  gap: 16px;
}

.topbar a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 13px;
}

.topbar a:hover {
  color: #fff;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Headings */
h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; margin: 0 0 14px; color: #374151; }

/* Login page */
.logo_wrap {
  grid-column-gap: 2.5%;
  grid-row-gap: 2.5%;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  max-width: 250px;
  display: flex;
  position: relative;
  margin: 0 auto;
}
.logo_symbol {
  flex: none;
  width: 15%;
  margin-top: 5%;
}
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

/* Forms */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.login-form label span,
.inline-form label span {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.login-form input,
.inline-form input[type="text"],
.inline-form input[type="email"],
.inline-form input[type="password"],
.inline-form input[type="date"],
.inline-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.login-form input:focus,
.inline-form input:focus {
  outline: none;
  border-color: #111827;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

/* Buttons */
button {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #000;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  margin-top: 0;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 2px solid #e5e7eb;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.data-table code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Detail Table (key-value) */
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th {
  text-align: left;
  padding: 8px 12px 8px 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  width: 140px;
  border-bottom: 1px solid #f3f4f6;
}

.detail-table td {
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 13px;
}

.pagination a {
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover {
  text-decoration: underline;
}

/* Error */
.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Links */
a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Newsletter app additions */
.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 260px;
}

.brand-link {
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.brand-mark,
.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 800;
}

.login-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: #111827;
  color: #fff;
  font-size: 21px;
}

.account-switcher {
  margin: 0;
}

.account-switcher select,
.inline-form select,
.compact-form select {
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

.topbar .account-switcher select {
  background: #1f2937;
  color: #fff;
  border-color: #374151;
  max-width: 220px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin-bottom: 6px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: #111827;
  color: #fff !important;
  font-size: 13px;
  text-decoration: none !important;
  white-space: nowrap;
}

.button-link:hover {
  background: #000;
}

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.flash-success,
.success-box {
  background: #d1fae5;
  color: #065f46;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.success-box {
  padding: 12px;
  border-radius: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stat-label {
  display: block;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  color: #111827;
  margin-bottom: 8px;
}

.stat-card small {
  color: #6b7280;
}

.checklist {
  display: grid;
  gap: 10px;
  color: #374151;
}

.checklist.left {
  text-align: left;
  max-width: 620px;
  margin: 18px auto 0;
}

.check {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  margin-right: 8px;
}

.empty-state {
  text-align: center;
  padding: 42px;
}

.empty-state p {
  color: #6b7280;
  max-width: 680px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.settings-form {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.settings-form label span {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.settings-form input,
.settings-form select,
.inline-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-form {
  margin: 0;
}

.badge-neutral {
  background: #eef2ff;
  color: #3730a3;
}

.truncate {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-card {
  margin-bottom: 24px;
  background: #ecfdf5;
  border: 2px solid #10b981;
}

.token-card h2 {
  color: #065f46;
}

.token-box {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
  border: 1px solid #d1d5db;
}

@media (max-width: 980px) {
  .topbar-inner,
  .topbar-nav,
  .brand-block,
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-nav {
    gap: 10px;
    margin-top: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
