/* User ticket detail (single column like screenshot) */
.gd-uticket{display:flex;flex-direction:column;gap:16px}
.gd-uticket .gd-ticket-header{display:flex;align-items:center;gap:12px;border-bottom:1px solid #1f2937;padding-bottom:10px;margin-bottom:12px}
.gd-uticket .gd-ticket-header .avatar{width:52px;height:52px;border-radius:8px;overflow:hidden;border:1px solid #1f2937}
.gd-uticket .gd-ticket-header .avatar img{width:100%;height:100%;object-fit:cover}
.gd-uticket .gd-ticket-header .meta{color:#9ca3af;font-size:12px;margin-top:4px}
.gd-uticket .gd-msg{background:transparent;border-color:#1f2937}
.gd-uticket .gd-reply{margin-top:8px}
html.theme-light .gd-uticket .gd-ticket-header{border-color:#e5e7eb}
:root{--bg:#0b1220;--card:#101827;--muted:#6b7280;--text:#e5e7eb;--primary:var(--primary, #3b82f6);--danger:#ef4444;--ok:#10b981}
html.theme-light{--bg:#f8fafc;--card:#ffffff;--muted:#64748b;--text:#0f172a;--primary:var(--primary, #2563eb);--danger:#dc2626;--ok:#059669}
*{box-sizing:border-box}html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;}
body{background:var(--bg);color:var(--text)}
.wrap{max-width:980px;margin:0 auto;padding:0 16px}
.gd-header{background:var(--bg);border-bottom:1px solid #1f2937;position:sticky;top:0;z-index:10}
.gd-header .wrap{display:flex;align-items:center;justify-content:space-between;height:56px}
.brand a{color:#fff;text-decoration:none;font-weight:700}
html.theme-light .brand a{color:#0f172a}
.nav a,.nav span{color:var(--text);margin-left:12px;text-decoration:none}
.nav .menu-btn{display:none}
.nav a:hover{color:#fff}
html.theme-light .nav a:hover{color:#0f172a}
.gd-container .wrap{padding:20px 16px}
.gd-card{background:var(--card);border:1px solid #1f2937;border-radius:12px;padding:16px;margin-bottom:16px;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.gd-card.narrow{max-width:520px;margin:20px auto}
.gd-card.center{text-align:center}
.gd-card.link{transition:transform .12s ease, box-shadow .2s ease}
.gd-card.link:hover{transform:translateY(-2px);box-shadow:0 16px 40px rgba(0,0,0,.35)}
.gd-grid{display:grid;grid-template-columns:1fr;gap:16px}
.gd-grid.two{grid-template-columns:1fr 1fr}
/* card grid for lists */
.gd-grid.cards{grid-template-columns:1fr}
@media(min-width:640px){.gd-grid.cards{grid-template-columns:1fr 1fr}}
@media(min-width:980px){.gd-grid.cards{grid-template-columns:1fr 1fr 1fr}}
.gd-vertical{display:flex;flex-direction:column;gap:12px}
@media(min-width:900px){.gd-grid{grid-template-columns:2fr 1fr}}
.gd-btn{display:inline-block;background:#1f2937;color:#e5e7eb;border:1px solid #374151;border-radius:10px;padding:8px 14px;text-decoration:none;cursor:pointer;transition:filter .2s,opacity .2s}
.gd-btn.primary{background:var(--primary);border-color:#2563eb;color:#fff}
.gd-btn.danger{background:var(--danger);border-color:#b91c1c;color:#fff}
.gd-actions{margin-top:12px}
.gd-form-inline{align-items:end}
.gd-form-inline .gd-actions{align-self:end;display:flex;align-items:flex-end;margin-top:0;padding-bottom:10px}
.gd-field{margin:10px 0}
.gd-field label{display:block;margin-bottom:6px;color:#cbd5e1}
.gd-field-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.gd-field-head > label{margin:0}
.gd-field input,.gd-field textarea,.gd-field select{width:100%;padding:10px;background:#0b1220;border:1px solid #374151;border-radius:10px;color:#e5e7eb}
.gd-alert{padding:10px 12px;border-radius:10px;margin:12px 0}
.gd-alert.ok{background:rgba(16,185,129,.1);border:1px solid rgba(16,185,129,.4)}
.gd-alert.error{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.4)}
.gd-tabs{display:flex;gap:8px;margin:8px 0 16px}
.gd-tabs a{padding:8px 12px;border:1px solid #374151;color:#e5e7eb;border-radius:999px;text-decoration:none}
.gd-tabs a.active{background:#111827}
.gd-list .gd-item{display:block;padding:12px;border-bottom:1px solid #1f2937;color:#e5e7eb;text-decoration:none}
.gd-list .gd-item:hover{background:#0b1220}
.gd-empty{padding:24px;text-align:center;color:#9ca3af}
.gd-pagination{display:flex;gap:8px;align-items:center;margin-top:12px}
.gd-pagination a{padding:6px 10px;border:1px solid #374151;border-radius:8px;color:#e5e7eb;text-decoration:none}
.gd-pagination a.active{background:#111827}
.gd-pagination .total{color:#9ca3af;margin-left:8px}
.gd-meta{color:#9ca3af;font-size:12px;margin:6px 0 12px}
.gd-msgs{display:flex;flex-direction:column;gap:12px}
.gd-msg{background:#0b1220;border:1px solid #1f2937;border-radius:12px;padding:10px}
.gd-msg.admin{border-color:#2563eb}
.gd-msg-head{display:flex;align-items:center;justify-content:flex-start;gap:8px;color:#cbd5e1}
.gd-msg-head .avatar{width:32px;height:32px;border-radius:50%;overflow:hidden;margin-right:0}
.gd-msg-head .time{margin-left:auto;opacity:.8;font-size:12px}
.gd-msg-head .avatar img{width:100%;height:100%;object-fit:cover;display:block}
.gd-msg-head strong{font-size:14px;line-height:1;color:#e5e7eb}
.gd-attachments ul{list-style:none;padding:0;margin:0}
.gd-attachments li{margin:6px 0}
.gd-badge{display:inline-block;margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid #374151;color:#e5e7eb;font-size:12px}
.gd-badge.open{background:rgba(59,130,246,.15);border-color:#2563eb}
.gd-badge.solved{background:rgba(16,185,129,.15);border-color:#10b981}
.gd-badge.closed{background:rgba(148,163,184,.15);border-color:#64748b}
.gd-badge.overtime{background:rgba(239,68,68,.15);border-color:#ef4444}
.gd-table{width:100%;border-collapse:collapse}
.gd-table th,.gd-table td{border-bottom:1px solid #1f2937;padding:10px;text-align:left}
.gd-footer{border-top:1px solid #1f2937;padding:16px 0;color:#94a3b8;background:var(--bg)}
.inline{display:inline-flex;gap:8px;align-items:center}
/* modal */
.gd-modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;padding:16px;z-index:9999}
.gd-modal.show{display:flex}
.gd-modal-card{background:var(--card);border:1px solid #1f2937;border-radius:12px;padding:0;max-width:560px;width:100%;position:relative}
.gd-modal-card .gd-card{margin:0;border:0;box-shadow:none}
.gd-modal-close{position:absolute;right:8px;top:8px;background:transparent;border:0;color:#cbd5e1;font-size:20px;cursor:pointer}

/* drawer (mobile sidebar) */
.gd-drawer{position:fixed;inset:0;display:none;background:rgba(0,0,0,.45);z-index:10000}
.gd-drawer.show{display:block}
.gd-drawer-panel{position:absolute;left:0;top:0;bottom:0;width:260px;background:var(--card);border-right:1px solid #1f2937;padding:16px;overflow:auto}
.gd-drawer a{display:block;color:var(--text);text-decoration:none;padding:10px 8px;border-radius:8px}
.gd-drawer a:hover{background:#0b1220}
html.theme-light .gd-drawer a:hover{background:#f3f4f6}
.gd-drawer-close{position:absolute;right:12px;top:12px;background:transparent;border:0;color:var(--text);font-size:22px}

/* Light theme overrides */
html.theme-light .brand a{color:#111}
html.theme-light .nav a:hover{color:#111}
html.theme-light .gd-header{border-color:#e5e7eb}
html.theme-light .gd-card{border-color:#e5e7eb;box-shadow:0 6px 20px rgba(0,0,0,.08)}
html.theme-light .gd-field label{color:#334155}
html.theme-light .gd-field input,html.theme-light .gd-field textarea,html.theme-light .gd-field select{background:#fff;border-color:#e5e7eb;color:#111}
html.theme-light .gd-tabs a{border-color:#e5e7eb;color:#111}
html.theme-light .gd-tabs a.active{background:#f3f4f6}
html.theme-light .gd-list .gd-item{color:#111;border-color:#e5e7eb}
html.theme-light .gd-list .gd-item:hover{background:#f9fafb}
html.theme-light .gd-pagination a{border-color:#e5e7eb;color:#111}
html.theme-light .gd-pagination a.active{background:#f3f4f6}
html.theme-light .gd-meta{color:#6b7280}
html.theme-light .gd-msg{background:#f9fafb;border-color:#e5e7eb}
html.theme-light .gd-msg-head{color:#334155}
html.theme-light .gd-badge{color:#111;border-color:#e5e7eb}
html.theme-light .gd-table th,html.theme-light .gd-table td{border-color:#e5e7eb;color:#111}
html.theme-light .gd-footer{border-color:#e5e7eb;color:#475569}
html.theme-light .gd-btn{background:#ffffff;border-color:#e5e7eb;color:#111}
html.theme-light .gd-btn.primary{background:var(--primary);border-color:#60a5fa;color:#111}
html.theme-light .gd-home-create{color:#111}
html.theme-light .gd-modal-card{border-color:#e5e7eb}

/* responsive tweaks */
@media(max-width:640px){
  .gd-header .wrap{flex-wrap:wrap;height:auto;padding:8px 16px}
  .nav a,.nav span{margin:6px 8px 0 0;display:none}
  .nav .menu-btn{display:inline-block}
  .gd-card{padding:12px}
  .gd-field input,.gd-field textarea,.gd-field select{font-size:16px}
  /* ticket detail tighter scaling */
  .gd-ticket-header .avatar{width:40px;height:40px}
  .gd-ticket-header h2{font-size:16px;line-height:1.4;word-break:break-word}
  .gd-msg-pics img{max-width:100% !important;height:auto !important}
}

/* Ticket detail layout */
.gd-ticket{display:grid;grid-template-columns:1fr;gap:16px}
.gd-ticket-header{display:flex;align-items:center;gap:12px;padding-bottom:10px;margin-bottom:12px}
.gd-ticket-header .avatar{width:52px;height:52px;border-radius:8px;overflow:hidden;border:1px solid #1f2937}
.gd-ticket-header .avatar img{width:100%;height:100%;object-fit:cover}
.gd-ticket-header .meta{color:#9ca3af;font-size:12px;margin-top:4px}
.gd-ticket-main .gd-msg{background:transparent;border-color:#1f2937}
.gd-ticket-aside{position:sticky;top:72px;height:fit-content}
.gd-ticket-reply{grid-column:1}
.gd-ticket-actions .gd-btn{width:100%}
.gd-ticket-actions .inline{display:flex;gap:8px;align-items:end}
.gd-ticket-actions .inline select{flex:1}
.gd-ticket-actions .row{display:flex;gap:8px;align-items:end;flex-wrap:wrap}
.gd-ticket-actions .row .gd-btn{width:auto}
.gd-ticket-actions .row form:last-child{margin-left:auto}
.gd-ticket-actions .row select,
.gd-ticket-actions .row .gd-btn{border-radius:12px;padding:8px 12px;height:38px;line-height:22px;background:var(--card);border:1px solid #374151;color:var(--text)}
.gd-ticket-actions .row .gd-btn.danger{background:var(--card);border-color:#374151;color:var(--text)}
html.theme-light .gd-ticket-actions .row select,
html.theme-light .gd-ticket-actions .row .gd-btn{background:#ffffff;border-color:#e5e7eb;color:#111}
html.theme-light .gd-ticket-actions .row .gd-btn.danger{background:#ffffff;border-color:#e5e7eb;color:#111}
.gd-reply-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:12px}
.gd-reply-row .left{flex:1}
.gd-reply-row .right{white-space:nowrap}
@media(max-width:640px){.gd-reply-row{flex-direction:column;align-items:stretch}.gd-ticket-actions{position:static}.gd-ticket-actions .gd-btn{width:100%}}

/* dashed separator under header */
.gd-msg-body{border-top:1px dashed #374151;padding-top:8px}
html.theme-light .gd-msg-body{border-top-color:#e5e7eb}
/* avoid double line after header: remove dashed top on first message in ticket main */
.gd-ticket-main .gd-msgs .gd-msg:first-child .gd-msg-body{border-top:none;padding-top:0}
.gd-uticket .gd-msgs .gd-msg:first-child .gd-msg-body{border-top:none;padding-top:0}

/* emoji picker */
.gd-emoji-trigger{background:transparent;border:1px dashed #374151;color:#e5e7eb;border-radius:8px;padding:6px 10px;cursor:pointer}
html.theme-light .gd-emoji-trigger{color:#111;border-color:#e5e7eb}
.gd-emoji-panel{position:static;width:100%;margin-top:2px;background:var(--card);border:1px solid #374151;border-radius:10px;padding:10px;display:flex;flex-wrap:wrap;gap:10px;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.gd-emoji-panel button{background:transparent;border:0;font-size:28px;cursor:pointer;padding:8px;border-radius:8px;line-height:1}
.gd-emoji-panel button:hover{background:#0b1220;transform:scale(1.08)}
html.theme-light .gd-emoji-panel{border-color:#e5e7eb}
html.theme-light .gd-emoji-panel button:hover{background:#f3f4f6}

/* bigger emoji in message text */
.gd-msg-text{font-size:16px;line-height:1.8}
.gd-msg-text .gd-emoji{font-size:28px;line-height:1}


