:root {
  --bg: #ffffff;
  --text: #111111;
  --accent: #7c3aed;
  --border: #e5e7eb;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

input {
  font-family: inherit;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  padding: 24px 16px;
  border-right: 1px solid var(--accent);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.sidebar h1 {
  font-size: 20px;
  margin: 0 0 24px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.sidebar-item {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.sidebar-item.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.sidebar-logout {
  width: 100%;
  margin-top: 16px;
}

.main-content {
  margin-left: 220px;
  padding: 32px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.danger {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #dc2626;
}

.btn.btn-small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.login-card {
  width: 360px;
  margin: 15vh auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
}

.login-card h2 {
  margin-top: 0;
}

.login-card p {
  color: var(--muted);
}

.login-card form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-card .form-field {
  width: 100%;
  max-width: 280px;
}

.login-card .form-field label {
  text-align: left;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.error {
  color: #b91c1c;
  font-size: 14px;
  margin-top: 8px;
}

.success {
  color: #16a34a;
  font-size: 14px;
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.notice {
  z-index: 40;
}

.modal-backdrop.trial-ended {
  background: rgba(15, 23, 42, 0.75);
  z-index: 50;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
}

.modal h3 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.notice-message {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.trial-ended-modal {
  max-width: 520px;
  text-align: center;
  border: 2px solid #111111;
  padding: 32px;
}

.trial-ended-title {
  margin: 0 0 24px;
  font-size: 28px;
  line-height: 1.2;
}

.trial-ended-btn {
  font-size: 16px;
  padding: 12px 20px;
}

.payload-pre {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 60vh;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

.phone-input {
  display: flex;
  align-items: center;
}

.phone-prefix {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  background: #f9fafb;
  color: var(--muted);
}

.phone-input input {
  border-radius: 0 6px 6px 0;
  border-left: none;
  flex: 1;
}

.table-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
}
