/* BuzaiManager 共通スタイル */

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: rgb(203 213 225);
  transition: all 0.15s;
}
.nav-link:hover {
  background: rgb(30 41 59);
  color: white;
}
.nav-link.active {
  background: rgb(37 99 235);
  color: white;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: rgb(37 99 235);
  color: white;
}
.btn-primary:hover {
  background: rgb(29 78 216);
}
.btn-secondary {
  background: white;
  color: rgb(51 65 85);
  border-color: rgb(203 213 225);
}
.btn-secondary:hover {
  background: rgb(248 250 252);
}
.btn-danger {
  background: rgb(220 38 38);
  color: white;
}
.btn-danger:hover {
  background: rgb(185 28 28);
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgb(59 130 246);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-green  { background: rgb(220 252 231); color: rgb(22 101 52); }
.badge-gray   { background: rgb(241 245 249); color: rgb(71 85 105); }
.badge-yellow { background: rgb(254 249 195); color: rgb(133 77 14); }
.badge-blue   { background: rgb(219 234 254); color: rgb(29 78 216); }
.badge-red    { background: rgb(254 226 226); color: rgb(153 27 27); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  text-align: left;
  background: rgb(248 250 252);
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: rgb(51 65 85);
  border-bottom: 1px solid rgb(226 232 240);
  white-space: nowrap;
}
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgb(241 245 249);
  vertical-align: middle;
}
.table tbody tr:hover {
  background: rgb(248 250 252);
}

.card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  padding: 1rem 1.25rem;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal {
  background: white;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.modal-lg { max-width: 900px; }

.handle {
  cursor: grab;
  color: rgb(148 163 184);
}
.handle:hover { color: rgb(71 85 105); }
.sortable-ghost { opacity: 0.4; background: rgb(219 234 254); }

/* レスポンシブテーブル */
@media (max-width: 768px) {
  .responsive-table {
    display: block;
  }
  .responsive-table thead { display: none; }
  .responsive-table tr {
    display: block;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: white;
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    border: none;
    padding: 0.35rem 0.5rem;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: rgb(71 85 105);
    margin-right: 0.5rem;
  }
}

.role-badge-admin  { background: rgb(254 226 226); color: rgb(153 27 27); }
.role-badge-pm     { background: rgb(219 234 254); color: rgb(29 78 216); }
.role-badge-editor { background: rgb(220 252 231); color: rgb(22 101 52); }
.role-badge-viewer { background: rgb(241 245 249); color: rgb(71 85 105); }

/* ========== 準備表 印刷用スタイル ========== */
.handle { cursor: grab; color: rgb(148 163 184); }
.handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.5; background: rgb(219 234 254); }

@media print {
  /* 印刷時非表示 */
  aside, header, .no-print, #mobile-menu-btn, .btn { display: none !important; }
  body { background: white !important; }
  main { padding: 0 !important; }
  #page-content { padding: 0 !important; overflow: visible !important; }
  .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
    margin-bottom: 0.5rem !important;
  }
  table { font-size: 11pt; }
  thead { background: #e2e8f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* 印刷ヘッダー */
  #print-header { display: block !important; }
  /* 入力欄を文字列風に */
  input.input, select.select, textarea {
    border: none !important; padding: 0 !important;
    background: transparent !important;
    -webkit-appearance: none; appearance: none;
  }
  @page { margin: 1.2cm; size: A4; }
}
#print-header { display: none; }
