/* ============================================================
   Lincloud Workspace — 社内ナレッジ共通スタイル
   既存 index.html のデザインシステムを継承（緑#1D9E75系・カード型）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: #f0f2f5;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(29,158,117,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(45,120,180,0.04) 0%, transparent 60%);
  min-height: 100vh;
  color: #1a202c;
  line-height: 1.6;
}

/* --- Header --- */
.header {
  background: linear-gradient(135deg, #0b5e47 0%, #1D9E75 55%, #28b485 100%);
  color: white;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 24px rgba(11,94,71,0.25);
  position: relative;
  z-index: 10;
}
.header h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0;
}
.header sub {
  font-size: 11px;
  opacity: 0.65;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.header-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-link {
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  transition: all 0.2s;
}
.header-link:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
}

/* --- Brand link (clickable logo + title) --- */
.header-brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: white;
  transition: opacity 0.2s;
}
.header-brand-link:hover { opacity: 0.88; }
.header-logo {
  height: 36px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* --- Breadcrumb --- */
.crumbs {
  font-size: 12px;
  color: #718096;
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.crumbs a { color: #1D9E75; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span.sep { color: #cbd5e0; }

/* --- Page Title --- */
.page-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.page-sub {
  font-size: 13px;
  color: #718096;
  margin-bottom: 24px;
}

/* --- Cards --- */
.card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.03);
  border: 1px solid rgba(255,255,255,0.7);
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

/* --- Hub Grid (knowledge/index.html) --- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: white;
  text-decoration: none;
  color: inherit;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}
.hub-card:hover {
  border-color: #1D9E75;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(29,158,117,0.13);
}
.hub-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.hub-icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
}
.hub-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
}
.hub-desc {
  font-size: 12px;
  color: #718096;
  line-height: 1.5;
}
.hub-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
}

/* --- Toolbar --- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar input[type="text"],
.toolbar input[type="search"],
.toolbar select {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 13px;
  font-family: inherit;
  color: #1a202c;
  outline: none;
  transition: border-color 0.18s;
  min-width: 0;
}
.toolbar input[type="text"]:focus,
.toolbar input[type="search"]:focus,
.toolbar select:focus {
  border-color: #1D9E75;
}
.toolbar .search { flex: 1; min-width: 180px; }
.toolbar .filter { min-width: 130px; }
.toolbar-spacer { flex: 1; }

/* --- Buttons --- */
.btn {
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #1a202c;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: #1D9E75; color: #0F6E56; }
.btn-primary {
  background: linear-gradient(135deg, #1D9E75, #28b485);
  color: white;
  border-color: #1D9E75;
  box-shadow: 0 2px 8px rgba(29,158,117,0.18);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0F6E56, #1D9E75);
  color: white;
  box-shadow: 0 4px 14px rgba(29,158,117,0.28);
}
.btn-danger { color: #c53030; border-color: #fed7d7; }
.btn-danger:hover { background: #fff5f5; border-color: #fc8181; color: #c53030; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f7fafc; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* --- Status / Tag --- */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  margin-right: 4px;
}
.tag-ok { background: #f0fff4; color: #276749; border-color: #c6f6d5; }
.tag-ng { background: #fff5f5; color: #c53030; border-color: #fed7d7; }
.tag-unknown { background: #f7fafc; color: #4a5568; border-color: #e2e8f0; }
.tag-info { background: #ebf8ff; color: #2c5282; border-color: #bee3f8; }
.tag-warn { background: #fffaf0; color: #975a16; border-color: #feebc8; }

/* --- List Items (Office / Company / QA) --- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-empty {
  text-align: center;
  color: #a0aec0;
  font-size: 13px;
  padding: 40px 0;
}
.item {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.item:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.item-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.item-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
  flex: 1;
  line-height: 1.4;
}
.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.item-meta {
  font-size: 12px;
  color: #718096;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.item-meta span { display: inline-flex; gap: 4px; align-items: center; }
.item-meta strong { color: #4a5568; font-weight: 600; }
.item-body {
  font-size: 13px;
  color: #2d3748;
  line-height: 1.65;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.item-body details { margin-top: 4px; }
.item-body summary { cursor: pointer; color: #1D9E75; font-size: 12px; font-weight: 600; }

/* --- QA item specific --- */
.qa-question {
  font-size: 14px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.qa-question::before { content: 'Q.'; color: #1D9E75; flex-shrink: 0; }
.qa-answer {
  font-size: 13px;
  color: #2d3748;
  line-height: 1.7;
  white-space: pre-wrap;
  display: flex;
  gap: 8px;
}
.qa-answer::before { content: 'A.'; color: #94a3b8; flex-shrink: 0; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,94,71,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: white;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 12px 60px rgba(0,0,0,0.25);
  animation: modal-pop 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #a0aec0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: #f7fafc; color: #1a202c; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid #f0f2f5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Form --- */
.form-row { margin-bottom: 14px; }
.form-row.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.form-label .req { color: #c53030; margin-left: 3px; }
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 13px;
  font-family: inherit;
  color: #1a202c;
  outline: none;
  transition: border-color 0.18s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: #1D9E75;
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-help {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* --- Notification toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F6E56;
  color: white;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(11,94,71,0.3);
  z-index: 200;
  animation: toast-pop 0.25s ease-out;
}
.toast.is-error { background: #c53030; box-shadow: 0 8px 24px rgba(197,48,48,0.3); }
@keyframes toast-pop {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Stats --- */
.stats {
  display: flex;
  gap: 24px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(29,158,117,0.05), rgba(40,180,133,0.04));
  border: 1px solid rgba(29,158,117,0.12);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #4a5568;
}
.stats strong { color: #0F6E56; font-weight: 700; }

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
  font-size: 13px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .form-row.cols2,
  .form-row.cols3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .search,
  .toolbar .filter { width: 100%; }
  .header { padding: 0 16px; }
  .header sub { display: none; }
}
