/* ------------------------- Styles ------------------------- */


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  background: #f5f5f5;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1a3c5e;
  color: #fff;
}
.navbar .brand { font-weight: bold; font-size: 18px; }
.navbar nav { display: flex; align-items: center; gap: 16px; }
.navbar a { color: #fff; text-decoration: none; }
.navbar a:hover { text-decoration: underline; }

.content { max-width: 720px; margin: 40px auto; padding: 0 20px; }

.footer {
  text-align: center;
  padding: 20px;
  color: #777;
  font-size: 13px;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 24px;
}

.form-row { margin-bottom: 12px; }
.form-row label { display: block; margin-bottom: 4px; font-size: 14px; }
.form-row input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  background: #1a3c5e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #15314d; }

.error { color: #b00020; margin-bottom: 12px; }
.notice { color: #1a6e2e; margin-bottom: 12px; }

.required { color: #b00020; font-weight: bold; }

/* Inline + block code (API keys, usage examples). */
code {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
}
.code {
  display: block;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
.token-box {
  font-family: "Courier New", Courier, monospace;
  background: #f0f0f0;
}

.hidden { display: none; }
.switch { margin-top: 14px; font-size: 14px; }
.switch a { color: #1a3c5e; cursor: pointer; }

/* Wider container for table-heavy pages (e.g. invoice history). */
.content-wide { max-width: 960px; }

/* ------------------------- Tables ------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e3e3e3;
  vertical-align: middle;
}
.table thead th {
  background: #f0f3f6;
  color: #1a3c5e;
  border-bottom: 2px solid #d4dae1;
  white-space: nowrap;
}
.table tbody tr:hover { background: #fafbfc; }
.table td form { margin: 0; }
.table td .btn { padding: 6px 12px; font-size: 13px; }

/* Status pills for invoices. */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: bold;
}
.badge-pending { background: #e7f0fb; color: #2a5a8c; }
.badge-open { background: #fff3cd; color: #8a6d3b; }
.badge-paid { background: #d4edda; color: #1a6e2e; }
.badge-void { background: #e2e3e5; color: #555; }


/* ------------------------- Support Chat ------------------------- */
.chat-window {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  padding: 14px;
  height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.chat-msg {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  font-size: 14px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.chat-user { background: #1a3c5e; color: #fff; }
.chat-agent { background: #e9edf1; color: #222; }
.chat-empty { color: #777; text-align: center; padding: 20px; }
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #ccc;
  border-top-color: #1a3c5e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }