/* ====== Reset & Base ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f6f9;
  color: #333;
  overflow-x: hidden;
}

/* ====== Main Layout ====== */
.subject-entry-container {
  margin-left: 270px;
  padding: 60px 40px 120px; /* extra bottom space for scroll end */
  min-height: 100vh;
  background-color: #f4f6f9;
  width: calc(100% - 270px);
  overflow-y: auto;
}
@media (max-width: 992px) {
  .subject-entry-container {
    margin-left: 0;
    width: 100%;
    padding: 40px 20px 100px;
  }
}

/* ====== Info Card ====== */
.info-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  padding: 1.8rem 2rem;
  margin-bottom: 2rem;
  margin-top: 25px;
}
.info-card h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.6rem;
}
.info-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
}

/* ====== Meta Tags Row ====== */
.info-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 1rem;
}
.info-meta .meta-sep {
  color: #999;
}
.info-meta .meta-year     { color: #0d6efd; }
.info-meta .meta-term     { color: #20c997; }
.info-meta .meta-level    { color: #6f42c1; }
.info-meta .meta-class    { color: #fd7e14; }
.info-meta .meta-subject  { color: #dc3545; }

/* ====== Table Styling ====== */
.table {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  width: 100%;
}
.table thead {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}
.table td,
.table th {
  vertical-align: middle;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}
.table tbody tr:hover {
  background-color: #f1f3f5;
}

/* ====== Alerts ====== */
.alert {
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
}

/* ====== Responsive Fixes ====== */
@media (max-width: 768px) {
  .info-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .info-card h2 {
    font-size: 1.4rem;
  }
  .info-card p {
    font-size: 0.9rem;
  }
  .table th, .table td {
    font-size: 0.88rem;
    padding: 0.65rem;
  }
}

@media (max-width: 576px) {
    .info-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.2rem;
      margin-top: 1rem;
      padding-left: 0.25rem;
    }
    .info-meta span {
      display: block;
      font-size: 0.95rem;
    }
    .info-meta .meta-sep {
      display: none; /* Hide separators on small screens */
    }
  }
 /* ====== Narrower CAT columns ====== */
.table th:nth-child(3),
.table th:nth-child(4),
.table th:nth-child(5),
.table th:nth-child(6) {
  width: 60px;
  min-width: 60px;
}

/* Slightly wider, shorter inputs */
.cat-input {
    max-width: 70px;       /* up from 50px */
    width: 100%;
    padding: 0.15rem 0.3rem;/* less vertical padding */
    font-size: 0.85rem;
    line-height: 1.0;      /* reduce overall height */
    text-align: center;
    border-radius: 3px;
  }
  
  /* Mobile */
  @media (max-width: 768px) {
    .cat-input {
      max-width: 50px;     /* up from 40px */
      padding: 0.1rem 0.25rem;
      font-size: 0.8rem;
    }
  }
  
/* tweak focus ring to match smaller size */
.cat-input:focus {
  box-shadow: 0 0 0 .05rem rgba(0,123,255,.25);
}

/* ====== Responsive adjustments ====== */
@media (max-width: 768px) {
  .table th:nth-child(3),
  .table th:nth-child(4),
  .table th:nth-child(5),
  .table th:nth-child(6) {
    width: 50px;
    min-width: 50px;
  }

  .cat-input {
    max-width: 40px;
    padding: 0.15rem 0.25rem;
    font-size: 0.8rem;
  }
}
