:root {
  --mobile-nav-height: 64px;
  --mobile-radius: 8px;
}
.hide {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}
.touch-target {
  min-height: 44px;
}
.mobile-stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.mobile-stack-actions .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-stat-card .card-body {
  min-height: 96px;
}
.profile-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.profile-info-item {
  min-width: 0;
}
.profile-info-label {
  color: #858796;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.profile-info-value {
  color: #3a3b45;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.qr-login-image {
  width: 180px;
  max-width: 100%;
}
.topbar .nav-item .nav-link .img-profile {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}
#userDropdown .small {
  display: inline-block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-left td,
.td-left th,
.td-right td,
.td-right th,
.td-center td,
.td-center th {
  padding: 5px;
  border: solid 1px #ddd;
  text-align: left;
}
.td-center td,
.td-center th {
  text-align: center;
}
.td-right td,
.td-right th {
  text-align: right;
}
.brd {
  border: solid 1px;
}
.brd1 {
  border: solid 1px red;
}
.brd2 {
  border: solid 1px blue;
}
.brd3 {
  border: solid 1px #ccc;
}
.clr {
  background-color: #ebebeb;
}
a:hover {
  text-decoration: none;
}
.brd-left {
  border-left: double 1px;
}
#dataTableDtl td,
#dataTableMore td {
  text-align: right;
}
#dataTableDtl td:first-of-type,
#dataTableMore td:first-of-type {
  text-align: center;
}
.table-responsive {
  -webkit-overflow-scrolling: touch;
}
.table-responsive .table {
  min-width: 620px;
}
.rapot-scroll {
  width: 100%;
}
.d-text-right {
  text-align: right;
}
@media (min-width: 768px) {
  #accordionSidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
  }
  #content-wrapper {
    margin-left: 14rem;
    width: calc(100% - 14rem);
  }
  body.sidebar-toggled #content-wrapper {
    margin-left: 6.5rem;
    width: calc(100% - 6.5rem);
  }
  .sidebar .nav-item .nav-link {
    padding: 8px 1rem;
  }
  .sidebar-heading {
    padding: 5px 0 0 20px !important;
  }
}
@media (max-width: 1024px) {
  .desktop {
    display: none;
  }
  .m-text-center {
    text-align: center !important;
  }
  .d-text-right {
    text-align: left;
  }
  .m-text-right {
    text-align: right;
  }
  .m-p-2 {
    padding: 10px;
  }
  .m-p-1 {
    padding: 5px;
  }
  .m-p-0 {
    padding: 0;
  }
}
@media (max-width: 767.98px) {
  body {
    padding-bottom: calc(
      var(--mobile-nav-height) + env(safe-area-inset-bottom)
    );
  }
  body.bg-gradient-warning {
    background: #f8f9fc !important;
  }
  #wrapper {
    display: block;
  }
  #accordionSidebar {
    display: none !important;
  }
  #content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
  }
  #content {
    padding-bottom: 1rem;
  }
  .topbar {
    height: auto;
    min-height: 56px;
    margin-bottom: 0.75rem !important;
    padding: 0.5rem 0.75rem;
  }
  .topbar .btn-link {
    display: none;
  }
  .topbar h4 {
    font-size: 1rem;
    line-height: 1.2;
    margin-left: 0 !important;
    max-width: calc(100vw - 86px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .nav-item .nav-link {
    height: 44px;
    padding: 0 0.25rem;
  }
  .topbar .nav-item .nav-link .img-profile {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
  }
  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .container-fluid.m-p-0 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .card {
    border-radius: var(--mobile-radius);
  }
  .card.shadow,
  .card.shadow-lg {
    box-shadow: 0 0.35rem 0.9rem rgba(58, 59, 69, 0.12) !important;
  }
  .card-body {
    padding: 1rem;
  }
  .card-header {
    padding: 0.85rem 1rem !important;
  }
  .mobile-hero h1,
  .mobile-hero .h3 {
    font-size: 1.25rem;
    line-height: 1.25;
  }
  .mobile-hero p {
    font-size: 0.9rem;
  }
  .mobile-stack-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-stack-actions .btn {
    width: 100%;
    margin: 0 !important;
    white-space: normal;
  }
  .mobile-stat-col {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
    margin-bottom: 0.75rem !important;
  }
  .mobile-stat-card {
    border-left-width: 0.25rem !important;
  }
  .mobile-stat-card .card-body {
    min-height: 88px;
    padding: 0.85rem;
  }
  .mobile-stat-card .h5,
  .mobile-stat-card .h6 {
    font-size: 1rem;
    line-height: 1.25;
  }
  .profile-info-list {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .qr-login-image {
    width: 210px;
  }
  .form-control,
  .input-group-text,
  .btn {
    min-height: 44px;
  }
  .input-group .btn {
    min-height: auto;
  }
  .login-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .login-container > .row {
    width: 100%;
  }
  .login-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100%;
  }
  .login-card .card-body-inner {
    padding: 1.25rem !important;
  }
  .login-logo {
    max-width: 76px !important;
  }
  .login-title {
    font-size: 1.25rem;
  }
  .login-subtitle {
    font-size: 1rem;
    margin-bottom: 0.75rem !important;
  }
  .table-responsive {
    border: 1px solid #e3e6f0;
    border-radius: var(--mobile-radius);
  }
  .table-responsive .dataTables_wrapper {
    min-width: 620px;
  }
  .table {
    font-size: 0.82rem;
  }
  .table th,
  .table td {
    padding: 0.55rem;
  }
  .dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
  }
  .dataTables_wrapper .col-sm-12 {
    padding-left: 0;
    padding-right: 0;
  }
  .dataTables_length,
  .dataTables_filter,
  .dataTables_info,
  .dataTables_paginate {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
  .modal-dialog {
    margin: 0.5rem;
  }
  #loadMore .modal-dialog {
    max-width: none;
  }
  #loadMore .modal-body {
    max-height: 70vh;
    overflow: auto;
  }
  .sticky-footer {
    display: none;
  }
  .scroll-to-top {
    bottom: calc(var(--mobile-nav-height) + 0.75rem);
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: var(--mobile-nav-height);
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e3e6f0;
    box-shadow: 0 -0.35rem 0.9rem rgba(58, 59, 69, 0.12);
  }
  .mobile-bottom-nav a {
    color: #858796;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    min-width: 0;
    min-height: 52px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
  }
  .mobile-bottom-nav a i {
    font-size: 1rem;
  }
  .mobile-bottom-nav a.active {
    color: #1cc88a;
    background: #e9fbf4;
  }
  .rapot-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e3e6f0;
    border-radius: var(--mobile-radius);
    background: #fff;
  }
  .rapot-scroll .rapot-sheet {
    min-width: 900px;
    margin: 0;
    border: 0;
  }
  .rapot-toolbar {
    justify-content: stretch !important;
  }
  .rapot-toolbar .btn {
    width: 100%;
  }
}
@media (max-width: 374.98px) {
  .mobile-stack-actions {
    grid-template-columns: 1fr;
  }
  .mobile-stat-col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .mobile-bottom-nav a {
    font-size: 0.62rem;
  }
}
@media print {
  body {
    padding-bottom: 0;
  }
  .mobile-bottom-nav {
    display: none !important;
  }
}
/* sidebar */
.sidebar-dark .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
}

.sidebar-dark .nav-link:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

.sidebar-dark .nav-link.active {
  color: white !important;
  background: rgba(255, 255, 255, 0.25) !important;
  font-weight: 600;
}

.sidebar-dark .nav-link i {
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-dark .sidebar-brand {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-dark .sidebar-brand-text {
  color: white;
  font-weight: 700;
}

/* ========================================== */
/* STUDENT UI POLISH */
/* ========================================== */
.student-green-theme .container-fluid {
  max-width: 1180px;
}

.student-green-theme .topbar {
  min-height: 58px;
}

.dashboard-welcome-card {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 172px;
  padding: 1.15rem 1.25rem;
}

.dashboard-welcome-main {
  min-width: 0;
}

.dashboard-welcome-copy h1 {
  max-width: 460px;
}

.dashboard-welcome-actions {
  align-items: center;
  align-self: center;
  display: flex;
  gap: 0.55rem;
  justify-content: center;
}

.dashboard-welcome-actions .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 92px;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}

.dashboard-summary-card,
.student-green-theme .card {
  border-radius: 8px;
}

.student-green-theme .card-header {
  align-items: center;
  gap: 0.75rem;
}

.student-green-theme .card-header .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.student-green-theme .btn-block.touch-target {
  align-items: center;
  display: flex;
}

.student-green-theme .alert {
  border-radius: 8px;
}

.rapot-toolbar,
.rapot-pagination {
  flex-wrap: wrap;
}

.rapot-pagination .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
}

.rapot-page-label {
  line-height: 1.25;
}

@media (max-width: 991.98px) {
  .dashboard-welcome-card {
    grid-template-columns: 1fr;
  }

  .dashboard-welcome-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .student-green-theme .container-fluid,
  .student-green-theme .container-fluid.m-p-0 {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .dashboard-welcome-card {
    align-items: stretch;
    gap: 0.9rem;
    margin-bottom: 0.9rem !important;
    min-height: 0;
    padding: 1rem;
  }

  .dashboard-welcome-main {
    align-items: center;
    gap: 0.75rem;
  }

  .dashboard-welcome-copy h1 {
    font-size: 1.2rem;
    line-height: 1.25;
    max-width: none;
  }

  .dashboard-welcome-meta {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .dashboard-welcome-actions {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .dashboard-welcome-actions .btn {
    min-height: 42px;
    min-width: 0;
    width: 100%;
  }

  .dashboard-summary-card {
    min-height: 118px;
  }

  .student-green-theme .card-header {
    align-items: stretch !important;
  }

  .student-green-theme .card-header .btn {
    width: 100%;
  }

  .rapot-toolbar {
    gap: 0.5rem;
  }

  .rapot-toolbar .btn {
    width: 100%;
  }

  .rapot-pagination {
    align-items: stretch;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 1fr;
  }

  .rapot-page-label {
    grid-column: 1 / -1;
    min-width: 0;
    order: -1;
    width: 100%;
  }

  .rapot-pagination .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .dashboard-welcome-main {
    align-items: flex-start;
  }

  .dashboard-welcome-meta span {
    max-width: 100%;
  }

  .dashboard-welcome-actions {
    grid-template-columns: 1fr;
  }
}
