.login-page {
  min-height: 100vh;
  margin: 0;
  background: #edf1ec;
  color: #17231c;
  font-family: "DM Sans", sans-serif;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-image: linear-gradient(rgba(35, 74, 52, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(35, 74, 52, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 40px;
  border-top: 4px solid #2f6b47;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 35, 28, 0.14);
}

.login-brand {
  color: #2f6b47;
  font-weight: 700;
}

.login-panel h1 {
  margin: 28px 0 8px;
  font-family: "Newsreader", serif;
  font-size: 42px;
  letter-spacing: 0;
}

.login-panel p {
  margin: 0 0 28px;
  color: #617066;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 8px;
  font-weight: 600;
}

.login-form input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b8c4bb;
  border-radius: 4px;
  font: inherit;
}

.login-form input:focus {
  border-color: #2f6b47;
  outline: 3px solid rgba(47, 107, 71, 0.16);
}

.login-form button {
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 4px;
  background: #2f6b47;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-form button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login-alert {
  margin-bottom: 18px;
  padding: 12px;
  border-left: 3px solid currentColor;
}

.login-alert-danger {
  background: #fff0ee;
  color: #9f2d20;
}

@media (max-width: 520px) {
  .login-panel {
    padding: 28px 22px;
  }

  .login-panel h1 {
    font-size: 36px;
  }
}
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #60a5fa;
  --bg: #f3f5f9;
  --sidebar-bg-1: #111827;
  --sidebar-bg-2: #1f2937;
  --sidebar-w: 264px;
}

* { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
}

/* ---------- App shell / sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg-1) 0%, var(--sidebar-bg-2) 100%);
  color: #cbd5e1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.1rem;
  z-index: 1030;
  transition: transform .3s ease;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  text-decoration: none;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sidebar-brand i { color: var(--brand-light); }

.side-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }

.side-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .68rem .9rem;
  border-radius: .65rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.side-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37,99,235,.4);
}

.sidebar-footer { margin-top: auto; font-size: .75rem; color: #64748b; padding-top: 1rem; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 1025;
  animation: fade-in .2s ease;
}
.sidebar-backdrop.show { display: block; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #ffffffee;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: .75rem 1.1rem;
}

.content-area {
  padding: 1.85rem clamp(1rem, 3vw, 2.75rem) 3rem;
  flex: 1;
  animation: page-in .35s ease;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 50px rgba(0,0,0,.4); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ---------- General components ---------- */
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -.01em; }

.card {
  border: none;
  border-radius: .9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(15,23,42,.1); }

.btn {
  border-radius: .6rem;
  font-weight: 500;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border: none; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); border: none; }
.btn-danger, .btn-outline-danger:hover { filter: saturate(1.1); }

.table { border-radius: .75rem; overflow: hidden; }
.table td, .table th { vertical-align: middle; }
.table tbody tr { transition: background-color .15s ease; }
.table-hover tbody tr:hover { background-color: rgba(37,99,235,.06); }

.list-group-item { transition: background-color .15s ease, transform .15s ease; border-radius: .5rem !important; margin-bottom: .25rem; border: 1px solid rgba(0,0,0,.06) !important; }
.list-group-item:hover { background-color: rgba(37,99,235,.05); }

/* Flash notifications */
.flash-message {
  border-radius: .7rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  animation: flash-in .35s ease;
  transition: opacity .4s ease, transform .4s ease, margin .4s ease, padding .4s ease;
  overflow: hidden;
}
.flash-message.flash-out {
  opacity: 0;
  transform: translateY(-10px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal pop */
.modal.fade .modal-dialog { transition: transform .25s ease, opacity .2s ease; transform: scale(.92) translateY(10px); }
.modal.show .modal-dialog { transform: scale(1) translateY(0); }
.modal-content { border: none; border-radius: 1rem; box-shadow: 0 24px 50px rgba(0,0,0,.25); }

.spinner-border { animation-duration: .6s; }

/* Document / attachment previews */
.preview-frame { width: 100%; height: 75vh; border: 0; border-radius: .6rem; background: #f3f5f9; }
.preview-image { max-width: 100%; max-height: 75vh; border-radius: .6rem; }
.email-preview {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 60vh;
  overflow-y: auto;
}
.attachment-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: .5rem;
  margin-right: .6rem;
  border: 1px solid rgba(0,0,0,.08);
  vertical-align: middle;
}

/* Booking calendar */
.calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-shell {
  overflow: hidden;
  border: 1px solid #d9dee8;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: #f8fafc;
  border-bottom: 1px solid #d9dee8;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.calendar-weekdays > div { padding: .7rem .35rem; }

.calendar-day {
  min-height: 142px;
  padding: .45rem;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  background: #fff;
}

.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside-month { background: #f8fafc; }
.calendar-day.outside-month .calendar-day-number { color: #a3acb9; }
.calendar-day.is-today { box-shadow: inset 0 3px 0 #2563eb; }

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.calendar-day-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.is-today .calendar-day-number {
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
}

.calendar-add {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 4px;
  color: #64748b;
  opacity: 0;
}

.calendar-day:hover .calendar-add,
.calendar-add:focus { opacity: 1; }
.calendar-add:hover { background: #e8eefc; color: #1d4ed8; }

.calendar-events { display: grid; gap: 4px; margin-top: 3px; }

.calendar-event {
  display: grid;
  min-width: 0;
  padding: 5px 7px;
  border-left: 3px solid #2563eb;
  border-radius: 3px;
  background: #eaf1ff;
  color: #163b7a;
  font-size: .72rem;
  line-height: 1.25;
  text-decoration: none;
}

.calendar-event:hover { background: #dce8ff; color: #102e61; }
.calendar-event time { font-size: .65rem; opacity: .78; }
.calendar-event strong,
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { margin-top: 2px; color: #526680; }
.calendar-event.status-confirmed { border-color: #16835c; background: #e6f7f0; color: #115f46; }
.calendar-event.status-completed { border-color: #64748b; background: #eef1f4; color: #475569; }
.calendar-event.status-cancelled { border-color: #c2413b; background: #fff0ee; color: #8f2f2a; text-decoration: line-through; }

@media (max-width: 767.98px) {
  .calendar-heading { align-items: flex-start; flex-direction: column; }
  .calendar-heading > .d-flex { width: 100%; flex-wrap: wrap; }
  .calendar-heading .btn-primary { margin-left: auto !important; }
  .calendar-shell { overflow-x: auto; }
  .calendar-weekdays,
  .calendar-grid { min-width: 760px; }
  .calendar-day { min-height: 120px; }
  .calendar-add { opacity: 1; }
}

/* Operations dashboard */
.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  margin: .2rem 0 .3rem;
  color: #172033;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.dashboard-header p { margin: 0; color: #697386; }
.dashboard-date { color: #2563eb; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.dashboard-actions .btn { white-space: nowrap; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.35rem;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .05);
}

.metric-item {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .8rem;
  padding: 1rem 1.15rem;
  border-right: 1px solid #e6e9ef;
  color: #1e293b;
  text-decoration: none;
  transition: background-color .16s ease;
}

.metric-item:last-child { border-right: 0; }
.metric-item:hover { background: #f8fafc; color: #172033; }
.metric-item > span:last-child { display: grid; min-width: 0; }
.metric-item strong { font-size: 1.55rem; line-height: 1; }
.metric-item small { margin-top: .28rem; overflow: hidden; color: #697386; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }

.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 6px;
  font-size: 1.1rem;
}

.metric-blue .metric-icon { background: #eaf1ff; color: #2563eb; }
.metric-teal .metric-icon { background: #e1f5f1; color: #087f6b; }
.metric-amber .metric-icon { background: #fff3d6; color: #a45b00; }
.metric-green .metric-icon { background: #e8f5e9; color: #287a3e; }

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 1.35rem;
  margin-bottom: 1.35rem;
}

.dashboard-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .04);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #e8ebf0;
}

.panel-heading h2 { margin: .05rem 0 0; color: #172033; font-size: 1.08rem; }
.panel-kicker { color: #768196; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel-link { color: #2563eb; font-size: .78rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.panel-link:hover { color: #1d4ed8; }

.schedule-row {
  display: grid;
  grid-template-columns: 62px 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  min-height: 70px;
  padding: .75rem 1.2rem;
  border-bottom: 1px solid #edf0f4;
  color: #1e293b;
  text-decoration: none;
}

.schedule-row:hover { background: #f8fafc; color: #172033; }
.schedule-row time { display: grid; color: #273449; line-height: 1; }
.schedule-row time strong { font-size: .9rem; }
.schedule-row time span { margin-top: .25rem; color: #8a94a6; font-size: .6rem; font-weight: 700; }
.schedule-marker { width: 4px; height: 36px; border-radius: 2px; background: #2563eb; }
.schedule-marker.status-confirmed { background: #16835c; }
.schedule-marker.status-completed { background: #64748b; }
.schedule-copy { display: grid; min-width: 0; }
.schedule-copy strong, .schedule-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-copy strong { font-size: .88rem; }
.schedule-copy small { margin-top: .25rem; color: #758094; font-size: .73rem; }

.status-label {
  padding: .25rem .5rem;
  border-radius: 4px;
  background: #eaf1ff;
  color: #1d4ed8;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-label.status-confirmed { background: #e1f5ed; color: #147453; }
.status-label.status-completed { background: #edf0f4; color: #526074; }

.upcoming-strip { display: flex; align-items: stretch; overflow-x: auto; background: #f8fafc; }
.upcoming-label { display: grid; min-width: 86px; place-items: center; padding: .75rem; color: #768196; font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.upcoming-item { display: flex; align-items: center; min-width: 165px; gap: .6rem; padding: .65rem .8rem; border-left: 1px solid #e4e8ee; color: #273449; text-decoration: none; }
.upcoming-item:hover { background: #eef3fb; color: #172033; }
.upcoming-item > span:last-child { display: grid; min-width: 0; }
.upcoming-item > span:last-child strong { max-width: 108px; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-item small { color: #758094; font-size: .66rem; }
.upcoming-date { display: grid; width: 32px; flex: 0 0 32px; color: #2563eb; font-size: .58rem; line-height: 1; text-align: center; text-transform: uppercase; }
.upcoming-date strong { font-size: 1rem; }

.attention-count { display: grid; min-width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #fff1d6; color: #965800; font-size: .8rem; font-weight: 700; }
.attention-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-height: 62px; padding: .65rem 1.1rem; border-bottom: 1px solid #edf0f4; color: #273449; text-decoration: none; }
.attention-row:hover { background: #fffaf0; color: #172033; }
.attention-row > span:nth-child(2) { display: grid; min-width: 0; }
.attention-row strong, .attention-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-row strong { font-size: .82rem; }
.attention-row small { margin-top: .2rem; color: #7a8497; font-size: .68rem; }
.attention-row > i { color: #a2aab8; font-size: .7rem; }
.attention-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 6px; }
.attention-symbol.pending { background: #fff0e8; color: #b54708; }
.attention-symbol.overdue { background: #fff1d6; color: #966000; }
.panel-foot { padding: .7rem 1.1rem; background: #fffaf0; color: #805f26; font-size: .72rem; font-weight: 600; text-align: center; }

.dashboard-empty { display: grid; min-height: 180px; place-items: center; align-content: center; gap: .35rem; padding: 1.5rem; color: #818b9c; text-align: center; }
.dashboard-empty i { color: #a6afbd; font-size: 1.5rem; }
.dashboard-empty strong { color: #465266; font-size: .88rem; }
.dashboard-empty span { font-size: .75rem; }
.dashboard-empty a { color: #2563eb; font-size: .75rem; font-weight: 600; text-decoration: none; }
.dashboard-empty.compact { min-height: 210px; }

.portfolio-band {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr);
  align-items: stretch;
  margin-bottom: 1.35rem;
  overflow: hidden;
  border: 1px solid #dce4df;
  border-radius: .5rem;
  background: #f5faf7;
}

.portfolio-summary { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.3rem; border-right: 1px solid #dce4df; }
.portfolio-summary h2 { margin: .1rem 0 .2rem; color: #173c2a; font-size: 1.05rem; }
.portfolio-summary p { margin: 0; color: #607267; font-size: .72rem; }
.portfolio-symbol { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 7px; background: #dcefe3; color: #267247; font-size: 1.25rem; }
.portfolio-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.portfolio-count { display: grid; place-items: center; align-content: center; min-width: 0; padding: .85rem .4rem; border-right: 1px solid #dce4df; color: #476054; text-decoration: none; }
.portfolio-count:last-child { border-right: 0; }
a.portfolio-count:hover { background: #eaf5ee; color: #174e30; }
.portfolio-count i { margin-bottom: .25rem; color: #6d8477; font-size: .85rem; }
.portfolio-count strong { color: #193c2a; font-size: 1.15rem; }
.portfolio-count span { max-width: 100%; overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
.subtle-count { color: #7d8798; font-size: .7rem; }
.activity-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .65rem; min-height: 60px; padding: .65rem 1rem; border-bottom: 1px solid #edf0f4; color: #273449; text-decoration: none; }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: #f8fafc; color: #172033; }
.activity-row.unread { background: #f4f8ff; }
.activity-row.unread:hover { background: #edf4ff; }
.activity-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 5px; background: #eaf1ff; color: #2563eb; }
.activity-icon.shared { background: #e1f5f1; color: #087f6b; }
.activity-icon.document { background: #fff1df; color: #a45b00; }
.activity-copy { display: grid; min-width: 0; }
.activity-copy strong, .activity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { font-size: .78rem; }
.activity-copy small { margin-top: .2rem; color: #7a8497; font-size: .67rem; }
.activity-row time { color: #8a94a6; font-size: .65rem; white-space: nowrap; }

@media (max-width: 1199.98px) {
  .dashboard-primary-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-activity-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-activity-grid > :last-child { grid-column: 1 / -1; }
  .portfolio-band { grid-template-columns: 1fr; }
  .portfolio-summary { border-right: 0; border-bottom: 1px solid #dce4df; }
}

@media (max-width: 767.98px) {
  .dashboard-header { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .dashboard-actions { justify-content: flex-start; width: 100%; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-item:nth-child(2) { border-right: 0; }
  .metric-item:nth-child(-n+2) { border-bottom: 1px solid #e6e9ef; }
  .dashboard-primary-grid, .dashboard-activity-grid { grid-template-columns: 1fr; }
  .dashboard-activity-grid > :last-child { grid-column: auto; }
  .portfolio-counts { grid-template-columns: repeat(5, minmax(72px, 1fr)); overflow-x: auto; }
  .portfolio-count { min-width: 72px; }
}

@media (max-width: 479.98px) {
  .dashboard-actions .btn { flex: 1 1 calc(50% - .5rem); }
  .metric-item { padding: .85rem; }
  .metric-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .metric-item strong { font-size: 1.25rem; }
  .schedule-row { grid-template-columns: 52px 3px minmax(0, 1fr); gap: .65rem; padding: .7rem .8rem; }
  .status-label { display: none; }
  .panel-heading { padding: .9rem 1rem; }
}

/* Shared record and form surfaces */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-header h1 { margin: .1rem 0 .2rem; color: #172033; font-size: 1.85rem; }
.page-header p { margin: 0; color: #788397; font-size: .78rem; }
.page-kicker, .modal-kicker { color: #2563eb; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.surface-panel { overflow: hidden; border: 1px solid #dfe4ec; border-radius: .5rem; background: #fff; box-shadow: 0 5px 18px rgba(15, 23, 42, .04); }
.data-table thead th { padding: .8rem 1rem; border-bottom: 1px solid #dfe4ec; background: #f8fafc; color: #717d90; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.data-table tbody td { padding: .75rem 1rem; border-color: #edf0f4; color: #526074; font-size: .8rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table .primary-cell { color: #1e293b; font-weight: 650; }
.data-table a:not(.btn) { color: #2563eb; text-decoration: none; }
.btn-icon { display: inline-grid; width: 31px; height: 31px; padding: 0; place-items: center; border-radius: 5px; }
.state-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .45rem; border-radius: 4px; font-size: .66rem; font-weight: 700; }
.state-chip.positive { background: #e2f5e9; color: #247046; }
.state-chip.neutral { background: #edf0f4; color: #657084; }
.table-empty { display: grid; min-height: 220px; place-items: center; align-content: center; gap: .35rem; color: #8791a2; text-align: center; }
.table-empty i { color: #a4adba; font-size: 1.5rem; }
.table-empty strong { color: #465266; font-size: .9rem; }
.table-empty span { font-size: .75rem; }
.standalone-form-shell { max-width: 680px; margin: 0 auto; }
.modal-header { padding: 1rem 1.2rem; border-bottom-color: #e6eaf0; }
.modal-title { margin-top: .1rem; color: #172033; }
.modal-body { padding: 1.2rem; }
.clean-form .form-label { margin-bottom: .35rem; color: #3d485b; font-size: .76rem; font-weight: 650; }
.required-mark { color: #c2413b; }
.form-switches { display: flex; flex-wrap: wrap; gap: .6rem; padding: .75rem; border: 1px solid #e2e7ee; border-radius: 6px; background: #f8fafc; }
.form-switches .form-check { margin: 0; }
.form-control, .form-select { border-color: #ccd3dd; border-radius: 5px; font-size: .85rem; }
.form-control:focus, .form-select:focus { border-color: #6e9cf5; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.modal-form-actions { display: flex; justify-content: flex-end; gap: .5rem; padding-top: .3rem; }

@media (max-width: 575.98px) {
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .btn { width: 100%; }
  .data-table { min-width: 680px; }
  .data-table.empty-table { min-width: 100%; }
  .data-table.empty-table thead { display: none; }
}

/* Entity detail pages */
.record-actions { display: flex; gap: .5rem; }
.record-facts { margin: 0 0 1.35rem; padding: 1.15rem 1.25rem .4rem; }
.record-facts dt { color: #778296; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.record-facts dd { min-height: 1.5rem; margin-bottom: .8rem; color: #263247; font-size: .84rem; }
.record-facts dd a { color: #2563eb; text-decoration: none; }
.record-page > h4,
.record-page > .d-flex h4 { margin: 1.35rem 0 .65rem; color: #172033; font-size: 1rem; }
.record-page > .d-flex { margin-top: 1.35rem !important; padding: .85rem 1rem; border: 1px solid #dfe4ec; border-bottom: 0; border-radius: .5rem .5rem 0 0; background: #fff; }
.record-page > .d-flex h4 { margin: 0; }
.record-page > .list-group { overflow: hidden; margin-bottom: 1.35rem !important; border: 1px solid #dfe4ec; border-radius: .5rem; background: #fff; box-shadow: 0 5px 18px rgba(15, 23, 42, .04); }
.record-page > .list-group .list-group-item { min-height: 52px; margin: 0; padding: .7rem 1rem; border: 0 !important; border-bottom: 1px solid #edf0f4 !important; border-radius: 0 !important; background: transparent; color: #526074; font-size: .82rem; }
.record-page > .list-group .list-group-item:last-child { border-bottom: 0 !important; }
.record-page > .list-group .list-group-item:hover { background: #f8fafc; transform: none; }
.record-page > .table { display: table; width: 100%; margin-bottom: 1.35rem; overflow: hidden; border: 1px solid #dfe4ec; border-radius: 0 0 .5rem .5rem; background: #fff; box-shadow: 0 5px 18px rgba(15, 23, 42, .04); }
.record-page > .table thead th { padding: .7rem 1rem; background: #f8fafc; color: #758094; font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; }
.record-page > .table td { padding: .7rem 1rem; border-color: #edf0f4; color: #526074; font-size: .78rem; }
.record-page > .table a:not(.btn) { color: #2563eb; font-weight: 600; text-decoration: none; }

@media (max-width: 767.98px) {
  .record-header { align-items: stretch; }
  .record-actions { width: 100%; }
  .record-actions .btn { flex: 1; }
  .record-facts { padding: 1rem 1rem .25rem; }
  .record-page > .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Mailbox and document workspaces */
.mailbox-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 1.2rem; }
.mailbox-layout > *, .mailbox-main { min-width: 0; }
.mail-folders { padding: .4rem; }
.mail-folder { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: .55rem .7rem; border-radius: 5px; color: #5e6a7d; font-size: .8rem; font-weight: 600; text-decoration: none; }
.mail-folder > span:first-child { display: flex; align-items: center; gap: .6rem; }
.mail-folder i { width: 18px; color: #8791a2; }
.mail-folder:hover { background: #f2f5f9; color: #273449; }
.mail-folder.active { background: #eaf1ff; color: #1d4ed8; }
.mail-folder.active i { color: #2563eb; }
.folder-count { color: #8a94a6; font-size: .68rem; }
.folder-count.has-unread { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 11px; background: #2563eb; color: #fff; }
#syncStatus { padding: .65rem .4rem; line-height: 1.4; }
.mailbox-toolbar { display: flex; align-items: center; gap: .8rem; min-height: 66px; padding: .75rem 1rem; border-bottom: 1px solid #e5e9ef; background: #f8fafc; }
.mail-search { position: relative; flex: 1; }
.mail-search > i { position: absolute; top: 50%; left: .8rem; z-index: 1; color: #8b95a5; transform: translateY(-50%); }
.mail-search .form-control { padding-left: 2.35rem; }
.mailbox-toolbar .form-check { margin: 0 .5rem 0 0; white-space: nowrap; }
.mailbox-table .clickable-row { cursor: pointer; }
.mailbox-table .unread-row { background: #f4f8ff; font-weight: 650; }
.mailbox-table td:first-child { width: 38px; text-align: center; }
.mail-snippet { max-width: 420px; overflow: hidden; margin-top: .2rem; color: #8993a3; font-size: .7rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.compose-surface { max-width: 920px; padding: 1.25rem; }
.contact-suggestions { z-index: 10; }
.booking-form-shell { max-width: 680px; }
.compose-surface textarea { min-height: 280px; resize: vertical; }
.compose-actions { display: flex; gap: .5rem; padding-top: .35rem; }
.message-header { align-items: flex-start; }
.message-header h1 { max-width: 920px; overflow-wrap: anywhere; font-size: 1.55rem; }
.message-meta, .document-meta { display: grid; grid-template-columns: 90px minmax(0, 1fr); margin: 0 0 1rem; padding: 1rem 1.2rem .3rem; }
.message-meta dt, .document-meta dt { color: #778296; font-size: .65rem; letter-spacing: .04em; text-transform: uppercase; }
.message-meta dd, .document-meta dd { min-width: 0; margin-bottom: .7rem; overflow-wrap: anywhere; color: #344055; font-size: .78rem; }
.message-body { min-height: 320px; margin: 0; padding: 1.25rem; border: 1px solid #dfe4ec !important; border-radius: .5rem !important; background: #fff !important; }
.message-labels { margin-top: 1.35rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: .9rem 1.1rem; border-bottom: 1px solid #e7ebf0; }
.section-heading h2, .document-preview-heading h2 { margin: .1rem 0 0; color: #172033; font-size: 1rem; }
.message-label-body { padding: 1rem 1.1rem; }
.conversation-thread { display: grid; gap: 1rem; }
.conversation-message { padding: 1.1rem 1.2rem; }
.conversation-message .preview-frame { min-height: 280px; box-shadow: none; }
.reply-surface { margin-top: 1rem; padding: 1.1rem 1.2rem; }
.document-preview-heading { margin: 1.35rem 0 .65rem; }
.document-preview-heading + .preview-frame,
.document-preview-heading + .preview-image { border: 1px solid #dfe4ec; border-radius: .5rem; background: #fff; box-shadow: 0 5px 18px rgba(15, 23, 42, .04); }

@media (max-width: 767.98px) {
  .mailbox-layout { grid-template-columns: 1fr; }
  .mail-folders { display: flex; overflow-x: auto; }
  .mail-folder { min-width: max-content; gap: .75rem; }
  .mailbox-toolbar { align-items: stretch; flex-wrap: wrap; }
  .mail-search { flex-basis: 100%; }
  .mailbox-main .table { min-width: 760px; }
  .mailbox-main .table.empty-table { min-width: 100%; }
  .message-meta, .document-meta { grid-template-columns: 72px minmax(0, 1fr); }
  .message-header .record-actions { width: 100%; }
  .compose-actions { flex-wrap: wrap; }
}

