* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 18px;
}

.compact-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-header h1 {
  margin: 0;
  font-size: 24px;
}

.compact-header p {
  margin: 0;
  opacity: 0.7;
  font-size: 13px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input,
select,
button {
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #fff;
  padding: 10px;
}

button {
  background: #2563eb;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: #1d4ed8;
}

.actions {
  margin-top: 10px;
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compact-actions small {
  opacity: 0.7;
  font-size: 12px;
}

.stats {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.stat {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 100px;
  font-size: 12px;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
}

.tickets-table th {
  background: #172033;
  color: #93c5fd;
  text-align: left;
  padding: 12px 10px;
  cursor: pointer;
  position: sticky;
  top: 0;
  font-size: 13px;
}

.tickets-table th:hover {
  background: #1e293b;
}

.tickets-table td {
  padding: 10px;
  border-top: 1px solid #1f2937;
  font-size: 13px;
  vertical-align: middle;
}

.tickets-table tr:hover {
  background: rgba(255,255,255,0.03);
}

.ticket-key {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 700;
}

.project-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
}

.summary-cell {
  min-width: 420px;
}

.summary-link {
  color: #e2e8f0;
  text-decoration: none;
}

.summary-link:hover {
  color: #93c5fd;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1e293b;
  white-space: nowrap;
}

.status.green {
  background: rgba(34,197,94,0.2);
  color: #86efac;
}

.status.blue {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
}

.status.orange {
  background: rgba(249,115,22,0.2);
  color: #fdba74;
}

.status.gray {
  background: rgba(148,163,184,0.2);
  color: #cbd5e1;
}

.date-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.date-pill.fresh {
  background: rgba(34,197,94,0.2);
  color: #86efac;
}

.date-pill.recent {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
}

.date-pill.aging {
  background: rgba(249,115,22,0.2);
  color: #fdba74;
}

.date-pill.old {
  background: rgba(148,163,184,0.2);
  color: #cbd5e1;
}

.empty {
  text-align: center;
  padding: 30px;
  opacity: 0.8;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.hidden {
  display: none !important;
}

.modal-content {
  width: min(900px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header button {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.inline-status-actions {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clickable-status {
  cursor: pointer;
}

.ticket-link-inline {
  color: #93c5fd;
  text-decoration: none;
}

.comment-box {
  margin-top: 16px;
}

.section-block {
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid rgba(148,163,184,0.12);
}

.section-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #cbd5e1;
}

.section-separator {
  margin: 22px 0;
  border-top: 1px solid rgba(148,163,184,0.12);
}

.comment-box textarea {
  width: 100%;
  min-height: 120px;
  margin-bottom: 10px;
  background: #0f172a;
  color: white;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
}

.description-box {
  margin-top: 10px;
  line-height: 1.7;
}

.description-box p,
.comment-body p {
  margin-top: 0;
  margin-bottom: 12px;
}

.mention {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
  font-weight: 600;
}

.adf-panel {
  border-left: 4px solid #3b82f6;
  background: rgba(59,130,246,0.08);
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.adf-media-single {
  margin: 12px 0;
}

.adf-media-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.2);
}

.comment-body blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 3px solid #475569;
  opacity: 0.9;
}

.comment-body code {
  background: rgba(148,163,184,0.15);
  padding: 2px 6px;
  border-radius: 6px;
}

.comment-body pre {
  overflow: auto;
  background: #020617;
  padding: 12px;
  border-radius: 8px;
}

.relations-box,
.comments-section {
  margin-top: 18px;
}

.comment-item {
  background: #0f172a;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}

.comment-item.internal-comment {
  background: rgba(120,53,15,0.22);
  border: 1px solid rgba(217,119,6,0.25);
}

.comment-author {
  font-weight: 700;
  margin-bottom: 6px;
  color: #93c5fd;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-body {
  line-height: 1.5;
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.attachment-link {
  color: #93c5fd;
  text-decoration: none;
}

.image-card {
  width: 180px;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  border: 1px solid #334155;
  cursor: pointer;
}

.image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.image-card div {
  padding: 8px;
  font-size: 12px;
}

.comment-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-visibility-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.visibility-toggle {
  border: 1px solid #334155;
  background: #0f172a;
  color: white;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.visibility-toggle.active {
  background: #2563eb;
}

.visibility-toggle.internal.active {
  background: rgba(180,83,9,0.85);
}

.comment-box.internal-mode textarea {
  border-color: rgba(217,119,6,0.55);
  background: rgba(120,53,15,0.18);
}

.comment-visibility {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.comment-visibility.public {
  background: rgba(34,197,94,0.2);
  color: #86efac;
}

.comment-visibility.internal {
  background: rgba(249,115,22,0.2);
  color: #fdba74;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.toast.success {
  background: #2563eb;
}

.toast.error {
  background: #dc2626;
}

.image-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.94);
}

.image-overlay img {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 12px;
}

@media (max-width: 1200px) {
  .tickets-table {
    display: block;
    overflow-x: auto;
  }
}
