/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  width: 14.5rem;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  background: #1e293b;
  border-right: 1px solid #334155;
}

.sidebar-brand {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sidebar-brand a {
  color: #e2e8f0;
  text-decoration: none;
}

.sidebar-user {
  margin: 0.4rem 0 1.25rem;
  font-size: 0.8rem;
  color: #94a3b8;
  word-break: break-all;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  color: #e2e8f0;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #334155;
}

.sidebar-subnav {
  list-style: none;
  margin: 0.15rem 0 0.4rem;
  padding: 0 0 0 0.75rem;
}

.sidebar-subnav a {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
}

.sidebar .auth-button {
  width: 100%;
  margin-top: 0;
}

.app-content {
  flex: 1;
  min-width: 0;
}

main {
  max-width: 40rem;
  margin: 20vh auto 0;
  padding: 0 1.5rem;
}

body.signed-in main {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

main.admin {
  max-width: 56rem;
}

.admin-panel,
.admin-subpanel {
  margin-top: 1.25rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #1e293b;
}

.admin-subpanel {
  background: #0f172a;
}

.admin-panel > summary,
.admin-subpanel > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.admin-panel > summary::-webkit-details-marker,
.admin-subpanel > summary::-webkit-details-marker {
  display: none;
}

.admin-panel > summary::before,
.admin-subpanel > summary::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  margin-right: 0.35rem;
  color: #94a3b8;
}

.admin-panel[open] > summary::before,
.admin-subpanel[open] > summary::before {
  content: "▾";
}

.admin-panel-body {
  padding: 0 1rem 1rem;
}

.admin-collapse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-collapse-toolbar .auth-button {
  margin-top: 0;
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.admin-user-card {
  padding: 0.85rem 1rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
}

.admin-user-form {
  margin-top: 0;
  width: 100%;
  gap: 0.75rem;
}

.admin-user-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1rem;
  width: 100%;
}

.admin-user-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.admin-user-field label {
  font-size: 0.85rem;
  color: #94a3b8;
}

.admin-user-field input,
.admin-user-field select {
  width: 100%;
  box-sizing: border-box;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-user-actions .auth-button {
  margin-top: 0;
}

.admin-user-meta {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
  word-break: break-all;
}

.admin-user-meta code {
  color: #94a3b8;
  font-size: 0.8rem;
}

main.admin input[type="email"],
main.admin input[type="tel"] {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

main.credit-cards,
main.notifications,
main.todos {
  max-width: 72rem;
}

.table-scroll {
  overflow-x: auto;
}

main.credit-cards .table-scroll,
main.notifications .table-scroll,
main.todos .table-scroll {
  border: 1px solid #334155;
  border-radius: 0.5rem;
}

main.credit-cards table,
main.notifications table,
main.todos table {
  margin-top: 0;
}

main.credit-cards thead th,
main.notifications thead th,
main.todos thead th {
  background: #1e293b;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
}

main.credit-cards tbody td,
main.notifications tbody td,
main.todos tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1e293b;
}

main.credit-cards tbody td {
  white-space: nowrap;
}

main.credit-cards tbody tr:last-child td,
main.notifications tbody tr:last-child td,
main.todos tbody tr:last-child td {
  border-bottom: 0;
}

main.credit-cards tbody tr:hover td,
main.notifications tbody tr:hover td,
main.todos tbody tr:hover td {
  background: #1e293b;
}


h1 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
}

p {
  line-height: 1.5;
  color: #94a3b8;
}

strong {
  color: #38bdf8;
}

.flash.notice {
  color: #86efac;
}

.flash.alert {
  color: #fca5a5;
}

.toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
}

.toast {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  line-height: 1.4;
  cursor: pointer;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-0.4rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-button {
  appearance: none;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #e2e8f0;
  font: inherit;
  cursor: pointer;
}

.auth-button:hover {
  background: #334155;
}

.auth-button.danger {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
  font-weight: 650;
}

.auth-button.danger:hover {
  background: #991b1b;
}

a.auth-button {
  display: inline-block;
  text-decoration: none;
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.button-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.4rem;
  border: 2px solid #64748b;
  border-top-color: #e2e8f0;
  border-radius: 50%;
  vertical-align: -0.15rem;
  animation: spin 0.6s linear infinite;
}

.button-spinner[hidden] {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

main.profile {
  margin: 3rem auto 4rem;
}

main.profile h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

main.profile a {
  color: #38bdf8;
}

.bank,
.connection {
  margin-top: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid #1e293b;
}

.bank ul,
.connection ul {
  padding-left: 1.25rem;
  color: #94a3b8;
}

form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.inline-form {
  margin-top: 0.75rem;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form .auth-button {
  margin-top: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="time"],
textarea {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.assistant-prompt-form {
  width: 100%;
  max-width: 40rem;
}

.assistant-prompt-form textarea {
  width: 100%;
  min-height: 8rem;
}

select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
}

.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #334155;
  color: #38bdf8;
  font-size: 0.75rem;
}

.badge-live {
  margin-left: 0;
  background: #14532d;
  color: #86efac;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-draft {
  margin-left: 0;
  background: #334155;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
}

main h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

select[multiple] {
  min-width: 22rem;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem;
  font: inherit;
}

table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid #1e293b;
}

.snapshot {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #1e293b;
}

.snapshot h2 {
  margin-top: 0;
}

.nicknames {
  margin-top: 2rem;
  width: 100%;
  max-width: 40rem;
}

.nickname-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  width: 100%;
}

.nickname-row label {
  flex: 1 1 16rem;
  color: #cbd5e1;
}

.nickname-row input[type="text"] {
  flex: 1 1 12rem;
}

main.legal {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

main.legal a,
.legal-note a {
  color: #38bdf8;
}

.legal-note {
  margin-top: 1rem;
  font-size: 0.85rem;
}

main.legal ul,
main.legal ol {
  padding-left: 1.25rem;
  color: #94a3b8;
  line-height: 1.5;
}

.sms-opt-in {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 36rem;
}

.sms-opt-in .button_to {
  margin-top: 0;
  width: 100%;
}

.sms-opt-in .auth-button.danger {
  width: 100%;
  margin-top: 0;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
}

.sms-opt-in-form {
  margin-top: 0.75rem;
  width: 100%;
  gap: 0.75rem;
}

.sms-opt-in-form input[type="tel"] {
  width: 100%;
  max-width: 22rem;
  box-sizing: border-box;
}

.sms-opted-in,
.sms-opted-out {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
}

.sms-opted-in {
  background: #14532d;
  border: 1px solid #22c55e;
  color: #bbf7d0;
}

.sms-opted-out {
  background: #7f1d1d;
  border: 1px solid #f87171;
  color: #fecaca;
}

.sms-disclosure {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.sms-opt-in-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.sms-opt-in-actions .legal-note {
  margin-top: 0;
}

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

.checkbox-set {
  margin-top: 0.5rem;
  padding: 0;
  border: 0;
}

.checkbox-set legend {
  padding: 0;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.snapshot-json,
.snapshot-body {
  overflow: auto;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.4rem;
  background: #0f172a;
  color: #86efac;
  font-size: 0.85rem;
}

main.todos .todo-add {
  margin-top: 1.25rem;
}

main.todos .todo-add input[type="text"] {
  width: 18rem;
  max-width: 100%;
}

main.todos .todo-add input[type="date"] {
  width: 9.5rem;
}

.todo-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
}

main.todos table form {
  margin: 0;
  display: inline;
  flex-direction: unset;
  align-items: unset;
  gap: 0;
}

.todo-star {
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 0;
  background: none;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.todo-star.active {
  color: #fbbf24;
}

.todo-actions {
  white-space: nowrap;
}

main.todos table .todo-actions form + form {
  margin-left: 0.75rem;
}

.todo-actions button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #38bdf8;
  font: inherit;
  cursor: pointer;
}

.todo-actions button.danger {
  color: #fca5a5;
}

main.admin input[type="text"] {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

