/* ZiSchool — base styles. Matches ZiTechnologies dark theme (#12172B). */

:root {
  --bg: #12172B;
  --bg-elevated: #1B2140;
  --text: #F5F6FA;
  --text-muted: #A3A9C2;
  --primary: #4D6BFE;
  --primary-hover: #3D57D6;
  --danger: #FF5C5C;
  --border: #2A3157;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 18px;
}

/* Screens */
.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hero {
  text-align: center;
  padding-top: 60px;
}

.hero h1 {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.subtext {
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 24px;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

/* Role selection grid */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.role-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.role-card:hover {
  border-color: var(--primary);
}

.role-icon {
  font-size: 28px;
}

/* Auth form */
#authForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#authForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

#authForm input,
#authForm select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 16px;
  width: 100%;
}

#authForm input:focus,
#authForm select:focus {
  outline: none;
  border-color: var(--primary);
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
}

.switch-mode {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== App shell (dashboard, students, staff, fees) ===== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  background: #0D1122;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 0.5px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  padding: 8px 12px 20px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}

.sidebar-link.active {
  background: var(--bg-elevated);
  color: var(--text);
}

.sidebar-link:hover:not(.active) {
  color: var(--text);
}

.main-content {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.dash-header h1 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.dash-header .subtext {
  margin: 2px 0 0;
  font-size: 13px;
}

.plan-badge {
  background: var(--bg-elevated);
  color: #8FA3FF;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 14px 16px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.stat-card .stat-value .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-small:hover {
  background: var(--primary-hover);
}

.data-table-wrap {
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
  border: 0.5px solid var(--border);
}

.data-table-row {
  display: grid;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
  align-items: center;
}

.data-table-row:last-child {
  border-bottom: none;
}

.data-table-row.head {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-block;
}

.badge-success { background: #123324; color: #7ED9A8; }
.badge-warning { background: #3A2A12; color: #F0B25D; }
.badge-danger { background: #3A1414; color: #F08A8A; }

.empty-row {
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}


.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
  margin-bottom: 28px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.form input,
.form select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 16px;
  width: 100%;
}

.form input:focus,
.form select:focus {
  outline: none;
  border-color: var(--primary);
}

.inline-edit-row input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--primary);
}