@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

html, body, button, input, select, textarea {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, .brand, .price strong, .stats strong {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

body { letter-spacing: -0.012em; }
h1, h2, h3 { letter-spacing: -0.035em; }
button, .btn, label, small, .eyebrow { letter-spacing: 0; }

.brand {
  gap: 9px;
  white-space: nowrap;
  letter-spacing: -.015em;
  font-weight: 800;
}

.brand span, .brand b { white-space: nowrap; letter-spacing: 0; }

.support-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: #45e06f;
  color: #06101f;
  box-shadow: 0 12px 30px rgba(4, 17, 33, .3);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.support-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(4, 17, 33, .36); }
.support-fab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.support-fab i { position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #18a646; }

.support-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(300px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid #dce5eb;
  border-radius: 15px;
  background: #fff;
  color: #0b1f35;
  box-shadow: 0 22px 60px rgba(4, 17, 33, .24);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.support-panel[aria-hidden="true"] { visibility: hidden; opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none; }
.support-panel[aria-hidden="false"] { visibility: visible; opacity: 1; transform: translateY(0) scale(1); }
.support-panel small { color: #16883d; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.support-panel h3 { margin: 6px 28px 7px 0; color: #0b1f35; font-size: 18px; letter-spacing: -.025em; }
.support-panel p { margin: 0 0 15px; color: #6b7f91; font-size: 10px; line-height: 1.6; }
.support-panel>a { display: flex; align-items: center; justify-content: center; min-height: 39px; border-radius: 8px; font-size: 9px; font-weight: 800; }
.support-panel .support-primary { background: #45e06f; color: #06101f; }
.support-panel .support-secondary { margin-top: 7px; border: 1px solid #dce5eb; background: #f7fafb; color: #0b1f35; }
.support-panel>span { display: block; margin-top: 11px; color: #8293a0; font-size: 8px; text-align: center; overflow-wrap: anywhere; }
.support-close { position: absolute; top: 12px; right: 12px; width: 27px; height: 27px; border: 0; border-radius: 50%; background: #eef3f7; color: #53697a; cursor: pointer; }

.pricing-profit-note {
  display: grid;
  gap: 4px;
  margin: 22px 0 14px;
  padding: 15px 17px;
  border: 1px solid #b8dfc4;
  border-radius: 12px;
  background: #f2faf4;
  color: #175d2d;
}

.pricing-profit-note strong { font-size: 13px; }
.pricing-profit-note span { color: #527561; font-size: 10px; line-height: 1.55; }
.pricing-cost-tip { grid-column: 1 / -1; color: #6f8190; font-size: 9px; line-height: 1.5; }
.resource-form .margin-apply { align-self: end; background: #0b1f35; color: #fff; }

.profit-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.profit-summary span {
  border: 1px solid #dce5eb;
  border-radius: 8px;
  padding: 8px;
  background: #f6f9fa;
  color: #667b8a;
  font-size: 8px;
  font-weight: 700;
}

.profit-summary .positive { border-color: #bce3c7; background: #edf9f0; color: #147335; }
.profit-summary .loss { border-color: #f0bcbc; background: #fff0f0; color: #a22f2f; }
.profit-summary .neutral { border-color: #ecdca6; background: #fff9e7; color: #8a6700; }
.profit-summary .missing { border-style: dashed; color: #8a6b17; }

.admin-body .stats { grid-template-columns: repeat(5, 1fr); }
.status.answered { background: #e8f2ff; color: #1766a7; }

.support-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 650px;
  margin-top: 22px;
  border: 1px solid #dce5eb;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(8, 29, 48, .06);
  overflow: hidden;
}

.ticket-sidebar { min-width: 0; border-right: 1px solid #e3eaee; background: #f8fafb; }
.ticket-sidebar-head { display: flex; align-items: center; gap: 10px; min-height: 82px; padding: 16px 18px; border-bottom: 1px solid #e3eaee; }
.ticket-sidebar-head>div { min-width: 0; margin-right: auto; }
.ticket-sidebar-head small { color: #188c40; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.ticket-sidebar-head h2 { margin: 4px 0 0; font-size: 17px; }
.ticket-sidebar-head button, .ticket-sidebar-head>b { border: 0; border-radius: 8px; padding: 8px 10px; background: #0b1f35; color: #fff; font-size: 8px; font-weight: 800; cursor: pointer; }
.ticket-list { max-height: 630px; overflow-y: auto; }
.ticket-list>a { position: relative; display: grid; gap: 5px; padding: 15px 18px; border-bottom: 1px solid #e5ecef; color: #0b1f35; }
.ticket-list>a:hover, .ticket-list>a.active { background: #fff; }
.ticket-list>a.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #45e06f; }
.ticket-list strong { padding-right: 54px; font-size: 10px; line-height: 1.4; }
.ticket-list span { color: #7e909d; font-size: 7px; }
.ticket-list>a>.status { position: absolute; top: 15px; right: 14px; }
.ticket-list>a>div { display: flex; align-items: center; gap: 5px; }
.ticket-list>a>div .status { margin-left: auto; }
.ticket-empty { display: grid; place-items: center; min-height: 180px; padding: 20px; color: #81939f; font-size: 9px; text-align: center; }
.priority { display: inline-block; border-radius: 999px; padding: 4px 7px; background: #edf2f5; color: #607585; font-size: 7px; font-style: normal; text-transform: uppercase; }
.priority.high { background: #fff1d7; color: #956600; }
.priority.urgent { background: #fee9e9; color: #a52f2f; }
.priority.low { background: #edf7ef; color: #26733d; }

.ticket-conversation { display: flex; min-width: 0; min-height: 650px; flex-direction: column; background: #fff; }
.ticket-conversation>header { display: flex; align-items: flex-start; gap: 14px; min-height: 82px; padding: 16px 20px; border-bottom: 1px solid #e3eaee; }
.ticket-conversation>header>div { min-width: 0; margin-right: auto; }
.ticket-conversation>header small { color: #188c40; font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.ticket-conversation>header h2 { margin: 4px 0; font-size: 17px; overflow-wrap: anywhere; }
.ticket-conversation>header span { color: #7c8e9b; font-size: 8px; }
.message-thread { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 360px; max-height: 530px; padding: 22px; background: #f4f7f9; overflow-y: auto; }
.message-bubble { width: fit-content; max-width: 76%; border: 1px solid #dfe7ec; border-radius: 4px 14px 14px; padding: 12px 14px; background: #fff; box-shadow: 0 5px 16px rgba(8, 29, 48, .04); }
.message-bubble.admin { align-self: flex-end; border-color: #bce6c7; border-radius: 14px 4px 14px 14px; background: #eaf9ee; }
.message-bubble b { color: #173046; font-size: 8px; }
.message-bubble p { margin: 5px 0 7px; color: #354f62; font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.message-bubble small { color: #8798a4; font-size: 7px; }

.ticket-reply { display: grid; gap: 9px; padding: 14px 18px; border-top: 1px solid #e3eaee; }
.ticket-reply textarea, .ticket-dialog textarea, .ticket-dialog input, .ticket-manage select { width: 100%; border: 1px solid #ccd8df; border-radius: 9px; padding: 11px 12px; background: #fff; color: #0b1f35; resize: vertical; outline: none; }
.ticket-reply textarea:focus, .ticket-dialog textarea:focus, .ticket-dialog input:focus { border-color: #42c966; box-shadow: 0 0 0 3px rgba(69, 224, 111, .12); }
.ticket-reply>div { display: flex; justify-content: flex-end; gap: 7px; }
.ticket-close-btn { border: 1px solid #e0b6b6; border-radius: 8px; padding: 0 12px; background: #fff5f5; color: #963333; font-size: 8px; font-weight: 800; cursor: pointer; }
.ticket-closed { margin: 16px; border-radius: 9px; padding: 13px; background: #f0f3f5; color: #657987; font-size: 9px; text-align: center; }
.ticket-welcome { display: grid; place-items: center; align-content: center; min-height: 580px; padding: 35px; text-align: center; }
.ticket-welcome>b { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #e8f9ed; color: #168a3d; font-size: 22px; }
.ticket-welcome h2 { margin: 15px 0 7px; }
.ticket-welcome p { max-width: 430px; margin: 0 0 18px; color: #718491; font-size: 10px; line-height: 1.65; }
.ticket-manage { display: grid; grid-template-columns: 150px 150px auto; gap: 8px; padding: 10px 20px; border-bottom: 1px solid #e3eaee; background: #fafcfd; }
.ticket-manage label { display: grid; gap: 4px; color: #778a97; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.ticket-manage select, .ticket-manage button { min-height: 35px; }
.ticket-manage button { align-self: end; border: 0; border-radius: 8px; background: #0b1f35; color: #fff; font-size: 8px; font-weight: 800; cursor: pointer; }
.admin-ticket-reply { grid-template-columns: 1fr auto; align-items: end; }
.admin-ticket-reply .btn { min-width: 110px; }

.ticket-dialog { width: min(520px, calc(100% - 28px)); border: 1px solid #d7e1e7; border-radius: 16px; padding: 0; background: #fff; color: #0b1f35; box-shadow: 0 28px 90px rgba(4, 17, 33, .32); }
.ticket-dialog::backdrop { background: rgba(4, 14, 27, .62); backdrop-filter: blur(4px); }
.ticket-dialog .stack-form { margin: 0; padding: 22px; }
.ticket-dialog header { display: flex; align-items: flex-start; gap: 10px; }
.ticket-dialog header>div { margin-right: auto; }
.ticket-dialog header small { color: #168a3d; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.ticket-dialog header h2 { margin: 4px 0 0; }
.ticket-dialog header button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #edf2f5; color: #536a7a; cursor: pointer; }
.ticket-dialog label { display: grid; gap: 6px; color: #718491; font-size: 8px; font-weight: 800; text-transform: uppercase; }

@media (max-width: 1050px) {
  .admin-body .stats { grid-template-columns: repeat(3, 1fr); }
  .support-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .pricing-cost-tip, .profit-summary { grid-column: auto; }
  .profit-summary { grid-template-columns: 1fr; }
  .support-widget { right: 14px; bottom: 14px; }
  .support-fab { width: 43px; height: 43px; }
  .admin-body .stats { grid-template-columns: 1fr 1fr; }
  .support-layout { grid-template-columns: 1fr; min-height: 0; }
  .ticket-sidebar { border-right: 0; border-bottom: 1px solid #e3eaee; }
  .ticket-list { max-height: 260px; }
  .ticket-conversation { min-height: 540px; }
  .message-thread { max-height: 420px; padding: 14px; }
  .message-bubble { max-width: 90%; }
  .ticket-manage { grid-template-columns: 1fr 1fr; }
  .ticket-manage button { grid-column: 1 / -1; }
  .admin-ticket-reply { grid-template-columns: 1fr; }
}
