html {
  font-size: 14px;
}

.ams-cart-panel {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---- Messages: modern chat layout ---- */
.ams-chat-page {
  position: relative;
  z-index: 2;
}

.ams-chat-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.ams-chat-shell {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.ams-chat-shell > .row {
  flex: 1;
  min-height: 0; /* allow inner scroll areas */
}

.ams-chat-shell-title {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.35);
}

.ams-chat-shell-title-text {
  font-weight: 800;
  font-size: 1.15rem;
  color: rgba(15, 23, 42, 0.88);
}

.ams-chat-sidebar {
  background: rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 992px) {
  .ams-chat-sidebar {
    border-bottom: 0;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
  }
}

/* ---- Login page: keep centered Bootstrap container (override dashboard full-width rules) ---- */
body.ams-login .ams-content > main {
  padding-left: 0;
  padding-right: 0;
}

body.ams-login .ams-content {
  margin-left: 0 !important;
}

/* Fully center the login page content on any screen size */
body.ams-login .ams-content {
  min-height: 100dvh;
  display: flex;
}

body.ams-login .ams-content > main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px !important;
}

body.ams-login .login-hero {
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

body.ams-login .ams-login-center {
  width: 100%;
  display: flex;
  justify-content: center;
}

body.ams-login .ams-login-card-wrap {
  width: min(560px, 100%);
}

@media (min-width: 992px) {
  body.ams-login .ams-content > main > .container,
  body.ams-login .ams-content > main > .container-sm,
  body.ams-login .ams-content > main > .container-md,
  body.ams-login .ams-content > main > .container-lg,
  body.ams-login .ams-content > main > .container-xl,
  body.ams-login .ams-content > main > .container-xxl {
    max-width: 1140px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Login page uses Bootstrap centering utilities; undo the dashboard override */
  body.ams-login .ams-content > main .row.justify-content-center {
    justify-content: center !important;
  }
}

.ams-chat-sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.ams-chat-search .input-group-text {
  border-radius: 14px 0 0 14px;
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.65);
}

.ams-chat-search .form-control {
  border-radius: 0 14px 14px 0;
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.65);
}

.ams-chat-people-header {
  margin-top: 12px;
  margin-bottom: 10px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.72);
}

.ams-chat-people-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.ams-chat-person {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  color: rgba(15, 23, 42, 0.88);
}

.ams-chat-person:hover {
  background: rgba(15, 23, 42, 0.04);
}

.ams-chat-person.is-active {
  background: rgba(37, 140, 251, 0.10);
  border-color: rgba(37, 140, 251, 0.22);
}

.ams-chat-person-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ams-chat-person-name {
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ams-chat-person-role {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.60);
}

.ams-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.80);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ams-chat-avatar--lg {
  width: 46px;
  height: 46px;
}

.ams-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ams-chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ams-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ams-chat-peer-name {
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ams-chat-peer-status {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.58);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.ams-chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.ams-chat-peer-status.is-offline .ams-chat-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.ams-chat-header-actions {
  display: inline-flex;
  gap: 8px;
}

.ams-chat-log {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.18);
}

.ams-chat-msg {
  display: flex;
  margin-bottom: 10px;
}

.ams-chat-msg.is-mine {
  justify-content: flex-end;
}

.ams-chat-msg.is-theirs {
  justify-content: flex-start;
}

.ams-chat-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(15, 23, 42, 0.04);
}

.ams-chat-msg.is-mine .ams-chat-bubble {
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.ams-chat-text {
  white-space: pre-wrap;
}

.ams-chat-time {
  margin-top: 6px;
  font-size: 0.78rem;
  opacity: 0.75;
}

.ams-chat-input {
  padding: 12px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.35);
}

.ams-chat-input textarea.form-control {
  resize: none;
}

@media (max-width: 991.98px) {
  .ams-chat-shell {
    border-radius: 18px;
  }

  .ams-chat-main {
    min-height: 480px;
  }
}

@media (min-width: 992px) {
  /* Keep the chat UI within the viewport and scroll inside, not the whole page */
  .ams-chat-shell {
    height: min(640px, calc(100vh - 140px));
  }

  .ams-chat-sidebar,
  .ams-chat-main {
    height: 100%;
  }
}

/* Dashboard container: keep max width but align to the left (no big empty gutter beside the sidebar) */
.dash-container {
  max-width: 1400px;
  margin-left: 0 !important;
  margin-right: auto !important;
}

@media (max-width: 767.98px) {
  .dash-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-hero-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ---- Light + clean professional baseline ---- */
:root {
  --ams-bg: #f4f6fb;
  --ams-surface: #ffffff;
  --ams-surface-2: #f8fafc;
  --ams-border: rgba(15, 23, 42, 0.12);
  --ams-text: #0f172a;
  --ams-text-muted: rgba(15, 23, 42, 0.62);
  --ams-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --ams-shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --ams-radius: 14px;
  --ams-primary: #f59e0b;
  --ams-primary-hover: #d97706;
}

body {
  color: var(--ams-text);
  background: var(--ams-bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  text-rendering: optimizeLegibility;
}

.text-muted {
  color: var(--ams-text-muted) !important;
}

/* Cards */
.card {
  border-color: var(--ams-border);
  border-radius: var(--ams-radius);
}

.shadow-sm {
  box-shadow: var(--ams-shadow-sm) !important;
}

/* Common surfaces used across dashboards */
.dashboard-card-60 {
  border: 1px solid var(--ams-border);
  background: #ffffff;
  box-shadow: var(--ams-shadow-md);
  border-radius: var(--ams-radius);
}

/* Tables */
.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.table thead th {
  font-weight: 600;
  color: rgba(15, 23, 42, 0.72);
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

/* Forms */
.form-control,
.form-select {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.14);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(37, 140, 251, 0.55);
  box-shadow: 0 0 0 .18rem rgba(37, 140, 251, 0.15);
}

.btn {
  border-radius: 12px;
}

.btn-primary {
  background-color: var(--ams-primary);
  border-color: var(--ams-primary);
  box-shadow: 0 10px 18px rgba(245, 158, 11, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--ams-primary-hover);
  border-color: var(--ams-primary-hover);
}

/* Tabs: cleaner, more "app"-like */
.nav-tabs {
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

.nav-tabs .nav-link {
  border: 0;
  color: rgba(15, 23, 42, 0.70);
  font-weight: 600;
}

.nav-tabs .nav-link:hover {
  color: rgba(15, 23, 42, 0.95);
}

.nav-tabs .nav-link.active {
  color: rgba(15, 23, 42, 0.95);
  background: transparent;
  border-bottom: 2px solid var(--ams-primary);
}

/* Alerts */
.alert {
  border-radius: 14px;
  border-color: rgba(15, 23, 42, 0.10);
}

/* Side bar subtle polish (desktop only) */
@media (min-width: 768px) {
  .ams-sidebar-link {
    border-radius: 12px;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---- Login page styles ---- */
.login-hero {
  /* keep the hero spacing but make its background transparent;
     the animated blobs now cover the entire viewport */
  background: transparent;
  min-height: 60vh;
}

/* Card */
.login-card {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  /* sits above the fixed background */
  position: relative;
  z-index: 3;
}

/* Subtle logo in the card */
.login-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0,0,0,0.05);
  padding: 4px;
}

/* Input group icons */
.input-group-text {
  background: #f8fafc;
  border-right: 0;
}

/* Make inputs visually consistent */
.login-card .form-control {
  border-left: 0;
}

/* Adjust card footer */
.login-card .card-footer {
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* Smaller devices spacing */
@media (max-width: 575.98px) {
  .login-card .card-body {
    padding: 1.25rem;
  }
}

/* Utility: center vertically at least a comfortable height */
.min-vh-60 {
  min-height: 60vh !important;
}

/* --- Two-circle animated background (full-viewport) --- */

/* Make the animated background cover the whole viewport and sit behind everything */
.bg-anim {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  will-change: transform, opacity;
  opacity: 0.14;
}

/* Subtle cloud pattern overlay (desktop only) */
@media (min-width: 992px) {
  .bg-anim::before {
    content: "";
    position: absolute;
    inset: -30% -20% 0 -20%;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='720'%20height='260'%20viewBox='0%200%20720%20260'%3E%3Cg%20fill='%23ffffff'%20opacity='0.55'%3E%3Cpath%20d='M112%20180c-30%200-54-20-54-45%200-22%2019-41%2044-44%2010-25%2034-42%2063-42%2036%200%2066%2026%2069%2059h6c26%200%2047%2018%2047%2041s-21%2031-47%2031H112z'/%3E%3Cpath%20d='M420%20118c-24%200-43-16-43-36%200-18%2015-33%2035-35%208-21%2029-36%2053-36%2031%200%2056%2022%2059%2050h5c22%200%2040%2016%2040%2036s-18%2021-40%2021H420z'/%3E%3Cpath%20d='M510%20210c-28%200-50-18-50-41%200-20%2017-37%2040-40%209-23%2031-39%2058-39%2034%200%2061%2024%2064%2054h6c25%200%2046%2017%2046%2038s-21%2028-46%2028H510z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 520px 200px;
    opacity: 0.10;
    filter: blur(0.2px);
    animation: amsCloudDrift 70s linear infinite;
  }
}

@keyframes amsCloudDrift {
  from { background-position: 0 0; }
  to { background-position: 900px 0; }
}

/* Base blob */
.bg-anim .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  transform: translate3d(0,0,0);
  mix-blend-mode: normal;
  will-change: transform;
  display: block;
}

/* Blue circle */
.bg-anim .blob-blue {
  width: 80vw;
  height: 80vw;
  max-width: 1600px;
  max-height: 1600px;
  left: -20vw;
  top: -12vh;
  background: radial-gradient(circle at 30% 30%, rgba(37,140,251,0.22), rgba(37,140,251,0.00));
  /* multi-directional path, moderate speed */
  animation: roamBlue 18s linear infinite;
  animation-fill-mode: both;
}

/* Red circle */
.bg-anim .blob-red {
  width: 78vw;
  height: 78vw;
  max-width: 1500px;
  max-height: 1500px;
  right: -22vw;
  bottom: -12vh;
  background: radial-gradient(circle at 30% 30%, rgba(244,63,94,0.18), rgba(244,63,94,0.00));
  /* different path and offset so they don't mirror exactly */
  animation: roamRed 20s linear infinite;
  animation-delay: 3s;
  animation-fill-mode: both;
}

/* Blue: roam across several points in x/Y (left/right, up/down) */
@keyframes roamBlue {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  12%  { transform: translate3d(10vw, -6vh, 0) scale(1.01) rotate(20deg); }
  25%  { transform: translate3d(28vw, -2vh, 0) scale(1.02) rotate(40deg); }
  37%  { transform: translate3d(14vw, 10vh, 0) scale(1.03) rotate(70deg); }
  50%  { transform: translate3d(-8vw, 18vh, 0) scale(1.04) rotate(100deg); }
  62%  { transform: translate3d(-26vw, 8vh, 0) scale(1.03) rotate(140deg); }
  75%  { transform: translate3d(-6vw, -8vh, 0) scale(1.02) rotate(180deg); }
  88%  { transform: translate3d(8vw, -14vh, 0) scale(1.01) rotate(210deg); }
  100% { transform: translate3d(0, 0, 0) scale(1) rotate(240deg); }
}

/* Red: different roaming path crossing multiple directions */
@keyframes roamRed {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  10%  { transform: translate3d(-8vw, 6vh, 0) scale(1.01) rotate(-15deg); }
  22%  { transform: translate3d(-22vw, 12vh, 0) scale(1.02) rotate(-40deg); }
  35%  { transform: translate3d(-6vw, 4vh, 0) scale(1.03) rotate(-70deg); }
  48%  { transform: translate3d(10vw, -6vh, 0) scale(1.04) rotate(-110deg); }
  62%  { transform: translate3d(26vw, -10vh, 0) scale(1.03) rotate(-150deg); }
  76%  { transform: translate3d(12vw, 8vh, 0) scale(1.02) rotate(-190deg); }
  88%  { transform: translate3d(-4vw, 14vh, 0) scale(1.01) rotate(-220deg); }
  100% { transform: translate3d(0, 0, 0) scale(1) rotate(-240deg); }
}

/* Responsive tweaks */
@media (max-width: 1200px) {
  .bg-anim .blob-blue,
  .bg-anim .blob-red {
    filter: blur(100px);
  }
  .bg-anim .blob-blue {
    left: -18vw;
    top: -10vh;
  }
  .bg-anim .blob-red {
    right: -18vw;
    bottom: -10vh;
  }
}

@media (max-width: 768px) {
  .bg-anim .blob-blue,
  .bg-anim .blob-red {
    width: 120vw;
    height: 120vw;
    filter: blur(110px);
  }
  .bg-anim .blob-blue {
    left: -30vw;
    top: -18vh;
  }
  .bg-anim .blob-red {
    right: -30vw;
    bottom: -18vh;
  }
}

@media (max-width: 576px) {
  .bg-anim .blob-blue,
  .bg-anim .blob-red {
    width: 160vw;
    height: 160vw;
    filter: blur(100px);
    opacity: 0.9;
  }
  .bg-anim .blob-blue {
    left: -40vw;
    top: -25vh;
  }
  .bg-anim .blob-red {
    right: -40vw;
    bottom: -25vh;
  }
}

/* Respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .bg-anim .blob,
  .bg-anim .blob-blue,
  .bg-anim .blob-red {
    animation: none !important;
    transform: none !important;
  }
}

/* input icon sizing & alignment */
.input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.6rem; /* keep compact */
  background: #f8fafc;
  border-right: 0;
}

.input-icon svg {
  width: 20px;
  height: 20px;
  color: #6c757d; /* muted icon color */
  display: block;
}

/* ensure control border looks seamless with input-group-text */
.input-group .form-control {
  border-left: 0;
}

/* Register form specific styles (append to existing file) */

.register-card {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  position: relative;
  overflow: visible;
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}

.register-header h2 {
  font-weight: 600;
  letter-spacing: -0.2px;
}

.register-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Circular photo preview, 2in x 2in */
.photo-preview-circle {
  width: 2in;
  height: 2in;
  min-width: 2in;
  min-height: 2in;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.85);
  box-shadow: 0 8px 20px rgba(16,24,40,0.12);
  background: linear-gradient(180deg,#e9eef6,#f7fbff);
}

/* small input style (consistent with form-control-sm) */
.register-card .form-control-sm {
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
}

/* subtle label styling */
.register-card .form-label {
  color: #344054;
  font-size: .85rem;
  font-weight: 500;
}

/* animated circle background contrast tweak */
.bg-anim {
  opacity: 0.85;
}

/* ensure card sits above background blobs */
.register-card {
  position: relative;
  z-index: 2;
}

/* Responsive stacking adjustments */
@media (max-width: 991.98px) {
  .photo-preview-circle {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
  }
  .register-card {
    padding: 1.25rem;
  }
}

/* ---- Dashboard card opacity (60%) ---- */
.dashboard-card-60 {
  /* Force Bootstrap card variables too (covers more cases than background-color alone) */
  --bs-card-bg: rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.6) !important;

  border: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(6px);
}

/* Dashboard (phones only): turn Profile Information into a 2-column grid like the desired screenshot */
@media (max-width: 575.98px) {
  /* The Profile Information items are in: .dashboard-card-60 .card-body > .row.small */
  .dashboard-card-60 .card-body > .row.small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    align-items: start;
  }

  /* Each item becomes a small block; remove Bootstrap column sizing/margins */
  .dashboard-card-60 .card-body > .row.small > [class*="col-"] {
    width: auto;
    max-width: none;
    flex: none;
    margin-bottom: 0 !important;
  }

  .dashboard-card-60 .card-body > .row.small > [class*="col-"] > .text-muted {
    font-size: 0.8rem;
    margin: 0;
  }

  .dashboard-card-60 .card-body > .row.small > [class*="col-"] > .fw-semibold {
    font-size: 0.9rem;
    margin: 0;
    word-break: break-word;
  }
}

/* Dashboard header actions: responsive + nicer on mobile */
.dashboard-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* Phones: stack actions full-width under the title, make buttons easier to tap */
@media (max-width: 575.98px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  .dashboard-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .dashboard-actions .btn {
    width: 100%;
    white-space: nowrap;
  }
}

/* ---- Sidebar navigation (layout) ---- */
:root {
  --ams-sidebar-w: 260px;
  --ams-sidebar-w-collapsed: 74px;
}

.ams-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--ams-sidebar-w);
  z-index: 1035;
  background: #ffffff;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  padding: 14px;
  transition: width 180ms ease, transform 180ms ease;
}

.ams-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 10px 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 10px;
}

/* Sidebar header: stacked + centered (matches the screenshot) */
.ams-sidebar-header--stack {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  gap: 10px;

  padding: 10px 8px 14px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 10px;
}

/* Brand centered on top */
.ams-sidebar-brand--center {
  text-align: center;
  width: 100%;
  max-width: 100%;
  padding: 4px 6px;

  /* keep it neat if it’s too long */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle centered box under brand */
.ams-sidebar-toggle {
  position: static;
  width: 44px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: none;
}

/* Collapsed: hide the brand + hide link text fully */
body.ams-sidebar-collapsed .ams-sidebar-brand {
  display: none !important;
}

/* Content offset when sidebar exists */
.ams-content {
  margin-left: var(--ams-sidebar-w);
  transition: margin-left 180ms ease;
}

/* Collapsed state (desktop) */
body.ams-sidebar-collapsed .ams-sidebar {
  width: var(--ams-sidebar-w-collapsed);
  padding: 12px 8px;
}

/* Remove content area offset appropriately */
body.ams-sidebar-collapsed .ams-content {
  margin-left: var(--ams-sidebar-w-collapsed);
}

/* Hide brand text completely (prevents the "AttendanceManagement..." clipping) */
body.ams-sidebar-collapsed .ams-sidebar-header {
  border-bottom: 0;
  margin-bottom: 6px;
  padding: 0;
}

body.ams-sidebar-collapsed .ams-sidebar-brand {
  display: none !important;
}

/* Hide link text completely (prevents the "Home" from showing) */
body.ams-sidebar-collapsed .ams-sidebar-nav {
  gap: 0;
}

body.ams-sidebar-collapsed .ams-sidebar-link {
  font-size: 0;              /* hides text */
  padding: 10px;             /* keep a clickable square */
  border-radius: 12px;
}

body.ams-sidebar-collapsed .ams-sidebar-link::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.35); /* simple "icon dot" placeholder */
}

body.ams-sidebar-collapsed .ams-sidebar-toggle {
  left: 10px;
}

/* Sidebar icon support */
.ams-sidebar-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.ams-sidebar-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: rgba(15, 23, 42, 0.70);
}

/* Text wrapper so we can hide it cleanly */
.ams-sidebar-text {
  display: inline;
}

/* Expanded sidebar: align icon + text like the reference UI (desktop only) */
@media (min-width: 768px) {
  .ams-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
  }
}

/* Collapsed: show house icon, hide text */
body.ams-sidebar-collapsed .ams-sidebar-icon {
  display: block;
}

body.ams-sidebar-collapsed .ams-sidebar-text {
  display: none;
}

/* Collapsed: remove the old gray placeholder block (you don't need it anymore) */
body.ams-sidebar-collapsed .ams-sidebar-link::before {
  content: none !important;
}

/* ---- Sidebar logo */
.ams-sidebar-logo {
  display: block;
  max-width: 70px;   /* adjust if you want bigger/smaller */
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---- Sidebar link color/font fix (force override in all states) ---- */
.ams-sidebar a,
.ams-sidebar a:link,
.ams-sidebar a:visited,
.ams-sidebar a:hover,
.ams-sidebar a:focus,
.ams-sidebar a:active {
  color: rgba(15, 23, 42, 0.85) !important;
  text-decoration: none !important;
}

/* Brand a bit stronger */
.ams-sidebar-brand,
.ams-sidebar-brand:link,
.ams-sidebar-brand:visited,
.ams-sidebar-brand:hover,
.ams-sidebar-brand:focus,
.ams-sidebar-brand:active {
  color: #0f172a !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}

/* Keep nav link styling consistent */
.ams-sidebar-link,
.ams-sidebar-link:link,
.ams-sidebar-link:visited {
  font-weight: 600;
}

.ams-sidebar-link:hover,
.ams-sidebar-link:focus {
  color: rgba(15, 23, 42, 1) !important;
}

/* Sidebar header: logo left, toggle right */
.ams-sidebar-header--logoRight {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;

  padding: 10px 8px 14px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 10px;
}

.ams-sidebar-brand--logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.ams-sidebar-logo {
  display: block;
  max-width: 240px; /* adjust as needed */
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---- Balance page content with sidebar ---- */

/* Make the main content area NOT center-shrink; use full available width */
.ams-content {
  display: block;          /* was: flex */
  justify-content: initial;/* was: center */
}

/* Let main fill the content area; control padding only */
.ams-content > main {
  width: 100%;
  max-width: none;         /* was: 1120px */
  padding-left: 16px;
  padding-right: 16px;
}

/* Collapsed state shouldn't change sizing either */
body.ams-sidebar-collapsed .ams-content > main {
  max-width: none;         /* was: 1120px */
}

/* ---- Keep mobile layout unchanged: disable sidebar behavior on small screens ---- */
@media (max-width: 991.98px) {
  /* Remove the "Hide the sidebar completely on mobile" block.
     Mobile uses an overlay drawer opened by .ams-mobile-menu-btn */

  /* Remove left offset and flex-centering effects on mobile */
  .ams-content {
    margin-left: 0 !important;
    display: block !important;
  }

  .ams-content > main {
    max-width: none !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* show a floating menu button on mobile */
  .ams-mobile-menu-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    left: auto;
    z-index: 2000;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
  }

  /* sidebar becomes an overlay drawer on mobile */
  .ams-sidebar {
    display: block !important;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 1999;
  }

  body.ams-mobile-menu-open .ams-sidebar {
    transform: translateX(0);
  }

  /* optional dim background */
  body.ams-mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1998;
  }

  /* ---- Mobile sidebar drawer refinement (match glass design) ---- */
  @media (max-width: 991.98px) {
    /* Drawer becomes a rounded "sheet" instead of a full-width slab */
    .ams-sidebar {
      width: min(92vw, 420px); /* was: min(86vw, 320px) */
      padding: 14px;           /* optional: slightly roomier */
      border-radius: 18px;
      margin: 10px 0 10px 10px;

      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(15, 23, 42, 0.10);
      box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);

      transform: translateX(calc(-100% - 24px));
      transition: transform 180ms ease;
    }

    body.ams-mobile-menu-open .ams-sidebar {
      transform: translateX(0);
    }

    /* Backdrop: blur + softer tint */
    body.ams-mobile-menu-open::before {
      background: rgba(15, 23, 42, 0.25);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    /* Make the floating button match your style */
    .ams-mobile-menu-btn {
      width: 44px;
      height: 44px;
      padding: 0;
      display: grid;
      place-items: center;

      background: rgba(255, 255, 255, 0.72) !important;
      border: 1px solid rgba(15, 23, 42, 0.12) !important;
      box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18) !important;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    /* Hide the in-drawer desktop toggle on mobile (prevents 2 hamburger buttons) */
    .ams-sidebar-toggle {
      display: none !important;
    }

    /* Slightly nicer nav spacing on mobile */
    .ams-sidebar-nav {
      display: grid;
      gap: 8px;
    }

    .ams-sidebar-link {
      padding: 12px 12px;
      border-radius: 12px;
    }

    .ams-sidebar-link:hover,
    .ams-sidebar-link:focus {
      background: rgba(15, 23, 42, 0.06);
    }
  }
}

/* ---- Desktop: push page content left (CSS-only, do not change views) ---- */
@media (min-width: 992px) {
  /* Stop Bootstrap's centered/narrow container behavior inside our main content area */
  .ams-content > main > .container,
  .ams-content > main > .container-sm,
  .ams-content > main > .container-md,
  .ams-content > main > .container-lg,
  .ams-content > main > .container-xl,
  .ams-content > main > .container-xxl {
    max-width: none !important;       /* removes the big side gutters */
    width: 100% !important;
    margin-left: 0 !important;        /* no centering */
    margin-right: 0 !important;
    padding-left: 16px !important;    /* keep a clean left padding */
    padding-right: 16px !important;
  }

  /* Force "center" rows to start at the left edge */
  .ams-content > main .row.justify-content-center {
    justify-content: flex-start !important;
  }
}

/* ---- Collapsed sidebar: center the toggle button perfectly ---- */
@media (min-width: 992px) {
  body.ams-sidebar-collapsed .ams-sidebar-header {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 0 !important; /* equal left/right */
    margin-bottom: 10px;
  }

  body.ams-sidebar-collapsed .ams-sidebar-toggle {
    margin: 0 auto !important;
    display: grid;
    place-items: center;
  }

  /* Ensure collapsed sidebar icons are perfectly centered (badges should not push the icon) */
  body.ams-sidebar-collapsed .ams-sidebar-link {
    position: relative;
    justify-content: center !important;
  }

  body.ams-sidebar-collapsed .ams-sidebar-icon {
    margin: 0 !important;
  }

  body.ams-sidebar-collapsed .ams-sidebar-link .badge {
    position: absolute;
    top: 8px;
    right: 10px;
    margin-left: 0 !important;
  }
}

@media (max-width: 991.98px) {
  /* ---- Mobile: always show logo + link text even if desktop collapsed state is saved ---- */
  body.ams-sidebar-collapsed .ams-sidebar-brand,
  body.ams-sidebar-collapsed .ams-sidebar-text {
    display: inline !important;
  }

  body.ams-sidebar-collapsed .ams-sidebar-brand {
    display: block !important;
  }

  /* Mobile should show normal links (not icon-only collapsed mode) */
  body.ams-sidebar-collapsed .ams-sidebar-link {
    font-size: 1rem !important;
    padding: 12px 12px !important;
  }

  body.ams-sidebar-collapsed .ams-sidebar-icon {
    display: none !important;
  }

  body.ams-sidebar-collapsed .ams-sidebar-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    padding: 10px 8px 14px 8px !important;
    margin-bottom: 10px !important;
  }
}

@media (max-width: 991.98px) {
  /* Bigger mobile drawer */
  .ams-sidebar {
    width: min(96vw, 520px); /* bigger than 92vw/420px */
    padding: 16px;
  }

  /* Make the header area roomier */
  .ams-sidebar-header--logoRight {
    padding: 16px 12px 16px 12px;
    margin-bottom: 12px;
  }

  /* Make the logo larger and easier to read */
  .ams-sidebar-logo {
    max-width: 84px; /* was ~60px */
  }

  /* Make nav text slightly larger for readability */
  .ams-sidebar-link {
    font-size: 1.05rem;
    padding: 14px 14px;
  }
}

/* ---- Mobile drawer: big "panel" like the reference screenshot ---- */
@media (max-width: 991.98px) {
  .ams-sidebar {
    /* bigger + taller */
    width: min(80vw, 360px) !important;
    height: calc(100dvh - 24px) !important;
    margin: 12px 0 12px 12px !important;

    border-radius: 26px !important;
    padding: 18px !important;

    /* 50% opacity panel (only the background, not the contents) */
    background: rgba(255, 255, 255, 0.50) !important;
  }

  /* Bigger header + logo */
  .ams-sidebar-header--logoRight {
    padding: 18px 10px 18px 10px !important;
    margin-bottom: 14px !important;
  }

  .ams-sidebar-logo {
    max-width: 120px !important; /* bigger logo */
  }

  /* Bigger nav */
  .ams-sidebar-nav {
    gap: 10px !important;
  }

  .ams-sidebar-link {
    font-size: 1.15rem !important;
    padding: 16px 16px !important;
    border-radius: 14px !important;
  }
}

/* ---- Desktop: uniform page width + left-aligned content (all views) ---- */
@media (min-width: 992px) {
  .ams-content > main {
    max-width: 1400px;
    margin-left: 0;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Prevent Bootstrap containers from re-centering content inside the main area */
  .ams-content > main .container,
  .ams-content > main .container-sm,
  .ams-content > main .container-md,
  .ams-content > main .container-lg,
  .ams-content > main .container-xl,
  .ams-content > main .container-xxl,
  .ams-content > main .container-fluid {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ---- Sidebar nav: professional list styling ---- */
.ams-sidebar-nav {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.ams-sidebar-section-label {
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.ams-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 12px;

  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.ams-sidebar-link:hover,
.ams-sidebar-link:focus {
  background: rgba(15, 23, 42, 0.06);
}

.ams-sidebar-link.is-active {
  background: rgba(37, 140, 251, 0.14);
  box-shadow: inset 0 0 0 1px rgba(37, 140, 251, 0.18);
}

/* Improve icon alignment */
.ams-sidebar-icon {
  flex: 0 0 20px;
}

/* Collapsed sidebar: hide admin-only label + text, but keep links/icons */
body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-section-label {
  display: none !important;
}

body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-text {
  display: none !important;
}

/* Collapsed mode: center icons for admin links like Home */
body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-icon {
  display: block !important;
  margin: 0 auto;
}

body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-link {
  font-size: 0;          /* prevent any text spacing */
  padding: 10px;
  border-radius: 12px;
  justify-content: center;
}

/* ---- Mobile drawer: show icon + label text (Home/Teachers/Students) ---- */
@media (max-width: 991.98px) {
  /* Always show link text in the drawer */
  .ams-sidebar .ams-sidebar-text {
    display: inline !important;
  }

  /* Always show icons too (so it's icon + word) */
  .ams-sidebar .ams-sidebar-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0; /* stop centering from collapsed rules */
  }

  .ams-sidebar .ams-sidebar-icon svg {
    width: 22px;
    height: 22px;
  }

  /* Make links a clean row: [icon] [text] */
  .ams-sidebar .ams-sidebar-link {
    font-size: 1.05rem !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }

  /* Show the "Manage" label on mobile (since it's a full drawer) */
  .ams-sidebar .ams-admin-nav .ams-sidebar-section-label {
    display: block !important;
  }
}

/* ---- Mobile: force visible labels for Students/Teachers (even if desktop collapsed is saved) ---- */
@media (max-width: 991.98px) {
  /* Override the collapsed admin-only rules */
  body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-text {
    display: inline !important;
  }

  body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-icon {
    display: inline-flex !important;
    margin: 0 !important;
  }

  body.ams-sidebar-collapsed .ams-admin-nav .ams-sidebar-link {
    font-size: 1.05rem !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 16px 16px !important;
  }
}

/* ---- Mobile: show text only (Teachers/Students), hide icons ---- */
@media (max-width: 991.98px) {
  /* Force labels visible */
  .ams-sidebar .ams-admin-nav .ams-sidebar-text {
    display: inline !important;
  }

  /* Hide icons on mobile */
  .ams-sidebar .ams-admin-nav .ams-sidebar-icon {
    display: none !important;
  }

  /* Ensure links look like normal text rows */
  .ams-sidebar .ams-admin-nav .ams-sidebar-link {
    font-size: 1.15rem !important;
    justify-content: flex-start !important;
  }
}

/* ---- Teacher/Student list: make mobile readable (cards instead of squeezed table) ---- */
@media (max-width: 575.98px) {
  .ams-list-tablewrap {
    display: none !important;
  }

  .ams-list-cards {
    display: grid;
    gap: 12px;
  }

  .ams-list-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .ams-list-card-header {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
  }

  .ams-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.6);
  }

  .ams-list-name {
    font-weight: 700;
    line-height: 1.1;
  }

  .ams-list-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 0.95rem;
  }

  .ams-list-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    align-items: start;
  }

  .ams-list-key {
    color: rgba(15, 23, 42, 0.55);
    font-weight: 600;
  }

  .ams-list-val {
    word-break: break-word;
  }

  .ams-list-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
  }
}

/* Default (tablet/desktop): show table, hide cards */
@media (min-width: 576px) {
  .ams-list-tablewrap {
    display: block;
  }

  .ams-list-cards {
    display: none;
  }
}

/* ---- Messages page: glass background + readable chat area ---- */
.messages-glass {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
}

/* ---- Reusable table card (for dashboard tables, lists, etc.) ---- */
.ams-table-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.ams-table-card .table {
  margin-bottom: 0;
}

.ams-table-card thead th {
  background: rgba(248, 250, 252, 0.96);
}

.ams-table-card tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* ---- Announcements: clean cards ---- */
.ams-announcements-list {
  display: grid;
  gap: 12px;
}

.ams-announcement-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.ams-announcement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ams-announcement-titlewrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ams-announcement-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.ams-announcement-icon svg {
  width: 18px;
  height: 18px;
  fill: rgba(15, 23, 42, 0.70);
}

.ams-announcement-title {
  font-weight: 900;
  color: rgba(15, 23, 42, 0.92);
}

.ams-announcement-meta {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.55);
  white-space: nowrap;
}

.ams-announcement-body {
  white-space: pre-wrap;
  color: rgba(15, 23, 42, 0.82);
  line-height: 1.5;
}

.ams-announcement-body--clamped {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.ams-announcement-readmore {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.ams-announcement-readmore:hover,
.ams-announcement-readmore:focus {
  text-decoration: underline;
}

/* ---- Tuition Payments: KPI cards + section icon ---- */
.ams-tuition-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .ams-tuition-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ams-tuition-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
}

.ams-tuition-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.ams-tuition-kpi-icon--ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.18);
}

.ams-tuition-kpi-icon--wallet {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.18);
}

.ams-tuition-kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: rgba(15, 23, 42, 0.78);
}

.ams-tuition-kpi-label {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.55);
  font-weight: 800;
}

.ams-tuition-kpi-value {
  font-size: 1.1rem;
  font-weight: 950;
  letter-spacing: -0.01em;
  color: rgba(15, 23, 42, 0.92);
}

.ams-tuition-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.ams-tuition-section-icon svg {
  width: 16px;
  height: 16px;
  fill: rgba(15, 23, 42, 0.75);
}

@media (min-width: 992px) {
  .ams-announcement-card {
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  }

  .ams-announcement-card:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  }
}

.messages-chatlog {
  background: rgba(255, 255, 255, 0.75);
}

/* Messages unread badge */
#messagesBadge {
  min-width: 1.6rem;
  text-align: center;
}

/* ---- Register pages: keep card inside content area ---- */
.register-card {
  max-width: 1100px;   /* prevents stretching past the content area */
  width: 100%;
  margin: 0 auto;      /* center within content */
}

.ams-content {
  overflow-x: hidden;  /* prevents any accidental horizontal scrolling */
}

/* Optional: make register columns wrap earlier on medium screens */
@media (max-width: 991.98px) {
  .register-card {
    max-width: 100%;
  }
}

/* ---- Student Grades: mobile cards ---- */
.ams-grades-tablewrap { display: block; }
.ams-grades-cards { display: none; }

/* ---- Store (student browse): match Messages/Grades glass layout ---- */
.ams-store-container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.ams-store-shell {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ams-store-shell-body {
  padding: 18px;
}

.ams-store-category-shell {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 18px;
}

.ams-store-category-body {
  padding: 14px;
}

.ams-store-product {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

@media (min-width: 992px) {
  .ams-store-product:hover,
  .ams-store-product:focus {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.25) !important;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  }
}

.ams-grades-container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.ams-grades-shell {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ams-grades-shell-body {
  padding: 18px;
}

@media (min-width: 992px) {
  .ams-grades-tablewrap {
    max-height: min(540px, calc(100vh - 260px));
    overflow: auto;
  }

  .ams-grades-tablewrap thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(248, 250, 252, 0.96);
  }
}

.ams-grades-tablewrap .table {
  margin-bottom: 0;
}

.ams-grades-tablewrap tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

@media (max-width: 575.98px) {
  .ams-grades-tablewrap { display: none !important; }

  .ams-grades-cards {
    display: grid;
    gap: 12px;
  }

  .ams-grades-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .ams-grades-card-header {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
  }

  .ams-grades-subject {
    font-weight: 800;
    line-height: 1.15;
  }

  .ams-grades-teacher {
    font-size: 0.9rem;
  }

  .ams-grades-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px 10px;
    align-items: center;
  }

  .ams-grades-k {
    color: rgba(15, 23, 42, 0.55);
    font-weight: 700;
    font-size: 0.9rem;
  }

  .ams-grades-v {
    font-weight: 600;
  }
}

/* (removed per-page desktop shifts to keep layout uniform) */

/* ---- Professional Dashboard (desktop-first) ---- */
@media (min-width: 768px) {
  /* Dark sidebar like the reference */
  .ams-sidebar {
    background: linear-gradient(180deg, #0b1634 0%, #0a1026 100%) !important;
    border-right: 0 !important;
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.35) !important;
  }

  .ams-sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.10) !important;
  }

  .ams-sidebar a,
  .ams-sidebar a:link,
  .ams-sidebar a:visited,
  .ams-sidebar a:hover,
  .ams-sidebar a:focus,
  .ams-sidebar a:active {
    color: rgba(255, 255, 255, 0.86) !important;
  }

  .ams-sidebar-brand,
  .ams-sidebar-brand:link,
  .ams-sidebar-brand:visited,
  .ams-sidebar-brand:hover,
  .ams-sidebar-brand:focus,
  .ams-sidebar-brand:active {
    color: rgba(255, 255, 255, 0.92) !important;
  }

  .ams-sidebar-icon svg {
    fill: rgba(255, 255, 255, 0.70) !important;
  }

  .ams-sidebar-section-label {
    color: rgba(255, 255, 255, 0.52) !important;
  }

  .ams-sidebar-link:hover,
  .ams-sidebar-link:focus {
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .ams-sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  }

  /* Dashboard page: use the custom hero instead of the generic topbar */
  body[data-controller="dashboard"] .ams-topbar {
    display: none !important;
  }
}

/* ---- Login page: no sidebar offset + true center alignment ---- */
body[data-controller="home"][data-action="index"] .ams-content {
  margin-left: 0 !important;
}

@media (min-width: 992px) {
  body[data-controller="home"][data-action="index"] .ams-content > main {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

body[data-controller="home"][data-action="index"] .login-hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
}

.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(900px 450px at 30% 0%, rgba(37, 140, 251, 0.30), transparent 58%),
    radial-gradient(800px 420px at 85% 25%, rgba(244, 63, 94, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.62));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

.dash-breadcrumb {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.60);
  margin-bottom: 6px;
}

.dash-title {
  font-size: clamp(1.35rem, 2vw, 2.05rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dash-subtitle {
  color: rgba(15, 23, 42, 0.62);
  margin-top: 6px;
}

.dash-hero-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dash-hero-actions .btn {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.dash-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.dash-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(37, 140, 251, 0.10);
  color: rgba(15, 23, 42, 0.82);
}

.dash-kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.55);
}

.dash-kpi-value {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.1;
}

.dash-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.70);
  color: rgba(15, 23, 42, 0.70);
  font-weight: 800;
  text-decoration: none;
}

.dash-tab:hover,
.dash-tab:focus {
  color: rgba(15, 23, 42, 0.92);
}

.dash-tab.is-active {
  background: #ffffff;
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.10);
  color: rgba(15, 23, 42, 0.95);
}

.dash-surface {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

.dash-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.70);
  font-weight: 800;
}

.dash-avatar {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.90);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.dash-name {
  margin-top: 12px;
  font-weight: 900;
  font-size: 1.15rem;
}

.dash-sub {
  font-size: 0.95rem;
}

.dash-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.dash-mini-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.55);
}

.dash-mini-value {
  font-weight: 900;
  color: rgba(15, 23, 42, 0.88);
}

.dash-card-title {
  font-weight: 900;
  margin-bottom: 12px;
}

.dash-info {
  display: grid;
  gap: 10px;
}

.dash-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dash-info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dash-info-row > span {
  color: rgba(15, 23, 42, 0.55);
  font-weight: 700;
}

.dash-info-row > strong {
  color: rgba(15, 23, 42, 0.92);
}

@media (min-width: 768px) {
  .dash-info-col + .dash-info-col {
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    padding-left: 18px;
  }
}
