/* 舞蹈教室管理システム スタイル */

:root {
  --primary: #6f42c1;
  --primary-light: #8b5cf6;
  --sidebar-bg: #2d1b69;
  --sidebar-hover: #3d2b7a;
  --sidebar-active: #4c3b8a;
}

body {
  font-family: "Segoe UI", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  background-color: #f5f5f5;
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  width: 400px;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.login-card .icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--sidebar-bg);
  color: white;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 1.2rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
  margin: 0;
  font-size: 1.1rem;
}

.sidebar-header .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.3rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar-menu li a.active {
  background: var(--sidebar-active);
  color: white;
  border-left-color: #a78bfa;
}

.sidebar-menu li a .menu-icon {
  width: 24px;
  margin-right: 10px;
  text-align: center;
}

/* Main content */
.main-content {
  margin-left: 240px;
  padding: 20px;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.top-bar h4 {
  margin: 0;
  color: #333;
}

/* Dashboard cards */
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
  border-left: 4px solid var(--primary);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

.stat-card .stat-label {
  color: #666;
  font-size: 0.9rem;
}

.stat-card.warning {
  border-left-color: #f59e0b;
}

.stat-card.warning .stat-number {
  color: #f59e0b;
}

.stat-card.success {
  border-left-color: #10b981;
}

.stat-card.success .stat-number {
  color: #10b981;
}

.stat-card.danger {
  border-left-color: #ef4444;
}

.stat-card.danger .stat-number {
  color: #ef4444;
}

/* Content panels */
.content-panel {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.content-panel h5 {
  margin-bottom: 1rem;
  color: #333;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

/* Table */
.table th {
  background: #f8f5ff;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

/* Status badges */
.badge-已扣 {
  background-color: #10b981 !important;
}
.badge-不扣 {
  background-color: #3b82f6 !important;
}
.badge-请假 {
  background-color: #f59e0b !important;
}
.badge-补课 {
  background-color: #8b5cf6 !important;
}
.badge-欠费 {
  background-color: #ef4444 !important;
}

/* Credit indicator */
.credit-ok {
  color: #10b981;
  font-weight: bold;
}
.credit-low {
  color: #f59e0b;
  font-weight: bold;
}
.credit-danger {
  color: #ef4444;
  font-weight: bold;
}

/* Clickable rows */
.table-hover tbody tr {
  cursor: pointer;
}

/* Modal */
.modal-header {
  background: var(--primary);
  color: white;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* Search bar */
.search-bar {
  max-width: 300px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}

/* Animations */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* Attendance grid */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.attendance-cell {
  padding: 6px 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  cursor: pointer;
}

.attendance-cell.已扣 {
  background: #d1fae5;
  color: #065f46;
}
.attendance-cell.不扣 {
  background: #dbeafe;
  color: #1e40af;
}
.attendance-cell.请假 {
  background: #fef3c7;
  color: #92400e;
}
.attendance-cell.补课 {
  background: #ede9fe;
  color: #5b21b6;
}
.attendance-cell.欠费 {
  background: #fecaca;
  color: #991b1b;
}

/* Attendance Matrix Table */
.attendance-matrix-table {
  font-size: 0.85rem;
  border-collapse: separate;
  border-spacing: 0;
}
.attendance-matrix-table th,
.attendance-matrix-table td {
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
  padding: 6px 8px;
}
.attendance-matrix-table th:first-child,
.attendance-matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  min-width: 120px;
}
.attendance-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8f9fa;
}
.attendance-matrix-table thead th:first-child {
  z-index: 4;
}
.attendance-matrix-table td:nth-child(2) {
  text-align: center;
  font-weight: 600;
  min-width: 50px;
}

/* Cell buttons inside matrix */
.attendance-cell-btn {
  display: inline-block;
  width: 36px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.1s;
}
.attendance-cell-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.attendance-cell-btn.empty {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
}

/* Status colors for matrix cells */
.status-已扣 {
  background: #d1fae5;
  color: #065f46;
}
.status-不扣 {
  background: #dbeafe;
  color: #1e40af;
}
.status-请假 {
  background: #fef3c7;
  color: #92400e;
}
.status-补课 {
  background: #ede9fe;
  color: #5b21b6;
}
.status-欠费 {
  background: #fecaca;
  color: #991b1b;
}

/* Matrix wrapper for horizontal scroll */
.matrix-wrapper {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

/* Sticky first column */
.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

/* ========== Student Detail Page ========== */
.student-detail-page {
  max-width: 900px;
}

.student-profile-header {
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
  border-radius: 16px;
  padding: 24px;
  position: relative;
}

.student-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26a69a, #00897b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3);
}

.student-info-bar {
  display: flex;
  gap: 32px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.info-item {
  text-align: center;
}
.info-label {
  font-size: 0.75rem;
  color: #78909c;
  margin-bottom: 2px;
}
.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #37474f;
}

.btn-outline-teal {
  border-color: #26a69a;
  color: #26a69a;
}
.btn-outline-teal:hover {
  background: #26a69a;
  color: #fff;
}
.bg-teal {
  background-color: #26a69a !important;
  color: #fff !important;
}

/* Student Tabs */
.student-tabs {
  border-bottom: 2px solid #e0e0e0;
}
.student-tabs .nav-link {
  color: #78909c;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.student-tabs .nav-link:hover {
  color: #26a69a;
}
.student-tabs .nav-link.active {
  color: #26a69a;
  font-weight: 600;
  border-bottom-color: #26a69a;
  background: transparent;
}

.student-tab-content {
  padding: 0;
}
.tab-pane-inner {
  padding: 20px 0;
}

/* Credit summary bar */
.credit-summary-bar {
  display: flex;
  gap: 24px;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.credit-item {
  text-align: center;
  flex: 1;
}
.credit-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.credit-label {
  font-size: 0.75rem;
  color: #90a4ae;
  margin-top: 4px;
}

/* Class detail card */
.class-detail-card {
  background: #f8fffe;
  border: 1px solid #e0f2f1;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.class-credit-row {
  display: flex;
  gap: 24px;
}
.class-credit-item {
  text-align: center;
}
.class-credit-val {
  font-size: 1.4rem;
  font-weight: 700;
}
.class-credit-lbl {
  font-size: 0.7rem;
  color: #90a4ae;
}

/* Attendance stats bar */
.attendance-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.att-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 6px 12px;
}

/* Print friendly */
@media print {
  .sidebar,
  .top-bar,
  .btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0;
  }
}
