:root {
  --primary-color: #0b5345;
  --primary-dark: #083c32;
  --primary-light: #117864;
  --accent-gold: #f59e0b;
  --accent-orange: #ea580c;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 75px; /* space for mobile bottom nav */
}

/* App Shell Layout */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background-color: #f8fafc;
  min-height: 100vh;
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .app-container {
    width: 96%;
    max-width: 960px;
    margin: 12px auto;
    min-height: calc(100vh - 24px);
    border-radius: 20px;
    overflow: hidden;
  }
}

@media (min-width: 1025px) {
  .app-container {
    width: 100%;
    max-width: 920px;
    margin: 20px auto;
    min-height: calc(100vh - 40px);
    border-radius: 24px;
    overflow: hidden;
  }
}


/* Top App Header */
.top-header {
  background: linear-gradient(135deg, #09493c 0%, #0d5c4d 100%);
  color: #ffffff;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
  padding-top: max(14px, env(safe-area-inset-top));
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.school-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.school-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.school-logo:hover {
  transform: scale(1.05);
}

.school-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.2;
}

.school-text .sub-badge {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  color: #a7f3d0;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* User & Role Bar */
.user-status-bar {
  background-color: #e6f4ea;
  border-bottom: 1px solid #b7e1cd;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.user-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-status-role-badge {
  background-color: #0b5345;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.user-status-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-switch-label {
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
  white-space: nowrap;
}

.quick-switch-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #0b5345;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  color: #0b5345;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.quick-switch-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(11, 83, 69, 0.15);
}

.btn-header-login {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background-color: #ffffff;
  color: #0b5345;
  border: 1px solid #0b5345;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header-login:hover {
  background-color: #0b5345;
  color: #ffffff;
}

/* Main Content Area */
.main-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hero Section */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: #ffffff;
  min-height: 190px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 60, 50, 0.25) 0%, rgba(5, 40, 33, 0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-desc {
  font-size: 13px;
  opacity: 0.95;
  margin-bottom: 12px;
  line-height: 1.4;
}

.hero-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Card Section Styles */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.card-accent-orange {
  border-top: 4px solid var(--accent-orange);
}

.card-accent-green {
  border-top: 4px solid var(--primary-light);
}

.card-accent-blue {
  border-top: 4px solid #3b82f6;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat Grid */
.stat-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

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

.stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 600px) {
  .stat-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.15s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
}

.stat-box.red {
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.stat-box.amber {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.stat-box.blue {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.stat-box.green {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Attendance Absent Breakdown Card */
.stat-box-absent {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.absent-breakdown-box {
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #bbf7d0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
}

.absent-row-excused {
  color: #1d4ed8;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.absent-row-unexcused {
  color: #ea580c;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-box.slate {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-number-tkb,
#curriculumCurrentWeek {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.2px;
  display: inline-block;
  max-width: 100%;
}

@media (max-width: 768px) {
  .stat-number-tkb,
  #curriculumCurrentWeek {
    font-size: 14px;
  }
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* Task Item Card */
.task-group-title {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-card {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s;
}

.task-card:hover {
  border-color: #94a3b8;
  background-color: #fafafa;
}

.task-card.border-amber {
  border-left-color: var(--accent-gold);
  background: #fffdfa;
}

.task-card.border-red {
  border-left-color: #ef4444;
  background: #fefafa;
}

.task-card.border-green {
  border-left-color: #10b981;
}

.task-card.border-blue {
  border-left-color: #2563eb;
  background: #f8fafc;
}

.task-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.task-card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.task-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.tag-today {
  background-color: #fef3c7;
  color: #92400e;
}

.tag-overdue {
  background-color: #fee2e2;
  color: #991b1b;
}

.tag-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.tag-upcoming {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* Task Group Toggle Button ("Xem thêm" / "Thu gọn") */
.task-extra-container {
  display: none;
}

.task-extra-container.animating {
  animation: taskSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes taskSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-task-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 14px;
  margin-top: 2px;
  margin-bottom: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  user-select: none;
}

.btn-task-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

.btn-task-toggle:active {
  transform: translateY(0);
}

.btn-task-toggle .toggle-icon {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.btn-task-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.btn-task-toggle .toggle-count {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

/* Color theme accents matching the 3 task categories */
.btn-task-toggle-red {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.btn-task-toggle-red:hover {
  background-color: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

.btn-task-toggle-amber {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.btn-task-toggle-amber:hover {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.btn-task-toggle-green {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.btn-task-toggle-green:hover {
  background-color: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.info-note {
  font-size: 12.5px;
  color: #64748b;
  margin: 12px 0;
  line-height: 1.4;
  padding: 8px 12px;
  background-color: #f8fafc;
  border-radius: var(--radius-sm);
  border-left: 3px solid #cbd5e1;
}

/* Action Links & Folder Buttons */
.action-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.action-btn-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(2px);
}

.action-btn-row.highlight-green {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.action-btn-row.highlight-blue {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.doc-box-card {
  margin-bottom: 8px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.doc-box-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.action-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.action-btn-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.3;
}

.action-btn-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.action-badge-arrow {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.action-badge-arrow.navy {
  background: #0f172a;
  color: #ffffff;
}

/* Schedule Card Styles */
.schedule-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.schedule-block-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-row {
  margin-bottom: 6px;
  font-size: 13.5px;
}

.schedule-row .session-label {
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 2px;
}

.schedule-row .session-content {
  color: #334155;
  line-height: 1.45;
}

.schedule-item-line {
  margin-bottom: 4px;
  line-height: 1.5;
  word-break: break-word;
}

.schedule-item-line:last-child {
  margin-bottom: 0;
}

/* Schedule Action Buttons for Admin/BGH */
.schedule-item-manageable {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-radius: 4px;
  padding: 3px 6px !important;
  margin-bottom: 4px;
  transition: background-color 0.15s ease;
}

.schedule-item-manageable:last-child {
  margin-bottom: 0;
}

.schedule-item-manageable:hover {
  background-color: #f1f5f9;
}

.schedule-item-manageable .schedule-item-line {
  margin-bottom: 0;
  flex: 1;
}

.schedule-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-sched-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  outline: none;
}

.btn-sched-edit {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.btn-sched-edit:hover {
  background-color: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn-sched-delete {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-sched-delete:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Subject Quick Pick Pills */
.btn-subject-pill {
  transition: all 0.15s ease;
  outline: none;
}
.btn-subject-pill:hover {
  background-color: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.15);
}

/* Attendance Missing Badges */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

/* Utilities Grid / Rows */
.utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: all 0.15s;
}

.utility-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.utility-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.utility-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 6px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 99;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
  .bottom-nav {
    display: none;
  }
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  flex: 1;
}

.nav-tab.active {
  color: var(--primary-light);
}

.nav-tab-icon {
  font-size: 20px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

body.modal-open {
  overflow: hidden !important;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.form-control {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(17, 120, 100, 0.15);
}

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

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-light);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-warning {
  background-color: #f59e0b;
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #d97706;
}

/* User Management Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f1f5f9;
  padding: 10px;
  text-align: left;
  font-weight: 700;
  color: #334155;
  border-bottom: 2px solid #cbd5e1;
}

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

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 200;
  display: none;
}

.toast.show {
  display: block;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* Custom Install Banner for iOS / Android */
.install-guide-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
}

.install-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.install-step-num {
  width: 22px;
  height: 22px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

/* ========================================== */
/* LOGIN SCREEN & MODAL STYLES                */
/* ========================================== */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(9, 73, 60, 0.95) 0%, rgba(13, 92, 77, 0.98) 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  background-color: #ffffff;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  border: 3px solid #ffffff;
  object-fit: contain;
}

.login-title {
  font-size: 17px;
  font-weight: 800;
  color: #0b5345;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.login-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.login-role-select {
  background-color: #f0fdf4 !important;
  border: 2px solid #86efac !important;
  font-weight: 700;
  color: #065f46 !important;
  font-size: 15px !important;
  padding: 12px !important;
}

.login-role-select:focus {
  border-color: #0b5345 !important;
  box-shadow: 0 0 0 3px rgba(11, 83, 69, 0.2) !important;
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #0b5345 0%, #117864 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(11, 83, 69, 0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11, 83, 69, 0.4);
}

.quick-login-hints,
.quick-login-title,
.quick-login-chips,
.quick-login-chip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  pointer-events: none !important;
}

/* ========================================== */
/* ADMIN DASHBOARD TABS & CONTROLS            */
/* ========================================== */
.admin-modal-content {
  max-width: 960px !important;
  width: 95% !important;
  height: 90vh !important;
  display: flex;
  flex-direction: column;
}

.admin-nav-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  overflow-x: auto;
  padding: 6px 12px 0 12px;
  gap: 4px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.admin-tab-btn:hover {
  color: #0b5345;
  background: rgba(255, 255, 255, 0.6);
}

.admin-tab-btn.active {
  background: #ffffff;
  color: #0b5345;
  border: 1px solid #cbd5e1;
  border-bottom-color: #ffffff;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.03);
}

.admin-tab-pane {
  display: none;
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.admin-tab-pane.active {
  display: block;
}

.admin-card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.admin-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-preview-box {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border: 2px solid #cbd5e1;
  margin-top: 8px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #ffffff;
}

.banner-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}

.badge-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-role {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-dept {
  background: #fef3c7;
  color: #92400e;
}

.btn-action-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}

.btn-action-icon:hover {
  background: #e2e8f0;
  color: #0b5345;
}

.btn-action-icon.danger:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.active {
  background: #dcfce7;
  color: #166534;
}

.status-pill.locked {
  background: #fee2e2;
  color: #991b1b;
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.table-responsive .data-table {
  margin-top: 0;
  border: none;
}

/* ========================================== */
/* APP FOOTER (Chân trang cổng điều hành)     */
/* ========================================== */

.app-footer {
  background: linear-gradient(135deg, #083c32 0%, #0b5345 50%, #062a22 100%);
  color: #f1f5f9;
  padding: 24px 20px 20px 20px;
  margin-top: 28px;
  border-top: 3px solid #10b981;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.footer-school-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  object-fit: contain;
  flex-shrink: 0;
}

.footer-school-info {
  text-align: left;
}

.footer-school-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.footer-copyright-text {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 2px;
  font-weight: 400;
}

.footer-copyright-text strong,
.footer-copyright-text span {
  font-weight: 400;
  color: inherit;
  font-size: inherit;
}

.footer-divider {
  width: 100%;
  max-width: 480px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(52, 211, 153, 0.5) 50%, rgba(255,255,255,0) 100%);
  margin: 4px 0;
}

.footer-designer-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 14px;
  padding: 10px 22px;
  backdrop-filter: blur(4px);
  transition: all 0.25s ease;
  text-align: center;
}

.footer-designer-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.footer-designer-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  color: #e2e8f0;
  line-height: 1.4;
}

.designer-line-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.footer-designer-text .designer-name {
  color: #fef08a;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.designer-line-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

.designer-line-phone i {
  color: #34d399;
  font-size: 12px;
}

.designer-phone {
  color: #a7f3d0;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.designer-phone:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-subtext {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: #94a3b8;
  flex-wrap: wrap;
  margin-top: 2px;
}

.footer-dot {
  color: #34d399;
  font-size: 10px;
}

/* ========================================================== */
/* RESPONSIVE & AUTO-FIT RULES FOR MOBILE PHONES & TABLETS    */
/* ========================================================== */

@media (max-width: 680px) {
  /* Prevent horizontal overflow on entire mobile view */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .app-container {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  /* 1. Top Header on Mobile: School info row + quick actions row */
  .top-header {
    padding: 10px 12px;
  }

  .header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .school-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .school-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .school-text {
    flex: 1;
    min-width: 0;
  }

  .school-text h1 {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.3;
    white-space: normal;
    word-break: normal;
  }

  .school-text .sub-badge {
    font-size: 11px;
    margin-top: 2px;
    white-space: normal;
    word-break: normal;
  }

  .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .header-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 13.5px;
    flex-shrink: 0;
  }

  /* 2. User Status Bar on Mobile: Row 1 user name & role; Row 2 switcher & login */
  .user-status-bar {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }

  .user-status-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  #userStatusName {
    font-weight: 700;
    font-size: 13px;
    color: #065f46;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
  }

  .user-status-role-badge {
    white-space: nowrap;
    font-size: 11px;
    padding: 2px 8px;
    flex-shrink: 0;
  }

  .user-status-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
  }

  .quick-switch-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #065f46;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .quick-switch-select {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 2px 6px;
    font-size: 11.5px;
    border-radius: 6px;
  }

  .btn-header-login {
    flex-shrink: 0;
    height: 32px;
    padding: 0 8px;
    font-size: 11.5px;
    border-radius: 6px;
    white-space: nowrap;
  }

  /* 3. Main content adjustments */
  .main-content {
    padding: 10px 10px 80px 10px;
    gap: 12px;
  }

  .hero-card {
    min-height: 155px;
    padding: 12px;
    border-radius: 14px;
  }

  .hero-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .hero-desc {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .hero-date-badge {
    font-size: 11.5px;
    padding: 4px 10px;
  }

  .section-card {
    padding: 12px 10px;
    border-radius: 14px;
  }

  .card-header-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 4. Modals on mobile: full width, clean padding, single-column forms */
  .modal-overlay {
    padding: 8px;
  }

  .modal-content {
    max-height: 94vh;
    border-radius: 16px;
    width: 100%;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 14px 12px;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .admin-modal-content {
    width: 100% !important;
    height: 95vh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .admin-nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 6px 8px 0 8px;
  }

  .admin-tab-btn,
  .admin-nav-tab {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  /* Touch scrolling & table auto-fit for mobile */
  .table-responsive,
  div[style*="overflow-x: auto"] {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
  }

  /* Single column for modal grid inputs */
  .modal-body div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

@media (max-width: 540px) {
  /* Footer layout */
  .footer-school-brand {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-school-info {
    text-align: center;
  }

  .footer-designer-card {
    border-radius: 14px;
    padding: 10px 14px;
  }

  /* Schedule layout on small screens: clean badge tag & full width content */
  .schedule-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
  }

  .schedule-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .schedule-row .session-label {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    margin-bottom: 2px;
  }

  .schedule-row .session-content {
    font-size: 13px;
    line-height: 1.5;
    padding-left: 2px;
  }

  .schedule-day-block {
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .schedule-day-title {
    font-size: 13px;
  }

  /* Compact stat grids on phones with fluid auto-fit */
  .stat-grid-2 {
    gap: clamp(4px, 1.8vw, 8px);
  }

  .stat-grid-3 {
    gap: clamp(4px, 1.8vw, 8px);
  }

  .stat-grid-4 {
    gap: clamp(4px, 1.8vw, 8px);
  }

  .stat-box {
    padding: clamp(7px, 2vw, 10px) clamp(6px, 1.8vw, 8px);
    min-width: 0;
    overflow: hidden;
  }

  .stat-number {
    font-size: clamp(16px, 4.8vw, 20px) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-number-tkb,
  #curriculumCurrentWeek,
  body.is-mobile-screen #curriculumCurrentWeek {
    font-size: clamp(15.2px, 4vw, 16px) !important;
    letter-spacing: -0.3px;
    line-height: 1.2;
  }

  .stat-label {
    font-size: clamp(9.5px, 2.7vw, 11px) !important;
    line-height: 1.3;
  }

  /* Action rows on mobile: stack nicely */
  .action-btn-row {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .action-btn-row > span,
  .action-btn-row > .action-badge-arrow {
    align-self: flex-end;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  /* Ultra-compact for small phones like iPhone SE */
  .stat-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .stat-box {
    padding: 6px 4px;
  }

  .stat-number {
    font-size: 14.5px !important;
  }

  .stat-number-tkb,
  #curriculumCurrentWeek,
  body.is-mobile-screen #curriculumCurrentWeek {
    font-size: 13px !important;
    letter-spacing: -0.4px;
  }

  .stat-label {
    font-size: 9px !important;
  }
}

/* In-iframe helper (e.g. Google Apps Script embed or responsive view) */
body.in-iframe {
  padding-bottom: 60px;
}
body.in-iframe .app-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* ========================================== */
/* STAFF KPI & EMULATION (THI ĐUA CBGVNV)     */
/* Bảng màu: Cam, Xanh dương, Xanh lá, Tím    */
/* ========================================== */

.stat-box.orange {
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
}
.stat-box.orange .stat-number {
  color: #ea580c;
}

.stat-box.purple {
  background-color: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #6d28d9;
}
.stat-box.purple .stat-number {
  color: #8b5cf6;
}

/* STAFF KPI FORM 3 MODAL LAYOUT */
.staff-kpi-modal-content {
  max-width: 1250px;
  width: 96%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.staff-kpi-modal-body {
  padding: 12px 16px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 10px;
}

.staff-kpi-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.staff-kpi-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.staff-kpi-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-kpi-filter-item label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 0;
}

.staff-kpi-filter-item select,
.staff-kpi-filter-item input {
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
}

.staff-kpi-date-quick {
  display: flex;
  gap: 4px;
}

.staff-kpi-date-quick button {
  padding: 4px 7px;
  font-size: 11px;
}

.staff-kpi-guide-box {
  background: #fdf4ff;
  border: 1px solid #f5d0fe;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #701a75;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.staff-kpi-guide-box summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
}

.staff-kpi-guide-box summary::-webkit-details-marker {
  display: none;
}

.staff-kpi-guide-box .guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-kpi-guide-box .guide-toggle {
  font-size: 11px;
  color: #9333ea;
  font-weight: 600;
  text-decoration: underline;
}

.staff-kpi-guide-box .guide-content {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #f0abfc;
  font-size: 12px;
  line-height: 1.5;
  color: #581c87;
}

.form3-table-wrapper {
  flex: 1 1 auto;
  min-height: 250px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 4px !important;
  }

  .staff-kpi-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 98vh !important;
    height: 98dvh !important;
    max-height: 98vh !important;
    max-height: 98dvh !important;
    margin: 0 !important;
    border-radius: 14px 14px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .staff-kpi-modal-content .modal-header {
    padding: 8px 12px !important;
    flex-shrink: 0 !important;
  }

  .staff-kpi-modal-content .modal-header h3 {
    font-size: 14.5px !important;
    line-height: 1.3 !important;
  }

  .staff-kpi-modal-content .modal-header .modal-subtitle {
    display: none !important;
  }

  .staff-kpi-modal-body {
    padding: 6px 8px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 6px !important;
  }

  .staff-kpi-filters-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
    border-radius: 6px !important;
  }

  .staff-kpi-filter-row {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  .staff-kpi-filter-item {
    font-size: 12px !important;
    gap: 4px !important;
  }

  .staff-kpi-filter-item label {
    font-size: 12px !important;
  }

  .staff-kpi-filter-item select,
  .staff-kpi-filter-item input {
    font-size: 12px !important;
    padding: 3px 6px !important;
    height: 30px !important;
  }

  .staff-kpi-date-quick button {
    padding: 2px 6px !important;
    font-size: 11px !important;
    height: 30px !important;
  }

  .staff-kpi-guide-box {
    padding: 5px 8px !important;
    font-size: 11px !important;
    margin-bottom: 0 !important;
    border-radius: 6px !important;
  }

  .staff-kpi-guide-box summary {
    font-size: 11px !important;
  }

  .staff-kpi-guide-box .guide-content {
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  .form3-table-wrapper {
    flex: 1 1 auto !important;
    min-height: 250px !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    overscroll-behavior: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
  }

  .form3-table {
    min-width: 820px !important;
    font-size: 12.5px !important;
  }

  .form3-table th {
    padding: 8px 6px !important;
    font-size: 12px !important;
  }

  .form3-table td {
    padding: 6px 4px !important;
    font-size: 12px !important;
  }

  .form3-chip {
    padding: 3px 5px !important;
    font-size: 10.5px !important;
  }

  .staff-kpi-modal-content .modal-footer {
    padding: 8px 12px !important;
    flex-shrink: 0 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .staff-kpi-modal-content .modal-footer #staffKpiLastSavedText {
    font-size: 11px !important;
    flex: 1 1 auto !important;
    line-height: 1.3 !important;
  }

  .staff-kpi-modal-content .modal-footer > div:last-child {
    display: flex !important;
    gap: 6px !important;
    width: auto !important;
  }

  .staff-kpi-modal-content .modal-footer .btn {
    flex: 0 0 auto !important;
    padding: 7px 14px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }
}

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

.form3-table th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  padding: 10px 8px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 5;
}

.form3-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.form3-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.form3-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.form3-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.form3-chip.minus.active {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.form3-chip.plus.active {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.2);
}

.form3-chip.neutral.active {
  background: #f1f5f9;
  border-color: #0284c7;
  color: #0369a1;
  font-weight: 700;
}

.score-badge-live {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13.5px;
  text-align: center;
}

.score-badge-live.excellent {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.score-badge-live.good {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.score-badge-live.pass {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.score-badge-live.fail {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.ranking-medal {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 11.5px;
}
.ranking-medal.gold {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
}
.ranking-medal.silver {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #94a3b8;
}
.ranking-medal.bronze {
  background: #fed7aa;
  color: #9a3412;
  border: 1px solid #fb923c;
}

/* =========================================================================
   FORM 5: [CÁ NHÂN CBGVNV & GVCN] - DASHBOARD BIẾN ĐỘNG ĐIỂM & THÔNG BÁO
   ========================================================================= */

.form5-dashboard-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 20px;
}

.form5-header-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

.form5-user-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.form5-staff-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.form5-staff-select {
  width: 220px;
  max-width: 240px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.form5-staff-select:focus {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.3);
}

.form5-kpi-pill {
  background: #ffffff;
  color: #065f46;
  border: 1.5px solid #6ee7b7;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.form5-kpi-pill.warning {
  background: #ffffff;
  color: #92400e;
  border-color: #fde68a;
}

.form5-kpi-pill.danger {
  background: #ffffff;
  color: #991b1b;
  border-color: #fecaca;
}

.form5-period-tabs {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.form5-period-tabs::-webkit-scrollbar {
  display: none;
}

.form5-period-tab-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.form5-period-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.form5-period-tab-btn:hover:not(.active) {
  background: #cbd5e1;
  color: #1e293b;
}

.form5-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 16px 12px 16px;
  box-sizing: border-box;
}

.form5-stat-box {
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.form5-stat-box.blue {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
}

.form5-stat-box.green {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
}

.form5-stat-box.orange {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #ea580c;
}

.form5-stat-box.purple {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-left: 4px solid #8b5cf6;
}

.form5-stat-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form5-stat-box-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form5-stat-box-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form5-card-section {
  margin: 0 16px 12px 16px;
  padding: 12px 14px;
  border-radius: 8px;
  box-sizing: border-box;
}

.form5-homeroom-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #f59e0b;
}

.form5-notifications-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
}

.form5-actions-footer {
  padding: 0 16px 14px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* Responsive auto-fit / zoom for mobile screens (phones & tablets) */
@media (max-width: 768px) {
  .form5-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(6px, 2vw, 10px);
    padding: clamp(8px, 2.5vw, 12px);
  }

  .form5-stat-box {
    padding: clamp(8px, 2.2vw, 12px);
  }

  .form5-stat-box-title {
    font-size: clamp(9px, 2.6vw, 11px);
    letter-spacing: 0.1px;
  }

  .form5-stat-box-value {
    font-size: clamp(14px, 4.2vw, 19px) !important;
  }

  .form5-stat-box-sub {
    font-size: clamp(8.5px, 2.4vw, 10.5px);
    line-height: 1.3;
  }
}

@media (max-width: 640px) {
  .form5-header-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .form5-user-title {
    font-size: clamp(12px, 3.4vw, 13.5px);
  }

  .form5-staff-select-wrapper {
    width: 100%;
  }

  .form5-staff-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .form5-kpi-pill {
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    font-size: clamp(11px, 3.2vw, 12.5px) !important;
  }

  .form5-card-section {
    margin: 0 10px 10px 10px;
    padding: 10px 12px;
  }

  .form5-period-tabs {
    padding: 6px 10px;
    gap: 6px;
  }

  .form5-period-tab-btn {
    padding: 4px 10px;
    font-size: 11px;
  }
}

@media (max-width: 540px) {
  .form5-actions-footer {
    flex-direction: column-reverse;
    gap: 8px;
    padding: 0 10px 12px 10px;
  }

  .form5-actions-footer .btn {
    width: 100% !important;
    justify-content: center;
    text-align: center;
    padding: 9px 12px !important;
    font-size: 12.5px !important;
  }
}






/* ==========================================================================
   TASK ATTACHMENTS (Văn bản hướng dẫn / chỉ đạo Word, Excel, PDF)
   ========================================================================== */
.task-file-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.task-file-dropzone:hover, .task-file-dropzone.dragover {
  border-color: #0b5345;
  background: #f0fdf4;
}

.task-dropzone-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e6f4ea;
  color: #0b5345;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.task-dropzone-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.task-dropzone-text .primary-text {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.task-dropzone-text .sub-text {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.task-attachment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.task-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  gap: 8px;
  transition: background 0.15s;
}

.task-attachment-item:hover {
  background: #e2e8f0;
}

.task-attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.task-attachment-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.task-attachment-icon.word { color: #2563eb; }
.task-attachment-icon.excel { color: #16a34a; }
.task-attachment-icon.pdf { color: #dc2626; }
.task-attachment-icon.other { color: #64748b; }

.task-attachment-name {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.task-attachment-size {
  font-size: 11.5px;
  color: #64748b;
  flex-shrink: 0;
}

.task-attachment-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s;
}

.task-attachment-remove:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Detail modal attachment cards */
.dt-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.dt-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  gap: 8px;
  transition: all 0.15s;
}

.dt-attachment-card:hover {
  background: #ffffff;
  border-color: #0b5345;
  box-shadow: 0 2px 6px rgba(11,83,69,0.08);
}

.dt-attachment-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dt-attachment-btn {
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.dt-attachment-btn.primary {
  background: #0b5345;
  color: #ffffff;
}

.dt-attachment-btn.primary:hover {
  background: #0e6655;
}

.dt-attachment-btn.secondary {
  background: #e2e8f0;
  color: #334155;
}

.dt-attachment-btn.secondary:hover {
  background: #cbd5e1;
}

/* Badge for task card */
.task-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Admin Attachments Tab */
.admin-att-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-att-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.admin-att-stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.admin-att-stat-card .stat-info {
  display: flex;
  flex-direction: column;
}

.admin-att-stat-card .stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.admin-att-stat-card .stat-lbl {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Responsive for smartphone and tablet */
@media (max-width: 768px) {
  .dt-attachment-grid {
    grid-template-columns: 1fr;
  }
  .task-file-dropzone {
    padding: 12px 10px;
    gap: 8px;
  }
  .task-dropzone-text .sub-text {
    font-size: 10.5px;
  }
  .admin-att-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .task-attachment-item {
    font-size: 12px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .admin-att-stats-grid {
    grid-template-columns: 1fr;
  }
  .task-file-dropzone {
    flex-direction: column;
    text-align: center;
  }
  .task-dropzone-text {
    text-align: center;
  }
  .dt-attachment-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dt-attachment-actions {
    width: 100%;
    margin-top: 6px;
  }
  .dt-attachment-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   DOCUMENT & ARCHIVE MANAGEMENT STYLES (TÀI LIỆU, HỒ SƠ, BIỂU MẪU)
   ========================================================================== */

.doc-box-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.doc-box-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.doc-box-card:active {
  transform: translateY(0);
}

.doc-badge-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

/* Document Modal Header */
.doc-modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bfdbfe;
  transition: all 0.2s ease;
}

/* File Dropzone in Doc Modal */
.doc-file-dropzone {
  border: 2px dashed #93c5fd;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Document Item Card in Modal */
.doc-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
  gap: 12px;
}

.doc-item-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.doc-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.doc-type-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-type-icon.word {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.doc-type-icon.excel {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.doc-type-icon.pdf {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.doc-type-icon.powerpoint {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.doc-type-icon.image {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.doc-type-icon.archive {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}

.doc-type-icon.other {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.doc-item-details {
  min-width: 0;
  flex: 1;
}

.doc-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  line-height: 1.35;
  word-break: break-word;
}

.doc-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
}

.doc-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
}

.doc-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.doc-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.doc-btn-view {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.doc-btn-view:hover {
  background: #dbeafe;
  color: #1e40af;
}

.doc-btn-download {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
.doc-btn-download:hover {
  background: #dcfce7;
  color: #166534;
}

.doc-btn-delete {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
  padding: 5px 8px;
}
.doc-btn-delete:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Admin Document Box Modal: Icon Presets & Color Swatches */
.btn-icon-preset {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-preset:hover {
  background: #eff6ff;
  color: #0284c7;
  border-color: #93c5fd;
  transform: scale(1.05);
}

.btn-icon-preset.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.color-swatch-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-swatch-dot:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #0f172a;
}

.color-swatch-dot.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #0f172a;
}

/* User Permissions Checklist in Admin Doc Box Modal */
.docbox-user-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s ease;
}

.docbox-user-checkbox-item:hover {
  background: #f1f5f9;
}

.docbox-user-checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0b5345;
  cursor: pointer;
}

/* Responsive adjustments for Mobile & Tablet */
@media (max-width: 640px) {
  .doc-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-item-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
  }
  .doc-btn-action {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   STRICT LEFT-ALIGNED DOCUMENT CATEGORIES (CANH THẲNG HÀNG THEO LỀ TRÁI)
   ========================================================================== */

#dynamicDocBoxesContainer {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  text-align: left !important;
  margin: 0 !important;
  padding: 0 !important;
}

.doc-box-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin: 0 0 8px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
}

.doc-box-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07) !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.doc-box-card:active {
  transform: translateY(0) !important;
}

.doc-box-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.doc-box-icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  flex-shrink: 0 !important;
}

.doc-box-text {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  text-align: left !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.doc-box-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  text-align: left !important;
  margin: 0 !important;
  width: 100% !important;
}

.doc-box-desc {
  font-size: 12.5px !important;
  color: #64748b !important;
  margin-top: 3px !important;
  text-align: left !important;
  line-height: 1.35 !important;
  width: 100% !important;
}


/* ==========================================================================
   PASSWORD STRENGTH, REQUIREMENTS CHECKLIST & CUSTOM MODAL STYLES
   ========================================================================== */
.pwd-requirements-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.pwd-requirements-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pwd-req-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pwd-req-item {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.pwd-req-item.valid {
  color: #15803d;
  font-weight: 600;
}

.pwd-req-item.valid i {
  color: #16a34a;
}

.pwd-req-item.invalid {
  color: #94a3b8;
}

.pwd-req-item.invalid i {
  color: #cbd5e1;
}

.pwd-strength-container {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
  margin-bottom: 4px;
  overflow: hidden;
}

.pwd-strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pwd-strength-bar.weak {
  width: 33%;
  background-color: #ef4444;
}

.pwd-strength-bar.medium {
  width: 66%;
  background-color: #f59e0b;
}

.pwd-strength-bar.strong {
  width: 100%;
  background-color: #10b981;
}

.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-input-wrap input {
  padding-right: 40px !important;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle-btn:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.btn-header-change-pwd {
  padding: 2px 8px;
  font-size: 11px;
  margin-left: 8px;
  border-radius: 6px;
  align-items: center;
  gap: 4px;
  color: #0b5345;
  border-color: #cbd5e1;
  background: #fff;
  transition: all 0.2s ease;
}

.btn-header-change-pwd:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}


/* ========================================== */
/* THỜI KHÓA BIỂU (TIMETABLE) STYLES          */
/* ========================================== */

.tkb-modal-header {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.btn-tkb-session {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-tkb-session:hover {
  color: #0b5345;
}

.btn-tkb-session.active {
  background: #ffffff;
  color: #0b5345;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ============================================================== */
/* MODAL THỜI KHÓA BIỂU CÁ NHÂN GIÁO VIÊN - RESPONSIVE 2D SCROLL */
/* ============================================================== */

.tkb-modal-content {
  max-width: 1140px;
  width: 96%;
  height: 92vh;
  max-height: 92vh;
  border-radius: 14px;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin: 0 auto;
}

.tkb-modal-header {
  flex-shrink: 0 !important;
}

.tkb-modal-body {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 10px 14px !important;
  gap: 8px !important;
  background: #ffffff;
}

.tkb-toolbar-wrapper {
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
}

.tkb-note-footer {
  flex-shrink: 0 !important;
  margin-top: 4px !important;
  padding-top: 6px !important;
  border-top: 1px dashed #cbd5e1 !important;
}

.tkb-grid-container {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  border-radius: 8px;
  border: 2px solid #0b5345;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  overscroll-behavior: contain !important;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  position: relative !important;
}

.tkb-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-size: 12.5px;
  background: #ffffff;
  touch-action: pan-x pan-y !important;
}

@keyframes tkbGridFadeIn {
  from {
    opacity: 0.35;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tkb-table-fade-in {
  animation: tkbGridFadeIn 0.22s ease-out;
}

/* Sticky top table header */
.tkb-table thead th {
  background: #0b5345;
  color: #ffffff;
  padding: 6px 4px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 2px solid #083c32;
  border-right: 1px solid #115e59;
  letter-spacing: 0.2px;
  position: sticky !important;
  top: 0 !important;
  z-index: 15 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.tkb-table thead th.col-session {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  left: 0 !important;
  top: 0 !important;
  z-index: 25 !important;
  background: #083c32 !important;
  border-right: 2px solid #042f2e !important;
}

.tkb-table thead th.col-period {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  left: 58px !important;
  top: 0 !important;
  z-index: 25 !important;
  background: #083c32 !important;
  border-right: 2px solid #042f2e !important;
}

.tkb-table thead th.col-day {
  min-width: 100px;
}

.tkb-table tbody td {
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  padding: 2px 3px;
  vertical-align: middle;
}

/* Sticky left column 1: Buổi */
.tkb-session-cell {
  background: #f0fdf4 !important;
  font-weight: 800;
  color: #166534;
  border-right: 2px solid #0b5345 !important;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 2px !important;
  position: sticky !important;
  left: 0 !important;
  z-index: 10 !important;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  box-shadow: 1px 0 3px rgba(0,0,0,0.06);
}

.tkb-session-morning {
  background: #f0fdf4 !important;
  color: #166534;
}

.tkb-session-afternoon {
  background: #fefce8 !important;
  color: #854d0e;
}

.tkb-session-title {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  text-align: center;
  margin: 0 auto;
}

/* Sticky left column 2: Tiết */
.tkb-period-cell {
  background: #f8fafc !important;
  font-weight: 800;
  color: #334155;
  font-size: 12.5px;
  border-right: 2px solid #0b5345 !important;
  padding: 2px 4px !important;
  position: sticky !important;
  left: 58px !important;
  z-index: 10 !important;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.08);
}

.tkb-session-sep-row td {
  border-top: 2px solid #0b5345 !important;
}

.tkb-cell-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  padding: 3px 4px;
  min-height: 28px;
  transition: all 0.15s ease;
  line-height: 1.15;
  touch-action: pan-x pan-y !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.tkb-cell-card:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(11, 83, 69, 0.15);
}

.tkb-cell-class {
  font-size: 11.5px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: 0.2px;
}

.tkb-cell-subject {
  font-size: 10px;
  font-weight: 600;
  color: #047857;
  margin-top: 1px;
}

.tkb-cell-empty {
  color: #cbd5e1;
  font-weight: 700;
  font-size: 12px;
  user-select: none;
  -webkit-user-select: none;
  line-height: 26px;
}

/* ============================================================== */
/* MOBILE TKB VIEW (Dưới 768px): VUỐT DỌC VÀ VUỐT NGANG MƯỢT MÀ   */
/* ============================================================== */
@media (max-width: 768px) {
  #modalTeacherTimetable.modal-overlay {
    padding: 4px !important;
  }

  #modalTeacherTimetable .tkb-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 98vh !important;
    height: 98dvh !important;
    max-height: 98vh !important;
    max-height: 98dvh !important;
    margin: 0 !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #modalTeacherTimetable .tkb-modal-header {
    padding: 8px 12px !important;
    flex-shrink: 0 !important;
  }

  #modalTeacherTimetable .tkb-modal-header h3 {
    font-size: 14.5px !important;
  }

  #modalTeacherTimetable .tkb-modal-body {
    padding: 6px 6px !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 6px !important;
  }

  #modalTeacherTimetable .tkb-toolbar-wrapper {
    flex-shrink: 0 !important;
    padding: 6px 8px !important;
    margin-bottom: 0 !important;
    gap: 6px !important;
  }

  #modalTeacherTimetable .tkb-note-footer {
    flex-shrink: 0 !important;
    padding-top: 4px !important;
    margin-top: 2px !important;
    font-size: 11px !important;
  }

  #modalTeacherTimetable .tkb-grid-container {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    overscroll-behavior: contain !important;
    border: 1.5px solid #0b5345 !important;
    border-radius: 8px !important;
  }

  .tkb-table thead th.col-session {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    left: 0 !important;
  }

  .tkb-table thead th.col-period {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    left: 50px !important;
  }

  .tkb-table thead th.col-day {
    min-width: 92px !important;
  }

  .tkb-session-cell {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    left: 0 !important;
  }

  .tkb-period-cell {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    left: 50px !important;
  }
}
