/* Admin-specific layout and component styles */

/* Layout */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 280px;
  background: var(--navy);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: var(--cream);
  margin-bottom: 4px;
}
.sidebar-sub { font-size: 12px; color: var(--sky); opacity: 0.7; }
.sidebar-new {
  margin: 12px 16px;
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--sage);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  width: calc(100% - 32px);
}
.sidebar-new:hover { opacity: 0.88; }
.sidebar-filter { padding: 8px 16px; }
.sidebar-filter select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--cream);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.sidebar-filter select option { background: var(--navy); }
.project-list { padding: 8px 0; flex: 1; }
.project-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.project-item:hover { background: rgba(255,255,255,0.05); }
.project-item.active {
  background: rgba(255,255,255,0.08);
  border-left-color: var(--sage);
}
.project-item__name { font-size: 13px; font-weight: 500; color: var(--cream); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-item__title { font-size: 12px; color: var(--sky); opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-item__meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.unread-badge {
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.deadline-badge { font-size: 10px; color: var(--orange); }

/* Main area */
.main { flex: 1; overflow-y: auto; }
.main-inner { max-width: 900px; margin: 0 auto; padding: 28px 32px 80px; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(26,39,68,0.06);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--navy);
}
.card-body { padding: 20px; }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* Steps */
.step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step-row:last-child { border-bottom: none; }
.step-order { display: flex; flex-direction: column; gap: 2px; }
.step-content { flex: 1; min-width: 0; }
.step-title { font-weight: 500; font-size: 14px; color: var(--navy); margin-bottom: 3px; }
.step-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.step-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Messages */
.msg-row {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.msg-row:last-child { border-bottom: none; }
.msg-author { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.msg-author.client { color: var(--sage); }
.msg-content { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Token list */
.token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.token-row:last-child { border-bottom: none; }
.token-url {
  flex: 1;
  font-family: monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 5px 8px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.token-meta { font-size: 11px; color: var(--muted); }
.token-revoked { opacity: 0.4; text-decoration: line-through; }

/* File list */
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.file-row:last-child { border-bottom: none; }
.file-name-col { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dashboard overview */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 16px 20px; box-shadow: 0 1px 6px rgba(26,39,68,0.06); }
.stat-card__num { font-size: 28px; font-weight: 600; color: var(--navy); }
.stat-card__label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.projects-table { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 6px rgba(26,39,68,0.06); overflow: hidden; }
.projects-table table { width: 100%; border-collapse: collapse; }
.projects-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.projects-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.projects-table tr:last-child td { border-bottom: none; }
.projects-table tr:hover td { background: var(--surface); cursor: pointer; }

@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; max-height: 50vh; }
  .main-inner { padding: 16px; }
}
