/* CSS for SS+2 High School Ghaghra Admin Portal */

.admin-body {
  background-color: #f1f5f9;
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
}

/* ==============================================
   AUTH SCREEN (PIN GATE)
   ============================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.auth-card {
  background: white;
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  text-align: center;
}

.auth-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.3px;
}

.auth-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  margin-bottom: 24px;
}

.auth-error {
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
  display: none;
}
.auth-error.show {
  display: block;
}

.auth-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.auth-back-link {
  color: #2563eb;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 600;
}
.auth-back-link:hover {
  text-decoration: underline;
}

.btn-link-forgot {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: all 0.15s;
}
.btn-link-forgot:hover {
  color: #1d4ed8;
}

.reset-instruction-box {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.76rem;
  color: #92400e;
  text-align: left;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* ==============================================
   ADMIN DASHBOARD LAYOUT
   ============================================== */
.admin-navbar {
  background: #1e3a8a;
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-logo {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.admin-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.admin-brand-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
}

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

.btn-view-app {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-view-app:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-logout {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-container {
  max-width: 1080px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

/* ==============================================
   STATS GRID
   ============================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.4px;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e3a8a;
  margin: 4px 0 2px;
}

.stat-meta {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ==============================================
   ADMIN TABS
   ============================================== */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #cbd5e1;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.admin-tab-btn:hover {
  color: #1e3a8a;
}

.admin-tab-btn.active {
  color: #1e3a8a;
  border-bottom-color: #1e3a8a;
}

/* ==============================================
   TAB CONTENT & CARDS
   ============================================== */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.card {
  background: white;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.card-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 3px;
}

.badge-pill {
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

/* ==============================================
   FORM CONTROLS
   ============================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.text-center {
  text-align: center;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.flex-gap {
  display: flex;
  gap: 8px;
}

.flex-1 {
  flex: 1;
}

.w-full {
  width: 100%;
}

.radio-toggle {
  display: flex;
  gap: 16px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed #93c5fd;
  background: #f0f7ff;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.file-dropzone:hover {
  background: #e0f2fe;
  border-color: #2563eb;
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.dropzone-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e3a8a;
}

.dropzone-file {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 6px;
}
.toggle-switch input {
  display: none;
}
.slider {
  width: 40px;
  height: 22px;
  background-color: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: 0.25s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background-color: white;
  transition: 0.25s;
}
.toggle-switch input:checked + .slider {
  background-color: #059669;
}
.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
}
.toggle-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

/* Buttons */
.btn-primary {
  background: #1e3a8a;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover {
  background: #1e40af;
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* ==============================================
   TABLE FOR MANAGING NOTES
   ============================================== */
.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 700;
  padding: 12px;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.4px;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #f8fafc;
}

.text-right {
  text-align: right;
}

.class-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
}
.class-tag-9th { background: #d1fae5; color: #065f46; }
.class-tag-10th { background: #dbeafe; color: #1e40af; }
.class-tag-11th { background: #fef3c7; color: #92400e; }
.class-tag-12th { background: #ede9fe; color: #5b21b6; }

.action-btns {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  color: #1e293b;
}
.btn-icon:hover {
  background: #e2e8f0;
}
.btn-icon.delete {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}
.btn-icon.delete:hover {
  background: #fee2e2;
}

/* ==============================================
   NOTICES LIST & EXPORT CARDS
   ============================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.notices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}
.notice-item-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.export-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.export-box.border-red {
  border-color: #fca5a5;
  background: #fff5f5;
}

.export-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.export-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.export-content p {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.mt-2 {
  margin-top: 8px;
}
.text-sm {
  font-size: 0.78rem;
}

/* Bulk Upload Dropzone & Queue */
.bulk-dropzone {
  border: 2px dashed #0284c7 !important;
  background: #f0f9ff !important;
  padding: 36px 20px !important;
}
.bulk-dropzone:hover {
  background: #e0f2fe !important;
  border-color: #0369a1 !important;
}
.bulk-supported-badge {
  font-size: 0.74rem;
  color: #0369a1;
  background: #e0f2fe;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  margin-top: 10px;
  font-weight: 700;
  border: 1px solid #bae6fd;
}
.bulk-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}
.bulk-input-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  width: 100%;
}
.bulk-input-sm:focus {
  border-color: #2563eb;
  outline: none;
}
.bulk-select-sm {
  padding: 6px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: white;
}
.bulk-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #2563eb 100%);
  width: 0%;
  transition: width 0.2s ease;
}

/* Google Drive Sync Badges & UI */
.note-badge-gdrive {
  background: #f0fdf4;
  color: #15803d;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Bulk Delete Toolbar for Manage Notes Table */
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.08);
  animation: fadeIn 0.15s ease-in-out;
}
.bulk-toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #991b1b;
}
.bulk-count-badge {
  background: #dc2626;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
}
.bulk-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==============================================
   ADMIN PROFILE & RECOVERY STYLES
   ============================================== */
.btn-profile-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-profile-badge:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.btn-reset-mode {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset-mode.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}





