.inbox-main {
  padding: 14px;
  overflow: hidden;
}

.inbox-shell {
  display: grid;
  grid-template-columns: 230px 330px minmax(420px, 1fr);
  height: calc(100vh - 28px);
  max-height: calc(100vh - 28px);
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
}

.inbox-left,
.inbox-list-panel,
.email-detail-panel {
  min-height: 0;
  border-right: 1px solid #1e293b;
  overflow: hidden;
}

.inbox-left {
  padding: 18px;
  background: #050b16;
  overflow-y: auto;
}

.inbox-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.inbox-title-row h1 {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
}

.inbox-title-row p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.inbox-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.inbox-stat-card {
  background: #0f172a;
  border: 1px solid #233047;
  border-radius: 14px;
  padding: 12px;
}

.inbox-stat-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.inbox-stat-card h2 {
  margin: 5px 0 0;
  color: #ffffff;
  font-size: 24px;
}

.inbox-filter-box {
  display: grid;
  gap: 9px;
}

.inbox-filter-box label,
.filter-label {
  color: #e5e7eb;
  font-weight: 900;
  font-size: 12px;
  margin-top: 5px;
}

.inbox-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0 10px;
}

.inbox-search span {
  color: #94a3b8;
}

.inbox-search input,
.inbox-filter-box input,
.inbox-filter-box select {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  background: #020617;
  color: #ffffff;
  outline: none;
  box-sizing: border-box;
  font-size: 13px;
}

.inbox-search input {
  border: 0;
  padding-left: 0;
}

.filter-pill {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: #111827;
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.filter-pill:hover,
.filter-pill.active {
  background: #172033;
  border-color: #334155;
}

.primary-btn,
.small-btn {
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
}

.primary-btn {
  border: 0;
  background: #2563eb;
  color: #ffffff;
}

.small-btn {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.full {
  width: 100%;
}

.inbox-list-panel {
  background: #07101f;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.inbox-list-header {
  flex-shrink: 0;
  padding: 14px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
}

.tab.active {
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.12);
}

.email-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.email-item {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: 0.15s ease;
  position: relative;
}

.email-item:hover,
.email-item.active {
  background: #172033;
  border-color: #2563eb;
}

.email-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: #2563eb;
}

.email-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.email-from {
  color: #ffffff;
  font-weight: 900;
  font-size: 12px;
  word-break: break-word;
}

.email-date {
  color: #94a3b8;
  font-size: 10px;
  white-space: nowrap;
}

.email-subject {
  color: #e5e7eb;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 7px;
}

.email-preview {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.email-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.email-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.email-tag.auto {
  background: rgba(250, 204, 21, 0.13);
  color: #facc15;
}

.email-tag.interested {
  background: rgba(34, 197, 94, 0.13);
  color: #4ade80;
}

.email-detail-panel {
  background: #020617;
  overflow-y: auto;
  border-right: 0;
  min-width: 0;
}

.email-empty-detail {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.email-empty-detail h2 {
  margin: 0;
  color: #ffffff;
}

.email-empty-detail p {
  color: #94a3b8;
}

.email-detail {
  padding: 18px;
}

.email-detail-top {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e293b;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #334155;
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
}

.detail-heading {
  min-width: 0;
}

.detail-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.detail-heading p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 12px;
  word-break: break-word;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-panel {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.10));
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 14px;
}

.ai-panel strong {
  color: #ffffff;
}

.ai-panel p {
  margin: 5px 0 0;
  color: #cbd5e1;
  line-height: 1.45;
  font-size: 12px;
}

.email-info-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 9px;
}

.email-info-grid div {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 11px;
  min-width: 0;
}

.email-info-grid span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  margin-bottom: 5px;
}

.email-info-grid strong {
  display: block;
  color: #ffffff;
  font-size: 12px;
  word-break: break-word;
}

.attachment-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.attachment-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 10px 12px;
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
}

.message-card {
  margin-top: 16px;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
}

.message-header {
  padding: 14px;
  border-bottom: 1px solid #1e293b;
}

.message-header strong {
  color: #ffffff;
}

.message-header p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.message-body {
  padding: 16px;
  color: #e5e7eb;
  line-height: 1.55;
  overflow-x: auto;
  max-width: 100%;
  font-size: 13px;
}

.message-body a {
  color: #60a5fa;
}

.message-body img,
.message-body table {
  max-width: 100%;
}

.reply-box {
  margin-top: 16px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
}

.reply-box-header {
  padding: 12px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.reply-box-header strong {
  color: #ffffff;
}

.reply-box-header span {
  color: #94a3b8;
  font-size: 11px;
}

.reply-box textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 0;
  outline: none;
  background: #020617;
  color: #ffffff;
  padding: 14px;
  box-sizing: border-box;
  line-height: 1.5;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #1e293b;
}

.empty-state {
  color: #94a3b8;
  text-align: center;
  padding: 28px 10px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1300px) {
  .inbox-shell {
    grid-template-columns: 220px 310px minmax(380px, 1fr);
  }
}

@media (max-width: 1050px) {
  .inbox-main {
    padding: 12px;
    overflow: auto;
  }

  .inbox-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .inbox-left,
  .inbox-list-panel,
  .email-detail-panel {
    border-right: 0;
    border-bottom: 1px solid #1e293b;
  }

  .email-list {
    max-height: 430px;
  }

  .email-detail-top {
    grid-template-columns: 42px 1fr;
  }

  .detail-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .email-info-grid {
    grid-template-columns: 1fr;
  }
}
