:root {
  --navy: #16324f;
  --blue: #0b5c8e;
  --teal: #148a8a;
  --purple: #6b5aa6;
  --red: #b42318;
  --amber: #c98200;
  --green: #198754;
  --grey: #647586;
  --bg: #f4f7f9;
  --panel: #ffffff;
  --border: #d9e2e8;
  --text: #243746;
  --muted: #718096;
  --sidebar-width: 250px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(11, 92, 142, 0.18), transparent 38%),
    linear-gradient(135deg, #edf4f8, #f8fafb);
}

.auth-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 22px 65px rgba(22, 50, 79, 0.18);
  overflow: hidden;
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 24px 28px;
  background: var(--navy);
  color: #fff;
}

.login-logo {
  width: 52px;
  height: 52px;
}

.login-brand h1,
.login-brand p {
  margin: 0;
}

.login-brand h1 {
  font-size: 25px;
}

.login-brand p {
  margin-top: 5px;
  opacity: 0.8;
  font-size: 13px;
}

.login-intro {
  padding: 26px 28px 0;
}

.login-intro h2,
.login-intro p {
  margin: 0;
}

.login-intro h2 {
  font-size: 21px;
  color: var(--navy);
}

.login-intro p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  padding: 22px 28px 12px;
}

.login-form label {
  display: block;
  margin: 0 0 6px;
  color: #4c5f70;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid #b9c7d2;
  border-radius: 8px;
  padding: 11px 12px;
  margin: 0 0 17px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 92, 142, 0.12);
}

.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 18px;
  cursor: pointer;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 2px;
}

.login-security {
  padding: 0 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: #fff;
  box-shadow: 5px 0 18px rgba(22, 50, 79, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-icon {
  width: 42px;
  height: 42px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.72;
}

.main-nav {
  flex: 1;
  padding: 16px 12px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 38px 1fr 34px;
  gap: 9px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  font-weight: 700;
}

.user-meta {
  min-width: 0;
}

.user-meta strong,
.user-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 12px;
}

.user-meta span {
  margin-top: 3px;
  font-size: 9px;
  opacity: 0.7;
}

.logout-button {
  border: 0;
  border-radius: 7px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  color: var(--navy);
  font-size: 20px;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-menu-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.topbar-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #4c5f70;
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.page-content {
  padding: 24px;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.flash-success {
  background: #dff3e7;
  color: #0f5132;
}

.flash-error {
  background: #fce1e3;
  color: #842029;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 50, 79, 0.1);
}

.stat-card span,
.stat-card small {
  opacity: 0.88;
}

.stat-card span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card strong {
  margin: 7px 0;
  font-size: 31px;
}

.stat-card small {
  font-size: 10px;
  line-height: 1.35;
}

.stat-blue {
  background: var(--blue);
}

.stat-navy {
  background: var(--navy);
}

.stat-red {
  background: var(--red);
}

.stat-teal {
  background: var(--teal);
}

.stat-amber {
  background: var(--amber);
}

.stat-grey {
  background: var(--grey);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(22, 50, 79, 0.05);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2,
.panel-header p {
  margin: 0;
}

.panel-header h2 {
  color: var(--navy);
  font-size: 16px;
}

.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  margin-left: auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 13px;
}

.standalone-empty {
  max-width: 540px;
  margin: 90px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.standalone-empty .primary-link {
  margin-top: 18px;
}

.compact-list {
  padding: 0 18px;
}

.compact-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #edf1f4;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-main {
  min-width: 0;
}

.compact-main strong,
.compact-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-main strong {
  font-size: 12px;
}

.compact-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.compact-row time {
  color: var(--muted);
  font-size: 9px;
}

.priority-badge,
.message-direction,
.coming-soon {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: #edf3f7;
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.message-direction.inbound {
  background: #dff3e7;
  color: #0f5132;
}

.message-direction.outbound {
  background: #eaf4fb;
  color: var(--blue);
}

.coming-soon {
  margin-left: auto;
  background: #fff3cd;
  color: #664d03;
}

.getting-started {
  margin-top: 18px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px;
}

.step {
  display: flex;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafcfd;
}

.step > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eef2;
  color: var(--navy);
  font-weight: 700;
}

.step strong,
.step p {
  margin: 0;
}

.step strong {
  font-size: 12px;
}

.step p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.step.is-complete > span {
  background: #dff3e7;
  color: #0f5132;
}

.step.is-current {
  border-color: var(--blue);
  background: #eef7fc;
}

.step.is-current > span {
  background: var(--blue);
  color: #fff;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 11px 13px;
  text-align: left;
  border-bottom: 1px solid #e8edf1;
  vertical-align: top;
}

th {
  background: #f4f7f9;
  color: #4b5f70;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

td strong {
  color: var(--navy);
}

code {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eef3f6;
  color: var(--blue);
  font-size: 10px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-button {
    display: inline-block;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-content {
    padding: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-status {
    display: none;
  }

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

  .steps-grid {
    grid-template-columns: 1fr;
  }
}
