/* ============================================================================
   VIDYAA NIKETAN COACHING CENTRE - SHARED STYLESHEET (LAPTOP & ANDROID)
   ============================================================================ */

:root {
  --primary: #1e3a8a;
  --primary-dark: #172554;
  --primary-light: #eff6ff;
  --accent: #0f766e;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --success: #15803d;
  --success-light: #f0fdf4;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------- LOGIN, REGISTRATION & FORGOT PASSWORD ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  background: linear-gradient(135deg, #172554 0%, #1e3a8a 55%, #0f766e 100%);
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.auth-header {
  background: var(--primary-dark);
  color: #ffffff;
  text-align: center;
  padding: 24px 18px;
  border-bottom: 4px solid #f59e0b;
}

.auth-header h1 {
  font-size: 1.25rem;
  letter-spacing: 0.4px;
  font-weight: 700;
}

.auth-header p {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-top: 4px;
}

.auth-body {
  padding: 24px 22px;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  text-align: center;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  font-size: 0.92rem;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--primary-dark);
}

/* ---------- FORMS & INPUTS ---------- */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

.req-star {
  color: var(--danger);
  margin-left: 2px;
}

.opt-tag {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.14);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 64px;
}

.toggle-pwd-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  border: none;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
}

/* ---------- ALERTS & BANNERS ---------- */
.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--danger-light);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success {
  background: var(--success-light);
  color: #166534;
  border-color: #bbf7d0;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border-color: #fde68a;
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: #bfdbfe;
}

/* ---------- POPUP MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modal-box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-box-lg {
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 15px 18px;
  background: var(--primary-dark);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  font-size: 0.95rem;
}

.modal-footer {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- PORTAL LAYOUT (ADMIN, TEACHER, STUDENT, PARENT, ACCOUNTANT) ---------- */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 255px;
  background: var(--primary-dark);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-brand h2 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.sidebar-brand span {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 600;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.content-area {
  padding: 18px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-active, .badge-success { background: #dcfce7; color: #166534; }
.badge-pending, .badge-warning { background: #fef3c7; color: #92400e; }
.badge-rejected, .badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.unread-highlight {
  background: #fffbeb !important;
  border-left: 4px solid #f59e0b;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ---------- MOBILE RESPONSIVENESS (ANDROID PHONES) ---------- */
@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .auth-body {
    padding: 18px 16px;
  }
}

@media print {
  .no-print, .sidebar, .topbar {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }
}