:root {
  --background: #FFFFFF;
  --foreground: #6B4C3B;
  --card: #FFFFFF;
  --card-foreground: #6B4C3B;
  --primary: #A03A3A;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F1ED;
  --secondary-foreground: #6B4C3B;
  --muted: #F8F5F2;
  --muted-foreground: #8B6F5F;
  --accent: #FF6B6B;
  --accent-foreground: #FFFFFF;
  --destructive: #E74C3C;
  --destructive-foreground: #FFFFFF;
  --border: #E8DDD4;
  --input: #F5F1ED;
  --ring: #6B4C3B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', 'Noto Sans JP', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  padding: 24px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
}

/* Screen Title */
.screen-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.screen-title-line {
  width: 4px;
  background-color: #A03A3A;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 4px;
}

.screen-title-content h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.025em;
}

.screen-title-content p {
  color: var(--muted-foreground);
  margin-top: 8px;
}

/* Card */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px 0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-weight: 600;
  line-height: 1;
  color: var(--card-foreground);
}

.card-description {
  font-size: 14px;
  color: var(--muted-foreground);
}

.card-content {
  padding: 0 24px;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
  outline: none;
  letter-spacing: 0.025em;
  font-family: inherit;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn:focus-visible {
  border: 1px solid var(--ring);
  box-shadow: 0 0 0 3px rgba(107, 76, 59, 0.1);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: 36px;
  padding: 8px 16px;
}

.btn-primary:hover:not(:disabled) {
  background-color: rgba(160, 58, 58, 0.9);
}

.btn-outline {
  border: 1px solid var(--border);
  background-color: var(--background);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: 36px;
  padding: 8px 16px;
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Input */
.input {
  height: 36px;
  width: 100%;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--secondary);
  font-size: 16px;
  transition: color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  outline: none;
  font-family: inherit;
}

.input:focus {
  /* border-color: var(--ring); */
  box-shadow: 0 0 0 3px rgba(107, 76, 59, 0.1);
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Label */
.label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--card-foreground);
}

.label-required {
  color: var(--destructive);
}

/* Error message */
.error-message {
  font-size: 12px;
  color: var(--destructive);
  margin-top: 4px;
  line-height: 1.4;
}

.input-error {
  border-color: var(--destructive) !important;
}

.input-error:focus {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* Select */
.select {
  position: relative;
  width: 100%;
}

.select-trigger {
  height: 36px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  outline: none;
  font-family: inherit;
}

.select-trigger:focus {
  /* border-color: var(--ring); */
  box-shadow: 0 0 0 3px rgba(107, 76, 59, 0.1);
}

.select-trigger::after {
  content: '▼';
  font-size: 10px;
  color: var(--muted-foreground);
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.checkbox input:checked+.checkbox-checkmark {
  display: block;
}

.checkbox-checkmark {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background-color: #22c55e;
  color: #FFFFFF;
}

.badge-outline {
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--foreground);
}

/* Avatar */
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layout */
.container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .lg\:col-span-1 {
    grid-column: span 1 / span 1;
  }

  .lg\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

.space-y-2>*+* {
  margin-top: 8px;
}

.space-y-3>*+* {
  margin-top: 12px;
}

.space-y-4>*+* {
  margin-top: 16px;
}

.space-y-6>*+* {
  margin-top: 24px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.flex-1 {
  flex: 1 1 0%;
}

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

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

.pt-2 {
  padding-top: 8px;
}

.border-t {
  border-top: 1px solid var(--border);
}

.border-2 {
  border-width: 2px;
}

.border-primary {
  border-color: var(--primary);
}

.border-green-500 {
  border-color: #22c55e;
}

.opacity-50 {
  opacity: 0.5;
}

.pointer-events-none {
  pointer-events: none;
}

/* Icon styles */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.icon-muted {
  color: var(--muted-foreground);
}

/* Utility classes */
.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 14px;
}

.text-lg {
  font-size: 18px;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-muted-foreground {
  color: var(--muted-foreground);
}

.text-card-foreground {
  color: var(--card-foreground);
}

.relative {
  position: relative;
}

.z-50 {
  z-index: 50;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.toast-close {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease-out forwards;
}

.pt-50 {
  padding-top: 50px;
}

/* Loading Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

.hidden {
  display: none !important;
}

/* Fix input autofill background color */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--secondary) inset !important;
  box-shadow: 0 0 0 30px var(--secondary) inset !important;
  -webkit-text-fill-color: var(--card-foreground) !important;
  background-color: var(--secondary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

input:-internal-autofill-selected {
  background-color: var(--secondary) !important;
  -webkit-box-shadow: 0 0 0 30px var(--secondary) inset !important;
  box-shadow: 0 0 0 30px var(--secondary) inset !important;
  -webkit-text-fill-color: var(--card-foreground) !important;
}

