
:root {
  --bg-main: #e9dfe8;
  --bg-glow-1: rgba(255, 205, 226, 0.58);
  --bg-glow-2: rgba(240, 164, 197, 0.35);
  --card: #f7f7f7;
  --text: #111111;
  --muted: #222222;
  --field: #eeeeee;
  --button: #f9a2bd;
  --button-hover: #ea86ae;
  --link: #68d5ff;
  --shadow: 0 18px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  font-family: "Roboto", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: inherit;
  color: var(--text);
  background:
    radial-gradient(circle at 83% 18%, var(--bg-glow-1) 0%, rgba(255, 205, 226, 0) 32%),
    radial-gradient(circle at 93% 84%, var(--bg-glow-2) 0%, rgba(240, 164, 197, 0) 38%),
    var(--bg-main);
  padding: 24px;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.card {
  width: min(510px, 100%);
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 34px 36px;
  animation: fade-up 550ms ease-out;
}

.content {
  width: min(370px, 100%);
  margin: 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

.sub {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.03;
}

.welcome {
  margin-top: 2px;
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  font-weight: 800;
  line-height: 1.15;
}

form {
  margin-top: 20px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 7px;
  font-size: 1.03rem;
}

.required-marker {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(249, 162, 189, 0.18);
  color: #9b3d62;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-transform: uppercase;
  vertical-align: 2px;
}

#technician-register-form label:has(.required-marker) {
  display: flex;
  align-items: center;
  gap: 12px;
}

#technician-register-form label .required-marker,
#technician-register-form .location-picker-title .required-marker {
  margin-left: auto;
}

#technician-register-form .location-picker-title::before {
  display: none;
}

input {
  width: 100%;
  border: 0;
  border-radius: 24px;
  background: var(--field);
  padding: 14px 18px;
  font-size: 1.02rem;
  font-family: inherit;
  color: var(--muted);
  outline: none;
  transition: box-shadow 120ms ease;
}

input::placeholder {
  color: #bcbcbc;
}

input:focus-visible {
  box-shadow: 0 0 0 3px rgba(240, 154, 189, 0.45);
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input {
  display: block;
  width: 100%;
  margin: 0;
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #555;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 0;
  display: grid;
  place-items: center;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.password-toggle-btn:hover {
  color: #222;
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 154, 189, 0.45);
}

.password-toggle-btn.is-visible {
  color: #1f1f1f;
  background: transparent;
}

.password-toggle-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.support-link {
  margin-top: 8px;
  display: inline-block;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 1.05rem;
}

.support-link:hover {
  color: var(--button-hover);
}

.field-note {
  margin-top: 8px;
  color: #666;
  font-size: 0.88rem;
  line-height: 1.35;
}

.location-picker {
  margin-top: 14px;
  padding: 15px 16px 14px;
  border-radius: 24px;
  background: #eeeeee;
  border: 1px solid transparent;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.location-picker:focus-within {
  background: #f4f0f2;
  border-color: rgba(234, 134, 174, 0.42);
  box-shadow: 0 0 0 3px rgba(240, 154, 189, 0.18);
}

.location-picker-header {
  display: block;
  margin-bottom: 10px;
}

.location-picker-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.location-picker-title::before {
  content: '';
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 4px solid var(--button);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.location-picker-copy {
  display: block;
  margin: 5px 0 0 23px;
  color: #5f6774;
  font-size: 0.84rem;
  line-height: 1.35;
}

.location-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.location-picker-btn {
  width: auto;
  margin-top: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease, color 140ms ease;
}

.location-picker-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.location-picker-btn.secondary {
  background: #fff;
  color: #8c3458;
  border-color: rgba(234, 134, 174, 0.38);
  box-shadow: 0 5px 12px rgba(136, 52, 88, 0.08);
}

.location-picker-btn.secondary:hover {
  background: #fff3f7;
  border-color: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(136, 52, 88, 0.12);
}

.location-picker-btn:focus-visible,
.location-modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 154, 189, 0.42);
}

.location-picker-btn.location-picker-launcher {
  width: 100%;
  margin-top: 4px;
  position: relative;
  padding: 12px 42px 12px 18px;
  background: var(--button);
  color: #111;
  border-color: transparent;
  box-shadow: none;
}

.location-picker-btn.location-picker-launcher:hover {
  background: var(--button-hover);
  border-color: transparent;
}

.location-picker-btn.location-picker-launcher::after {
  content: '\2192';
  position: absolute;
  right: 18px;
  top: 50%;
  font-size: 1.15rem;
  transform: translateY(-52%);
}

.location-summary {
  margin: 11px 2px 0;
  color: #6e5360;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
}

.location-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 26, 37, 0.56);
  backdrop-filter: blur(10px);
}

.location-modal.hidden {
  display: none;
}

.service-area-notice {
  position: absolute;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(43, 26, 37, 0.48);
  backdrop-filter: blur(8px);
}

.service-area-notice.hidden {
  display: none;
}

.service-area-notice-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(249, 162, 189, 0.24), transparent 38%),
    var(--card);
  box-shadow: 0 24px 60px rgba(45, 24, 37, 0.3);
  text-align: center;
  animation: fade-up 220ms ease-out;
}

.service-area-notice-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 900;
}

.service-area-notice-card p {
  margin: 10px 0 0;
  color: #6e5360;
  font-size: 0.94rem;
  line-height: 1.55;
}

.service-area-notice-button {
  margin-top: 20px;
  font-size: 1rem;
}

.location-modal-card {
  width: min(860px, 100%);
  background:
    radial-gradient(circle at 100% 0, rgba(249, 162, 189, 0.2), transparent 34%),
    var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(45, 24, 37, 0.3);
  padding: 24px;
  animation: fade-up 220ms ease-out;
}

.location-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.location-modal-header h3 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.location-modal-copy {
  margin-top: 6px;
  color: #6e5360;
  font-size: 0.92rem;
  line-height: 1.45;
}

.location-modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(249, 162, 189, 0.2);
  color: #78314f;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.location-modal-close:hover {
  background: var(--button);
  transform: translateY(-1px);
}

.location-modal-actions {
  justify-content: flex-end;
  margin: 16px 0 0;
}

.location-map {
  width: 100%;
  min-height: 360px;
  height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(234, 134, 174, 0.28), 0 12px 24px rgba(89, 47, 68, 0.12);
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 24%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
    linear-gradient(135deg, rgba(249, 162, 189, 0.26), rgba(104, 213, 255, 0.22));
  position: relative;
}

.location-map.leaflet-container {
  font-family: inherit;
  outline: none;
}

.location-map .leaflet-bar {
  border: 0;
  box-shadow: 0 6px 18px rgba(67, 35, 51, 0.18);
}

.location-map .leaflet-bar a {
  color: #713049;
  border-color: #f2d9e2;
}

.location-map .leaflet-bar a:hover {
  background: #fff3f7;
}

.daily-nail-map-pin-icon {
  background: transparent;
  border: 0;
}

.daily-nail-map-pin {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  background: #ff4d7d;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  transform: rotate(-45deg);
}

.daily-nail-map-pin::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
}

.pin-board {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(48, 86, 129, 0.96), rgba(83, 129, 179, 0.9) 50%, rgba(104, 213, 255, 0.78));
  background-size: 28px 28px, 28px 28px, 100% 100%;
  color: #fff;
  cursor: crosshair;
  overflow: hidden;
}

.pin-board:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.pin-board-grid,
.pin-board-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pin-board-grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.75;
}

.pin-board-scan {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: pin-board-scan 7s linear infinite;
  mix-blend-mode: screen;
}

.pin-board-label {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(9, 19, 34, 0.55);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
}

.pin-board-pin-text {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(9, 19, 34, 0.48);
  font-size: 0.88rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.pin-board-pin {
  position: absolute;
  left: var(--pin-x, 50%);
  top: var(--pin-y, 50%);
  width: 30px;
  height: 30px;
  transform: translate(-50%, -100%);
  border-radius: 50% 50% 50% 0;
  background: #ff4d7d;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  rotate: -45deg;
  opacity: 0;
}

.pin-board-pin::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
}

.pin-board.has-pin .pin-board-pin {
  opacity: 1;
  animation: pin-pop 220ms ease-out;
}

@keyframes pin-pop {
  from {
    transform: translate(-50%, -100%) scale(0.7);
  }
  to {
    transform: translate(-50%, -100%) scale(1);
  }
}

@keyframes pin-board-scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

.location-status {
  min-height: 1.2em;
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(249, 162, 189, 0.14);
  color: #6e5360;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 700;
}

.location-status.hidden,
.manual-address-field.hidden {
  display: none;
}

.manual-address-field {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(140, 52, 88, 0.12);
}

.manual-address-field label {
  margin-top: 0;
}

.manual-address-field .field-note {
  margin-bottom: 0;
}

.location-status.success {
  color: #7a3452;
}

.location-status.error {
  color: #b4233c;
  background: rgba(180, 35, 60, 0.09);
}

.primary {
  margin-top: 18px;
  width: 100%;
  border: 0;
  border-radius: 24px;
  background: var(--button);
  color: #111;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.primary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.primary:active {
  transform: translateY(0);
}

.switch {
  margin-top: 10px;
  text-align: center;
  font-size: 1.03rem;
}

.switch a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-message {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c23369;
}

.form-message.success {
  color: #27ae60;
}

.registration-otp-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 20, 20, 0.38);
  z-index: 1200;
}

.registration-otp-card {
  width: min(430px, 100%);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.registration-otp-card h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.registration-otp-subtitle {
  margin: 8px 0 12px;
  color: #555;
  font-size: 0.92rem;
  line-height: 1.35;
}

.registration-otp-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.registration-otp-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  width: auto;
  margin-top: 0;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.registration-otp-btn.secondary {
  background: #e8e8e8;
  color: #333;
}

.registration-otp-btn.secondary:hover {
  background: #dcdcdc;
}

.registration-otp-btn.primary {
  background: var(--button);
  color: #111;
}

.registration-otp-btn.primary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.dashboard-shell {
  width: min(980px, 100%);
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: fade-up 550ms ease-out;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: #f0f0f0;
  border-radius: 14px;
  padding: 16px;
}

.stat-label {
  font-size: 0.92rem;
  color: #555;
  margin-bottom: 8px;
}

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

.table-card {
  margin-top: 14px;
  background: #f0f0f0;
  border-radius: 14px;
  padding: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #d6d6d6;
}

th {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c5c5c;
}

tr:last-child td {
  border-bottom: 0;
}

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

  .dashboard-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 600px) {
  .card {
    border-radius: 16px;
    padding: 30px 20px 24px;
  }

  .primary {
    font-size: 1.38rem;
  }

  .location-modal {
    padding: 12px;
  }

  .location-modal-card {
    padding: 18px;
    border-radius: 20px;
  }

  .location-modal-header h3 {
    font-size: 1.35rem;
  }

  .location-modal-actions {
    display: flex;
    justify-content: flex-end;
  }

  .location-modal-actions .location-picker-btn {
    width: auto;
    padding-inline: 10px;
  }

  .location-map {
    min-height: 320px;
    height: 320px;
  }
}

body.admin-page,
body.client-page,
body.technician-page {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 83% 18%, var(--bg-glow-1) 0%, rgba(255, 205, 226, 0) 32%),
    radial-gradient(circle at 93% 84%, var(--bg-glow-2) 0%, rgba(240, 164, 197, 0) 38%),
    var(--bg-main);
}

body.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 80px 24px;
  min-height: 100vh;
  margin: 0;
  box-sizing: border-box;
}

.admin-sidebar,
.client-page .sidebar,
.technician-page .sidebar {
  width: 250px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.admin-sidebar-header,
.client-page .sidebar-header,
.technician-page .sidebar-header {
  padding: 20px 24px;
  border-bottom: 2px solid var(--field);
  margin-bottom: 16px;
  text-align: center;
}

.admin-logo,
.client-page .sidebar-logo,
.technician-page .sidebar-logo {
  font-weight: 900;
  color: var(--button);
  margin: 0;
}

.admin-logo {
  font-size: 1.5rem;
}

.client-page .sidebar-logo {
  font-size: 1.5rem;
}

.technician-page .sidebar-logo {
  font-size: 1.3rem;
}

.admin-nav,
.client-page .sidebar-nav,
.technician-page .sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}

.admin-nav-item,
.client-page .nav-item,
.technician-page .nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--text);
  cursor: pointer;
  border-radius: 12px;
  transition: all 140ms ease;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.client-page .nav-item {
  text-decoration: none;
}

.admin-nav-item:hover,
.client-page .nav-item:hover,
.technician-page .nav-item:hover {
  background: var(--field);
  transform: translateX(4px);
}

.admin-nav-item.active,
.client-page .nav-item.active,
.technician-page .nav-item.active {
  background: var(--button);
  color: white;
  font-weight: 700;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.admin-content,
.client-page .main-content,
.technician-page .main-content {
  margin-left: 250px;
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.client-page .dashboard-container {
  width: min(1400px, 100%);
}

.admin-header,
.client-page .dashboard-header,
.technician-page .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 20px;
}

.admin-title,
.client-page .header-title,
.technician-page .title {
  margin: 0;
  font-weight: 800;
  color: var(--text);
}

.admin-title,
.technician-page .title {
  font-size: 2rem;
}

.client-page .header-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.admin-logout-btn,
.client-page .sidebar-logout,
.technician-page .logout-btn {
  background: var(--button);
  color: var(--text);
  border: none;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.admin-logout-btn {
  padding: 12px 24px;
}

.client-page .sidebar-logout,
.technician-page .logout-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.admin-logout-btn:hover,
.client-page .sidebar-logout:hover,
.technician-page .logout-btn:hover {
  background: var(--button-hover);
}

.full-width-btn {
  width: 100%;
}

.admin-sidebar-footer,
.client-page .sidebar-footer,
.technician-page .admin-sidebar-footer {
  padding: 16px 12px;
  border-top: 2px solid var(--field);
  margin-top: auto;
}

.admin-page .stats-grid,
.technician-page .stats-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}

.admin-page .stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.technician-page .stats-grid {
  grid-template-columns: repeat(3, 1fr);
}

.admin-page .stat-card,
.technician-page .stat-box,
.table-card,
.technician-page .card,
.client-page .section-card,
.client-page .transaction-summary {
  background: var(--card);
  box-shadow: var(--shadow);
}

.admin-page .stat-card,
.technician-page .stat-box {
  padding: 20px;
  border-radius: 16px;
  text-align: center;
}

.admin-page .stat-number,
.technician-page .stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--button);
  margin: 0;
}

.admin-page .stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

.technician-page .stat-label {
  font-size: 0.85rem;
  color: #666;
  margin-top: 8px;
}

.table-card,
.technician-page .card,
.client-page .section-card,
.client-page .transaction-summary {
  border-radius: 20px;
  padding: 24px;
}

.table-card,
.technician-page .card,
.client-page .section-card,
.client-page .transaction-summary {
  animation: page-fade-up 550ms ease-out;
}

.table-card,
.technician-page .card {
  margin-bottom: 24px;
}

.table-title,
.technician-page .card-title,
.client-page .section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 16px 0;
  color: var(--text);
}

.admin-table,
.technician-page .table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead,
.technician-page .table thead {
  background: var(--field);
}

.admin-table th,
.admin-table td,
.technician-page .table th,
.technician-page .table td {
  padding: 12px;
  text-align: left;
}

.admin-table th,
.technician-page .table th {
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid #ddd;
}

.admin-table td,
.technician-page .table td {
  border-bottom: 1px solid #f0f0f0;
}

.admin-table tbody tr:hover,
.technician-page .table tbody tr:hover {
  background: #fafafa;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pending {
  background: #ffeaa7;
  color: #d63031;
}

.status-expired {
  background: #fdba74;
  color: #9a3412;
}

.status-cancelled,
.status-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.status-approved {
  background: #a9e7a8;
  color: #27ae60;
}

.status-completed {
  background: #74b9ff;
  color: #0984e3;
}

.action-btn {
  background: var(--button);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 140ms ease;
  margin-right: 8px;
}

.action-btn:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.action-btn.reject {
  background: #ff7675;
}

.action-btn.reject:hover {
  background: #d63031;
}

.action-btn.complete {
  background: #27ae60;
}

.action-btn.complete:hover {
  background: #229954;
}

.hidden {
  display: none;
}

.empty-state-cell {
  text-align: center;
  color: #999;
}

.report-panel {
  padding: 20px;
}

.client-page .search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--field);
  border-radius: 24px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.client-page .search-bar input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1rem;
  outline: none;
  color: var(--muted);
  margin: 0;
  padding: 0;
}

.client-page .search-bar input::placeholder {
  color: #bcbcbc;
}

.search-icon {
  color: #999;
}

.client-page .search-btn {
  background: #17c0a8;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 140ms ease;
}

.client-page .search-btn:hover {
  background: #14a894;
}

.client-page .professionals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.client-page .professional-card {
  background: #f9f9f9;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease;
  cursor: pointer;
}

.client-page .professional-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.client-page .professional-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #f9a2bd, #ffb3d9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  overflow: hidden;
}

.client-page .professional-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-page .professional-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 8px 0;
  color: var(--text);
}

.client-page .professional-rating {
  color: #ffc107;
  font-size: 0.9rem;
}

.client-page .technician-distance {
  margin-top: 6px;
  color: #3d6f8d;
  font-size: 0.84rem;
  font-weight: 700;
}

.client-page .calendar-container {
  margin-top: 20px;
}

.client-page .calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-weight: 700;
}

.client-page .calendar-nav button {
  background: var(--field);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: background 140ms ease;
}

.client-page .calendar-nav button:hover {
  background: #e0e0e0;
}

.client-page .calendar-nav button + button {
  margin-left: 8px;
}

.client-page .calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.client-page .calendar-day-header {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
  padding: 8px;
}

.client-page .calendar-day {
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background: var(--field);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 140ms ease;
}

.client-page .calendar-day:hover {
  background: #e0d5df;
}

.client-page .calendar-day.selected,
.client-page .calendar-day.today {
  background: var(--button);
  color: white;
  font-weight: 700;
}

.client-page .calendar-day.empty {
  background: transparent;
  cursor: default;
}

.client-page .calendar-day.empty:hover {
  background: transparent;
}

.client-page .services-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-page .service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--field);
  border-radius: 12px;
  cursor: pointer;
  transition: all 140ms ease;
}

.client-page .service-item:hover {
  background: #e8e8e8;
  transform: translateX(4px);
}

.client-page .service-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #17c0a8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.client-page .service-details {
  flex: 1;
}

.client-page .service-name {
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.client-page .service-price {
  font-weight: 800;
  color: var(--button);
  margin-left: auto;
  font-size: 1.05rem;
}

.client-page .transaction-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-page .transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.view-more-link {
  color: var(--button);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}

.view-more-link:hover {
  opacity: 0.8;
}

.client-page .transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.client-page .transaction-item:last-child {
  border-bottom: none;
}

.client-page .transaction-label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}

.client-page .transaction-value {
  font-weight: 800;
  color: var(--text);
  font-size: 1.1rem;
}

.client-page .transaction-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 2px solid var(--button);
  margin-top: 12px;
}

.client-page .total-label {
  font-weight: 800;
  color: var(--text);
  font-size: 1.1rem;
}

.client-page .total-value {
  font-weight: 800;
  color: var(--button);
  font-size: 1.3rem;
}

.book-btn {
  background: var(--button);
  border: none;
  color: var(--text);
  padding: 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 140ms ease;
  margin-top: 8px;
}

.book-btn:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.notification-support {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-top: 12px;
}

.section-title-spaced {
  margin-bottom: 12px;
}

.section-card-spaced {
  margin-top: 20px;
}

.client-page .book-btn-styled {
  width: 100%;
  margin-top: 16px;
}

.client-page .section-card-spaced {
  margin-top: 20px;
}

.client-page .dashboard-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.client-page .dashboard-content > div:first-child {
  display: flex;
  flex-direction: column;
}

.technician-page .table {
  font-size: 1rem;
}

.technician-page .card-title {
  margin-bottom: 16px;
}

.technician-page .profile-info {
  background: var(--field);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.technician-page .profile-info p {
  margin: 8px 0;
  font-weight: 600;
}

.technician-page .schedule-panel {
  padding: 20px;
  background: var(--field);
  border-radius: 12px;
}

.technician-page .schedule-note {
  margin-top: 16px;
  color: #666;
  font-size: 0.9rem;
}

@keyframes page-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@media (max-width: 1024px) {
  .admin-page .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .client-page .dashboard-content,
  .client-page .professionals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .client-page .sidebar,
  .technician-page .sidebar,
  .admin-sidebar {
    width: 220px;
  }

  .admin-content,
  .client-page .main-content,
  .technician-page .main-content {
    margin-left: 220px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar,
  .client-page .sidebar,
  .technician-page .sidebar {
    width: 200px;
    padding: 16px 0;
  }

  .admin-sidebar-header,
  .client-page .sidebar-header,
  .technician-page .sidebar-header {
    padding: 16px 16px;
    margin-bottom: 12px;
  }

  .admin-content,
  .client-page .main-content,
  .technician-page .main-content {
    margin-left: 200px;
    padding: 16px;
  }

  .admin-page .stats-grid,
  .technician-page .stats-grid,
  .client-page .professionals-grid,
  .client-page .dashboard-content {
    grid-template-columns: 1fr;
  }

  .admin-table,
  .technician-page .table {
    font-size: 0.9rem;
  }

  .admin-table th,
  .admin-table td,
  .technician-page .table th,
  .technician-page .table td {
    padding: 8px;
  }

  .client-page .dashboard-header {
    flex-direction: column;
    gap: 16px;
  }

  .client-page .calendar-week {
    gap: 4px;
  }

  .client-page .calendar-day {
    padding: 8px 4px;
    font-size: 0.8rem;
  }
}

@media (max-width: 512px) {
  .client-page .sidebar,
  .technician-page .sidebar {
    width: 180px;
  }

  .admin-content,
  .client-page .main-content,
  .technician-page .main-content {
    margin-left: 180px;
    padding: 12px;
  }

  .admin-sidebar-header,
  .client-page .sidebar-header,
  .technician-page .sidebar-header {
    padding: 12px 12px;
  }

  .admin-nav,
  .client-page .sidebar-nav,
  .technician-page .sidebar-nav {
    padding: 0 6px;
  }

  .admin-nav-item,
  .client-page .nav-item,
  .technician-page .nav-item,
  .client-page .sidebar-logout,
  .technician-page .logout-btn {
    padding: 10px 12px;
    gap: 10px;
    font-size: 0.85rem;
  }

  .nav-icon {
    font-size: 0.9rem;
  }
}

/* Receipt Preview Modal Styles */
.receipt-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 24, 24, 0.45);
  overflow-y: auto;
  z-index: 12000;
  animation: modal-fade-in 200ms ease-out;
  box-sizing: border-box;
}

.receipt-modal-card {
  width: min(720px, 100%);
  background: #ffffff;
  color: #333333;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 30px;
  animation: modal-pop-in 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.receipt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #e91e63;
  padding-bottom: 18px;
}

.receipt-logo {
  font-family: 'Roboto', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #e91e63;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-title-wrap {
  text-align: right;
}

.receipt-title-label {
  font-size: 20px;
  font-weight: 800;
  color: #333;
  letter-spacing: 0.5px;
}

.receipt-ref-no {
  font-size: 0.85rem;
  color: #777;
  margin-top: 4px;
  font-family: monospace;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: #f8f9fa;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #eaeaea;
}

.receipt-info-sec h4 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

.receipt-info-sec p {
  margin: 4px 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #444;
}

.receipt-info-sec p strong {
  color: #111;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.receipt-items-table th {
  background: #f1f3f5;
  color: #495057;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
}

.receipt-items-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.95rem;
  color: #333;
}

.receipt-items-table .total-row td {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e91e63;
  border-bottom: none;
  padding-top: 18px;
}

.receipt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.receipt-action-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
  border: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-action-btn.print {
  background: #e91e63;
  color: #ffffff;
}

.receipt-action-btn.print:hover {
  background: #d81b60;
  transform: translateY(-1px);
}

.receipt-action-btn.close {
  background: #f1f3f5;
  color: #495057;
}

.receipt-action-btn.close:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

  .admin-sidebar-header,
  .client-page .sidebar-header,
  .technician-page .sidebar-header {
    padding: 12px 12px;
  }

  .admin-nav,
  .client-page .sidebar-nav,
  .technician-page .sidebar-nav {
    padding: 0 6px;
  }

  .admin-nav-item,
  .client-page .nav-item,
  .technician-page .nav-item,
  .client-page .sidebar-logout,
  .technician-page .logout-btn {
    padding: 10px 12px;
    gap: 10px;
    font-size: 0.85rem;
  }

  .nav-icon {
    font-size: 0.9rem;
  }
}

/* Receipt Preview Modal Styles */
.receipt-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 24, 24, 0.45);
  overflow-y: auto;
  z-index: 12000;
  animation: modal-fade-in 200ms ease-out;
  box-sizing: border-box;
}

.receipt-modal-card {
  width: min(720px, 100%);
  background: #ffffff;
  color: #333333;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 30px;
  animation: modal-pop-in 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.receipt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #e91e63;
  padding-bottom: 18px;
}

.receipt-logo {
  font-family: 'Roboto', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #e91e63;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-title-wrap {
  text-align: right;
}

.receipt-title-label {
  font-size: 20px;
  font-weight: 800;
  color: #333;
  letter-spacing: 0.5px;
}

.receipt-ref-no {
  font-size: 0.85rem;
  color: #777;
  margin-top: 4px;
  font-family: monospace;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: #f8f9fa;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #eaeaea;
}

.receipt-info-sec h4 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

.receipt-info-sec p {
  margin: 4px 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #444;
}

.receipt-info-sec p strong {
  color: #111;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.receipt-items-table th {
  background: #f1f3f5;
  color: #495057;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
}

.receipt-items-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.95rem;
  color: #333;
}

.receipt-items-table .total-row td {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e91e63;
  border-bottom: none;
  padding-top: 18px;
}

.receipt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.receipt-action-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
  border: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-action-btn.print {
  background: #e91e63;
  color: #ffffff;
}

.receipt-action-btn.print:hover {
  background: #d81b60;
  transform: translateY(-1px);
}

.receipt-action-btn.close {
  background: #f1f3f5;
  color: #495057;
}

.receipt-action-btn.close:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Live Chat Styles */
.chat-layout {
  display: flex;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  height: calc(100vh - 150px);
  min-height: 500px;
  overflow: hidden;
  animation: page-fade-up 550ms ease-out;
}

.chat-sidebar {
  width: 320px;
  border-right: 1px solid var(--field);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.45);
}

.chat-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--field);
}

.chat-sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.chat-contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-contact-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 150ms ease;
  margin-bottom: 6px;
  position: relative;
}

.chat-contact-item:focus-visible {
  outline: 3px solid rgba(234, 134, 174, 0.42);
  outline-offset: 2px;
}

.chat-contact-item:hover {
  background: var(--field);
}

.chat-contact-item.active {
  background: var(--button);
  color: #ffffff;
}

.chat-contact-item.active .chat-contact-meta .chat-contact-lastmsg {
  color: rgba(255, 255, 255, 0.8);
}

.chat-contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(249, 162, 189, 0.4);
}

.chat-contact-item.active .chat-contact-avatar {
  border-color: rgba(255, 255, 255, 0.6);
}

.chat-contact-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #2ecc71;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5);
  animation: onlinePulse 2s ease-in-out infinite;
}

.chat-contact-item.active .online-indicator {
  border-color: var(--button);
}

@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.chat-contact-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.chat-contact-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-contact-lastmsg {
  font-size: 0.8rem;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-unread-badge {
  background: #e91e63;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
}

.chat-contact-item.active .chat-unread-badge {
  background: #ffffff;
  color: var(--button);
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.chat-window-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--field);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.chat-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.chat-header-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.chat-header-status {
  font-size: 0.75rem;
  color: #27ae60;
  font-weight: 600;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row.sender {
  justify-content: flex-end;
}

.chat-message-row.receiver {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 60%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.chat-message-row.sender .chat-bubble {
  background: linear-gradient(135deg, var(--button) 0%, #ee7893 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-message-row.receiver .chat-bubble {
  background: #f1f3f5;
  color: #333333;
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 4px;
  text-align: right;
  display: block;
}

.chat-message-row.sender .chat-time {
  color: rgba(255, 255, 255, 0.7);
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--field);
  display: flex;
  gap: 12px;
  align-items: center;
  background: #ffffff;
}

.chat-textarea {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
  resize: none;
  height: 40px;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 150ms ease;
  outline: none;
}

.chat-textarea:focus {
  border-color: var(--button);
  box-shadow: 0 0 0 3px rgba(249, 162, 189, 0.2);
}

.chat-send-btn {
  background: var(--button);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.chat-send-btn:hover {
  background: #ee7893;
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.95rem;
  background: #fbfbfb;
  gap: 12px;
}

.chat-empty-state i {
  font-size: 3rem;
  color: #e2e8f0;
}

/* Admin Chatlogs Styling */
.admin-chatlogs-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
  height: calc(100vh - 160px);
  min-height: 500px;
  animation: page-fade-up 550ms ease-out;
}

.admin-conversations-list {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-conversation-card {
  border: 1px solid var(--field);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 150ms ease;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-conversation-card:hover {
  border-color: var(--button);
  transform: translateY(-2px);
}

.admin-conversation-card.active {
  border-color: var(--button);
  background: rgba(249, 162, 189, 0.04);
  box-shadow: 0 4px 12px rgba(249, 162, 189, 0.08);
}

.admin-conversation-users {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-info-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 45%;
}

.admin-user-info-mini span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-chat-arrow {
  font-size: 0.8rem;
  color: #ccc;
}

.admin-conversation-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
  border-top: 1px dashed var(--field);
  padding-top: 8px;
}

.admin-chat-viewer-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.admin-chat-viewer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--field);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.admin-chat-viewer-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.admin-chat-viewer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 60%;
  gap: 4px;
}

.admin-chat-bubble-row.align-left {
  align-self: flex-start;
}

.admin-chat-bubble-row.align-right {
  align-self: flex-end;
}

.admin-chat-sender-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #777;
  margin-left: 4px;
}

.admin-chat-bubble-row.align-right .admin-chat-sender-label {
  text-align: right;
  margin-right: 4px;
}

.admin-chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.admin-chat-bubble-row.align-left .admin-chat-bubble {
  background: #f1f3f5;
  color: #33;
  border-bottom-left-radius: 4px;
}

.admin-chat-bubble-row.align-right .admin-chat-bubble {
  background: #fff0f3;
  color: #c2185b;
  border: 1px solid #ffd4dc;
  border-bottom-right-radius: 4px;
}

.admin-chat-time {
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 2px;
}

.admin-chat-bubble-row.align-right .admin-chat-time {
  text-align: right;
}

.admin-chatlogs-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  background: #fbfbfb;
  gap: 14px;
}

.admin-chatlogs-empty i {
  font-size: 3.5rem;
  color: #e2e8f0;
}
