/* ===================== Axus Hub — Client Portal ===================== */
/* Brand: Axus orange #F26522, slate #2A2F3A, tagline orange #F7941D     */

:root {
  /* Brand */
  --orange: #f26522;
  --orange-2: #f7941d;
  --orange-deep: #d9501a;
  --grad: linear-gradient(120deg, #f26522 0%, #f7941d 100%);

  /* Light theme (default) */
  --bg: #f4f5f7;
  --bg-soft: #eceef1;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #1f2430;
  --text-soft: #5a6373;
  --muted: #8a93a3;
  --border: #e6e8ec;
  --topbar: #ffffff;
  --topbar-text: #1f2430;
  --shadow: 0 6px 24px rgba(31, 36, 48, 0.08);
  --shadow-lg: 0 16px 48px rgba(31, 36, 48, 0.14);
  --ring: rgba(242, 101, 34, 0.18);
}

html[data-theme="dark"] {
  --bg: #11141b;
  --bg-soft: #0c0f15;
  --surface: #1a1f29;
  --surface-2: #20262f;
  --text: #eef1f6;
  --text-soft: #b3bccb;
  --muted: #7f8a9c;
  --border: #2a313d;
  --topbar: #161b23;
  --topbar-text: #eef1f6;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --ring: rgba(242, 101, 34, 0.30);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
h1, h2, h3 { font-family: "Poppins", "Inter", sans-serif; margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: none; border-radius: 10px; padding: 10px 18px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: var(--grad);
  box-shadow: 0 6px 18px var(--ring);
}
.btn-primary:hover { box-shadow: 0 10px 26px var(--ring); }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn-ghost {
  background: transparent; color: var(--text-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 17px; line-height: 1;
  display: grid; place-items: center;
  transition: transform .2s ease, background .2s;
}
.theme-toggle:hover { transform: rotate(-18deg) scale(1.06); }
.theme-toggle-float { position: fixed; top: 22px; right: 22px; z-index: 5; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 50% -10%, #2a2f3a 0%, #11141b 60%);
}
.login-aurora {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 80% 10%, rgba(242,101,34,.35), transparent 70%),
    radial-gradient(500px 320px at 12% 90%, rgba(247,148,29,.30), transparent 70%);
  filter: blur(6px); pointer-events: none;
}
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  background: var(--surface); border-radius: 20px; padding: 38px 34px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  text-align: center; animation: rise .5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-logo { height: 46px; margin-bottom: 18px; object-fit: contain; }
html[data-theme="dark"] .login-logo { filter: brightness(0) invert(1) drop-shadow(0 0 0 #fff); }
.login-card h1 { font-size: 24px; }
.login-sub { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.login-foot { margin-top: 22px; color: var(--muted); font-size: 13px; letter-spacing: .5px; }
.login-foot span { color: var(--orange); font-weight: 700; }

/* ---------- Forms ---------- */
form label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 14px; }
input, textarea, select {
  width: 100%; margin-top: 6px; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; transition: border .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--ring);
}
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: #e5484d; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--topbar);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 4;
}
.topbar-logo { height: 34px; object-fit: contain; }
html[data-theme="dark"] .topbar-logo { filter: brightness(0) invert(1); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.who-name { font-weight: 600; font-size: 14px; }
.who-company { color: var(--muted); font-size: 12px; }
.accent-strip { height: 4px; background: var(--grad); }

/* ---------- Container / pages ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 30px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h2 { font-size: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-title { font-size: 15px; margin-bottom: 16px; }

/* ---------- Ticket list ---------- */
.ticket-list { display: flex; flex-direction: column; gap: 14px; }
.ticket-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s;
}
.ticket-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--orange); }
.tc-prio-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--muted); }
.tc-body { flex: 1; min-width: 0; }
.tc-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.tc-sub { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.tc-ref { font-weight: 600; color: var(--orange); }

/* ---------- Badges / chips ---------- */
.badge { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; text-transform: capitalize; white-space: nowrap; }
.badge.open        { background: #e7f0ff; color: #2563eb; }
.badge.in_progress { background: #fff3e0; color: #d9701a; }
.badge.waiting     { background: #f3e8ff; color: #8b5cf6; }
.badge.resolved    { background: #e7f8ef; color: #16a34a; }
.badge.closed      { background: #eef0f3; color: #6b7280; }
html[data-theme="dark"] .badge.open        { background: rgba(37,99,235,.18); color: #7aa7ff; }
html[data-theme="dark"] .badge.in_progress { background: rgba(217,112,26,.20); color: #f0a35a; }
html[data-theme="dark"] .badge.waiting     { background: rgba(139,92,246,.20); color: #c4a8ff; }
html[data-theme="dark"] .badge.resolved    { background: rgba(22,163,74,.20); color: #5fd693; }
html[data-theme="dark"] .badge.closed      { background: rgba(107,114,128,.22); color: #aab2bf; }

.prio { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.prio.low { color: #16a34a; } .prio.medium { color: #2563eb; }
.prio.high { color: var(--orange); } .prio.critical { color: #e5484d; }
.chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft);
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 8px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; }
.empty-emoji { font-size: 42px; }
.empty h3 { margin: 12px 0 6px; }
.empty p { margin-bottom: 18px; }

/* ---------- Detail ---------- */
.back-link { background: none; border: none; color: var(--text-soft); font: inherit; font-weight: 600;
  cursor: pointer; margin-bottom: 16px; padding: 4px 0; }
.back-link:hover { color: var(--orange); }
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ref-pill { font-weight: 700; color: var(--orange); font-size: 14px; }
#d-title { font-size: 20px; margin-bottom: 10px; }
.detail-desc { color: var(--text-soft); line-height: 1.6; white-space: pre-wrap; }
.meta-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------- Conversation thread ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msg { display: flex; gap: 12px; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.msg.them .msg-avatar { background: var(--grad); }
.msg.me .msg-avatar { background: #4b5563; }
.msg-bubble { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; flex: 1; }
.msg.me .msg-bubble { background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box; }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.msg-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.thread-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px; }
.reply-form { border-top: 1px solid var(--border); padding-top: 16px; }
.reply-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- Attachments ---------- */
.attach-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.attach-item { display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.attach-item a { color: var(--text); text-decoration: none; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item a:hover { color: var(--orange); }
.attach-size { color: var(--muted); font-size: 11.5px; }
.upload-box { display: block; text-align: center; border: 1.5px dashed var(--border);
  border-radius: 10px; padding: 14px; cursor: pointer; color: var(--text-soft);
  font-size: 13px; font-weight: 600; transition: border .2s, color .2s; }
.upload-box:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(17,20,27,.55);
  backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 18px;
  padding: 26px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: rise .3s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font-size: 19px; }
.modal-x { background: none; border: none; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 50; animation: rise .25s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .who { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
