/* TaskBook — shared UI components (modal, toast, forms) */

.tb-toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.tb-toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1A2B48;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(26, 43, 72, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.tb-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tb-toast.is-success {
  background: #065F46;
}

.tb-toast.is-error {
  background: #991B1B;
}

.tb-toast.is-info {
  background: #1E3A8A;
}

.tb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tb-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.tb-modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.tb-backdrop.is-open .tb-modal {
  transform: translateY(0);
}

.tb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #E5E7EB;
}

.tb-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A2B48;
}

.tb-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tb-modal-close:hover {
  background: #F3F4F6;
  color: #1A2B48;
}

.tb-modal-body {
  padding: 16px 20px 8px;
}

.tb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid #E5E7EB;
}

.tb-field {
  margin-bottom: 14px;
}

.tb-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 6px;
}

.tb-label .req {
  color: #EF4444;
}

.tb-input,
.tb-select,
.tb-textarea {
  width: 100%;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #1A2B48;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tb-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

.tb-input:focus,
.tb-select:focus,
.tb-textarea:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.tb-input.is-invalid,
.tb-select.is-invalid,
.tb-textarea.is-invalid {
  border-color: #FCA5A5;
}

.tb-error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  color: #EF4444;
}

.tb-error.is-visible {
  display: block;
}

.tb-hint {
  margin-top: 4px;
  font-size: 12px;
  color: #9CA3AF;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tb-btn-primary {
  background: #1A2B48;
  color: #FFFFFF;
}

.tb-btn-primary:hover {
  background: #132038;
}

.tb-btn-secondary {
  background: #FFFFFF;
  border-color: #E5E7EB;
  color: #1A2B48;
}

.tb-btn-secondary:hover {
  background: #F9FAFB;
}

.tb-btn-danger {
  background: #EF4444;
  color: #FFFFFF;
}

.tb-btn-danger:hover {
  background: #DC2626;
}

.tb-empty {
  padding: 36px 24px;
  text-align: center;
  color: #6B7280;
  font-size: 14px;
}

.tb-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tb-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
}

.tb-settings-item p {
  font-size: 13px;
  color: #6B7280;
  margin-top: 2px;
}

.tb-settings-item strong {
  font-size: 14px;
  color: #1A2B48;
}

.team-empty {
  padding: 32px 24px;
  text-align: center;
  color: #64748B;
  font-size: 14px;
}

.tb-status-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}

.tb-status-banner.is-visible {
  display: block;
}

.tb-status-banner.is-warning {
  background: #FEF3C7;
  color: #92400E;
  border-bottom: 1px solid #FCD34D;
}

.tb-status-banner.is-error {
  background: #FEE2E2;
  color: #991B1B;
  border-bottom: 1px solid #FECACA;
}

.tb-status-banner.is-info {
  background: #DBEAFE;
  color: #1E40AF;
  border-bottom: 1px solid #93C5FD;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 14px;
  background: #1A2B48;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.team-skeleton {
  padding: 8px 0;
}

.team-skeleton-row {
  height: 72px;
  margin: 8px 24px;
  border-radius: 10px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: tb-skeleton 1.2s ease-in-out infinite;
}

@keyframes tb-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .team-skeleton-row,
  .tb-toast,
  .tb-backdrop,
  .tb-modal {
    animation: none !important;
    transition: none !important;
  }
}

.user-avatar {
  border: none;
  font: inherit;
  padding: 0;
}
