:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --bg: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

/* Header */
header {
  background: var(--card-bg);
  color: var(--primary);
  padding: 15px 5%;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  padding: 20px 5%;
  max-width: 1000px;
  margin: auto;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  margin-bottom: 25px;
}

.search {
  width: 100%;
  padding: 16px;
  padding-left: 20px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  box-sizing: border-box;
  transition: all 0.2s;
}

.search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-main);
}

.badge {
  background: #e0e7ff;
  color: var(--primary);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 10px;
}

.field {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-muted);
  line-height: 1.5;
}

.field strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Collapsible Details */
details {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
  cursor: pointer;
}

summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  user-select: none;
}

.details-content {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: pre-wrap;
}

/* Button Grid */
.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 15px;
}

.copy-full-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-full-btn:hover {
  background: var(--primary-hover);
}

.mini-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-pill {
  background: white;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f5f3ff;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 50px;
}

.page-btn {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast Notification */
#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 16px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
}

#toast.show {
  visibility: visible;
  opacity: 1;
}

/* Mobile Responsiveness */
@media (min-width: 600px) {
  .actions {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}