* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: #000;
  color: #f5f5f5;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

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

.brand-name {
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.brand-label {
  margin-top: 8px;
  color: #777;
  font-size: 9px;
  letter-spacing: 0.18em;
  line-height: 1;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  flex: 1;
}

.nav-item {
  position: relative;
  min-height: 44px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  color: #777;
  font-size: 13px;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-item:hover {
  color: #fff;
  background: #080808;
}

.nav-item.active {
  color: #fff;
}

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

.signout-button {
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-top: 1px solid #1d1d1d;
  background: transparent;
  color: #666;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.signout-button:hover {
  color: #fff;
}

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

.mobile-header {
  display: none;
}

.menu-button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

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

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

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 34px;
  border-bottom: 1px solid #1d1d1d;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: #666;
  font-size: 12px;
}

.back-link:hover {
  color: #fff;
}

.eyebrow {
  margin: 0 0 13px;
  color: #666;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.page-description {
  max-width: 520px;
  margin: 16px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}

.text-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  cursor: pointer;
  white-space: nowrap;
}

.text-button {
  border: 0;
  background: transparent;
  color: #888;
  padding: 0;
  font-size: 12px;
}

.text-button:hover {
  color: #fff;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid #fff;
  background: #fff;
  color: #000;
  font-size: 12px;
}

.primary-button:hover {
  background: #ddd;
  border-color: #ddd;
}

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

.toolbar {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 24px 0;
  border-bottom: 1px solid #1d1d1d;
}

.search-wrap {
  flex: 1;
  max-width: 600px;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #242424;
  outline: none;
  border-radius: 0;
  background: #050505;
  color: #fff;
}

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

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

.toolbar-count {
  color: #555;
  font-size: 11px;
  white-space: nowrap;
}

/* =========================
   SENT LIST
========================= */

.sent-list {
  border-top: 1px solid #1d1d1d;
}

.sent-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(250px, 1.8fr) 150px;
  gap: 30px;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid #1d1d1d;
  color: #555;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sent-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(250px, 1.8fr) 150px;
  gap: 30px;
  align-items: center;
  min-height: 76px;
  padding: 15px 0;
  border-bottom: 1px solid #151515;
  cursor: pointer;
  transition: background 0.18s ease;
}

.sent-row:hover {
  background: #050505;
}

.sent-recipient,
.sent-subject {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sent-recipient {
  color: #bbb;
  font-size: 13px;
}

.sent-subject {
  color: #888;
  font-size: 13px;
}

.sent-preview {
  margin-top: 6px;
  color: #555;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sent-date {
  color: #555;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

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

.state {
  padding: 90px 20px;
  text-align: center;
  color: #555;
  font-size: 12px;
}

.state h2 {
  margin: 0;
  color: #aaa;
  font-size: 19px;
  font-weight: 400;
}

.state p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.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
========================= */

.sidebar-overlay {
  display: none;
}

@media (max-width: 800px) {
  .mobile-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: 62px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000;
    border-bottom: 1px solid #1d1d1d;
  }

  .mobile-brand {
    display: flex;
    align-items: baseline;
    gap: 9px;
  }

  .mobile-brand .brand-name {
    font-size: 13px;
  }

  .mobile-brand .brand-label {
    margin: 0;
    font-size: 8px;
  }

  .sidebar {
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 200;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.7);
  }

  .sidebar-overlay.visible {
    display: block;
  }

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

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 26px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-wrap {
    flex: 1 0 100%;
    max-width: none;
  }

  .sent-head {
    display: none;
  }

  .sent-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding: 18px 0;
  }

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

@media (max-width: 480px) {
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-header h1 {
    font-size: 34px;
  }
}