* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f0f2f5; color: #333; }
a { text-decoration: none; color: inherit; }

.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: #fff; border-radius: 12px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { color: #667eea; font-size: 28px; }
.login-header p { color: #888; margin-top: 5px; }
.login-hint { text-align: center; margin-top: 20px; color: #aaa; font-size: 13px; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; background: #1a1a2e; color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 20px; color: #667eea; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: #ccc; transition: 0.2s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active { background: #667eea; color: #fff; border-radius: 0 20px 20px 0; }

.main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 30px; background: #fff; border-bottom: 1px solid #e0e0e0;
}
.topbar h1 { font-size: 24px; }
#userInfo { color: #667eea; font-weight: 600; }

.content { padding: 30px; flex: 1; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 20px;
  display: flex; align-items: center; gap: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.stat-icon.blue { background: #e8f0fe; }
.stat-icon.green { background: #e6f4ea; }
.stat-icon.orange { background: #fef7e0; }
.stat-icon.purple { background: #f3e8fd; }
.stat-card h3 { font-size: 24px; margin-bottom: 5px; }
.stat-card p { color: #888; font-size: 14px; }

.dashboard-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-bottom { grid-template-columns: 1fr; } }

.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card h3 { margin-bottom: 15px; }

.search-bar { margin-bottom: 15px; }
.search-bar input {
  width: 100%; padding: 10px 15px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; outline: none;
}
.search-bar input:focus { border-color: #667eea; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.table th { background: #f8f9fa; font-weight: 600; color: #555; }
.table tr:hover { background: #f8f9fa; }
.table-wrapper { overflow-x: auto; }

.btn {
  padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 14px; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px;
}
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5a6fd6; }
.btn-success { background: #34a853; color: #fff; }
.btn-success:hover { background: #2d9249; }
.btn-danger { background: #ea4335; color: #fff; }
.btn-danger:hover { background: #d33426; }
.btn-warning { background: #fbbc04; color: #333; }
.btn-info { background: #17a2b8; color: #fff; }
.btn-info:hover { background: #138496; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #667eea; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.error { color: #ea4335; font-size: 14px; margin: 10px 0; }

.modal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
  background: #fff; border-radius: 12px; padding: 30px;
  width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  position: relative; animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #888; }
.close:hover { color: #333; }

.badge {
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.badge-success { background: #e6f4ea; color: #137333; }
.badge-danger { background: #fce8e6; color: #c5221f; }
.badge-warning { background: #fef7e0; color: #e37400; }

.attendance-controls {
  display: flex; justify-content: space-between; align-items: end; gap: 15px;
  margin-bottom: 20px; flex-wrap: wrap;
}

canvas { max-width: 100%; }

.installment-section {
  background: #f8f9fa; border-radius: 8px; padding: 15px; margin-bottom: 15px;
}
.installment-section h4 { margin-bottom: 10px; color: #555; }

.notification-item {
  display: flex; align-items: start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid #eee; cursor: pointer;
}
.notification-item.unread { background: #f0f2ff; margin: 0 -20px; padding: 12px 20px; }
.notif-icon { font-size: 20px; margin-top: 2px; }
.notif-body { flex: 1; }
.notif-title { font-weight: 600; margin-bottom: 4px; }
.notif-msg { color: #666; font-size: 14px; margin-bottom: 4px; }
.notif-meta { color: #999; font-size: 12px; }
.notif-dot {
  width: 8px; height: 8px; background: #667eea; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
