/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .55rem 1.1rem; border-radius: .5rem;
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  cursor: pointer; border: 1px solid transparent;
  transition: color 150ms, background-color 150ms, border-color 150ms, transform 150ms;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { border-color: var(--border); background: var(--card); color: var(--foreground); }
.btn-outline:hover:not(:disabled) { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn-danger { background: var(--destructive); color: var(--destructive-foreground); }
.btn-danger:hover:not(:disabled) { opacity: .9; }
.btn-gold { background: var(--gold); color: var(--primary-dark); }
.btn-gold:hover:not(:disabled) { filter: brightness(.95); }
.btn-sm { padding: .3rem .7rem; font-size: .75rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1rem; }

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}
.card-lg { border-radius: var(--radius-2xl); padding: 2rem; }

/* Forms */
.label {
  display: block; margin-bottom: .375rem;
  font-size: .75rem; font-weight: 600;
  color: var(--muted-foreground); text-transform: uppercase;
  letter-spacing: .03em;
}
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--input);
  border-radius: .5rem; background: var(--card);
  padding: .55rem .75rem; font-size: .875rem;
  font-family: var(--font-sans); color: var(--foreground);
  outline: none; transition: border-color 150ms, box-shadow 150ms;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 20%, transparent);
}
.field { margin-bottom: 1rem; }
.help { font-size: .75rem; color: var(--muted-foreground); margin-top: .25rem; }
.error { font-size: .75rem; color: var(--destructive); margin-top: .25rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  border-radius: 9999px; padding: .125rem .625rem;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: color-mix(in oklab, var(--success) 12%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in oklab, var(--warning) 18%, transparent); color: oklch(0.55 0.15 70); }
.badge-danger  { background: color-mix(in oklab, var(--destructive) 12%, transparent); color: var(--destructive); }
.badge-info    { background: var(--primary-soft); color: var(--primary); }
.badge-gold    { background: var(--gold-soft); color: oklch(0.42 0.09 80); }
.badge-neutral { background: var(--muted); color: var(--muted-foreground); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.th {
  padding: .75rem 1rem; text-align: left; font-size: .75rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .025em;
  color: var(--muted-foreground); border-bottom: 1px solid var(--border);
}
.td {
  padding: .75rem 1rem; font-size: .875rem;
  border-bottom: 1px solid var(--border);
}
.tr:hover .td { background: var(--accent); }

/* Nav */
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .55rem .75rem; border-radius: .5rem;
  font-size: .875rem; font-weight: 500;
  color: var(--muted-foreground);
  transition: color 150ms, background-color 150ms;
}
.nav-item:hover { background: var(--accent); color: var(--accent-foreground); }
.nav-item-active { background: var(--primary); color: var(--primary-foreground); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: color-mix(in oklab, var(--foreground) 45%, transparent);
  backdrop-filter: blur(4px);
  animation: fadeIn 150ms ease-out;
}
.modal {
  width: 100%; max-width: 520px; border-radius: 1.5rem;
  background: var(--card); box-shadow: var(--shadow-elevated);
  animation: zoomIn 180ms ease-out;
}
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: scale(1) } }

/* Layout helpers */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.grid { display: grid; gap: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: .875rem; } .text-xs { font-size: .75rem; }


/* Password field with show/hide toggle */
.password-wrap { position: relative; display: block; }
.password-wrap .input { padding-right: 2.75rem; }
.password-toggle {
  position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent;
  color: var(--muted-foreground);
  border-radius: .4rem; cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--accent); color: var(--accent-foreground); outline: none;
}

/* --------------------------------------------------
   Session timeout warning modal
   -------------------------------------------------- */
.librya-timeout-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: color-mix(in oklab, var(--foreground) 55%, transparent);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms ease-out;
}

.librya-timeout-card {
  width: 100%;
  max-width: 380px;
  padding: 2rem 1.75rem;
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-elevated);
  text-align: center;
  animation: zoomIn 200ms ease-out;
}

.librya-timeout-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.librya-timeout-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 .5rem;
}

.librya-timeout-card p {
  font-size: .9rem;
  color: var(--muted-foreground);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.librya-timeout-count {
  display: inline-block;
  font-weight: 800;
  color: var(--destructive);
  font-size: 1.3rem;
  min-width: 2ch;
  padding: 0 .2rem;
}

.librya-timeout-actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
}