/* Carte PoC — Beauty Salon Electronic Chart System
   Design: Clean, warm, professional (inspired by LiME/KaruteKun UX) */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== Navigation ========== */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  text-decoration: none;
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-link:hover { background: var(--border-light); color: var(--text); }
.nav-link.active { background: var(--primary-bg); color: var(--primary); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.nav-user-info { display: flex; flex-direction: column; }
.nav-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.nav-user-store { font-size: 0.72rem; color: var(--text-dim); }
.nav-logout {
  color: var(--text-dim);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-logout:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ========== Layout ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 1.0rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea.form-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-light); box-shadow: var(--shadow); }
.btn-secondary {
  background: var(--border-light);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { opacity: 0.9; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ========== Badges & Tags ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}
.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid;
}

/* ========== Customer List ========== */
.search-bar {
  position: relative;
  margin-bottom: 20px;
}
.search-bar input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.customer-list { list-style: none; }
.customer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.customer-item:hover { background: var(--border-light); }
.customer-item:last-child { border-bottom: none; }
.customer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.customer-info { flex: 1; min-width: 0; }
.customer-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.customer-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.customer-last-visit {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.pin-icon { color: var(--warning); font-size: 0.82rem; }

/* ========== Carte (Customer Detail) ========== */
.carte-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.carte-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}
.carte-basic { flex: 1; }
.carte-basic h1 {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.carte-basic-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.customer-memo-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.7;
  margin-top: 12px;
}
.customer-memo-box::before {
  content: '📋 お客様メモ';
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

/* Visit timeline */
.timeline { margin-top: 20px; }
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.timeline-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.timeline-section {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.timeline-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.timeline-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.timeline-section-body {
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.handover-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.6;
}
.handover-box::before {
  content: '📝 申し送り';
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 4px;
}

/* ========== Visit Input Form ========== */
.visit-form { max-width: 720px; }
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.photo-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

/* ========== Login ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.login-card p {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.login-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-inner { padding: 0 12px; gap: 12px; }
  .nav-brand span { display: none; }
  .nav-user-info { display: none; }
  .container { padding: 16px 12px; }
  .page-title { font-size: 1.2rem; }
  .carte-header { flex-direction: column; gap: 12px; }
  .carte-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
  .carte-basic h1 { font-size: 1.1rem; }
  .customer-item { padding: 12px; gap: 10px; }
  .customer-avatar { width: 36px; height: 36px; font-size: 0.8rem; }
  .card { padding: 16px; }
  .login-card { padding: 28px 20px; }
  .timeline-item { padding-left: 20px; }
}

/* ========== Utility ========== */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
