:root {
  --primary-color: #1e40af;
  --primary-light: #3b82f6;
  --primary-subtle: #eff6ff;
  --sidebar-width: 270px;
  --topbar-height: 64px;
  --bg-color: #f1f5f9;
  --card-border: #e2e8f0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: #1e293b;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  z-index: 1030;
}

.brand-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
  display: block;
  line-height: 1.1;
}

.brand-version {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.school-name-badge {
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.status-pill {
  font-size: 0.8rem;
  padding: 5px 12px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  margin-right: 6px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.user-role {
  font-size: 0.72rem;
  color: #64748b;
}

.user-profile-btn {
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  background: white;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
}

/* SIDEBAR DRAWER */
.sidebar-drawer {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--card-border);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-content {
  padding: 16px 12px;
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
}

.sidebar-content::-webkit-scrollbar {
  width: 5px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.menu-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  padding: 12px 14px 6px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #475569;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.15s ease-in-out;
}

.sidebar-nav .nav-link .material-icons {
  font-size: 1.25rem;
  margin-right: 12px;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
}

.sidebar-nav .nav-link:hover .material-icons {
  color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, #eff6ff, #dbeafe);
  color: var(--primary-color);
  font-weight: 600;
}

.sidebar-nav .nav-link.active .material-icons {
  color: var(--primary-color);
}

/* MAIN CONTENT */
.main-content {
  flex-grow: 1;
  overflow-y: auto;
  height: calc(100vh - var(--topbar-height));
}

/* STAT CARDS */
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
}

/* DATA TABLE CARDS */
.data-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

.data-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.data-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.table {
  margin-bottom: 0;
}

.table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  vertical-align: middle;
}

.table td {
  padding: 12px 16px;
  font-size: 0.88rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

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

/* AVATARS IN TABLES */
.student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 10px;
}

.avatar-boy {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.avatar-girl {
  background-color: #fce7f3;
  color: #be185d;
}

/* EVIDENCE GALLERY */
.gallery-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
  border-color: #93c5fd;
}

.gallery-thumb-wrapper {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: #f1f5f9;
}

.gallery-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s;
}

.gallery-card:hover .gallery-thumb-wrapper img {
  transform: scale(1.04);
}

.gallery-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  padding: 14px;
}

.gallery-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta {
  font-size: 0.75rem;
  color: #64748b;
}

/* RESPONSIVE */
@media (max-width: 991px) {
  .sidebar-drawer {
    position: fixed;
    top: var(--topbar-height);
    left: -270px;
    height: calc(100vh - var(--topbar-height));
    z-index: 1020;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  .sidebar-drawer.show {
    left: 0;
  }
}

/* STUDENT UPDATE / ADD MODAL STYLING (PIXEL-PERFECT MATCH) */
.custom-field-box {
  background-color: #f1f3f4;
  border-radius: 4px;
  padding: 6px 12px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.custom-field-box:focus-within {
  background-color: #e8eaed;
  border-bottom: 2px solid #00acc1;
}
.field-label {
  font-size: 0.72rem;
  color: #5f6368;
  margin-bottom: 1px;
  display: block;
  font-weight: 500;
}
.custom-field-input, .custom-field-select {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 0.95rem;
  font-weight: 500;
  color: #202124 !important;
  height: auto !important;
}
.avatar-upload-container {
  width: 90px;
  height: 110px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}
.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 20%;
}
.avatar-tip-text {
  font-size: 0.72rem;
  color: #00acc1;
  font-weight: 500;
  cursor: pointer;
}
.avatar-tip-text:hover {
  text-decoration: underline;
}
.custom-nav-tabs {
  border-bottom: 1px solid #e0e0e0;
  gap: 4px;
}
.custom-nav-tabs .nav-link {
  border: none;
  background-color: #f1f3f4;
  color: #5f6368;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
}
.custom-nav-tabs .nav-link.active {
  background-color: #e0f7fa !important;
  color: #00838f !important;
  font-weight: 700;
  border-bottom: 2px solid #00acc1;
}
.custom-radio:checked {
  background-color: #00acc1 !important;
  border-color: #00acc1 !important;
}
.btn-cyan {
  background-color: #0097a7 !important;
  border-color: #0097a7 !important;
  color: white !important;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,151,167,0.3);
}
.btn-cyan:hover {
  background-color: #00838f !important;
}

/* ===================================================
   APP LAUNCHER GRID DRAWER (EXACT REPLICA OF AIS CONNECT)
   =================================================== */
.app-launcher-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0288d1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}
.app-launcher-btn:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
  transform: scale(1.05);
}

.app-launcher-drawer {
  width: 440px !important;
  max-width: 90vw !important;
  border-right: 1px solid #cbd5e1;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
  background-color: #ffffff;
}

.launcher-header {
  height: 56px;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.launcher-header .btn-close-custom {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #475569;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.launcher-header .btn-close-custom:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.launcher-header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.launcher-header-ver {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.launcher-body {
  padding: 12px 14px;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}

.launcher-group {
  margin-bottom: 16px;
}

.launcher-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0288d1;
  margin-top: 10px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.launcher-group-title .group-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0284c7;
  padding: 2px 8px;
  border-radius: 12px;
}

.app-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.app-tile {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease-in-out;
  min-height: 66px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.app-tile:hover {
  background: #f0f9ff;
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(2, 136, 209, 0.15);
}

.app-tile-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 4px;
}

.app-tile-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.15;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tile.highlight-blue {
  background: #e0f2fe;
  border-color: #7dd3fc;
}
.app-tile.highlight-blue .app-tile-label {
  color: #0369a1;
  font-weight: 700;
}

/* AIS Connect Full-Page Table & Filter Styles */
.ais-page-header {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ais-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.table-ais {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table-ais thead th {
  background-color: #0097a7 !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 10px 12px;
  vertical-align: middle;
  border: none;
  white-space: nowrap;
}

.table-ais thead th:first-child {
  border-top-left-radius: 6px;
}

.table-ais thead th:last-child {
  border-top-right-radius: 6px;
}

.table-ais tbody td {
  padding: 10px 12px;
  font-size: 0.84rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.table-ais tbody tr:hover {
  background-color: #f8fafc;
}

/* KPI Summary Cards */
.kpi-badge-card {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  color: white;
  min-width: 130px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.kpi-badge-card.bg-luyke {
  background: #2e7d32;
}

.kpi-badge-card.bg-dathu {
  background: #0097a7;
}

.kpi-badge-card.bg-dangthu {
  background: #ef6c00;
}

.kpi-badge-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 10px;
  flex-shrink: 0;
}

.kpi-badge-info .kpi-label {
  font-size: 0.72rem;
  opacity: 0.9;
  line-height: 1;
}

.kpi-badge-info .kpi-val {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Class Sidebar Drawer */
.class-list-sidebar {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.class-list-header {
  background: #0097a7;
  color: white;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.88rem;
}

.class-item-btn {
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border: none;
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.83rem;
  font-weight: 500;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.class-item-btn:hover {
  background: #e0f2fe;
  color: #0284c7;
}

.class-item-btn.active {
  background: #0284c7;
  color: white;
  font-weight: 700;
}

.class-item-btn.active .badge {
  background: white !important;
  color: #0284c7 !important;
}

/* ==========================================================================
   AIS CONNECT SETTINGS PAGE STYLES (MATCHING AUTHENTIC UI 100%)
   ========================================================================== */

.ais-settings-wrapper {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  padding: 1.5rem 2rem 2.5rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.ais-settings-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.ais-settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.ais-settings-school-brand {
  text-align: right;
}

.ais-settings-school-brand h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #006064;
  margin: 0;
  letter-spacing: 0.5px;
}

.ais-settings-school-brand small {
  color: #64748b;
  font-size: 0.8rem;
}

/* Profile banner card */
.ais-settings-profile-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.ais-settings-banner-img {
  width: 140px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

.ais-settings-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ais-settings-user-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ais-settings-user-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #64748b;
  font-size: 0.88rem;
}

.ais-settings-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ais-settings-camera-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ais-settings-camera-btn:hover {
  background: #0097a7;
  transform: scale(1.08);
}

.ais-settings-camera-btn .material-icons {
  font-size: 14px;
}

/* Tab Navigation */
.ais-settings-tabs-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.ais-settings-tab-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ais-settings-tab-btn:hover {
  color: #0097a7;
  background: #f0fdfa;
}

.ais-settings-tab-btn.active {
  background: #0097a7 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(0, 151, 167, 0.25);
}

/* Form Fields */
.ais-form-fields-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ais-field-box {
  background: #f2f3f5;
  border-radius: 4px;
  padding: 6px 14px 4px 14px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.ais-field-box:focus-within {
  background: #ffffff;
  border-color: #0097a7;
  box-shadow: 0 0 0 1px #0097a7;
}

.ais-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 2px;
}

.ais-field-label .required-star {
  color: #ef4444;
  margin-left: 2px;
}

.ais-field-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
}

.ais-field-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1e293b;
  padding: 2px 0;
  font-family: inherit;
}

.ais-field-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.ais-field-input:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.ais-field-toggle-pwd-btn {
  background: transparent;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
}

.ais-field-toggle-pwd-btn:hover {
  color: #0097a7;
}

/* Switch styling for "Đổi mật khẩu" */
.ais-switch-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 8px 0;
  padding: 4px 0;
}

.ais-switch-row label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  cursor: pointer;
}

.ais-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.ais-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ais-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 24px;
}

.ais-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ais-switch input:checked + .ais-slider {
  background-color: #0097a7;
}

.ais-switch input:checked + .ais-slider:before {
  transform: translateX(20px);
}

/* Action button */
.ais-settings-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.ais-btn-update {
  background: #0097a7;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 151, 167, 0.25);
}

.ais-btn-update:hover {
  background: #00838f;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 151, 167, 0.3);
}

.ais-btn-update:active {
  transform: translateY(0);
}

/* ========================================================
   ATTENDANCE 4-STATE & CAMERA AI WORKFLOW (IMAGES 2 & 3)
   ======================================================== */
.att-counter-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.att-counter-badge {
  min-width: 44px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}

.att-counter-badge:hover {
  transform: scale(1.05);
}

.att-badge-early {
  background: #10b981;
}

.att-badge-ontime {
  background: #0ea5e9;
}

.att-badge-late {
  background: #f59e0b;
}

.att-badge-absent {
  background: #ef4444;
}

.att-row-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.att-row-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.att-student-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.att-gender-icon-female {
  color: #ec4899;
  font-size: 18px;
}

.att-gender-icon-male {
  color: #3b82f6;
  font-size: 18px;
}

.att-cam-pin-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #0d9488;
  background: #f0fdfa;
  color: #0d9488;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.att-cam-pin-btn:hover {
  background: #0d9488;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(13, 148, 136, 0.3);
}

/* 4-State Capsule Pill */
.att-capsule {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.att-state-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  font-size: 18px;
}

.att-state-btn:hover:not(.active) {
  background: #e2e8f0;
  color: #475569;
}

.att-state-btn.active.early {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.25);
}

.att-state-btn.active.ontime {
  background: #0ea5e9;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.25);
}

.att-state-btn.active.late {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.25);
}

.att-state-btn.active.absent {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.25);
}

/* Snapshot & Time column */
.att-snapshot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 66px;
}

.att-snapshot-img {
  width: 56px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  background: #f8fafc;
}

.att-snapshot-empty {
  width: 56px;
  height: 68px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.att-time-pill {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  text-align: center;
  min-width: 48px;
}

/* ========================================================
   PLAYBACK & 6-SECOND VIDEO CLIP GALLERY
   ======================================================== */
.playback-session-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.playback-session-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.playback-photo-item {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.playback-photo-item:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.playback-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playback-photo-time {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  padding: 2px 4px;
}

.playback-photo-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 132, 199, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.playback-photo-item:hover .playback-photo-hover-overlay {
  opacity: 1;
}

.video-player-container {
  background: #090d16;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ==========================================================================
   RESPONSIVE DESIGN CHO WEB TRÊN NỀN TẢNG MOBILE & TABLET
   (Bảo tồn 100% giao diện Desktop, tự động tối ưu trên điện thoại & máy tính bảng)
   ========================================================================== */

/* 1. TABLET & MOBILE (< 992px): Khung layout, Topbar & Sidebar Drawer */
@media (max-width: 991.98px) {
  :root {
    --topbar-height: 58px;
  }

  /* Body & Layout */
  body.sidebar-mobile-open {
    overflow: hidden;
  }

  .app-layout {
    display: block;
    min-height: calc(100vh - var(--topbar-height));
  }

  /* Topbar co giãn linh hoạt */
  .topbar {
    padding: 0 10px;
  }

  .brand-logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 1rem;
  }

  #topbarSchoolName,
  .school-name-badge {
    display: none !important;
  }

  /* Sidebar Drawer trượt mượt mà từ trái sang */
  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 82vw;
    height: 100vh;
    z-index: 1060;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.2);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }

  .sidebar-drawer.show {
    transform: translateX(0);
  }

  .sidebar-mobile-header {
    background: #f8fafc;
    flex-shrink: 0;
  }

  .sidebar-content {
    flex-grow: 1;
    height: auto;
    overflow-y: auto;
    padding: 12px 10px;
  }

  /* Lớp phủ mờ nền khi mở sidebar */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1055;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.show {
    display: block;
    opacity: 1;
  }

  /* Main Content Area */
  .main-content {
    width: 100%;
    margin-left: 0;
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    overflow-x: hidden;
  }

  #mainFluidContainer,
  .main-content > .container-fluid {
    padding: 12px 10px !important;
  }

  /* Dropdown menu căn lề an toàn */
  .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
    max-width: calc(100vw - 20px) !important;
  }

  #notificationDropdownMenu {
    width: 320px !important;
  }

  /* App Launcher Drawer */
  .app-launcher-drawer {
    width: 380px !important;
    max-width: 90vw !important;
  }

  .app-grid-6 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
}

/* 2. MOBILE SPECIFIC (< 768px): Chi tiết các khối nội dung, bảng dữ liệu & form */
@media (max-width: 767.98px) {
  /* Topbar nút và khoảng cách */
  .topbar .btn-icon {
    padding: 4px 6px;
  }

  .user-profile-btn {
    padding: 2px 6px;
  }

  .user-profile-btn .avatar-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  /* App Launcher Grid 3 cột trên điện thoại */
  .app-grid-6 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .app-tile {
    padding: 10px 4px !important;
  }

  .app-tile-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .app-tile-label {
    font-size: 0.72rem !important;
  }

  /* Dashboard: Thẻ thống kê 2 cột */
  .stat-card {
    padding: 14px 12px !important;
    border-radius: 12px;
  }

  .stat-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px;
  }

  .stat-val {
    font-size: 1.35rem !important;
  }

  .stat-label {
    font-size: 0.75rem !important;
  }

  /* Data Cards & Bảng dữ liệu */
  .data-card {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .data-card-header {
    padding: 12px 14px !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .data-card-title {
    font-size: 1rem !important;
  }

  /* Tối ưu cuộn ngang mượt mà cho bảng */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .table-responsive table {
    min-width: 720px;
    margin-bottom: 0;
  }

  .table td, .table th {
    padding: 10px 10px !important;
    font-size: 0.84rem;
  }

  /* Thanh công cụ tìm kiếm và lọc học sinh / giáo viên */
  .student-toolbar-wrap,
  .teacher-toolbar-wrap,
  .data-card-header .d-flex {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100%;
  }

  .search-input-mobile-wrap,
  .input-group:has(input[type="text"]) {
    width: 100% !important;
  }

  /* Phân trang Pagination */
  .pagination-container,
  #studentPaginationBtns {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  #studentPaginationInfo {
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 6px;
  }

  /* Modal Form Hộp Thoại trên Mobile */
  .modal-dialog {
    margin: 8px auto !important;
    max-width: 96vw !important;
  }

  .modal-content {
    border-radius: 16px !important;
    max-height: 92vh;
    overflow-y: auto;
  }

  .modal-header {
    padding: 12px 16px !important;
  }

  .modal-body {
    padding: 14px 16px !important;
  }

  .modal-footer {
    padding: 10px 16px !important;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    padding: 8px 12px;
  }

  /* Phân hệ Thực đơn Bán trú (#meals) */
  .meal-main-wrapper {
    padding: 12px 8px !important;
  }

  /* Card cài đặt đơn giá bán trú xếp dọc trên mobile */
  .card:has(#inputDailyMealPrice) .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .card:has(#inputDailyMealPrice) .input-group {
    width: 100% !important;
  }

  .card:has(#inputDailyMealPrice) #btnSaveMealPrice {
    width: 100%;
    justify-content: center;
  }

  /* Lưới 7 ngày thực đơn */
  .meal-week-grid {
    grid-template-columns: repeat(7, minmax(130px, 1fr)) !important;
    gap: 8px !important;
  }

  /* CỔNG PHỤ HUYNH (PARENT PORTAL) TRÊN MOBILE */
  /* Thẻ Hero con em */
  .card:has(.rounded-circle[alt]) .row.align-items-center {
    flex-direction: column;
    text-align: center;
  }

  .card:has(.rounded-circle[alt]) .col-auto {
    margin-bottom: 8px;
  }

  .card:has(.rounded-circle[alt]) h3 {
    font-size: 1.35rem !important;
  }

  .card:has(.rounded-circle[alt]) .d-flex {
    justify-content: center;
  }

  /* Thanh chọn nhiều con: vuốt ngang */
  .card:has(.btn[onclick*="switchChildPortal"]) .d-flex.flex-wrap {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .card:has(.btn[onclick*="switchChildPortal"]) .btn {
    flex-shrink: 0;
    min-width: 160px;
  }

  /* Bố cục 2 cột lớn thành 1 cột */
  #mainContent .row.g-4 {
    --bs-gutter-y: 1rem;
  }

  #mainContent .row.g-4 > .col-lg-6 {
    width: 100% !important;
  }

  /* VietQR trên điện thoại: mã QR căn giữa, thông tin xếp dưới */
  #parentFeeCard .row.align-items-center {
    flex-direction: column;
    text-align: center;
  }

  #parentFeeCard .col-sm-5 {
    width: 100% !important;
    margin-bottom: 12px;
  }

  #parentFeeCard .col-sm-7 {
    width: 100% !important;
    text-align: left;
  }

  #parentFeeCard img[alt="VietQR Học Phí"] {
    max-width: 190px !important;
    margin: 0 auto;
  }
}

/* 3. MÀN HÌNH NHỎ TINH GỌN (< 480px) */
@media (max-width: 479.98px) {
  .brand-title {
    display: none;
  }

  .stat-card .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .stat-icon-wrapper {
    margin-bottom: 4px;
  }

  /* Thanh chọn con co lại */
  .card:has(.btn[onclick*="switchChildPortal"]) .btn {
    min-width: 140px;
    padding: 6px 10px;
  }
}

/* 4. TỐI ƯU MÀN HÌNH ĐĂNG NHẬP RESPONSIVE TRÊN MOBILE */
@media (max-width: 991.98px) {
  #fullLoginScreen {
    padding: 24px 14px !important;
    align-items: center !important;
  }
  #fullLoginScreen > div {
    gap: 28px !important;
  }
  .login-card-box {
    max-width: 380px !important;
    padding: 30px 22px !important;
  }
}

@media (max-width: 767.98px) {
  .login-brand-col {
    text-align: center;
  }
  .login-brand-col .d-flex {
    justify-content: center;
  }
  .login-brand-col h3 {
    font-size: 1.35rem !important;
  }
}

@media (max-width: 575.98px) {
  #fullLoginScreen {
    padding: 20px 10px !important;
  }
  .login-card-box {
    padding: 26px 18px !important;
    border-radius: 8px !important;
  }
  .login-brand-col {
    display: none !important;
  }
}

/* =============================================================================
   NEUMORPHIC SOFT-PASTEL ANALYTICS HUB STYLES
   Tham chiếu: istockphoto-1292897536-1024x1024.jpg
   ============================================================================= */
.analytics-showcase-container {
  background-color: #EEF3FA;
  min-height: calc(100vh - 80px);
  border-radius: 24px;
}

.analytics-canvas-wrapper {
  background-color: #FFFFFF;
  border-radius: 24px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 20px 40px -15px rgba(50, 50, 93, 0.08), 0 8px 16px -8px rgba(0, 0, 0, 0.04);
}

/* Left Mini Sidebar */
.analytics-mini-sidebar {
  background-color: #4E54C8;
  width: 100%;
  min-height: auto;
}

@media (min-width: 992px) {
  .analytics-mini-sidebar {
    width: 72px;
    min-width: 72px;
    min-height: 850px;
    border-radius: 23px 0 0 23px;
  }
}

.sidebar-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sidebar-avatar-circle:hover {
  transform: scale(1.06);
}

.sidebar-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.sidebar-icon-btn:hover,
.sidebar-icon-btn.active {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.18);
}

/* Main Workspace */
.analytics-main-workspace {
  background-color: #F4F7FC;
}

/* Soft Cards */
.soft-card {
  background-color: #FFFFFF;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 8px 20px -6px rgba(50, 50, 93, 0.04), 0 2px 6px -2px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.soft-card:hover {
  box-shadow: 0 12px 28px -6px rgba(50, 50, 93, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
}

/* Color Tokens */
.text-indigo { color: #565AC9 !important; }
.bg-indigo { background-color: #565AC9 !important; color: #FFFFFF !important; }
.bg-indigo-subtle { background-color: rgba(86, 90, 201, 0.12) !important; color: #565AC9 !important; }

.text-coral { color: #FF8A65 !important; }
.bg-coral { background-color: #FF8A65 !important; color: #FFFFFF !important; }
.bg-coral-subtle { background-color: rgba(255, 138, 101, 0.12) !important; color: #FF8A65 !important; }

.text-sky { color: #8EA5FC !important; }
.bg-sky { background-color: #8EA5FC !important; color: #FFFFFF !important; }

.btn-indigo {
  background-color: #565AC9;
  color: #FFFFFF;
  border: none;
}
.btn-indigo:hover {
  background-color: #464AB8;
  color: #FFFFFF;
}

.stat-arrow-icon {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

/* Calendar Grid */
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
}

.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-day {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  color: #475569;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day:hover {
  background-color: #EEF2F6;
}

.cal-day.empty {
  visibility: hidden;
}

.cal-day.circled {
  border: 1.5px solid #FF8A65;
  color: #FF8A65;
  font-weight: 700;
}

.cal-day.today-active {
  background-color: #565AC9 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(86, 90, 201, 0.35);
}

/* Circular Gauge Ring */
.gauge-ring-wrapper {
  width: 68px;
  height: 68px;
}

.circular-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: #E2E8F0;
  stroke-width: 3.2;
}

.circle-fill-indigo {
  fill: none;
  stroke: #565AC9;
  stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.gauge-text-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.95rem;
  font-weight: 800;
  color: #1E293B;
}

/* Donut center label */
.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Custom Legends & Dots */
.legend-line {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.dot-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.rounded-pill-start {
  border-top-left-radius: 50rem !important;
  border-bottom-left-radius: 50rem !important;
}

.rounded-pill-end {
  border-top-right-radius: 50rem !important;
  border-bottom-right-radius: 50rem !important;
}


