/* DEEKO HELPDESK CSS */
:root {
  --dk:    #0f172a;
  --dk2:   #1a3a5c;
  --grn:   #059669;
  --blue:  #2563eb;
  --gold:  #d97706;
  --red:   #dc2626;
  --bg:    #f8fafc;
  --white: #ffffff;
  --bdr:   #e2e8f0;
  --text:  #0f172a;
  --muted: #64748b;
  --light: #94a3b8;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* ── NAVBAR ── */
.hd-nav { background: var(--dk); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.hd-nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hd-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hd-brand img { width: 34px; height: 34px; border-radius: 8px; }
.hd-brand-title { font-size: 15px; font-weight: 700; color: #fff; }
.hd-brand-sub { font-size: 10px; color: rgba(255,255,255,.4); }
.hd-nav-links { display: flex; gap: 2px; }
.hd-nav-link { color: rgba(255,255,255,.6); text-decoration: none; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 7px; transition: all .15s; }
.hd-nav-link:hover, .hd-nav-link.active { background: rgba(255,255,255,.1); color: #fff; }
.hd-nav-right { display: flex; align-items: center; gap: 10px; }
.hd-nav-user { font-size: 12px; color: rgba(255,255,255,.5); }
.hd-nav-btn { padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; }
.hd-nav-btn-ghost { border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.7); }
.hd-nav-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.hd-nav-btn-solid { background: var(--grn); color: #fff; }
.hd-nav-btn-solid:hover { background: #047857; }

/* ── HERO ── */
.hd-hero { background: linear-gradient(135deg, var(--dk) 0%, var(--dk2) 100%); padding: 56px 24px; text-align: center; }
.hd-hero h1 { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing: -.5px; }
.hd-hero p  { font-size: 16px; color: rgba(255,255,255,.6); margin-bottom: 28px; }
.hd-search-wrap { max-width: 580px; margin: 0 auto; position: relative; }
.hd-search-input { width: 100%; padding: 16px 56px 16px 20px; border: none; border-radius: 12px; font-size: 15px; font-family: inherit; outline: none; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.hd-search-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--dk2); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.hd-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; z-index: 50; display: none; text-align: left; }
.hd-search-results.show { display: block; }
.hd-search-item { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background .1s; }
.hd-search-item:hover { background: #f8fafc; }
.hd-search-item:last-child { border-bottom: none; }
.hd-search-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.hd-search-item-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hd-search-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── LAYOUT ── */
.hd-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.hd-section { padding: 48px 0; }
.hd-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.hd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hd-grid-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }

/* ── CARDS ── */
.hd-card { background: var(--white); border: 1px solid var(--bdr); border-radius: 12px; overflow: hidden; transition: box-shadow .15s; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.hd-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.hd-card-body { padding: 22px; }
.hd-card-head { padding: 14px 20px; border-bottom: 1px solid var(--bdr); background: #f8fafc; display: flex; align-items: center; justify-content: space-between; }
.hd-card-head h3 { font-size: 14px; font-weight: 700; color: var(--dk2); }

/* ── CATEGORY CARDS ── */
.kb-cat-card { display: flex; align-items: flex-start; gap: 16px; padding: 22px; background: var(--white); border: 1px solid var(--bdr); border-radius: 12px; text-decoration: none; color: inherit; transition: all .15s; }
.kb-cat-card:hover { border-color: var(--dk2); box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.kb-cat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.kb-cat-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.kb-cat-desc  { font-size: 13px; color: var(--muted); line-height: 1.5; }
.kb-cat-count { font-size: 11px; color: var(--light); margin-top: 6px; }

/* ── ARTICLE ── */
.kb-article-content { font-size: 15px; line-height: 1.8; color: #1e293b; }
.kb-article-content h2 { font-size: 20px; font-weight: 700; color: var(--dk); margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--bdr); }
.kb-article-content h3 { font-size: 16px; font-weight: 600; color: var(--dk); margin: 20px 0 8px; }
.kb-article-content p  { margin-bottom: 14px; }
.kb-article-content ul, .kb-article-content ol { padding-left: 22px; margin-bottom: 14px; }
.kb-article-content li { margin-bottom: 6px; }
.kb-article-content code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 2px 6px; font-size: 13px; font-family: monospace; }
.kb-article-content strong { font-weight: 600; color: var(--dk); }

/* ── TICKET THREAD ── */
.ticket-msg { border-radius: 12px; padding: 16px 20px; margin-bottom: 14px; }
.ticket-msg-client { background: #f0f9ff; border: 1px solid #bae6fd; }
.ticket-msg-agent  { background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid var(--grn); }
.ticket-msg-system { background: #f8fafc; border: 1px dashed #e2e8f0; font-size: 13px; color: var(--muted); }
.ticket-msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ticket-msg-author { font-size: 13px; font-weight: 600; color: var(--dk); }
.ticket-msg-time   { font-size: 11px; color: var(--light); }
.ticket-msg-body   { font-size: 14px; color: var(--text); line-height: 1.75; white-space: pre-wrap; }

/* ── CHAT ── */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 999; }
.chat-toggle { width: 56px; height: 56px; background: var(--grn); border: none; border-radius: 50%; cursor: pointer; font-size: 24px; box-shadow: 0 4px 20px rgba(5,150,105,.4); transition: all .2s; display: flex; align-items: center; justify-content: center; }
.chat-toggle:hover { transform: scale(1.08); background: #047857; }
.chat-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; display: none; }
.chat-window { position: absolute; bottom: 70px; right: 0; width: 360px; background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.18); overflow: hidden; display: none; flex-direction: column; height: 520px; }
.chat-window.open { display: flex; }
.chat-header { background: linear-gradient(135deg, var(--dk), var(--dk2)); padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.chat-header-avatar { width: 38px; height: 38px; background: rgba(255,255,255,.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chat-header-name { font-size: 14px; font-weight: 700; color: #fff; }
.chat-header-status { font-size: 11px; color: rgba(255,255,255,.5); display: flex; align-items: center; gap: 4px; }
.chat-header-status::before { content: ''; width: 6px; height: 6px; background: var(--grn); border-radius: 50%; }
.chat-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.5); font-size: 20px; cursor: pointer; padding: 0 4px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; }
.chat-msg-user { align-self: flex-end; }
.chat-msg-ai   { align-self: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.chat-msg-user .chat-bubble { background: var(--dk2); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg-ai   .chat-bubble { background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg-ai   .chat-bubble strong { color: var(--dk2); }
.chat-msg-time { font-size: 10px; color: var(--light); margin-top: 3px; }
.chat-msg-user .chat-msg-time { text-align: right; }
.chat-typing { display: flex; gap: 4px; padding: 10px 14px; background: #f1f5f9; border-radius: 12px; width: 60px; }
.chat-typing span { width: 7px; height: 7px; background: var(--light); border-radius: 50%; animation: typing .8s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }
.chat-input-area { padding: 12px 14px; border-top: 1px solid var(--bdr); background: #f8fafc; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 9px 13px; border: 1.5px solid var(--bdr); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; resize: none; height: 40px; transition: border-color .15s; }
.chat-input:focus { border-color: var(--grn); }
.chat-send { background: var(--grn); color: #fff; border: none; border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 16px; transition: background .15s; }
.chat-send:hover { background: #047857; }
.chat-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chat-action-btn { font-size: 11px; padding: 4px 10px; border: 1px solid var(--bdr); border-radius: 20px; background: #fff; color: var(--muted); cursor: pointer; transition: all .15s; }
.chat-action-btn:hover { border-color: var(--grn); color: var(--grn); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .3px; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid #d1d5db; border-radius: 9px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; background: #fff; }
.form-control:focus { border-color: var(--dk2); box-shadow: 0 0 0 3px rgba(26,58,92,.08); }
textarea.form-control { resize: vertical; min-height: 110px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 22px; border-radius: 9px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: all .15s; font-family: inherit; }
.btn-primary { background: var(--dk2); color: #fff; } .btn-primary:hover { background: var(--dk); }
.btn-green   { background: var(--grn); color: #fff;  } .btn-green:hover   { background: #047857; }
.btn-outline { background: #fff; border: 1.5px solid var(--bdr); color: var(--muted); } .btn-outline:hover { border-color: var(--dk2); color: var(--dk2); }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-open     { background: #dbeafe; color: #1e40af; }
.badge-progress { background: #d1fae5; color: #065f46; }
.badge-resolved { background: #fef3c7; color: #92400e; }
.badge-closed   { background: #f1f5f9; color: #64748b; }
.badge-critical { background: #fee2e2; color: #991b1b; }
.badge-high     { background: #fff7ed; color: #c2410c; }
.badge-medium   { background: #eff6ff; color: #1d4ed8; }
.badge-low      { background: #f8fafc; color: #475569; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 9px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── TABLE ── */
.hd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hd-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--bdr); background: #f8fafc; text-transform: uppercase; letter-spacing: .4px; }
.hd-table td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.hd-table tbody tr:hover td { background: #f8fafc; cursor: pointer; }
.hd-table tr:last-child td { border-bottom: none; }

/* ── MISC ── */
.page-title { font-size: 24px; font-weight: 800; color: var(--dk); margin-bottom: 6px; }
.page-sub   { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--dk); margin-bottom: 4px; }
.divider { border: none; border-top: 1px solid var(--bdr); margin: 24px 0; }
.mono { font-family: monospace; font-size: 12px; }
.text-muted { color: var(--muted); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--dk); margin-bottom: 8px; }

/* ── FOOTER ── */
.hd-footer { background: var(--dk); color: rgba(255,255,255,.5); text-align: center; padding: 28px 20px; font-size: 13px; margin-top: 60px; }
.hd-footer a { color: rgba(255,255,255,.4); text-decoration: none; }
.hd-footer a:hover { color: #fff; }

/* ── RESPONSIVE ── */
@media(max-width:768px) {
  .hd-grid-3, .hd-grid-2, .hd-grid-sidebar { grid-template-columns: 1fr; }
  .hd-nav-links { display: none; }
  .chat-window { width: calc(100vw - 32px); right: -8px; }
  .hd-hero h1 { font-size: 26px; }
}
