*,
*::before,
*::after {
  box-sizing: border-box;
}

body.bb-app {
  margin: 0;
  min-height: 100vh;
  background: #0a0f19;
  color: #dbe4ef;
  font-family: Inter, system-ui, sans-serif;
}

.bb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.bb-header h1 {
  margin: 0;
  font-size: 22px;
}

.bb-sub {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.78;
}

.bb-actions {
  display: flex;
  gap: 8px;
}

.bb-main {
  padding: 16px 24px 32px;
}

.bb-meta {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: 0.85;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.bb-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  min-height: 400px;
}

@media (max-width: 1200px) {
  .bb-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bb-board {
    grid-template-columns: 1fr;
  }
}

.bb-column {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
  min-width: 0;
}

.bb-column-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bb-column-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
}

.bb-column-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  font-size: 12px;
  font-weight: 700;
}

.bb-column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
}

.bb-card {
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.7);
  padding: 12px;
  cursor: pointer;
}

.bb-card:hover {
  border-color: rgba(96, 165, 250, 0.55);
}

.bb-card-code {
  font-size: 12px;
  font-weight: 800;
  color: #60a5fa;
  margin-bottom: 6px;
}

.bb-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.bb-card-summary {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bb-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bb-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.bb-badge-priority-medium { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; }
.bb-badge-priority-high { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.bb-badge-priority-critical { background: rgba(239, 68, 68, 0.2); color: #fecaca; }
.bb-badge-severity-major { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.bb-badge-severity-blocker { background: rgba(239, 68, 68, 0.2); color: #fecaca; }

.bb-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.bb-input,
.bb-select,
.bb-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.8);
  color: #f8fafc;
  padding: 8px 10px;
  font-size: 14px;
}

.bb-textarea {
  min-height: 88px;
  resize: vertical;
}

.bb-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.bb-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bb-field-full {
  grid-column: 1 / -1;
}

.bb-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bb-modal.is-open {
  display: flex;
}

.bb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

.bb-modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 32px);
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bb-modal-card-wide {
  width: min(1240px, 100%);
}

.bb-modal-head,
.bb-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bb-modal-actions {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.bb-modal-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
}

.bb-task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
}

@media (max-width: 900px) {
  .bb-task-layout {
    grid-template-columns: 1fr;
  }
}

.bb-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.45);
}

.bb-panel-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.bb-detail-label {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.bb-detail-value {
  margin-bottom: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.bb-update-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.bb-update-head {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.bb-attachment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.bb-attachment-preview {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.bb-attachment-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}

.bb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.88);
}

.bb-lightbox.hidden {
  display: none;
}

.bb-lightbox-img {
  max-width: min(960px, 92vw);
  max-height: 80vh;
  border-radius: 8px;
}

.bb-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  padding: 12px 16px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.bb-toast.is-visible {
  opacity: 1;
}
