/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow:    #FFFF01;
  --black:     #111111;
  --white:     #ffffff;
  --gray-100:  #f5f5f5;
  --gray-200:  #eeeeee;
  --gray-300:  #dddddd;
  --gray-400:  #cccccc;
  --gray-500:  #aaaaaa;
  --gray-600:  #888888;
  --gray-700:  #555555;
  --green:     #22c55e;
  --red:       #dc2626;
  --red-light: #fef2f2;
  --red-border:#fecaca;

  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius:    6px;
  --radius-lg: 12px;
}

html { font-size: 16px; }

body {
  background: var(--gray-100);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: baseline; gap: 6px; }

.logo-fi {
  color: var(--yellow);
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo-sub {
  color: var(--gray-600);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.admin-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  font-family: var(--font-mono);
}
.admin-link:hover { color: var(--white); }


  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-600);
  background: #222;
  border-radius: 999px;
  padding: 3px 12px;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: var(--black);
  border-bottom: 1px solid #222;
  position: relative;
  overflow: hidden;
}

.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #2a2a2a 1px, transparent 1px);
  background-size: 22px 22px;
}

.hero-content {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 52px 24px 48px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 14px;
}

.hero-title em {
  font-style: normal;
  color: var(--yellow);
}

.hero-sub {
  color: var(--gray-600);
  font-size: 1rem;
  margin-bottom: 28px;
}

/* ── Section ───────────────────────────────────────────────────────────── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
}

/* ── Project Cards ─────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.project-card {
  background: var(--white);
  border: 0.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--yellow);
  opacity: 0;
  transition: opacity 0.15s;
}

.project-card:hover {
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

.project-card:hover::before { opacity: 1; }

.project-card-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--black);
  margin-bottom: 5px;
  word-break: break-all;
}

.project-card-url {
  font-size: 0.75rem;
  color: var(--gray-600);
  text-decoration: none;
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-meta {
  display: flex;
  gap: 7px;
  align-items: center;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}
.status-dot.active  { background: var(--green); }
.status-dot.failure { background: var(--red); }
.status-dot.building {
  background: var(--yellow);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.project-card-date {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.project-card-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}
.btn-primary:hover { background: #f0f000; }

.btn-dark {
  background: var(--black);
  color: var(--white);
}
.btn-dark:hover { background: #333; }

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 0.5px solid var(--gray-300);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--black); }

.btn-outline {
  background: transparent;
  color: var(--black);
  border: 0.5px solid var(--gray-400);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 0.5px solid var(--red);
}
.btn-danger:hover { background: var(--red-light); }

.btn-danger-solid {
  background: var(--red);
  color: var(--white);
  border: none;
  flex: 1;
}
.btn-danger-solid:hover { background: #b91c1c; }

.btn-lg { font-size: 1rem; padding: 12px 28px; }
.btn-sm { font-size: 0.8rem; padding: 5px 12px; }
.btn-full { width: 100%; margin-top: 14px; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--white);
  border: 0.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 660px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 0.5px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 2px;
}

.detail-url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-600);
  text-decoration: none;
}
.detail-url:hover { color: var(--black); text-decoration: underline; }

.modal-close {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 12px;
}
.modal-close:hover { color: var(--black); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 0.5px solid var(--gray-200);
}

/* ── Form Fields ───────────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field-input {
  width: 100%;
  background: var(--white);
  border: 0.5px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--black); }

.field-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--gray-500);
}
.field-hint code {
  font-family: var(--font-mono);
  color: var(--gray-700);
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Deploy Drop Zone ──────────────────────────────────────────────────── */
.deploy-zone {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}

.deploy-zone:hover,
.deploy-zone.dragover {
  border-color: var(--black);
  background: var(--gray-100);
}

.deploy-icon {
  display: block;
  font-size: 1.5rem;
  color: var(--black);
  margin-bottom: 10px;
}

.deploy-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.deploy-hint {
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-bottom: 14px;
}

/* ── File List ─────────────────────────────────────────────────────────── */
.file-list {
  background: var(--gray-100);
  border: 0.5px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 0.5px solid var(--gray-200);
  font-size: 0.78rem;
  color: var(--gray-600);
}

#file-list-items {
  list-style: none;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px 0;
}

#file-list-items li {
  display: flex;
  justify-content: space-between;
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-700);
}

#file-list-items li span:last-child { color: var(--gray-500); }

/* ── Deployments ───────────────────────────────────────────────────────── */
.deployments-section { margin-top: 28px; }

.deployments-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.deployment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--gray-200);
  font-size: 0.78rem;
}

.deployment-row:last-child { border-bottom: none; }

.deployment-id {
  font-family: var(--font-mono);
  color: var(--gray-400);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.deployment-date {
  color: var(--gray-600);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  flex: 1;
}

.deployment-live {
  background: var(--yellow);
  color: var(--black);
  border-radius: var(--radius);
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.deployment-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Danger Zone ───────────────────────────────────────────────────────── */
.danger-zone {
  margin-top: 28px;
  padding: 16px;
  border: 0.5px solid var(--red-border);
  border-radius: var(--radius);
  background: var(--red-light);
}

.danger-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.danger-desc {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Delete Confirmation ───────────────────────────────────────────────── */
.delete-confirm {
  margin-top: 12px;
  padding: 14px;
  background: var(--white);
  border: 0.5px solid var(--red-border);
  border-radius: var(--radius);
}

.delete-confirm-label {
  font-size: 0.8125rem;
  color: var(--black);
  margin-bottom: 4px;
}

.delete-confirm-label strong {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--red);
}

.delete-confirm-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.delete-confirm-input {
  margin-bottom: 10px;
}

.delete-confirm-input:focus {
  border-color: var(--red);
}

.delete-confirm-actions {
  display: flex;
  gap: 8px;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 0.875rem;
  z-index: 999;
  max-width: 340px;
}

.toast.success { background: var(--black); }
.toast.error   { background: var(--red); }
.toast.hidden  { display: none; }

/* ── Utility ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-500);
  font-size: 0.875rem;
  padding: 12px 0;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.875rem; }
}
