/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f5f5;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top Navigation ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: #1a1a1a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.logo {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  text-decoration: none;
}
.breadcrumb-sep { color: #666; margin: 0 4px; }
.breadcrumb-current { color: #ccc; font-size: 13px; }
.breadcrumb-link { color: #999; font-size: 13px; }
.breadcrumb-link:hover { color: #fff; }

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Page Header ── */
.page-header {
  margin-bottom: 20px;
}
.page-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
details.card summary {
  cursor: pointer;
  user-select: none;
}
details.card summary h3 {
  display: inline;
  margin-bottom: 0;
}

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.flex-0 { flex: 0 0 auto; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.mt-1 { margin-top: 12px; }
.upload-form { margin-bottom: 16px; }
.inline-form { margin-bottom: 0; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-danger {
  background: #fff;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fef2f2; }
.btn-ghost {
  background: transparent;
  color: #999;
  border-color: transparent;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ── Alert ── */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}

/* ── Table ── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.table th {
  font-weight: 600;
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e0e0e0;
}
.table tbody tr:hover { background: #fafafa; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #f3f4f6; color: #9ca3af; }

/* ── URL Cell ── */
.url-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}
.url-input {
  flex: 1;
  padding: 4px 8px;
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #f9f9f9;
  color: #333;
  min-width: 200px;
}

/* ── Misc ── */
.text-muted { color: #888; }
.text-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-inactive { opacity: 0.5; }
.action-cell { white-space: nowrap; }
.action-cell form { margin-right: 4px; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}
.empty-inline {
  color: #888;
  font-size: 13px;
  margin-top: 12px;
}

/* ── Project Grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.project-card {
  display: block;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.project-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
  text-decoration: none;
}
.project-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.project-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}
.project-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #888;
}
.project-date {
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
}

/* ── Login Page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f5f5f5;
}
.login-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-card .subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}
.login-card .form-group {
  text-align: left;
  margin-bottom: 16px;
}

/* ── Share Pages ── */
.share-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}
.share-header {
  text-align: center;
  margin-bottom: 32px;
}
.share-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.share-desc {
  font-size: 14px;
  color: #666;
}
.share-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  color: #aaa;
}

/* ── Mockup Grid (share page) ── */
.mockup-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mockup-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.mockup-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
  text-decoration: none;
}
.mockup-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4ff;
  border-radius: 8px;
  color: #2563eb;
}
.mockup-info {
  flex: 1;
}
.mockup-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.mockup-info p {
  font-size: 13px;
  color: #888;
}
.mockup-open {
  font-size: 13px;
  color: #2563eb;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .form-row { flex-direction: column; }
  .container { padding: 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .url-cell { flex-direction: column; }
  .url-input { min-width: 0; width: 100%; }
}
