/* ============================================================
   Service Desk DP — Campos e Souza Consultoria
   Identidade Visual Oficial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto:wght@300;400;500;600;700&display=swap');

/* ── Variáveis da Marca ───────────────────────────────────── */
:root {
  --cs-black:        #000000;
  --cs-dark:         #0a0a0a;
  --cs-dark-card:    #111111;
  --cs-dark-surface: #181818;
  --cs-teal:         #277364;
  --cs-teal-light:   #34B29A;
  --cs-teal-glow:    rgba(39, 115, 100, 0.30);
  --cs-orange:       #FF9000;
  --cs-orange-dark:  #e07d00;
  --cs-white:        #FFFFFF;
  --cs-gray:         #7A7A7A;
  --cs-gray-light:   #2a2a2a;
  --cs-border:       rgba(255,255,255,0.08);
  --sidebar-width:   272px;
  --radius-card:     14px;
  --radius-btn:      8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', sans-serif;
  background: var(--cs-dark);
  color: var(--cs-white);
  min-height: 100vh;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bebas Neue', 'Roboto', sans-serif;
  letter-spacing: 1px;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--cs-dark); }
::-webkit-scrollbar-thumb { background: var(--cs-teal); border-radius: 3px; }

/* ── Layout ───────────────────────────────────────────────── */
#wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--cs-black);
  border-right: 1px solid var(--cs-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .3s ease;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-logo-wrap {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--cs-border);
}

.sidebar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

.sidebar-subtitle {
  font-size: 10px;
  color: var(--cs-teal-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
  display: block;
  padding-left: 2px;
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.sidebar-section-label {
  font-size: 10px;
  color: var(--cs-gray);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 14px 20px 5px;
}

.cs-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s;
}

.cs-nav-link i { width: 18px; text-align: center; color: var(--cs-teal); transition: color .18s; font-size: 13px; }

.cs-nav-link:hover { color: var(--cs-white); background: rgba(39,115,100,.12); border-left-color: var(--cs-teal); }
.cs-nav-link.active { color: var(--cs-white); background: rgba(39,115,100,.18); border-left-color: var(--cs-orange); }
.cs-nav-link.active i { color: var(--cs-orange); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cs-border);
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-white);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--cs-teal-light);
  display: block;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cs-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--cs-white);
  flex-shrink: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
#topbar {
  background: var(--cs-black);
  border-bottom: 1px solid var(--cs-border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.75);
  flex: 1;
}

.topbar-btn {
  background: transparent;
  border: 1px solid var(--cs-border);
  color: rgba(255,255,255,.65);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  font-size: 14px;
}

.topbar-btn:hover { color: var(--cs-white); border-color: var(--cs-teal); background: rgba(39,115,100,.1); }

.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--cs-orange);
  color: var(--cs-black);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page Content ─────────────────────────────────────────── */
#page-content { flex: 1; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

main.cs-main { padding: 24px 28px; flex: 1; }

/* ── Gradient accent bar ──────────────────────────────────── */
.cs-glow-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--cs-teal) 0%, var(--cs-teal-light) 60%, var(--cs-orange) 100%);
}

/* ── Cards ────────────────────────────────────────────────── */
.cs-card {
  background: var(--cs-dark-card);
  border: 1px solid var(--cs-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.cs-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--cs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--cs-white);
  margin: 0;
}

.cs-card-body { padding: 22px; }

/* Metric cards */
.metric-card {
  background: var(--cs-dark-card);
  border: 1px solid var(--cs-border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .2s, transform .2s;
  border-top: 2px solid;
}

.metric-card:hover { transform: translateY(-2px); }

.metric-card.t-teal   { border-top-color: var(--cs-teal-light); }
.metric-card.t-orange { border-top-color: var(--cs-orange); }
.metric-card.t-red    { border-top-color: #ef4444; }
.metric-card.t-blue   { border-top-color: #60a5fa; }
.metric-card.t-green  { border-top-color: #4ade80; }
.metric-card.t-purple { border-top-color: #c084fc; }

.metric-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}

.i-teal   { background: rgba(39,115,100,.2);  color: var(--cs-teal-light); }
.i-orange { background: rgba(255,144,0,.15);  color: var(--cs-orange); }
.i-red    { background: rgba(220,38,38,.15);  color: #ef4444; }
.i-blue   { background: rgba(59,130,246,.15); color: #60a5fa; }
.i-green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.i-purple { background: rgba(168,85,247,.15); color: #c084fc; }

.metric-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--cs-white);
}

.metric-label {
  font-size: 11px;
  color: var(--cs-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-cs {
  border-radius: var(--radius-btn);
  padding: 9px 18px;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  border: none;
}

.btn-cs-teal    { background: var(--cs-teal);    color: var(--cs-white); }
.btn-cs-teal:hover  { background: var(--cs-teal-light); color: var(--cs-white); box-shadow: 0 4px 20px var(--cs-teal-glow); transform: translateY(-1px); }

.btn-cs-orange  { background: var(--cs-orange);  color: var(--cs-black); font-weight: 700; }
.btn-cs-orange:hover { background: var(--cs-orange-dark); color: var(--cs-black); transform: translateY(-1px); }

.btn-cs-ghost {
  background: transparent;
  color: rgba(255,255,255,.55);
  border: 1px solid var(--cs-border);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-cs-ghost:hover { color: var(--cs-white); border-color: var(--cs-teal); background: rgba(39,115,100,.1); }

.btn-cs-danger {
  background: rgba(220,38,38,.12);
  color: #ef4444;
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-cs-danger:hover { background: rgba(220,38,38,.25); color: #ef4444; }

.btn-sm-cs { padding: 6px 13px; font-size: 12px; }

/* ── Forms ────────────────────────────────────────────────── */
.cs-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 7px;
  display: block;
}

.cs-input, .cs-select, .cs-textarea {
  background: var(--cs-dark-surface);
  border: 1px solid var(--cs-border);
  color: var(--cs-white);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
  font-family: 'Roboto', sans-serif;
}

.cs-input:focus, .cs-select:focus, .cs-textarea:focus {
  border-color: var(--cs-teal);
  box-shadow: 0 0 0 3px rgba(39,115,100,.25);
}

.cs-input::placeholder, .cs-textarea::placeholder { color: var(--cs-gray); }

.cs-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.cs-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7A7A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Badges ───────────────────────────────────────────────── */
.cs-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.b-teal   { background: rgba(39,115,100,.2);    color: var(--cs-teal-light); border: 1px solid rgba(52,178,154,.2); }
.b-orange { background: rgba(255,144,0,.15);   color: var(--cs-orange);     border: 1px solid rgba(255,144,0,.25); }
.b-red    { background: rgba(220,38,38,.15);   color: #ef4444;              border: 1px solid rgba(220,38,38,.25); }
.b-yellow { background: rgba(234,179,8,.12);   color: #facc15;             border: 1px solid rgba(234,179,8,.2); }
.b-blue   { background: rgba(59,130,246,.15);  color: #60a5fa;             border: 1px solid rgba(59,130,246,.2); }
.b-green  { background: rgba(34,197,94,.15);   color: #4ade80;             border: 1px solid rgba(34,197,94,.2); }
.b-gray   { background: rgba(122,122,122,.12); color: var(--cs-gray);      border: 1px solid rgba(122,122,122,.2); }

/* ── Tables ───────────────────────────────────────────────── */
.cs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.cs-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--cs-gray);
  border-bottom: 1px solid var(--cs-border);
  white-space: nowrap;
}

.cs-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: rgba(255,255,255,.8);
  vertical-align: middle;
}

.cs-table tbody tr { transition: background .12s; cursor: pointer; }
.cs-table tbody tr:hover { background: rgba(39,115,100,.07); }
.cs-table tbody tr:last-child td { border-bottom: none; }

.ticket-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  color: var(--cs-teal-light);
  letter-spacing: 1px;
}

/* ── Messages ─────────────────────────────────────────────── */
.msg-wrap { display: flex; margin-bottom: 16px; }
.msg-wrap.analyst { flex-direction: row; }
.msg-wrap.client  { flex-direction: row-reverse; }

.msg-bubble {
  max-width: 82%;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.65;
  border: 1px solid var(--cs-border);
}

.msg-bubble.analyst {
  background: rgba(39,115,100,.1);
  border-color: rgba(39,115,100,.2);
  border-radius: 4px 12px 12px 12px;
}

.msg-bubble.client {
  background: var(--cs-dark-surface);
  border-radius: 12px 4px 12px 12px;
}

.msg-bubble.internal {
  background: rgba(255,144,0,.07);
  border-color: rgba(255,144,0,.2);
  border-left: 3px solid var(--cs-orange);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.msg-author { font-size: 12px; font-weight: 600; color: var(--cs-teal-light); }
.msg-author.client-author { color: rgba(255,255,255,.6); }
.msg-time { font-size: 11px; color: var(--cs-gray); margin-left: auto; }

/* ── Kanban ───────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 65vh;
}

.kanban-col { flex-shrink: 0; width: 280px; display: flex; flex-direction: column; }

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid;
}

.kh-open     { background: rgba(59,130,246,.07);  border-color: #60a5fa; }
.kh-progress { background: rgba(39,115,100,.1);   border-color: var(--cs-teal-light); }
.kh-waiting  { background: rgba(255,144,0,.08);   border-color: var(--cs-orange); }
.kh-resolved { background: rgba(34,197,94,.07);   border-color: #4ade80; }

.kanban-col-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--cs-white);
}

.kanban-col-body {
  background: rgba(0,0,0,.25);
  border: 1px solid var(--cs-border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 180px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  flex: 1;
}

.kanban-card {
  background: var(--cs-dark-card);
  border: 1px solid var(--cs-border);
  border-radius: 9px;
  padding: 13px;
  cursor: pointer;
  transition: all .18s;
}

.kanban-card:hover { border-color: var(--cs-teal); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,0,0,.4); }

/* ── Upload zone ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--cs-border);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.upload-zone:hover { border-color: var(--cs-teal); background: rgba(39,115,100,.05); }

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ── Category chips ───────────────────────────────────────── */
.cat-chip input[type="radio"] { display: none; }

.cat-chip label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--cs-border);
  border-radius: 8px;
  background: var(--cs-dark-surface);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .18s;
}

.cat-chip label:hover { border-color: var(--cs-teal); color: var(--cs-white); }

.cat-chip input:checked + label {
  border-color: var(--cs-teal-light);
  background: rgba(39,115,100,.15);
  color: var(--cs-white);
}

/* ── Divider ──────────────────────────────────────────────── */
.cs-divider { border: none; border-top: 1px solid var(--cs-border); margin: 20px 0; }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Empty state ──────────────────────────────────────────── */
.cs-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--cs-gray);
}

.cs-empty i { font-size: 2.8rem; opacity: .15; margin-bottom: 14px; display: block; }

/* ── Animations ───────────────────────────────────────────── */
.fade-in { animation: fadeIn .3s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Detail sidebar ───────────────────────────────────────── */
.detail-section { margin-bottom: 20px; }
.detail-label { font-size: 10.5px; color: var(--cs-gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.detail-value { font-size: 13.5px; color: var(--cs-white); font-weight: 500; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { width: 0 !important; overflow: hidden; }
  #sidebar.cs-sidebar-open { width: var(--sidebar-width) !important; position: fixed; z-index: 999; }
  main.cs-main { padding: 16px; }
}

/* ── Utilities ────────────────────────────────────────────── */
.text-teal   { color: var(--cs-teal-light) !important; }
.text-orange { color: var(--cs-orange) !important; }
.text-muted  { color: var(--cs-gray) !important; }
.text-white  { color: var(--cs-white) !important; }
.text-sm     { font-size: 12.5px; }
.text-xs     { font-size: 11px; }
.fw-600      { font-weight: 600; }
.gap-1       { gap: 4px; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.d-flex      { display: flex; }
.d-grid      { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1      { flex: 1; }
.w-100       { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.p-0 { padding: 0 !important; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }
.cursor-pointer { cursor: pointer; }
