/* ===================================================
   style.css — แบบรายงานผลการพัฒนาคุณภาพผู้เรียน
=================================================== */

:root {
  --primary: #26A69A;
  --secondary: #AED581;
  --accent: #FFCA28;
  --orange: #FF8A65;
  --red: #EF5350;
  --purple: #4A2C6D;
  --dark-red: #D32F2F;
  --burnt-orange: #F57C00;
  --gold: #FBC02D;
  --blue: #0288D1;
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Kanit', sans-serif;
  background: #f0f2f5;
  margin: 0;
  color: #333;
}

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ======================== SIDEBAR ======================== */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 1000;
  transition: width .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
  box-sizing: border-box;
}

/* ========== COLLAPSED (icon-only) state — desktop ========== */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

/* Hide text elements when collapsed */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-nav li a span.nav-text,
.sidebar.collapsed .sidebar-footer .user-name,
.sidebar.collapsed .sidebar-footer .user-role,
.sidebar.collapsed .sidebar-footer .btn-logout span {
  display: none;
}

/* Center logo image when collapsed */
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 16px 0;
}

/* Center nav links when collapsed */
.sidebar.collapsed .sidebar-nav li a {
  justify-content: center;
  padding: 12px 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  position: relative;
}

.sidebar.collapsed .sidebar-nav li a.active {
  border-left-color: var(--accent);
}

.sidebar.collapsed .sidebar-nav li a i {
  width: auto;
  font-size: 18px;
  margin: 0;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .sidebar-nav li a .nav-text {
  display: none;
}

.sidebar.collapsed .sidebar-nav li {
  position: relative;
}

.sidebar.collapsed .sidebar-nav li a:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .82);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2000;
}

/* Footer icons centered when collapsed */
.sidebar.collapsed .sidebar-footer {
  padding: 10px 0;
}

.sidebar.collapsed .sidebar-footer .user-info {
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer .btn-logout {
  justify-content: center;
  padding: 8px 0;
}

.sidebar-admin {
  background: linear-gradient(160deg, #007fe3 0%, #020089 60%, #000251 100%);
}

.sidebar-teacher {
  background: linear-gradient(160deg, #26A69A 0%, #158a7e 60%, #0d5e56 100%);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 999;
}

/* Sidebar Logo Area */
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .3);
}

.sidebar-logo .logo-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  border: 2px solid rgba(255, 255, 255, .3);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  flex: 1;
  overflow: hidden;
}

.sidebar-logo .logo-text h6 {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo .logo-text span {
  color: rgba(255, 255, 255, .6);
  font-size: 10px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1 1 0%;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* Essential for flex-shrink with overflow */
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: all .2s;
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.sidebar-nav li a.active {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav li a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

/* Sidebar label sections */
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 18px 4px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  flex-shrink: 0;
  margin-top: auto; /* Fallback to keep at bottom */
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .3);
  flex-shrink: 0;
}

.sidebar-footer .user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-footer .user-name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-footer .user-role {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, .55);
}

.sidebar-footer .btn-logout {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.sidebar-footer .btn-logout:hover {
  background: rgba(239, 83, 80, .25);
  border-color: rgba(239, 83, 80, .5);
  color: #fff;
}

/* ======================== MAIN CONTENT ======================== */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .3s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.main-content.sidebar-collapsed-content {
  margin-left: var(--sidebar-collapsed-w);
}

/* Top navbar */
.topbar {
  background: #fff;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .toggle-btn {
  display: flex;
  background: none;
  border: none;
  font-size: 18px;
  color: #555;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 8px;
  transition: background .2s, color .2s;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar .toggle-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.topbar .page-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.topbar .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content area */
.content-area {
  flex: 1;
  padding: 22px;
}

/* ======================== CARDS ======================== */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
  transition: box-shadow .2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stat cards */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .2s, box-shadow .2s;
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

/* ======================== TABLES ======================== */
.table-wrapper {
  overflow-x: auto;

}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

table thead tr {
  background: #f9fafb;
}

table thead th {
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #555;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #e5e7eb;
}

table tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

table tbody tr:hover {
  background: #fafbff;
}

table tbody td {
  padding: 10px 14px;
  font-size: 13.5px;
  color: #333;
  vertical-align: middle;
}

table tbody tr:last-child {
  border-bottom: none;
}

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(.97);
}

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

.btn-primary:hover {
  background: #1d8a7f;
}

.btn-secondary {
  background: var(--secondary);
  color: #333;
}

.btn-secondary:hover {
  background: #9ac95c;
}

.btn-warning {
  background: var(--gold);
  color: #333;
}

.btn-warning:hover {
  background: #e6af00;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #c62828;
}

.btn-info {
  background: var(--blue);
  color: #fff;
}

.btn-info:hover {
  background: #01579b;
}

.btn-purple {
  background: var(--purple);
  color: #fff;
}

.btn-purple:hover {
  background: #371f54;
}

.btn-ghost {
  background: transparent;
  color: #555;
  border: 1.5px solid #ddd;
}

.btn-ghost:hover {
  background: #f5f5f5;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

/* ======================== BADGES ======================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-primary {
  background: #e0f4f3;
  color: #26A69A;
}

.badge-success {
  background: #f1f8e9;
  color: #558b2f;
}

.badge-warning {
  background: #fffde7;
  color: #f57f17;
}

.badge-danger {
  background: #fce4ec;
  color: #c62828;
}

.badge-purple {
  background: #ede7f6;
  color: #4a148c;
}

.badge-blue {
  background: #e1f5fe;
  color: #01579b;
}

.badge-orange {
  background: #fbe9e7;
  color: #bf360c;
}

.badge-gray {
  background: #f5f5f5;
  color: #555;
}

/* ======================== MODALS ======================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s;
}

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

.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
  position: relative;
}

.modal-box.sm {
  max-width: 420px;
}

.modal-box.md {
  max-width: 600px;
}

.modal-box.lg {
  max-width: 800px;
}

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h5 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.modal-close:hover {
  background: #eee;
  color: #333;
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 13.5px;
  color: #333;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: #fff;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38, 166, 154, .12);
}

.form-control.error {
  border-color: var(--red);
}

.form-hint {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.form-row {
  display: grid;
  gap: 14px;
}

.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ======================== IMG PREVIEW ======================== */
.img-preview {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #eee;
  display: block;
  margin-bottom: 8px;
}

.img-preview-round {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e0e0e0;
}

/* ======================== LOADING SPINNER ======================== */
.spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

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

.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.spinner-text {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

/* ======================== LOGIN ======================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f9;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: rgba(38, 166, 154, 0.08);
  top: -200px;
  right: -150px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(74, 44, 109, 0.06);
  bottom: -150px;
  left: -100px;
  pointer-events: none;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  top: -150px;
  right: -150px;
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.login-card {
  background: rgba(255, 255, 255, .97);
  border-radius: 20px;
  width: 100%;
  max-width: 800px;
  min-height: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  position: relative;
  z-index: 1;
  animation: slideUp .4s ease;
  display: flex;
  padding: 0;
  overflow: hidden;
}

.login-left {
  flex: 1.3;
  padding: 50px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0095b7 0%, #001255 100%);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.login-right {
  flex: 1;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.login-logo img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.login-logo .logo-init {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  margin-bottom: 2px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 2;
}

.login-school-name {
  font-size: 26px;
  font-weight: 700;
  color: #fffa59;
  margin: 12px 0 2px;

  z-index: 2;
  position: relative;
}

.login-district {
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
  z-index: 2;
  position: relative;
}

.login-year-badge {
  display: inline-block;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin-top: 10px;
  z-index: 2;
  position: relative;
  backdrop-filter: blur(4px);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 12px;
}

.login-subtitle {
  font-size: 14px;
  color: #888;
  text-align: center;
  margin-bottom: 24px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap>i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 14px;
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 38px;
}

.input-icon-wrap input[type="password"],
.input-icon-wrap input#password {
  padding-right: 40px;
}

.input-icon-wrap .toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0095b7 0%, #001255 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.btn-login:hover {
  opacity: .92;
}

/* ======================== AVATAR TABLE ======================== */
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}

.avatar-placeholder-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26A69A, #4A2C6D);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ======================== FOOTER ======================== */
.footer {
  background: #cccccc;
  color: #3f3f3f;
  text-align: center;
  padding: 14px 20px;
  font-size: 12.5px;
}

.footer strong {
  color: #3f3f3f;
}

/* ======================== PAGINATION ======================== */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #555;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.page-btn:hover {
  background: #f5f5f5;
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* ======================== SEARCH BOX ======================== */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 13px;
}

.search-box input {
  padding-left: 32px;
  width: 220px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  padding-top: 8px;
  padding-bottom: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

/* ======================== DYNAMIC ROOMS ======================== */
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1.5px solid #eee;
}

.room-item input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Kanit', sans-serif;
  font-size: 13.5px;
  outline: none;
  color: #333;
}

.room-item .remove-room {
  background: none;
  border: none;
  color: #EF5350;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: color .2s;
}

.room-item .remove-room:hover {
  color: #c62828;
}

/* ======================== ANIMATIONS ======================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: var(--sidebar-w) !important;
    /* always full width on mobile */
  }

  .sidebar.collapsed {
    width: var(--sidebar-w) !important;
  }

  /* Restore hidden elements on mobile even if collapsed */
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .sidebar-label,
  .sidebar.collapsed .sidebar-nav li a span.nav-text,
  .sidebar.collapsed .sidebar-footer .user-name,
  .sidebar.collapsed .sidebar-footer .user-role,
  .sidebar.collapsed .sidebar-footer .btn-logout span {
    display: unset;
  }

  .sidebar.collapsed .sidebar-nav li a {
    justify-content: flex-start;
    padding: 11px 18px;
  }

  .sidebar.collapsed .sidebar-logo {
    justify-content: flex-start;
    padding: 20px 16px 14px;
  }

  .sidebar.collapsed .sidebar-footer {
    padding: 12px 16px;
  }

  .sidebar.collapsed .sidebar-footer .user-info {
    justify-content: flex-start;
  }

  .sidebar.collapsed .sidebar-footer .btn-logout {
    justify-content: center;
    padding: 7px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .2);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .main-content.sidebar-collapsed-content {
    margin-left: 0 !important;
  }

  .content-area {
    padding: 14px;
  }

  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .login-card {
    max-width: 420px;
    flex-direction: column;
  }

  .login-left {
    padding: 30px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  .login-right {
    padding: 30px;
  }
}

@media (max-width: 480px) {
  .stat-value {
    font-size: 20px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ======================== MISC UTILS ======================== */
.text-primary {
  color: var(--primary) !important;
}

.text-purple {
  color: var(--purple) !important;
}

.text-gold {
  color: var(--gold) !important;
}

.text-danger {
  color: var(--red) !important;
}

.text-muted {
  color: #888 !important;
}

.divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 14px 0;
}

.mt-0 {
  margin-top: 0
}

.mb-0 {
  margin-bottom: 0
}

.gap-2 {
  gap: 8px
}

.gap-3 {
  gap: 12px
}

.flex {
  display: flex
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center
}

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

.flex-wrap {
  flex-wrap: wrap
}

.w-full {
  width: 100%
}

.hidden {
  display: none !important
}

/* Chart wrapper */
.chart-wrap {
  position: relative;
}

.chart-wrap canvas {
  max-width: 100%;
}

/* Ensure SweetAlert2 is always on top */
.swal2-container {
  z-index: 3000 !important;
}