/* ====== PetConnect DX - Design System ====== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B85FF;
  --secondary: #FF6B9D;
  --accent: #00D2FF;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --bg: #F0F2F5;
  --bg-dark: #1A1D23;
  --sidebar-bg: #12141A;
  --surface: #FFFFFF;
  --surface-hover: #F8F9FB;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #00D2FF 100%);
  --gradient-pink: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
  --gradient-dark: linear-gradient(135deg, #1A1D23 0%, #2D3748 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans JP', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* ====== Layout ====== */
.app-layout { display: flex; min-height: 100vh; }

/* ====== Sidebar ====== */
.sidebar {
  width: 260px; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo { width: 40px; height: 40px; background: var(--gradient-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sidebar-brand h2 { font-size: 16px; font-weight: 700; }
.sidebar-brand span { font-size: 11px; color: var(--text-light); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title { font-size: 11px; text-transform: uppercase; color: var(--text-light); padding: 0 12px; margin-bottom: 8px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer; color: #A0AEC0;
  transition: all 0.2s ease; font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(108,99,255,0.2); color: var(--primary-light); font-weight: 500; }
.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }
.nav-item .badge { margin-left: auto; background: var(--secondary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-pink); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 500; }
.sidebar-user-role { font-size: 11px; color: var(--text-light); }

/* ====== Main Content ====== */
.main-content { flex: 1; margin-left: 260px; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; transition: all 0.2s; position: relative; }
.topbar-btn:hover { background: var(--surface-hover); border-color: var(--primary); }
.topbar-btn .notif-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--error); border-radius: 50%; border: 2px solid var(--surface); }

.page-content { padding: 32px; }

/* ====== Cards ====== */
.card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); transition: all 0.2s; }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* ====== Stats ====== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: 24px; border: 1px solid var(--border-light); transition: all 0.3s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.gradient-1 { background: var(--gradient-primary); color: #fff; border: none; }
.stat-card.gradient-2 { background: var(--gradient-pink); color: #fff; border: none; }
.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); background: rgba(108,99,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-card.gradient-1 .stat-icon, .stat-card.gradient-2 .stat-icon { background: rgba(255,255,255,0.2); }
.stat-trend { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--error); }
.stat-card.gradient-1 .stat-trend, .stat-card.gradient-2 .stat-trend { color: rgba(255,255,255,0.85); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-card.gradient-1 .stat-label, .stat-card.gradient-2 .stat-label { color: rgba(255,255,255,0.8); }

/* ====== Tables ====== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); background: var(--bg); letter-spacing: 0.5px; }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-light); }
tr:hover td { background: var(--surface-hover); }

/* ====== Badges ====== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #ECFDF5; color: #059669; }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-error { background: #FEF2F2; color: #DC2626; }
.badge-info { background: #EFF6FF; color: #2563EB; }
.badge-purple { background: #F5F3FF; color: #7C3AED; }

/* ====== Buttons ====== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108,99,255,0.35); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); cursor: pointer; }

/* ====== Grid Layouts ====== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ====== Charts (CSS) ====== */
.chart-bar-container { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 16px; }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--gradient-primary); min-height: 8px; transition: height 0.6s ease; }
.chart-bar-label { font-size: 11px; color: var(--text-secondary); }
.chart-bar-value { font-size: 11px; font-weight: 600; color: var(--text); }

/* ====== Salon Cards (End User View) ====== */
.salon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.salon-card { background: var(--surface); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-light); transition: all 0.3s; cursor: pointer; }
.salon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.salon-card-img { height: 180px; background: var(--gradient-primary); position: relative; overflow: hidden; }
.salon-card-img img { width: 100%; height: 100%; object-fit: cover; }
.salon-card-badge { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,0.6); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 11px; backdrop-filter: blur(4px); }
.salon-card-fav { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: rgba(255,255,255,0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; }
.salon-card-content { padding: 16px; }
.salon-card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.salon-card-location { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.salon-card-rating { display: flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 8px; }
.salon-card-rating .stars { color: #F59E0B; }
.salon-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.salon-tag { font-size: 11px; padding: 3px 8px; background: #F0F2F5; border-radius: 4px; color: var(--text-secondary); }
.salon-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border-light); }
.salon-price { font-size: 18px; font-weight: 700; color: var(--primary); }
.salon-price span { font-size: 12px; font-weight: 400; color: var(--text-secondary); }

/* ====== Search Bar ====== */
.search-bar { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-md); padding: 16px 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.search-input { flex: 1; border: none; outline: none; font-size: 15px; font-family: inherit; background: transparent; }
.search-filter { display: flex; gap: 8px; }
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 13px; background: var(--bg); border: 1px solid var(--border); cursor: pointer; transition: all 0.2s; }
.filter-chip:hover, .filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== Forms ====== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input, .form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; transition: border-color 0.2s; background: var(--surface); }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }

/* ====== Booking Calendar ====== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { padding: 10px; text-align: center; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; transition: all 0.2s; }
.calendar-day:hover { background: rgba(108,99,255,0.1); }
.calendar-day.today { background: var(--primary); color: #fff; font-weight: 600; }
.calendar-day.booked { background: #FEF2F2; color: var(--error); }
.calendar-day.available { background: #ECFDF5; }
.calendar-day.header { font-weight: 600; color: var(--text-secondary); font-size: 12px; cursor: default; }
.calendar-day.header:hover { background: transparent; }

/* ====== Booking Timeline ====== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); }
.timeline-item.completed::before { background: var(--success); }
.timeline-item.pending::before { background: var(--warning); }

/* ====== Page Sections ====== */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ====== User App (End User View) ====== */
.user-app { max-width: 100%; }
.hero-section { background: var(--gradient-primary); border-radius: var(--radius-lg); padding: 48px; margin-bottom: 32px; color: #fff; position: relative; overflow: hidden; }
.hero-section::after { content: '🐾'; position: absolute; right: 48px; top: 50%; transform: translateY(-50%); font-size: 120px; opacity: 0.15; }
.hero-title { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.hero-subtitle { font-size: 16px; opacity: 0.9; margin-bottom: 24px; max-width: 500px; }
.hero-search { display: flex; gap: 12px; max-width: 600px; }
.hero-search input { flex: 1; padding: 14px 20px; border-radius: var(--radius-sm); border: none; font-size: 15px; font-family: inherit; }
.hero-search .btn { padding: 14px 28px; background: var(--secondary); font-size: 15px; font-weight: 600; border: none; border-radius: var(--radius-sm); color: #fff; cursor: pointer; }
.hero-search .btn:hover { background: #E5558A; }

/* ====== Tabs ====== */
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 24px; }
.tab { padding: 8px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; color: var(--text-secondary); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ====== Modal ====== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--bg); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }

/* ====== Toast ====== */
.toast { position: fixed; top: 80px; right: 32px; background: var(--surface); border-radius: var(--radius-md); padding: 16px 20px; box-shadow: var(--shadow-lg); z-index: 2000; display: none; align-items: center; gap: 12px; border-left: 4px solid var(--success); animation: slideIn 0.3s ease; min-width: 300px; }
.toast.show { display: flex; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ====== View Switch ====== */
.view-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.view-btn { padding: 8px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== Notification Dropdown ====== */
.notif-dropdown {
  display: none; position: absolute; top: 52px; right: 0; width: 380px;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light); z-index: 200; overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-header {
  padding: 16px 20px; font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center;
}
.notif-item {
  display: flex; gap: 12px; padding: 14px 20px; cursor: pointer;
  border-bottom: 1px solid var(--border-light); transition: background 0.2s;
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: rgba(108,99,255,0.03); }
.notif-item.unread::after {
  content: ''; width: 8px; height: 8px; background: var(--primary);
  border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
.notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.notif-desc { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ====== Responsive ====== */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .salon-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .sidebar { transform: translateX(-100%); } .main-content { margin-left: 0; } .stats-grid { grid-template-columns: 1fr; } .salon-grid { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } .hero-section { padding: 32px; } .hero-title { font-size: 24px; } }
