/* RESET + BASE */
* { box-sizing: border-box; margin:0; padding:0; font-family: "Poppins", sans-serif; }
:root{
  --bg:#f7f8fb;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#4f46e5;
  --danger:#dc2626;
  --success:#16a34a;
  --shadow: 0 6px 18px rgba(15,23,42,0.08);
}

/* BODY + HEADER */
body { background: var(--bg); color: #111827; min-height:100vh; }
/* MAIN LAYOUT */
.container { max-width:1200px; margin:90px auto 40px; padding:0 18px; }

/* Ticket Top */
.card { background:var(--card); border-radius:12px; padding:18px; box-shadow:var(--shadow); }
.ticket-top { margin-bottom:18px; }
.ticket-meta { display:flex; gap:20px; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; }
.ticket-meta .id { max-width:68%; }
.t-id{ color:var(--muted); font-weight:700; display:inline-block; margin-bottom:6px; }
.title { font-size:20px; margin-bottom:6px; color:#0f1724; }
.subtitle { color:var(--muted); font-size:13px; }

/* Controls */
.controls { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.status-pill{ padding:8px 12px; border-radius:999px; font-weight:700; color:white; }
.status-open{ background:#f59e0b; } /* amber for open */
.status-inprogress{ background:#06b6d4; } /* cyan */
.status-resolved{ background:var(--success); }
.status-closed{ background:#6b7280; }

.priority { color:var(--muted); }
.assignee { color:var(--muted); }

/* Buttons */
.button-group { display:flex; gap:8px; }
.button-group .btn { padding:8px 12px; font-size:14px; border-radius:8px; }

/* LAYOUT: two-column */
.layout { display:grid; grid-template-columns: 1fr 320px; gap:18px; }

/* MAIN COLUMN */
.main-col .card { margin-bottom:16px; }
.description h3, .comments h3 { margin-bottom:10px; }
.description p { line-height:1.5; color:#283046; }

.attachments { margin-top:12px; }
.att-grid { display:flex; gap:10px; flex-wrap:wrap; }
.att { background:#f3f4f6; padding:8px; border-radius:8px; width:120px; position:relative; display:flex; align-items:center; gap:8px; }
.att-thumb{ width:44px; height:44px; border-radius:6px; background:#e6e9ff; display:flex; align-items:center; justify-content:center; font-weight:700; color:#31345a; }
.att-meta { font-size:13px; color:#374151; flex:1; }
.att-download { position:absolute; right:8px; bottom:8px; background:transparent; border:0; cursor:pointer; color:#374151; }

/* COMMENTS / TIMELINE */
.timeline { display:flex; flex-direction:column; gap:12px; margin-bottom:12px; }
.timeline-item { display:flex; gap:12px; }
.timeline-item .time { min-width:130px; font-size:12px; color:var(--muted); }
.timeline-item .entry { background:#fbfdff; padding:10px; border-radius:8px; box-shadow: 0 4px 10px rgba(13,18,35,0.03); }
.entry-head { font-weight:700; margin-bottom:6px; }
.entry-body { color:#334155; }

/* Comment form */
.comment-form textarea { width:100%; min-height:80px; padding:10px; border-radius:8px; border:1px solid #e6e9ef; resize:vertical; margin-bottom:8px; }
.comment-actions { display:flex; gap:8px; align-items:center; justify-content:space-between; }
.comment-actions input[type="file"] { font-size:13px; }
.comment-actions .btn { padding:8px 12px; }

/* SIDE COLUMN */
.side-col .details h4, .quick-actions h4 { margin-bottom:10px; }
.details dl .row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #f1f5f9; }
.details dt { color:var(--muted); font-size:13px; }
.details dd { font-weight:600; color:#0f1724; }
.tag { display:inline-block; background:#eef2ff; color:#4338ca; padding:6px 8px; border-radius:6px; font-size:12px; margin-right:6px; }

.quick-actions .btn.full { width:100%; margin-bottom:8px; text-align:left; }



/* RESPONSIVE */
/* 
/* ================================
   RESPONSIVE MEDIA QUERIES
================================ */

/* ===== Large Tablets (max-width: 1024px) ===== */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr 280px;
  }
  .ticket-meta .id {
    max-width: 100%;
  }
  .title {
    font-size: 18px;
  }
}

/* ===== Tablets (max-width: 900px) ===== */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side-col {
    order: -1;
  }
  .controls {
    justify-content: flex-start;
    gap: 10px;
  }
  .button-group {
    flex-wrap: wrap;
  }
}

/* ===== Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {

  .container {
    margin: 70px auto 30px;
    padding: 0 12px;
  }

  .ticket-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .title {
    font-size: 17px;
  }

  .subtitle {
    font-size: 12px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    flex-direction: column;
  }

  .timeline-item .time {
    min-width: 100%;
    font-size: 11px;
  }

  .att {
    width: 100%;
  }

  .comment-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-actions .btn {
    width: 100%;
    text-align: center;
  }

  .quick-actions .btn.full {
    width: 100%;
    text-align: center;
  }
}

/* ===== Small Mobile (max-width: 520px) ===== */
@media (max-width: 520px) {

  .title {
    font-size: 16px;
  }

  .t-id {
    font-size: 12px;
  }

  .ticket-meta .id {
    max-width: 100%;
  }

  .controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-group {
    flex-direction: column;
    width: 100%;
  }

  .button-group .btn {
    width: 100%;
  }

  .timeline-item .entry {
    padding: 8px;
  }
}

/* ===== Extra Small Mobile (max-width: 400px) ===== */
@media (max-width: 400px) {
  .title {
    font-size: 15px;
  }

  .comment-form textarea {
    min-height: 70px;
  }

  .tag {
    font-size: 11px;
    padding: 4px 6px;
  }

  .att-thumb {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }
}
