/* Grading system styles — matches site theme #1 */
:root {
  --g-primary: #0077CC;
  --g-accent: #CC0000;
  --g-title: #522d80;
  --g-header-bg: #336699;
  --g-bg: #fdfdfd;
  --g-text: #333;
  --g-border: #ddd;
  --g-success: #28a745;
  --g-warning: #ffc107;
  --g-danger: #dc3545;
  --g-light-bg: #f5f7fa;
}

/* ========================
   LOGIN
   ======================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}
.login-card {
  background: #fff;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.login-card h2 {
  color: var(--g-title);
  margin-bottom: 24px;
  text-align: center;
}

/* ========================
   FORMS
   ======================== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row .form-group {
  margin-bottom: 0;
  min-width: 0;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--g-text);
  white-space: nowrap;
}
.form-group input,
.form-group select {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--g-border);
  border-radius: 4px;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: #fff;
  color: var(--g-text);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--g-primary);
  box-shadow: 0 0 0 2px rgba(0,119,204,0.15);
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--g-primary); color: #fff; }
.btn-danger  { background: var(--g-danger); color: #fff; }
.btn-success { background: var(--g-success); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ========================
   ALERTS
   ======================== */
.alert {
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* ========================
   TABS
   ======================== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--g-border);
  margin-bottom: 20px;
  gap: 0;
}
.tab {
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.95rem;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab:hover { color: var(--g-primary); }
.tab.active {
  color: var(--g-primary);
  border-bottom-color: var(--g-primary);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========================
   TABLES
   ======================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
  table-layout: auto;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--g-border);
  vertical-align: middle;
}
.data-table th {
  background: var(--g-light-bg);
  font-weight: 600;
  color: var(--g-title);
  position: sticky;
  top: 0;
}
.data-table tr:hover { background: #f0f4f8; }
.data-table input[type="number"] {
  width: 70px;
  padding: 4px 6px;
  border: 1px solid var(--g-border);
  border-radius: 3px;
  text-align: center;
  box-sizing: border-box;
}
.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-tarea    { background: #e3f2fd; color: #1565c0; }
.badge-examen   { background: #fce4ec; color: #c62828; }
.badge-proyecto { background: #e8f5e9; color: #2e7d32; }

/* ========================
   CARDS
   ======================== */
.card {
  background: #fff;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  overflow: hidden;
}
.card h3 {
  color: var(--g-title);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

/* ========================
   STAT CARDS
   ======================== */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--g-primary);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
}

/* ========================
   TOOLBAR
   ======================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ========================
   WEIGHT BAR
   ======================== */
.weight-bar {
  height: 6px;
  background: var(--g-border);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.weight-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ========================
   MODAL
   ======================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.modal h3 { color: var(--g-title); margin-bottom: 16px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 8px 14px; font-size: 0.85rem; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 6px 8px; }
  .stats-row { flex-direction: column; }
  .login-card { padding: 24px; margin: 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .form-row .form-group { flex: none !important; width: 100%; margin-bottom: 12px; }
}
