/* Brade App Mock — realistic inbox/processing simulation */

.app-mock {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(10, 21, 32, 0.08),
    0 40px 100px -30px rgba(10, 21, 32, 0.3),
    0 20px 50px -20px rgba(10, 21, 32, 0.25);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  color: #1a1a1a;
  aspect-ratio: 16 / 10;
  max-width: 1280px;
  margin: 0 auto;
}

/* Chrome */
.app-chrome {
  background: #2f2f33;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 14px;
  gap: 14px;
}
.app-chrome-dots { display: flex; gap: 6px; }
.app-chrome-dots span { width: 11px; height: 11px; border-radius: 50%; }
.app-chrome-url {
  background: #1e1e22;
  color: #c0c0c0;
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 4px;
  justify-self: center;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-chrome-url .lock { font-size: 10px; opacity: 0.8; }
.app-chrome-right { width: 50px; }

/* Header */
.app-header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.app-header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.app-header-right .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

/* Body */
.app-body {
  display: grid;
  grid-template-columns: 160px 220px 1fr;
  height: calc(100% - 72px);
  background: #fafbfc;
}

/* Sidebar */
.app-sidebar {
  background: #fafbfc;
  border-right: 1px solid #e5e7eb;
  padding: 10px 6px;
  overflow: hidden;
  font-size: 11px;
}
.sidebar-switcher {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 8px;
}
.sw-title { font-weight: 600; font-size: 11px; }
.sw-sub { color: #6b7280; font-size: 9px; margin-top: 1px; }
.ask-btn {
  width: 100%;
  padding: 6px 10px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
  cursor: pointer;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  color: #374151;
  font-size: 11px;
}
.sb-item.indent { padding-left: 14px; }
.sb-item.active { color: #111827; font-weight: 500; }
.sb-item.active-sub {
  background: #e0e7ff;
  color: #1e40af;
  font-weight: 600;
}
.sb-ico { font-size: 10px; opacity: 0.8; }
.sb-count {
  font-size: 9px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 8px;
}
.sb-item.active-sub .sb-count { background: #c7d2fe; color: #1e40af; }
.sb-div { height: 1px; background: #e5e7eb; margin: 6px 0; }

/* List */
.app-list {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.list-search {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-search {
  background: #f3f4f6;
  margin: 8px;
  border-radius: 4px;
  padding: 5px 10px;
  border: none;
}
.search-ico { font-size: 10px; opacity: 0.5; }
.search-placeholder { color: #9ca3af; font-size: 11px; }
.list-items { flex: 1; overflow: hidden; }
.list-item {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 10px;
}
.list-item.active {
  background: #f5f3ff;
  border-left: 2px solid #8b5cf6;
}
.list-item.active .li-from { color: #6d28d9; font-weight: 600; }
.li-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.li-from { font-weight: 500; color: #111827; font-size: 10px; }
.li-date { color: #9ca3af; font-size: 9px; }
.li-subj {
  color: #6b7280;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Detail */
.app-detail {
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.detail-head {
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.detail-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  flex: 1;
}
.process-btn {
  padding: 6px 14px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}
.process-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4); }
.process-btn:disabled { opacity: 0.9; cursor: not-allowed; }
.process-btn .spinner {
  width: 11px; height: 11px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}
@keyframes spinner { to { transform: rotate(360deg); } }

/* Detail body */
.detail-body {
  padding: 18px 24px;
  overflow: hidden;
  flex: 1;
  position: relative;
}
.mail-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  align-items: center;
}
.mail-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #a78bfa;
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mail-from { font-size: 12px; }
.mail-to { color: #6b7280; font-size: 10px; }
.mail-date { color: #6b7280; font-size: 10px; }
.mail-body { font-size: 11px; line-height: 1.5; color: #374151; }
.mail-body p { margin-bottom: 8px; }

.mail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.mail-table th, .mail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.mail-table th {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 9px;
  color: #6b7280;
  letter-spacing: 0.02em;
}
.mail-table td.code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; color: #111827; font-size: 10px; }
.mail-table td.desc-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}
.mail-table td.num {
  font-family: ui-monospace, Menlo, monospace;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.mail-table tr.matched {
  background: #ecfdf5;
  transition: background 0.4s ease;
}

.project-info {
  margin-top: 12px;
}
.pi-title { font-weight: 600; font-size: 11px; color: #111827; margin-bottom: 6px; }
.pi-row { font-size: 10px; color: #374151; margin-bottom: 3px; }

/* Pipeline */
.pipeline {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(calc(100% + 20px));
  width: calc(100% - 40px);
  max-width: 620px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 2px solid #8b5cf6;
  border-radius: 6px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.25);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 5;
}
.pipeline.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.pipe-step-badge {
  background: #f5f3ff;
  padding: 6px 10px;
  border-radius: 4px;
  text-align: center;
}
.pipe-step-num { font-weight: 700; font-size: 12px; color: #6d28d9; line-height: 1; }
.pipe-step-label { font-size: 8px; color: #8b5cf6; letter-spacing: 0.15em; font-weight: 600; margin-top: 2px; }

.pipe-lanes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 60px;
  justify-content: center;
}
.pipe-lane {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  font-size: 10px;
  color: #9ca3af;
  transition: all 0.3s ease;
  border-radius: 3px;
  opacity: 0.4;
}
.pipe-lane.done {
  color: #059669;
  opacity: 0.65;
}
.pipe-lane.current {
  color: #6d28d9;
  font-weight: 600;
  opacity: 1;
  background: #f5f3ff;
}
.pipe-lane-state .check { color: #059669; }
.pipe-lane-state .spin {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid #c4b5fd;
  border-top-color: #6d28d9;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

.pipe-timer {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* Live badge */
.app-live-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  color: #0a1520;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.app-live-indicator .dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulse-sm 2s infinite;
}
@keyframes pulse-sm {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Responsive */
@media (max-width: 860px) {
  .app-mock { font-size: 9px; border-radius: 8px; }
  .app-body { grid-template-columns: 60px 140px 1fr; }
  .app-sidebar .sb-lbl { display: none; }
  .app-sidebar .sb-count { display: none; }
  .sidebar-switcher, .ask-btn { display: none; }
  .sb-item { grid-template-columns: 1fr; justify-items: center; }
  .mail-table td.desc-cell { display: none; }
  .mail-table th:nth-child(2) { display: none; }
  .pipeline { max-width: none; padding: 8px 10px; }
}
