/* Palette taken from the Cressel Software logo:
   wordmark blue, the mark's teal and purple. */
:root {
  --brand: #4b54c4;
  --brand-dark: #363eA0;
  --brand-teal: #2bc4d8;
  --brand-purple: #7b3f9d;
  --sidebar-w: 232px;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
}

.text-primary {
  color: var(--brand) !important;
}

.bg-primary {
  background-color: var(--brand) !important;
}

a {
  color: var(--brand);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 .2rem rgba(43, 196, 216, .2);
}

body {
  background: #f4f5f9;
  font-size: 0.925rem;
  color: #1f2333;
}

/* ---------- Chrome ---------- */

/* Light bar so the full-colour logo reads correctly, with the mark's
   teal-to-purple gradient as a hairline accent along the bottom. */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7f0;
  box-shadow: 0 1px 3px rgba(16, 20, 40, .06);
  padding: .45rem 0;
  position: relative;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-purple));
}

.brand-logo {
  height: 34px;
  width: auto;
}

.brand-logo-mark {
  height: 30px;
  width: auto;
}

/* ---------- Notification bell ---------- */

.notif-menu {
  width: 340px;
  max-width: calc(100vw - 1.5rem);
  padding: 0;
  max-height: 26rem;
  overflow-y: auto;
}

.notif-item {
  white-space: normal;
  padding: .6rem .9rem;
  border-bottom: 1px solid #f1f2f8;
}

.notif-item:last-of-type {
  border-bottom: 0;
}

.notif-item.unread {
  background: #f2f6ff;
}

.notif-item.unread .notif-text {
  font-weight: 600;
}

.notif-item i {
  color: var(--brand);
}

.layout {
  display: flex;
  min-height: calc(100vh - 58px);
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e5e7f0;
}

.sidebar .nav-link {
  color: #4a5069;
  border-radius: .45rem;
  padding: .5rem .75rem;
  margin-bottom: .15rem;
  font-weight: 500;
}

.sidebar .nav-link i {
  width: 1.25rem;
  margin-right: .35rem;
}

.sidebar .nav-link:hover {
  background: #f1f2f8;
  color: var(--brand);
}

.sidebar .nav-link.active {
  background: var(--brand);
  color: #fff;
}

.sidebar .nav-heading {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9096ad;
  padding: .9rem .75rem .3rem;
  font-weight: 600;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- Cards & tables ---------- */

.card {
  border: 1px solid #e5e7f0;
  border-radius: .6rem;
  box-shadow: 0 1px 2px rgba(16, 20, 40, .04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0f6;
  font-weight: 600;
  padding: .7rem 1rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #7b8199;
  font-weight: 600;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  opacity: .35;
}

.table > :not(caption) > * > * {
  padding: .6rem .7rem;
}

.table thead th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7b8199;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table-hover tbody tr:hover {
  background: #f7f8fc;
}

tr.overdue td:first-child {
  box-shadow: inset 3px 0 0 #dc3545;
}

/* ---------- Conversation ---------- */

.msg {
  border: 1px solid #e5e7f0;
  border-radius: .6rem;
  background: #fff;
  padding: .8rem 1rem;
  margin-bottom: .75rem;
}

.msg.staff {
  border-left: 3px solid var(--brand);
}

.msg.internal {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
}

.msg .msg-meta {
  font-size: .78rem;
  color: #7b8199;
}

.msg .msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: .4rem;
}

/* ---------- Auth ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 45%, var(--brand-purple) 100%);
  padding: 1.5rem;
}

.auth-logo {
  max-width: 260px;
  width: 100%;
  height: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: .75rem;
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(10, 12, 35, .28);
}

.badge {
  font-weight: 600;
  letter-spacing: .02em;
}

.form-label {
  font-weight: 500;
  font-size: .85rem;
  margin-bottom: .25rem;
}

a {
  text-decoration: none;
}
