* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050505;
  color: #f5f5f5;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background: #050505;
  border-right: 1px solid #202020;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 28px 24px 30px;
  border-bottom: 1px solid #202020;
}

.brand-name {
  font-size: 18px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #777;
}

.sidebar-nav {
  padding: 18px 0;
  flex: 1;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  color: #777;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.sidebar-nav a:hover {
  color: #fff;
  background: #0b0b0b;
}

.sidebar-nav a.active {
  color: #fff;
}

.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #fff;
}

.sign-out {
  margin: 18px 24px 24px;
  padding: 11px 0;
  border: 1px solid #292929;
  background: transparent;
  color: #777;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  text-align: center;
}

.sign-out:hover {
  color: #fff;
  border-color: #555;
}


/* =========================================================
   MOBILE HEADER
========================================================= */

.mobile-header {
  display: none;
}


/* =========================================================
   MAIN
========================================================= */

.main {
  min-height: 100vh;
  margin-left: 230px;
  padding: 56px 56px 80px;
}

.page-header {
  padding-bottom: 34px;
  border-bottom: 1px solid #202020;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #777;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.page-description {
  max-width: 620px;
  margin: 16px 0 0;
  color: #777;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.7;
}


/* =========================================================
   TOOLBAR
========================================================= */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  margin-top: 30px;
}

.search-wrap input,
.filter-wrap select {
  width: 100%;
  height: 46px;
  border: 1px solid #292929;
  outline: none;
  background: #080808;
  color: #eee;
  border-radius: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.search-wrap input {
  padding: 0 15px;
}

.filter-wrap select {
  padding: 0 12px;
}

.search-wrap input::placeholder {
  color: #555;
}

.search-wrap input:focus,
.filter-wrap select:focus {
  border-color: #555;
}


/* =========================================================
   SUMMARY
========================================================= */

.summary {
  display: flex;
  gap: 48px;
  margin-top: 26px;
  padding: 18px 0;
  border-top: 1px solid #161616;
  border-bottom: 1px solid #161616;
}

.summary-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.summary-label {
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-item strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
}


/* =========================================================
   MESSAGE SECTION
========================================================= */

.messages-section {
  margin-top: 42px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #202020;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 400;
}

.section-heading span {
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
}


/* =========================================================
   MESSAGE LIST
========================================================= */

.message-list {
  width: 100%;
}

.message-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(200px, 1.3fr) minmax(220px, 2fr) 130px;
  gap: 24px;
  align-items: center;
  min-height: 86px;
  padding: 18px 4px;
  border-bottom: 1px solid #191919;
  color: inherit;
  text-decoration: none;
  transition: background 0.18s ease;
}

.message-row:hover {
  background: #0a0a0a;
}

.message-row.is-new {
  padding-left: 14px;
}

.message-row.is-new::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

.message-sender,
.message-subject,
.message-preview {
  min-width: 0;
}

.sender-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.sender-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  color: #555;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
}

.subject-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.message-row.is-new .subject-text {
  color: #fff;
  font-weight: 600;
}

.preview-text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.message-date {
  color: #555;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}


/* =========================================================
   STATES
========================================================= */

.loading-state,
.empty-state,
.error-state {
  padding: 50px 0;
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.error-state {
  color: #aaa;
}

.page-message {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid #333;
  background: #0b0b0b;
  color: #ddd;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.page-message.show {
  opacity: 1;
  transform: translateY(0);
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

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


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.22s ease,
      visibility 0.22s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 17px;
    background: #050505;
    border-bottom: 1px solid #202020;
  }

  .menu-button {
    width: 28px;
    height: 28px;
    padding: 5px 3px;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .menu-button span {
    display: block;
    width: 20px;
    height: 1px;
    background: #aaa;
  }

  .mobile-brand {
    display: flex;
    flex-direction: column;
  }

  .mobile-brand strong {
    font-size: 13px;
    letter-spacing: 0.14em;
  }

  .mobile-brand span {
    margin-top: 3px;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 7px;
    letter-spacing: 0.18em;
  }

  .main {
    margin-left: 0;
    padding: 100px 20px 60px;
  }

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

  .message-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 19px 4px;
  }

  .message-row.is-new {
    padding-left: 14px;
  }

  .message-date {
    text-align: left;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 500px) {

  .main {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 36px;
  }

  .summary {
    gap: 30px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

}