/* assets/styles.css */

:root {
  --bg: #f3f5fb;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.06);
  --text-main: #1f2933;
  --text-sub: #6b7280;
  --accent: #2563eb;
  --accent-soft: #e0edff;
  --accent-strong: #1d4ed8;
  --danger: #ef4444;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.07);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #e5ecff 0, #f7f7fb 40%, #f9fafb 100%);
  color: var(--text-main);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  max-width: 1040px;
  width: 100%;
  margin: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), #ffffff);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--card-border);
}

.card-inner { padding: 24px 24px 28px; }
@media (min-width: 768px) {
  .card-inner { padding: 28px 32px 32px; }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.app-header-left { display:flex; align-items:center; gap:16px; }
.app-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: conic-gradient(from 180deg, #2563eb, #4f46e5, #22c55e, #0ea5e9, #2563eb);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  position: relative;
}
.app-logo::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, #ffffff, #dbeafe);
}
.app-title { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.03em; }
.app-subtitle { font-size: 0.85rem; color: var(--text-sub); }
.app-header-right { display:flex; gap:12px; flex-wrap:wrap; }

.badge-row { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 0.78rem;
}
.badge-dot { width:7px; height:7px; border-radius:999px; background:#22c55e; }

.upload-layout { display:grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap:22px; }
@media (max-width: 768px) { .upload-layout { grid-template-columns: 1fr; } }

.dropzone {
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(148, 163, 184, 0.9);
  background: #f8fafc;
  padding: 32px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.dropzone:hover {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 10px 30px rgba(148, 163, 184, 0.35);
  transform: translateY(-1px);
}
.dropzone.is-dragover {
  border-style: solid;
  border-color: var(--accent-strong);
  background: #e0edff;
}
.dropzone-icon {
  width: 48px; height: 48px; border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  background:#e0edff; color: var(--accent-strong);
  font-size: 1.3rem;
  box-shadow: var(--shadow-subtle);
}
.dropzone-title { font-weight: 600; font-size: 0.98rem; }
.dropzone-subtitle { font-size: 0.8rem; color: var(--text-sub); }
.dropzone-filename { margin-top: 4px; font-size: 0.8rem; color: #4b5563; }
.hidden-input { display:none; }

.upload-form {
  padding: 16px 16px 14px;
  border-radius: var(--radius-lg);
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.form-group { margin-bottom: 12px; }
.label { font-size: 0.8rem; font-weight: 600; color: #4b5563; margin-bottom: 4px; }
.text-input, .password-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
}
.text-input:focus, .password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}
.static-field {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  font-size: 0.86rem;
  color: var(--text-sub);
  background: #f8fafc;
}

.btn {
  display:inline-flex; align-items:center; justify-content:center;
  border-radius: 999px;
  border:none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor:pointer;
  padding: 8px 16px;
  transition: all 0.15s ease-out;
  font-family: inherit;
  white-space: nowrap;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); }
.btn-outline { background:#fff; color:#1e3a8a; border:1px solid rgba(37,99,235,.4); }
.btn-outline:hover { background:#e0edff; }
.btn-danger { background:#ef4444; color:#fff; box-shadow: 0 10px 20px rgba(239, 68, 68, 0.35); }
.btn-danger:hover { background:#dc2626; }
.btn-small { font-size: .78rem; padding: 6px 10px; }
.btn-sm { font-size: .78rem; padding: 6px 10px; }

.status-bar {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin-top:10px; font-size:.78rem;
}
.status-pill {
  padding: 4px 10px; border-radius: 999px;
  background:#e5e7eb; color:#374151; font-weight:600;
}
.status-pill.idle { background:#e5e7eb; color:#374151; }
.status-pill.loading { background:#facc15; color:#78350f; }
.status-pill.ok { background:#bbf7d0; color:#166534; }
.status-pill.error { background:#fee2e2; color:#b91c1c; }

.result-section { margin-top: 20px; padding-top: 16px; border-top: 1px dashed rgba(148,163,184,.7); }
.result-heading { font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
.result-grid { display:grid; gap:12px; }
@media (min-width: 768px) { .result-grid { grid-template-columns: 2.1fr 1.4fr 1.2fr; } }
.result-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background:#f9fafb;
  border:1px solid rgba(148,163,184,.3);
}
.result-label { font-size:.75rem; color: var(--text-sub); margin-bottom:4px; }
.result-value { font-size:.86rem; word-break: break-all; }
.mono { font-family: var(--font-mono); }

.progress-wrapper { margin-top: 6px; }
.progress-label { font-size: .78rem; color:#4b5563; margin-bottom: 4px; }
.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background:#e5e7eb;
  overflow:hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.15s ease-out;
}

/* 管理テーブル */
.table-wrapper {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  overflow: hidden;
  background: #ffffff;
}
.table { width:100%; border-collapse: collapse; font-size: .82rem; }
.table thead { background:#eff6ff; }
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}
.table th { text-align:left; font-weight:600; color:#4b5563; }

.form-row { display:flex; flex-wrap:wrap; gap:12px; }
.form-row .form-group { flex: 1; }

/* download page */
.download-wrapper { margin-top: 6px; }
.download-meta { font-size: .9rem; color:#111827; }
.divider { margin: 14px 0; border-top: 1px dashed rgba(148,163,184,.7); }
