:root {
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #020617;
  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
  --accent-soft: #eff6ff;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #1e40af 0%, #0f172a 40%, #020617 100%);
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #60a5fa, #fff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-tagline {
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
}

.header-right {
  display: flex;
  align-items: center;
}

.badge {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

main {
  max-width: 1000px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.25rem 2rem;
  flex: 1;
}

.card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.pill {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.pill-accent {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.pill-soft {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: block;
  color: #334155;
}

.required { color: var(--danger); }

input[type="text"], select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
}

input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea { min-height: 80px; }

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

button {
  cursor: pointer;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-secondary:hover { background: #e2e8f0; color: #1e293b; }

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-danger:hover { background: #fecaca; }

.small-text {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 1rem;
  text-align: right;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1 1 300px;
  position: relative;
}

.search-input-wrapper input { padding-left: 2.5rem; }

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

.table-wrapper {
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

thead { background: #f8fafc; }

th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr { transition: background 0.15s; cursor: pointer; }
tbody tr:hover { background: #f0f9ff; }

.status-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.status-planned { background: #fef9c3; color: #854d0e; }
.status-progress { background: #e0f2fe; color: #0369a1; }
.status-completed { background: #dcfce7; color: #15803d; }
.status-archived { background: #f3e8ff; color: #7e22ce; }

.muted { color: #94a3b8; font-size: 0.85rem; }

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  background: #f8fafc;
  border-radius: 0.75rem;
  border: 2px dashed #e2e8f0;
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-inner strong {
  color: #e2e8f0;
  font-weight: 600;
}

.footer-links a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .header-left, .header-right { align-items: center; width: 100%; text-align: center; }
  .header-right { justify-content: center; margin-top: 0.5rem; }
  .card-header { flex-direction: column; }
  .form-actions { justify-content: stretch; }
  button { width: 100%; }
}