/* ===========================================================
   Vanaa ServiceDesk — navy + coral design system
   (inspired by the VanaaCred product UI)
   =========================================================== */
:root {
  --navy-900:#0A1734; --navy-800:#0E2149; --navy-700:#16305f;
  --coral:#FF5A2C; --coral-2:#FF8A4C;
  --sd-bg:#F3F6FB; --sd-surface:#FFFFFF; --sd-surface-2:#f5f7fb;
  --sd-primary:#FF5A2C; --sd-primary-2:#FF8A4C;
  --sd-ink:#152142; --sd-ink-2:#3A4767; --sd-text:#152142; --sd-muted:#7A8399;
  --sd-border:#E7ECF4; --sd-border-2:#dbe2ee;
  --green:#159E5B; --green-bg:#E7F6EC;
  --amber:#C9760A; --amber-bg:#FDF1DF;
  --red:#D5352C; --red-bg:#FCEBEA;
  --blue:#2C63E6; --blue-bg:#E9F0FE; --violet:#6B4CE6; --violet-bg:#EEEAFC;
  --sd-radius:16px;
  --sd-shadow:0 1px 2px rgba(16,32,64,.04), 0 6px 24px rgba(16,32,64,.06);
  --sd-shadow-hover:0 12px 32px rgba(16,32,64,.12);
}

* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--sd-bg);
  color: var(--sd-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .9rem;
  letter-spacing: -.01em;
}
::selection { background: var(--coral); color: #fff; }
h1,h2,h3,h4,h5,h6 { color: var(--navy-900); font-weight: 800; letter-spacing: -.02em; }
a { color: var(--coral); text-decoration: none; }
a:hover { color: var(--coral-2); }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1030;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #c3cbe0; display: flex; flex-direction: column; padding: 22px 16px;
  transition: transform .22s ease;
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px 14px;
}
.brand-logo-img { width: 150px; max-height: 46px; object-fit: contain; }

/* Profile */
.sidebar-profile { text-align: center; padding: 12px 8px 14px; }
.profile-avatar {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto .6rem;
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  border: 3px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
}
.profile-name { color: #fff; font-weight: 800; font-size: 1.02rem; }
.profile-role {
  display: inline-block; margin-top: .5rem; font-size: .7rem; color: #aeb9d4;
  background: rgba(255,255,255,.07); padding: .18rem .7rem; border-radius: 20px;
}

.sidebar-nav { padding: .5rem .1rem; gap: .25rem; }
.sidebar-nav .nav-link {
  color: #c3cbe0; border-radius: 11px; padding: .72rem .9rem;
  display: flex; align-items: center; gap: .8rem; font-size: .92rem; font-weight: 600;
  transition: background .15s, color .15s, box-shadow .15s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: #fff;
  box-shadow: 0 6px 18px rgba(255,90,44,.35);
}
.sidebar-nav .nav-link i { width: 1.2rem; text-align: center; font-size: 1.05rem; }

/* CTA card */
.sidebar-cta {
  margin: 1rem .1rem .8rem; padding: 1.05rem 1rem; border-radius: 14px; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.sidebar-cta > i { font-size: 1.4rem; display: block; margin-bottom: .4rem; color: var(--coral-2); }
.cta-title { font-weight: 800; font-size: .95rem; }
.cta-sub { font-size: .74rem; color: #aeb9d4; margin: .15rem 0 .75rem; line-height: 1.35; }
.cta-btn {
  display: block; text-align: center;
  background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: #fff;
  font-weight: 700; font-size: .82rem; padding: .55rem; border-radius: 10px;
  box-shadow: 0 6px 16px rgba(255,90,44,.3);
}
.cta-btn:hover { color: #fff; filter: brightness(1.05); }

/* Logout */
.sidebar-logout { margin-top: auto; padding: 0 .1rem; }
.logout-btn {
  width: 100%; background: transparent; color: #93a0c2; border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px; padding: .65rem; font-weight: 700; font-size: .88rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem; transition: .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

.app-main { flex: 1; margin-left: 248px; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Topbar (dark navy) ---------- */
.topbar {
  background: var(--navy-900); border: 0;
  padding: 0 1.75rem; display: flex; align-items: center; gap: 1.25rem;
  position: sticky; top: 0; z-index: 1020; height: 70px;
}
.topbar-search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: .6rem;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px; padding: .6rem .85rem; margin: 0;
}
.topbar-search:focus-within { border-color: rgba(255,138,76,.5); }
.topbar-search i { color: #8fa0c4; font-size: .95rem; }
.topbar-search input { background: none; border: 0; outline: none; color: #fff; font-size: .88rem; width: 100%; }
.topbar-search input::placeholder { color: #8592b5; }
.topbar .btn-light { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.1); color: #c3cbe0; }
.topbar .dropdown-toggle { color: #fff !important; }
.topbar .dropdown-toggle::after { color: #8592b5; }
.topbar .text-muted, .topbar .d-none.d-sm-inline { color: #fff !important; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--coral-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; border: 2px solid rgba(255,255,255,.14);
}
.content { padding: 1.75rem 2rem 3rem; max-width: 1400px; width: 100%; }

/* ---------- Page head ---------- */
.page-head h1 { font-size: 1.65rem; }
.page-head .text-muted { font-size: .85rem; color: var(--sd-muted); }

/* ---------- Help icon ---------- */
.help-icon { color: #b3bcc9; font-size: .78rem; margin-left: .28rem; cursor: help; transition: color .15s; }
.help-icon:hover { color: var(--coral); }
.btn .help-icon { color: rgba(255,255,255,.8); }
.btn-light .help-icon, .btn-outline-secondary .help-icon { color: #b3bcc9; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--sd-border); border-radius: var(--sd-radius); box-shadow: var(--sd-shadow); background: var(--sd-surface); }
.card-header { border-bottom: 1px solid var(--sd-border); border-radius: var(--sd-radius) var(--sd-radius) 0 0 !important; padding: 1rem 1.35rem; background: transparent !important; font-weight: 800; }
.card-body { padding: 1.35rem; }
a .card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
a .card:hover { transform: translateY(-2px); box-shadow: var(--sd-shadow-hover); border-color: var(--sd-border-2); }
.bg-light { background: var(--sd-surface-2) !important; }

/* Stat cards */
.stat-card { position: relative; overflow: hidden; border-left: 4px solid var(--coral); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--navy-900); letter-spacing: -.03em; }
.stat-card .stat-label { color: var(--sd-muted); font-size: .82rem; font-weight: 600; }
.stat-icon { font-size: 2rem; opacity: .16; align-self: center; color: var(--coral); }

/* ---------- Buttons ---------- */
.btn { border-radius: 11px; font-weight: 700; font-size: .865rem; padding: .55rem 1rem; transition: filter .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 10px; padding: .4rem .8rem; }
.btn-primary { background: linear-gradient(135deg, var(--coral), var(--coral-2)); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(255,90,44,.28); }
.btn-primary:hover { filter: brightness(1.05); color: #fff; box-shadow: 0 8px 20px rgba(255,90,44,.38); }
.btn-light { background: #fff; border: 1.5px solid var(--sd-border); color: var(--sd-ink-2); }
.btn-light:hover { border-color: var(--coral); color: var(--coral); background: #fff; }
.btn-outline-secondary { border: 1.5px solid var(--sd-border); color: var(--sd-ink-2); }
.btn-outline-secondary:hover { border-color: var(--coral); color: var(--coral); background: #fff; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border: 1.5px solid var(--sd-border); padding: .55rem .85rem; font-size: .9rem; color: var(--sd-ink); }
.form-control:focus, .form-select:focus { border-color: var(--coral); box-shadow: 0 0 0 .2rem rgba(255,90,44,.12); }
.form-label { font-weight: 700; font-size: .82rem; color: var(--sd-ink-2); margin-bottom: .35rem; }
.form-control-sm, .form-select-sm { border-radius: 9px; }
.form-check-input:checked { background-color: var(--coral); border-color: var(--coral); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sd-muted); font-weight: 700; border-bottom: 1px solid var(--sd-border); padding: .75rem 1.15rem; }
.table tbody td { padding: .8rem 1.15rem; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #fbfcfe; }

/* ---------- Badges (soft pills) ---------- */
.badge { font-weight: 700; padding: .4em .7em; border-radius: 999px; font-size: .7rem; letter-spacing: .01em; }
.text-bg-light { background: #eef1f7 !important; color: #6b7488 !important; }
.text-bg-success { background: var(--green-bg) !important; color: var(--green) !important; }
.text-bg-danger  { background: var(--red-bg) !important; color: var(--red) !important; }
.text-bg-warning { background: var(--amber-bg) !important; color: var(--amber) !important; }
.text-bg-primary { background: var(--blue-bg) !important; color: var(--blue) !important; }
.text-bg-secondary { background: #eef1f7 !important; color: #6b7488 !important; }
.text-bg-info { background: var(--blue-bg) !important; color: var(--blue) !important; }
.text-bg-dark { background: #e6e9f2 !important; color: #3A4767 !important; }

/* priority dot helper */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }

/* ---------- List groups ---------- */
.list-group-item { border-color: #f1f4f9; padding: .7rem 1.1rem; font-size: .875rem; }

/* ---------- Dropdowns ---------- */
.dropdown-menu { border: 1px solid var(--sd-border); border-radius: 13px; box-shadow: var(--sd-shadow-hover); padding: .4rem; }
.dropdown-item { border-radius: 9px; font-weight: 600; font-size: .86rem; padding: .5rem .7rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--sd-surface-2); color: var(--coral); }

/* ---------- Alerts ---------- */
.alert { border: 0; border-radius: 13px; box-shadow: var(--sd-shadow); font-size: .88rem; }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-danger  { background: var(--red-bg); color: var(--red); }
.alert-info    { background: var(--blue-bg); color: var(--blue); }
.alert-warning { background: var(--amber-bg); color: var(--amber); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--sd-muted); }
.empty i { font-size: 2.4rem; opacity: .3; display: block; margin-bottom: .5rem; }

/* ---------- Auth (login) — keep coral/navy ---------- */
.auth-badge { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, var(--coral), var(--coral-2)); display: inline-flex; align-items: center; justify-content: center; }
.auth-badge i { font-size: 1.8rem; color: #fff; }
.auth-demo { background: var(--sd-surface-2); border-radius: 12px; font-size: .78rem; }
.auth-demo code { color: var(--coral); }

/* ---------- Reference pill ---------- */
.ref-pill {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: .78rem; font-weight: 700; letter-spacing: -.01em;
  background: #FFEDE6; color: var(--coral); padding: .2rem .5rem; border-radius: 7px;
  white-space: nowrap;
}
tr:hover .ref-pill { background: #ffe0d3; }

/* clickable table rows */
tr.row-link { cursor: pointer; transition: background .12s; }

/* ---------- Chat conversation ---------- */
.chat { display: flex; flex-direction: column; gap: .75rem; }
.chat-msg { display: flex; gap: .65rem; }
.chat-msg .avatar { width: 32px; height: 32px; font-size: .8rem; flex-shrink: 0; }
.chat-bubble {
  background: var(--sd-surface-2); border: 1px solid var(--sd-border); border-radius: 4px 14px 14px 14px;
  padding: .7rem .9rem; flex: 1; min-width: 0;
}
.chat-bubble .chat-meta { font-size: .76rem; color: var(--sd-muted); margin-bottom: .25rem; }
.chat-bubble .chat-meta strong { color: var(--sd-text); }
.chat-body { white-space: pre-wrap; font-size: .9rem; word-break: break-word; }
.chat-note .chat-bubble { background: #fffbeb; border-color: #fde68a; border-radius: 14px; }
.chat-note .avatar { background: linear-gradient(135deg,#f59e0b,#d97706); }

/* ---------- Timeline (activity) ---------- */
.timeline { list-style: none; margin: 0; padding: .25rem .25rem .25rem .9rem; }
.timeline li { position: relative; padding: 0 0 .95rem 1.1rem; border-left: 2px solid var(--sd-border); font-size: .82rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: .2rem; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .15rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px #FFEDE6;
}
.timeline .tl-time { color: var(--sd-muted); font-size: .74rem; }

/* section label */
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sd-muted); margin-bottom: .25rem; }

/* pagination */
.pagination .page-link { color: var(--sd-ink-2); border-radius: 9px; margin: 0 2px; border-color: var(--sd-border); font-weight: 600; }
.pagination .page-link:hover { color: var(--coral); }
.pagination .page-item.disabled .page-link { color: var(--sd-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .content { padding: 1.1rem; }
  .topbar { padding: 0 1rem; }
}
