:root{
  /* Neutrals */
  --app-bg: #f3f5f9;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-border: #e3e7ed;
  --app-border-strong: #ccd3dd;

  --app-text: #1c2430;
  --app-muted: #667085;
  --app-link: #2955a3;

  /* Accent — calm navy, suited to a legal practice */
  --app-primary: #2955a3;
  --app-primary-dark: #1f3f80;
  --app-primary-soft: #eaf0f9;

  --app-success-bg: #ecfdf3;
  --app-success-border: #bbf7d0;
  --app-success-text: #15803d;

  --app-warning-bg: #fffaeb;
  --app-warning-border: #fde68a;
  --app-warning-text: #a15c07;

  --app-danger-bg: #fef2f2;
  --app-danger-border: #fecaca;
  --app-danger-text: #b42318;

  --app-info-bg: #eff4fb;
  --app-info-border: #bfd4ec;
  --app-info-text: #1f3f80;

  --app-radius-sm: 8px;
  --app-radius-md: 12px;
  --app-radius-lg: 16px;

  --app-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --app-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);

  --app-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html,
body{
  min-height: 100%;
}

body{
  margin: 0;
  font-family: var(--app-font-sans);
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*{
  box-sizing: border-box;
}

a{
  color: var(--app-link);
}

a:hover{
  color: var(--app-primary-dark);
}

h1,
h2,
h3,
h4{
  color: var(--app-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1{
  margin: 0 0 16px 0;
  font-size: 26px;
}

h2{
  margin: 0 0 18px 0;
  font-size: 21px;
}

h3{
  font-size: 17px;
  font-weight: 600;
}

h4{
  font-size: 15px;
  font-weight: 600;
}

button,
input,
select,
textarea{
  font: inherit;
}

input,
select,
textarea{
  border: 1px solid var(--app-border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--app-text);
}

input:focus,
select:focus,
textarea:focus{
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(41, 85, 163, 0.14);
}

hr{
  border: 0;
  border-top: 1px solid var(--app-border);
  margin: 18px 0;
}

/* Forms / status helpers */

.form-error-box{
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--app-danger-border);
  background: var(--app-danger-bg);
  color: var(--app-danger-text);
  border-radius: var(--app-radius-md);
  font-weight: 600;
}

.status-text-danger{
  color: var(--app-danger-text);
  font-weight: 600;
}

.status-text-success{
  color: var(--app-success-text);
  font-weight: 600;
}

.user-link{
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.user-link:hover{
  text-decoration: underline;
}

/* Notification bell */

.notification-bell{
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: #fff;
  color: #475467;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.notification-bell svg{
  width: 18px;
  height: 18px;
}

.notification-bell:hover{
  background: var(--app-surface-soft);
  color: var(--app-text);
  border-color: var(--app-border-strong);
}

.notification-badge{
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notification-wrapper{
  position: relative;
  display: inline-flex;
}

.notification-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: var(--app-shadow-md);
  padding: 10px;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.notification-dropdown.is-open{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-dropdown-title{
  padding: 8px 10px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 8px;
}

.notification-empty{
  padding: 12px 10px;
  color: var(--app-muted);
  font-size: 13px;
  text-align: center;
}

.notification-item{
  display: grid;
  gap: 4px;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.notification-item + .notification-item{
  margin-top: 8px;
}

.notification-item span{
  color: #344054;
}

.notification-item.is-unread{
  opacity: 1;
  box-shadow: inset 3px 0 0 currentColor;
}

.notification-item.is-read{
  opacity: .55;
  font-weight: 500;
}

.notification-item-success{
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
}

.notification-item-error{
  background: #fef2f2;
  border-color: #fecaca;
  color: #b42318;
}

.notification-item-warning{
  background: #fffaeb;
  border-color: #fde68a;
  color: #a15c07;
}

.notification-item-info,
.notification-item-debug{
  background: #eff4fb;
  border-color: #bfd4ec;
  color: #1f3f80;
}

/* Token block overlay */

.token-block-overlay{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(127, 29, 29, 0.92);
}

.token-block-overlay.is-visible{
  display: flex;
}

.token-block-card{
  max-width: 420px;
  width: 100%;
  background: #fff;
  border-radius: var(--app-radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.token-block-icon{
  font-size: 40px;
  margin-bottom: 12px;
}

.token-block-card h2{
  margin: 0 0 10px;
  font-size: 20px;
  color: #7f1d1d;
}

.token-block-card p{
  margin: 0 0 20px;
  color: var(--app-text);
  font-size: 15px;
  line-height: 1.5;
}

/* Toasts */

.toast-stack{
  position: fixed;
  top: 84px;
  right: 28px;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast{
  pointer-events: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-left-width: 4px;
  box-shadow: var(--app-shadow-md);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible{
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-hiding{
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.toast-icon{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.toast-body{
  display: grid;
  gap: 3px;
  min-width: 0;
}

.toast-body strong{
  font-size: 14px;
  font-weight: 700;
  color: var(--app-text);
}

.toast-body span{
  font-size: 13px;
  line-height: 1.4;
  color: #475467;
  overflow-wrap: anywhere;
}

.toast-close{
  border: 0;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
}

.toast-close:hover{
  color: var(--app-text);
}

.toast-success{
  border-color: #bbf7d0;
  border-left-color: #15803d;
}

.toast-success .toast-icon{
  background: #ecfdf3;
  color: #15803d;
}

.toast-error{
  border-color: #fecaca;
  border-left-color: #b42318;
}

.toast-error .toast-icon{
  background: #fef2f2;
  color: #b42318;
}

.toast-warning{
  border-color: #fde68a;
  border-left-color: #a15c07;
}

.toast-warning .toast-icon{
  background: #fffaeb;
  color: #a15c07;
}

.toast-info,
.toast-debug{
  border-color: #bfd4ec;
  border-left-color: #1f3f80;
}

.toast-info .toast-icon,
.toast-debug .toast-icon{
  background: #eff4fb;
  color: #1f3f80;
}

/* Utilities */

.u-inline-form{
  display: inline;
}

.u-inline-form-spaced{
  display: inline;
  margin-left: 8px;
}

.u-mt-6{
  margin-top: 6px;
}

.u-mt-8{
  margin-top: 8px;
}

.u-mt-14{
  margin-top: 14px;
}

.u-mt-16{
  margin-top: 16px;
}

.u-mb-12{
  margin-bottom: 12px;
}

.u-muted{
  opacity: 0.6;
}

.u-hidden{
  display: none;
}

.u-center-empty{
  padding: 24px;
  text-align: center;
  color: var(--app-muted);
}
