/* Shared classic School ERP layout */
:root {
  --navy: #24364b;
  --navy-dark: #1b2a3a;
  --blue: #315f8c;
  --ink: #263445;
  --muted: #687789;
  --line: #d9dfe7;
  --bg: #eef1f5;
  --white: #fff;
  --sidebar-width: 238px;
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%;
  margin: 0
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 Arial, Helvetica, sans-serif
}

.school-masthead {
  min-height: 86px;
  background: #fff;
  border-bottom: 1px solid #d6dce4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  gap: 20px
}

.school-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0
}

.school-brand img {
  width: 58px !important;
  height: 58px !important;
  max-width: 58px;
  max-height: 58px;
  min-width: 58px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.school-brand-text strong {
  display: block;
  color: var(--navy);
  font-size: 19px;
  letter-spacing: .35px;
  line-height: 1.25
}

.school-brand-text span {
  display: block;
  color: #586779;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  margin-top: 3px
}

.masthead-user {
  display: flex;
  flex-direction: column;
  text-align: right;
  color: #34465a;
  font-weight: 700
}

.masthead-user small {
  color: var(--muted);
  font-weight: 400
}

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 132px)
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 132px)
}

.sidebar-heading {
  padding: 22px 20px 12px;
  color: #b9c6d5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 10px
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 5px;
  color: #e4eaf1;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent
}

.sidebar-link:hover {
  background: #30465e;
  color: #fff
}

.sidebar-link.active {
  background: #3a526d;
  color: #fff;
  border-left-color: #d8b66a;
  font-weight: 700
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  font-size: 17px;
  color: #d8b66a
}

.sidebar-bottom {
  margin-top: auto;
  padding: 15px 18px 18px;
  border-top: 1px solid #40546a
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px
}

.sidebar-user strong {
  font-size: 13px;
  color: #fff
}

.sidebar-user span {
  font-size: 11px;
  color: #bdc9d7
}

.sidebar-logout {
  display: block;
  color: #f1d6d6;
  text-decoration: none;
  font-size: 12px;
  padding: 7px 0
}

.sidebar-logout:hover {
  color: #fff
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 27px 30px 36px;
  max-width: calc(100% - var(--sidebar-width))
}

.auth-main {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px
}

.copyright-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  color: #6b7785;
  text-align: center;
  font-size: 11px;
  padding: 13px 18px
}

h1 {
  font-size: 26px;
  margin: 0 0 7px;
  color: #26394f
}

h2 {
  font-size: 18px;
  margin: 0 0 16px;
  color: #2d4056
}

.muted {
  color: var(--muted);
  margin: 0
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #536f8e;
  font-weight: bold;
  margin: 0 0 5px
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px
}

.status-pill {
  background: #e7edf4;
  color: #314d6c;
  padding: 6px 11px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 20px
}

.stat-card,
.panel,
.notice {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 19px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .035)
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px
}

.stat-card strong {
  display: block;
  font-size: 27px;
  margin-top: 5px;
  color: var(--navy)
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px
}

.module-item,
.module-link {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 13px;
  background: #fff
}

.module-item b,
.module-item span,
.module-link b,
.module-link span {
  display: block
}

.module-item span,
.module-link span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px
}

.module-link {
  text-decoration: none;
  color: var(--ink)
}

.module-link:hover {
  border-color: #8ca6c1;
  background: #f8fafc
}

.notice {
  margin-top: 16px;
  background: #eff5fa;
  border-color: #d1dfeb;
  color: #294e70
}

.notice-warning {
  background: #fff8e8;
  border-color: #e9d39e;
  color: #76520c
}

label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin: 9px 0 5px
}

input,
select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #c8d0da;
  border-radius: 3px;
  font: inherit;
  background: #fff;
  color: var(--ink)
}

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 9px 13px;
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer
}

.btn-primary {
  background: var(--blue);
  color: #fff
}

.btn-primary:hover {
  background: #274d73
}

.btn-light {
  background: #edf1f5;
  color: #30465d;
  border-color: #d7dee7
}

.btn-small {
  padding: 6px 9px;
  font-size: 11px
}

.btn-block {
  width: 100%
}

.alert {
  padding: 10px 12px;
  border-radius: 3px;
  margin: 12px 0;
  font-size: 12px
}

.alert-error {
  background: #fff0f0;
  color: #9b2525;
  border: 1px solid #ffd0d0
}

.alert-success {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6
}

.year-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end
}

.form-submit {
  padding-bottom: 1px
}

.inline-form {
  display: inline
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-top: 12px
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  background: #fff;
  font-size: 12px
}

.data-table th {
  background: #e9edf2;
  color: #35465a;
  text-align: left;
  padding: 11px 10px;
  font-size: 11px;
  border-bottom: 1px solid #d4dbe4
}

.data-table td {
  padding: 10px;
  border-top: 1px solid #e6eaf0
}

.data-table tbody tr:hover {
  background: #f7f9fb
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 26px !important
}

.current-badge {
  display: inline-block;
  background: #e5f3e9;
  color: #28613a;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold
}

.privacy-note {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 2px
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 1fr 1fr auto;
  gap: 12px;
  align-items: end
}

.filter-search {
  min-width: 0
}

.filter-actions {
  display: flex;
  gap: 7px;
  padding-bottom: 1px
}

.table-summary,
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted)
}

.pagination>div {
  display: flex;
  gap: 7px
}

.student-name-link {
  color: #245a8c;
  text-decoration: none
}

.student-name-link:hover {
  text-decoration: underline
}

.tamil-name {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px
}

.profile-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  background: #e8edf3;
  color: #304b69;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold
}

.profile-heading h2 {
  margin: 0
}

.tamil-name-large {
  margin: 3px 0;
  color: var(--muted)
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px
}

.profile-tags span {
  background: #eef2f6;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px
}

.profile-panel {
  margin-top: 14px
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px
}

.profile-grid label {
  margin: 0 0 3px;
  color: var(--muted);
  font-weight: 400
}

.profile-grid strong {
  font-size: 13px
}

.auth-card {
  width: min(100%, 410px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 26px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06)
}

.school-mark {
  text-align: center;
  margin-bottom: 20px
}

.school-mark img {
  width: 70px;
  height: 70px;
  object-fit: contain
}

.school-mark h1 {
  font-size: 21px;
  margin: 8px 0 4px
}

.school-mark p {
  color: var(--muted);
  margin: 0;
  font-size: 12px
}

@media(max-width:1050px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .filter-form {
    grid-template-columns: 1fr 1fr
  }

  .filter-search {
    grid-column: 1/-1
  }

  .filter-actions {
    grid-column: 1/-1
  }
}

@media(max-width:760px) {
  .school-masthead {
    padding: 10px 15px;
    min-height: 76px
  }

  .school-brand img {
    width: 48px;
    height: 48px
  }

  .school-brand-text strong {
    font-size: 15px
  }

  .school-brand-text span {
    font-size: 10px
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 122px)
  }

  .sidebar {
    width: 100%;
    min-height: 0;
    display: block
  }

  .sidebar-heading {
    padding: 10px 14px 5px
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 8px 9px;
    gap: 5px
  }

  .sidebar-link {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 11px
  }

  .sidebar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px
  }

  .sidebar-user {
    margin: 0
  }

  .sidebar-logout {
    padding: 5px 0
  }

  .main-content {
    max-width: none;
    padding: 20px 14px 28px
  }

  .module-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:520px) {
  .masthead-user {
    display: none
  }

  .school-brand-text strong {
    font-size: 13px
  }

  .stats-grid,
  .module-grid,
  .year-form,
  .filter-form,
  .profile-grid {
    grid-template-columns: 1fr
  }

  .filter-search,
  .filter-actions {
    grid-column: auto
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column
  }

  .main-content {
    padding: 16px 11px 24px
  }

  .stat-card,
  .panel {
    padding: 14px
  }
}

/* Phase 2 user management */
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #c8d0da;
  border-radius: 3px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  resize: vertical
}

.permission-group {
  border-top: 1px solid var(--line);
  padding: 15px 0
}

.permission-group h3 {
  font-size: 14px;
  color: var(--navy);
  margin: 0 0 10px
}

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-weight: 400 !important;
  margin: 0 !important
}

.permission-option input {
  width: auto;
  margin-top: 3px
}

.permission-option span {
  min-width: 0
}

.link-button {
  background: none;
  border: 0;
  color: #315f8c;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0
}

.actions {
  white-space: normal;
  min-width: 230px
}

.action-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.actions a {
  color: #315f8c
}

.actions a.btn-primary {
    color: #fff;
}

.actions .inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0
}

.actions .link-button {
  display: inline-block;
  line-height: 1.4
}

/* Read-only account role for non-Super Admin editors */
.readonly-field {
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f1f4f7;
  color: var(--ink);
  font-size: 13px
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions .btn {
    height: 36px;
    min-height: 36px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 12px;
}


.form-grid button[type="submit"] {
    margin-top: 10px;
}



/* =====================================
   REGISTRATION APPLICATIONS TABLE
===================================== */

.registration-table-card {
    width: 100%;
    margin-top: 20px;
}

.registration-table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

/* .registration-table-heading h3 {
    margin-bottom: 5px;
} */

.registration-table-heading h3 {
    color: #24384f;
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 6px;
}

.registration-table-heading p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

/* Table outer border */
.registration-table-wrap {
    border: 1px solid #d5dce5;
    border-radius: 8px;
    overflow-x: auto;
}

.registration-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-size: 13px;
}

.registration-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.registration-table th {
    background: #24384f;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    padding: 17px 14px;
    white-space: nowrap;
    border-bottom: 3px solid #d5a84b;
}

.registration-table th.reg-id {
    text-align: center;
}


.registration-table th.reg-action {
    text-align: center !important;
}

.registration-table td {
    padding: 13px;
    border-bottom: 1px solid #e8edf3;
    color: #334155;
    vertical-align: middle;
}

.registration-table tbody tr:nth-child(even) {
    background: #f8fafc;
}


/* Subtle hover effect */
.registration-table tbody tr:hover {
    background: #e8f1fc;
}

.registration-table tbody tr:last-child td {
    border-bottom: none;
}

.reg-id {
    width: 65px;
    color: #64748b !important;
}

.reg-applicant {
    color: #173b65;
    font-size: 13px;
    white-space: nowrap;
}

.reg-mobile {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.reg-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.reg-date small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

.reg-action {
    text-align: center !important;
}

.reg-review-btn {
    display: inline-block;
    min-width: 75px;
    padding: 7px 13px;
    text-align: center;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.reg-status {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.reg-status-pending {
    background: #fff3cd;
    color: #856404;
}

.reg-status-approved {
    background: #d1fae5;
    color: #065f46;
}

.reg-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.registration-empty {
    padding: 35px 15px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .registration-table {
        min-width: 1000px;
    }

    .registration-table-heading {
        align-items: flex-start;
    }
}


.registration-table td:first-child {
    color: #173b65;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

/* Force ID column header to use white text */
.registration-table thead th.reg-id {
    color: #ffffff !important;
    background: #24384f !important;
}

/* =====================================================
   GLOBAL CHECKBOX STYLING
   Applies to all checkboxes throughout the portal
   ===================================================== */

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    vertical-align: middle;
    accent-color: #315f89;
}

/* Disabled checkboxes */
input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}