body { font-family: Arial, sans-serif; margin: 0; background: #f5f6f8; color: #222; }
.site-header { background: #123f73; color: #fff; padding: 12px 0; }
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 10px; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 74px; height: 52px; flex: 0 0 auto; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.site-header h1 { margin: 0; font-size: 20px; line-height: 1.2; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header nav { display: flex; align-items: center; gap: 8px; }
.admin-menu-toggle { display: none; border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #fff; margin-left: auto; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; width: 100%; }
.site-header nav a { color: #fff; text-decoration: none; font-size: 14px; padding: 4px 6px; border-radius: 4px; }
.site-header nav a:hover { background: rgba(255,255,255,0.12); }
.site-header nav .nav-logout { background: rgba(255,255,255,0.15); }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); max-width: 100%; box-sizing: border-box; }
label { display: block; margin-bottom: 12px; }
input, select, textarea { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; }
form { padding-right: 2px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form select, .inline-form input { flex: 1 1 240px; margin-top: 0; }
.inline-form button { margin-top: 0; min-width: 88px; }
@media (max-width: 640px) {
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form button { width: 100%; }
  .inline-form select, .inline-form input { flex: 0 0 auto; }
}
button { padding: 10px 16px; border: none; background: #2563eb; color: white; border-radius: 6px; cursor: pointer; }
button:hover { background: #1d4ed8; }
button.admin-menu-toggle { width: auto; padding: 0; background: transparent; }
.buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.btn { background: #e5e7eb; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: #111; text-align: center; display: inline-flex; justify-content: center; align-items: center; min-height: 40px; box-sizing: border-box; }
.info-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin: 10px 0 16px; color: #374151; }
.info-box ul { margin: 8px 0 0 16px; padding: 0; }
.info-box li { margin: 4px 0; }
.backup-buttons { margin-top: 12px; }
.backup-buttons .btn { width: 100%; justify-content: center; }
.backup-form { display: grid; gap: 10px; margin-top: 12px; }
.backup-form input[type="file"] { width: 100%; }
.backup-form .danger { width: 100%; }
.link { display: inline-block; margin-top: 12px; }
.flash { background: #fff3cd; border: 1px solid #ffeeba; padding: 10px; border-radius: 6px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.team-block { margin: 12px 0 18px; padding: 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; }
.team-list { list-style: none; padding-left: 0; margin: 0; }
.team-list li { padding: 8px 0; border-bottom: 1px dashed #e5e7eb; }
.team-list li:last-child { border-bottom: none; }
.team-members { color: #374151; margin-top: 4px; font-size: 14px; }
.btn-move-member { width: auto; min-width: 76px; padding: 5px 9px; margin-top: 6px; font-size: 12px; line-height: 1.2; }
.move-modal-form { display: grid; gap: 12px; margin-top: 12px; }
.move-modal-form label { margin: 0; }
.move-modal-form select { width: 100%; }
.team-leader { margin-top: 4px; font-weight: 600; color: #111827; }
.leader-form { margin-top: 6px; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.admin-sidebar { position: sticky; top: 16px; background: #fff; padding: 14px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.admin-sidebar h3 { margin-top: 0; font-size: 16px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.admin-sidebar a { text-decoration: none; color: #111827; font-size: 14px; padding: 6px 8px; border-radius: 6px; }
.admin-sidebar a:hover { background: #f3f4f6; }
.menu-group { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.admin-submenu { display: flex; flex-direction: column; gap: 6px; padding-left: 8px; margin: 0; border-left: 2px solid #e5e7eb; }
.admin-submenu a { font-size: 13px; color: #374151; }
.admin-content { max-width: 100%; }
.admin-overlay { display: none; }
.filter-form { margin: 8px 0 12px; gap: 8px; }
.filter-form select { min-width: 120px; }
.phase-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phase-form select { min-width: 220px; height: 36px !important; padding: 4px 8px !important; line-height: 1.2; }
.phase-form button { padding: 6px 10px; font-size: 13px; }
.btn-assign { padding: 8px 14px; font-size: 14px; width: auto; min-width: 140px; }
.team-assign-section { margin: 12px 0 18px; }
.assignment-locked { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px; margin: 8px 0 10px; color: #6b7280; }
.assignment-locked p { margin: 8px 0 0; }
.btn-disabled, .btn-disabled:hover { background: #9ca3af; color: #fff; cursor: not-allowed; }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { border-bottom: 1px solid #e5e7eb; padding: 8px; text-align: left; vertical-align: middle; }
.admin-table th { background: #f3f4f6; font-size: 13px; }
.summary-table td { vertical-align: top; }
.summary-table td:nth-child(3) { white-space: pre-wrap; }
.idea-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 12px; }
.idea-stats-block { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; }
.stat-row { display: grid; grid-template-columns: 60px 1fr 30px; gap: 8px; align-items: center; margin: 6px 0; }
.stat-bar { background: #f3f4f6; border-radius: 999px; height: 10px; overflow: hidden; }
.stat-fill { background: #2563eb; height: 100%; }
.stat-count { text-align: right; font-weight: 600; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.skill-title { grid-column: 1 / -1; font-weight: 600; color: #374151; }
.skill-grid label { margin: 0; }
.skill-help { grid-column: 1 / -1; color: #6b7280; font-size: 13px; display: grid; gap: 4px; margin: -6px 0 6px; }
.checkbox-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.checkbox-title { grid-column: 1 / -1; font-weight: 600; color: #374151; }
.checkbox-item { display: flex; align-items: center; gap: 6px; margin: 0; }
.checkbox-item input { width: auto; margin: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.radio-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.radio-item:hover { background: #fff4e6; }
.radio-item input { width: auto; margin: 0; }
.radio-choice { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2 { margin: 0; }
.page-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.page-title-row h2 { margin: 0; }
.small-btn { width: auto; min-width: unset; padding: 4px 8px; font-size: 12px; line-height: 1.2; text-decoration: none; }
.small-btn.active-sort { background: #bfdbfe; color: #111827; }
.sortable-header { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.sort-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; color: #111827; text-decoration: none; font-size: 12px; line-height: 1; }
.sort-icon:hover, .sort-icon.active-sort { background: #bfdbfe; color: #111827; }
.admin-table td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table input, .admin-table select { min-width: 140px; }
.board .actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.board .actions button { padding: 4px 8px; font-size: 12px; line-height: 1.2; width: auto; min-width: unset; }
.admin-table td.compact-actions button { padding: 4px 8px; font-size: 12px; line-height: 1.2; width: auto; min-width: unset; }
.admin-table td.compact-actions .inline-form button { min-width: unset; }
.admin-table td.compact-actions form { margin: 0; }
.participants-table th, .participants-table td { text-align: center; font-size: 13px; }
.participants-table .skill-cell { justify-content: center; }
.participants-table td.actions { justify-content: center; }
.board .actions .viewed-button, .board .actions .viewed-button:hover { background: #9ca3af; color: #fff; }
.board .actions .danger { background: #dc2626; }
.board .actions .danger:hover { background: #b91c1c; }
.board .actions form { margin: 0; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

.idea-section { margin-top: 16px; }
.board { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff; }
.board-row { display: grid; grid-template-columns: 60px 120px 110px 1fr 170px; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; align-items: center; transition: background 0.15s ease; }
.board-row:hover { background: #fff4e6; }
.board-header:hover { background: #f9fafb; }
.idea-list-row { grid-template-columns: 60px 120px 110px 1fr 90px; }
.idea-admin-row { grid-template-columns: 60px 120px 110px 1fr 110px 170px; }
.idea-admin-board { border: none; border-radius: 0; }
.idea-admin-board .board-row { border-bottom: 1px solid #e5e7eb; }
.idea-admin-row > div { text-align: center; font-size: 13px; }
.idea-admin-row .title-cell { text-align: left; font-size: 13px; }
.idea-admin-row .actions { justify-content: center; }
.title-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { font-size: 12px; padding: 2px 6px; background: #f3f4f6; border-radius: 999px; }
.board-header { background: #f9fafb; font-weight: 600; }
.board-row:last-child { border-bottom: none; }
.idea-title { color: #1d4ed8; text-decoration: none; font-weight: 600; }
.idea-title:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; display: none; background: rgba(0,0,0,0.45); align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.open { display: flex; }
.modal-content { background: #fff; border-radius: 12px; padding: 18px; max-width: 720px; width: 100%; max-height: 80vh; overflow: auto; position: relative; }
.modal-close { position: absolute; right: 12px; top: 8px; background: none; border: none; font-size: 22px; cursor: pointer; }
.modal-timer { position: absolute; right: 56px; top: 10px; width: 108px; height: 108px; border-radius: 16px; border: 3px dashed #ef4444; color: #ef4444; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 700; background: #fff; }
.modal-meta { color: #6b7280; font-size: 14px; margin: 4px 0; }
.modal-body { white-space: pre-wrap; line-height: 1.5; margin-top: 12px; }
.idea-modal-content { display: flex; flex-direction: column; max-height: 80vh; overflow: hidden; }
.idea-modal-header { flex: 0 0 auto; padding-right: 180px; min-height: 112px; }
.idea-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 8px; }
.edit-form { display: grid; gap: 10px; }
.edit-form textarea { width: 100%; resize: vertical; }
.btn-secondary { background: #2563eb; }
.btn-secondary:hover { background: #1d4ed8; }
.idea-item { padding: 10px 0; border-bottom: 1px solid #e5e7eb; }
.idea-item:last-child { border-bottom: none; }
.idea-item-title { font-weight: 600; margin-bottom: 4px; }
.idea-item-meta { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.idea-item-desc { white-space: pre-wrap; line-height: 1.5; }

@media (max-width: 980px) {
  .board-row { grid-template-columns: 50px 1fr 90px 1fr 130px; }
}
@media (max-width: 640px) {
  .board-row { grid-template-columns: 40px 1fr; }
  .board-row > div:nth-child(3),
  .board-row > div:nth-child(4),
  .board-row > div:nth-child(5) { grid-column: span 2; }
}

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 76px; left: 0; width: 80%; max-width: 280px; height: calc(100vh - 76px); overflow-y: auto; transform: translateX(-120%); transition: transform 0.2s ease; z-index: 1001; }
  .admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 1000; }
  .admin-menu-toggle { display: inline-flex; color: #fff; padding: 4px 8px; }
  body.admin-menu-open .admin-sidebar { transform: translateX(0); }
  body.admin-menu-open .admin-overlay { display: block; }
}

@media (max-width: 640px) {
  .admin-table input, .admin-table select { min-width: 120px; }
  .site-header { padding: 10px 0; }
  .brand-logo { width: 58px; height: 42px; }
  .site-header h1 { font-size: 16px; max-width: none; }
  .site-header nav a { font-size: 13px; }
  main { padding: 12px; }
  .card { padding: 16px; }
  .buttons { grid-template-columns: 1fr; gap: 8px; }
  button:not(.admin-menu-toggle):not(.btn-move-member), .btn { width: 100%; text-align: center; }
  .btn-move-member { width: auto; }
  .admin-menu-toggle { width: auto; }
  .phase-form { flex-direction: column; align-items: stretch; }
  .phase-form select { min-width: 0; width: 100%; height: 34px !important; padding: 4px 8px !important; line-height: 1.2; }
  .phase-form button { width: 100%; }
}
