:root {
  --bg: #d6f6eb;
  --shell: #eef3f8;
  --sidebar: #f8fafc;
  --card: #ffffff;
  --line: #d9e1ea;
  --line-soft: #ebf0f5;
  --text: #142033;
  --muted: #6e7b8f;
  --accent: #2d7ff9;
  --accent-soft: #e7f0ff;
  --success: #11a36a;
  --danger: #d3485b;
  --shadow: 0 18px 45px rgba(20, 32, 51, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #8de1c8 0%, var(--bg) 100%);
  color: var(--text);
}

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

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(14px);
}

.auth-card h1,
.brand h1,
.brand p,
.topbar h2,
.modal-header h3 {
  margin: 0;
}

.auth-copy,
.brand p,
.eyebrow,
.status-message,
.transaction-meta {
  color: var(--muted);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
}

.auth-input,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.auth-input:focus,
.search-input:focus {
  border-color: var(--accent);
}

.primary-button,
.secondary-button,
.icon-button,
.arrow-button {
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-button,
.secondary-button {
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, #1f4ed8, #56c8ff);
  color: #fff;
  margin-top: 8px;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary-button {
  background: #eff5ff;
  color: var(--accent);
}

.status-message {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 14px;
}

.status-message.success {
  color: var(--success);
}

.status-message.error {
  color: var(--danger);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  background: var(--shell);
  border-radius: 0;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line-soft);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f4ed8, #56c8ff);
  color: #fff;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.nav-section-gap {
  height: 16px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-link > span:not(.nav-dot):not(.nav-count) {
  flex: 1;
}

.nav-link:hover,
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.nav-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.nav-count--invisible {
  visibility: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 31, 0.55);
  display: grid;
  place-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.page-loader-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analytics-spin 0.75s linear infinite;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analytics-spin 0.75s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}

.main-panel {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title-row h2 {
  margin: 0;
}

.topbar-reload-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  background: #f1f5fb;
  border: 1px solid var(--line-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.topbar-reload-button:hover {
  opacity: 0.75;
}

.topbar-reload-button.is-loading {
  cursor: wait;
  opacity: 0.6;
}

.topbar-reload-icon {
  font-size: 16px;
  color: var(--muted);
  line-height: 1;
}

.topbar-reload-icon.is-spinning {
  display: inline-block;
  animation: analytics-spin 0.85s linear infinite;
}

.bookings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.bookings-toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.booking-create-button {
  margin-top: 0;
  white-space: nowrap;
}

.sort-select {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 14px;
  padding: 10px 14px;
  outline: none;
}

.sort-select:focus {
  border-color: var(--accent);
}

.bookings-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checkbox-label:hover {
  color: var(--accent);
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-label {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.app-status {
  margin-top: -6px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.table-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(20, 32, 51, 0.05);
}

.analytics-shell {
  display: grid;
  gap: 22px;
}

.analytics-heading {
  margin-bottom: 0;
}

.analytics-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-reload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  background: #f1f5fb;
  border: 1px solid var(--line-soft);
}

.analytics-reload-button.is-loading {
  cursor: wait;
  opacity: 0.85;
}

.analytics-reload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.analytics-reload-icon.is-spinning {
  animation: analytics-spin 0.85s linear infinite;
}

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

.analytics-card,
.analytics-detail-card {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #f8fbff;
  padding: 18px;
}

.analytics-card-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-card-value {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
}

.analytics-card-date {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.analytics-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.analytics-subheading {
  margin-bottom: 16px;
}

.analytics-subheading h4 {
  margin: 0;
}

.analytics-subheading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.analytics-slot-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analytics-slot-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid #d4e2f6;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

.analytics-slot-pill-open {
  background: #f8fbff;
  color: #6e7b8f;
  border: 1px solid #d4e2f6;
}

.analytics-slot-pill-open:hover {
  background: #e7f0ff;
  border-color: #bfcff2;
  color: #1946a7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 127, 249, 0.15);
}

.analytics-slot-pill-booked {
  background: #dbe7ff;
  color: #1946a7;
  border-color: #bfcff2;
  opacity: 0.6;
}

.analytics-slot-pill-booked:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 127, 249, 0.25);
}

.analytics-slot-pill-expired {
  background-color: #e8eaf0;
  color: #6e7b8f;
  border-color: #c5cdd8;
  cursor: not-allowed;
  opacity: 0.7;
}

.analytics-slot-pill-expired:hover {
  background-color: #e8eaf0;
  border-color: #c5cdd8;
  color: #6e7b8f;
  cursor: not-allowed;
  transform: none;
}

.analytics-date-input {
  min-width: 170px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading h3,
.closure-summary h4 {
  margin: 0;
}

.section-heading p,
.closure-summary p {
  margin: 6px 0 0;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.customer-care-table {
  min-width: 1180px;
}

.data-table thead th {
  background: #edf3fb;
  color: #59708a;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

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

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

.data-table tbody td {
  background: #fff;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: #fbfdff;
}

.arrow-col {
  width: 110px;
  text-align: center;
}

.transactions-cell {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  color: var(--success);
  background: #e8fbf3;
}

.badge.danger {
  color: var(--danger);
  background: #ffe9ec;
}

.customer-care-message {
  display: -webkit-box;
  max-width: 340px;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.45;
}

.customer-care-status-select {
  min-width: 150px;
  font-weight: 800;
}

.customer-care-status-select.status-new {
  border-color: #83b7ff;
  background: #eaf3ff;
  color: #1757b8;
}

.customer-care-status-select.status-in-progress {
  border-color: #f5a623;
  background: #fff4df;
  color: #a35d00;
}

.customer-care-status-select.status-completed {
  border-color: #35a853;
  background: #e8fbf3;
  color: #247a3d;
}

.balance-pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f7ff;
  color: #1747b8;
  font-weight: 700;
}

.arrow-button {
  min-width: 72px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.arrow-button:hover,
.icon-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 22px;
}

.hover-detail {
  cursor: help;
}

.empty-table-state,
.no-transactions {
  padding: 18px;
  border-radius: 16px;
  background: #f7fafc;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 34, 0.48);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 20px 22px 24px;
  max-height: 70vh;
  overflow: auto;
}

.modal-form {
  padding: 20px 22px 24px;
  display: grid;
  gap: 12px;
}

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

.modal-primary-button {
  margin-top: 0;
}

.notes-input {
  resize: vertical;
  min-height: 112px;
}

.attachment-dropzone {
  position: relative;
  border: 1px dashed var(--line);
  background: #f8fbff;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  outline: none;
}

.attachment-dropzone:focus,
.attachment-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.attachment-copy {
  margin: 0;
  font-weight: 700;
}

.attachment-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
}

.attachment-item span {
  min-width: 0;
  word-break: break-word;
}

.attachment-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.closure-summary {
  background: #f8fbff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 16px;
}

.closure-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.summary-item {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.summary-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  font-weight: 700;
  word-break: break-word;
}

.transaction-list {
  display: grid;
  gap: 12px;
}

.transaction-item {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 14px;
  background: #fbfdff;
}

.transaction-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.transaction-type,
.transaction-amount {
  font-weight: 700;
}

.transaction-amount {
  color: #1747b8;
}

.transaction-amount.credit {
  color: var(--success);
}

.transaction-amount.debit {
  color: var(--danger);
}

@keyframes analytics-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.booking-details-modal-content {
  padding: 10px 0;
}

.booking-details-modal-content h3 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--text);
}

.booking-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-item span {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 980px) {
  .app-shell {
    width: 100%;
    margin: 0;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .topbar,
  .topbar-actions,
  .session-meta,
  .bookings-toolbar,
  .bookings-toolbar-group,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .closure-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-heading,
  .analytics-subheading {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-heading-actions {
    justify-content: flex-start;
  }
}
