@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/vazirmatn-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/vazirmatn-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lalezar";
  src: url("/static/fonts/lalezar-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --ink: #1b2530;
  --muted: #667786;
  --brand: #1f4b6e;
  --brand-2: #304f67;
  --danger: #8c2f39;
  --line: #d8e0e7;
  --ok: #2f6b57;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(25, 43, 58, 0.1);
  --glow: 0 18px 45px rgba(23, 49, 74, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Vazirmatn", sans-serif;
  font-size: 15px;
  background: radial-gradient(circle at 12% 8%, rgba(228, 236, 244, 0.95) 0%, transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(222, 232, 240, 0.95) 0%, transparent 36%),
    linear-gradient(180deg, #f5f7fa 0%, #eef3f7 100%);
  color: var(--ink);
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
}

body.landing-page {
  background: radial-gradient(circle at 15% 12%, rgba(246, 213, 160, 0.24) 0%, transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(110, 166, 196, 0.18) 0%, transparent 32%),
    linear-gradient(180deg, #fcfaf6 0%, #f3f7fb 100%);
}

body.dashboard-page {
  background: radial-gradient(circle at 8% 14%, rgba(64, 129, 164, 0.18) 0%, transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(249, 184, 126, 0.12) 0%, transparent 25%),
    linear-gradient(180deg, #eef4f8 0%, #e7eef5 100%);
}

.bg-shape {
  position: fixed;
  z-index: -1;
  filter: blur(35px);
  opacity: 0.22;
}

.bg-shape-a {
  width: 260px;
  height: 260px;
  top: -60px;
  right: -40px;
  background: #c9d8e5;
  border-radius: 42% 58% 56% 44% / 48% 37% 63% 52%;
  animation: floatA 8s ease-in-out infinite;
}

.bg-shape-b {
  width: 320px;
  height: 280px;
  bottom: -80px;
  left: -60px;
  background: #d4dde7;
  border-radius: 61% 39% 31% 69% / 43% 42% 58% 57%;
  animation: floatB 11s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(14px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
  align-items: stretch;
  gap: 18px;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0;
  font-family: "Lalezar", cursive;
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 2;
}

.hero-copy {
  padding: 12px 4px 12px 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.hero-login-btn {
  padding-inline: 22px;
  min-height: 48px;
  box-shadow: 0 14px 30px rgba(31, 75, 110, 0.22);
}

.hero-inline-note {
  color: #456173;
  font-size: 0.92rem;
}

.hero-spotlight {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 20px;
  background: linear-gradient(160deg, rgba(22, 49, 71, 0.95), rgba(46, 84, 112, 0.9));
  border-color: rgba(33, 68, 95, 0.35);
  color: #f7fbff;
}

.spotlight-kicker,
.section-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.spotlight-kicker {
  background: rgba(255, 255, 255, 0.12);
  color: #dfeefa;
}

.section-label {
  background: #eef4f8;
  color: #355569;
}

.spotlight-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.7;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spotlight-grid div {
  border: 1px solid rgba(228, 240, 248, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.spotlight-grid strong {
  display: block;
  margin-bottom: 6px;
}

.spotlight-grid p {
  margin: 0;
  color: rgba(239, 247, 253, 0.82);
  line-height: 1.9;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.mode-switch {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid #ccd6df;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 8px 18px rgba(25, 43, 58, 0.12);
}

.mode-btn {
  border: 0;
  background: transparent;
  color: #506273;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, #1f4b6e, #2b5f86);
  color: #fff;
  box-shadow: 0 8px 16px rgba(31, 75, 110, 0.3);
}

.mode-btn:not(.active):hover {
  background: #f4f7fa;
  color: #324a5d;
}

.hero-badges span {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(209, 220, 230, 0.95);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.landing-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.landing-story {
  grid-column: span 7;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 253, 0.98));
}

.landing-story h2,
.landing-cta-band h2 {
  margin: 12px 0 10px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.7;
}

.landing-story p,
.landing-cta-band p {
  margin: 0;
  line-height: 2;
  color: #526a79;
}

.story-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.story-points article,
.metric-card {
  border: 1px solid #dce7ef;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f9fcff);
}

.story-points strong,
.metric-card strong {
  display: block;
  margin-bottom: 8px;
  color: #17384c;
}

.story-points p,
.metric-card p {
  margin: 0;
  color: #5f7383;
  line-height: 1.9;
}

.landing-metrics {
  grid-column: span 5;
  background: linear-gradient(180deg, #ffffff, #f5f9fc);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric-card span {
  display: inline-flex;
  margin-bottom: 10px;
  color: #2b5f86;
  font-weight: 800;
}

.landing-cta-band {
  grid-column: span 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fbfe, #edf4f8);
}

.landing-cta-btn {
  min-width: 140px;
  min-height: 48px;
  box-shadow: 0 14px 26px rgba(58, 78, 97, 0.2);
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  animation: riseIn 0.45s ease-out;
}

.glass-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(12px);
  box-shadow: var(--glow);
}

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

#public-panel,
#auth-panel,
#activity-panel {
  grid-column: span 4;
}

#public-note-panel {
  grid-column: span 4;
}

#dashboard-panel {
  grid-column: span 12;
  background: linear-gradient(180deg, #ffffff, #f9fcff);
  padding: 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view {
  margin-top: 12px;
  border: 1px solid #d9e3eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 14px;
}

.view h3 {
  margin-bottom: 10px;
  color: #223847;
}

h2,
h3 {
  margin: 0;
}

small {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-feedback {
  border: 1px solid #e7c8cd;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f8, #fff1f3);
  color: #8c2f39;
  padding: 10px 12px;
  line-height: 1.8;
  font-size: 0.9rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 147, 150, 0.12);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.btn-primary {
  background: linear-gradient(135deg, #1f4b6e, #2b5f86);
}

.btn-secondary {
  background: linear-gradient(135deg, #3a4e61, #4a6073);
}

.btn-accent {
  background: linear-gradient(135deg, #4a6073, #5d7387);
}

.btn-danger {
  background: linear-gradient(135deg, #8c2f39, #7a2530);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.62);
  color: #27465c;
  border: 1px solid rgba(173, 193, 208, 0.95);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid #d3dce4;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f9fb, #eff3f7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(25, 43, 58, 0.08);
}

.menu button {
  border: 1px solid #d4dde5;
  background: #ffffff;
  color: #344b5d;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.22s ease;
}

.menu button.active {
  border-color: #2b5f86;
  background: linear-gradient(135deg, #1f4b6e, #2b5f86);
  color: #fff;
  box-shadow: 0 9px 18px rgba(31, 75, 110, 0.26);
}

.menu button:not(.active):hover {
  transform: translateY(-1px);
  border-color: #b7c7d4;
  background: #f8fafc;
}

.menu button:focus-visible,
.mode-btn:focus-visible {
  outline: 3px solid rgba(10, 147, 150, 0.3);
  outline-offset: 2px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}

.profile-main-card {
  border: 1px solid #dce7ef;
  border-radius: 16px;
  background: linear-gradient(160deg, #f4fafc, #ffffff 48%);
  padding: 14px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f4b6e, #2b5f86);
  color: #fff;
  font-weight: 800;
}

.profile-name {
  font-weight: 800;
}

.profile-email {
  color: #587181;
  font-size: 0.9rem;
}

.profile-meta-list {
  display: grid;
  gap: 7px;
}

.profile-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #e3ebf1;
  padding-bottom: 6px;
}

.profile-meta-label {
  color: #587181;
}

.profile-meta-value {
  font-weight: 700;
}

.profile-side-card {
  border: 1px solid #dce7ef;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 9px;
}

.profile-template-card {
  grid-column: 1 / -1;
  border: 1px solid #dce7ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff, #f4f9fc);
  padding: 16px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-manager {
  border: 1px solid #dbe7ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.template-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.template-manager-head h4 {
  margin: 0;
  color: #17384c;
}

.template-manager-head p {
  margin: 6px 0 0;
  color: #5c7282;
  line-height: 1.8;
  font-size: 0.88rem;
}

.template-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf5fb;
  border: 1px solid #d8e7f2;
  color: #234c69;
  font-weight: 700;
  font-size: 0.82rem;
}

.template-label {
  display: inline-block;
  margin-bottom: 6px;
  color: #4f6574;
  font-weight: 700;
}

.template-form-actions {
  display: flex;
  justify-content: flex-start;
}

.template-list {
  display: grid;
  gap: 10px;
}

.template-item {
  border: 1px solid #dde7ee;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.template-item-input,
.template-create-form textarea {
  width: 100%;
  border: 1px solid #d5e0e8;
  border-radius: 12px;
  background: #fcfeff;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  resize: vertical;
  min-height: 92px;
  line-height: 1.9;
}

.template-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-empty-state {
  min-height: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.online {
  background: #e8f8f0;
  color: #1f7a58;
  border: 1px solid #c8ecd9;
}

.status-pill.offline {
  background: #eef2f6;
  color: #53687a;
  border: 1px solid #d7e0e8;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f2f7ff;
  border: 1px solid #d7e5ff;
  color: #28558a;
  font-weight: 700;
}

.profile-presence-form {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #dce7ef;
  border-radius: 14px;
  background: #fbfdff;
}

.presence-label {
  color: #5f7383;
  font-size: 0.9rem;
  align-self: center;
}

.stack {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.item .meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
}

.tickets-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.6fr);
  gap: 14px;
  margin-top: 10px;
}

.tickets-list {
  max-height: 640px;
  overflow: auto;
  padding-right: 6px;
}

.tickets-list::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.menu::-webkit-scrollbar,
.toast::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tickets-list::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.menu::-webkit-scrollbar-thumb,
.toast::-webkit-scrollbar-thumb {
  background: #c4d3df;
  border-radius: 999px;
}

.ticket-card {
  border: 1px solid #d7e1ea;
  border-radius: 14px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  cursor: pointer;
}

.ticket-card:hover {
  border-color: #8fb6c6;
  transform: translateY(-1px);
}

.ticket-card.active {
  border-color: #2b5f86;
  box-shadow: 0 8px 18px rgba(31, 75, 110, 0.18);
}

.ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ticket-id {
  color: #2b5f86;
  font-weight: 700;
}

.ticket-title {
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
  border: 1px solid #d8e4eb;
  background: #f7fbfe;
}

.chip-attachment {
  background: #fff4e7;
  border-color: #f1d4ab;
  color: #8a5415;
}

.ticket-detail-panel {
  margin-top: 0;
  min-height: 440px;
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  border-style: solid;
}

.conversation-head {
  border-bottom: 1px solid #e2eaf0;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ticket-attachments-block {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dfe8ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff, #f6fafd);
}

.ticket-attachments-head {
  margin-bottom: 10px;
}

.ticket-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.attachment-card {
  border: 1px solid #d9e4ec;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 10px;
  cursor: zoom-in;
  text-align: right;
  box-shadow: 0 8px 18px rgba(20, 43, 60, 0.06);
}

.attachment-card:hover {
  border-color: #88aebe;
  transform: translateY(-1px);
}

.attachment-thumb-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #f1f6fa, #e9f0f5);
}

.attachment-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-meta {
  display: grid;
  gap: 4px;
}

.attachment-meta strong {
  color: #17384c;
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
}

.attachment-meta small {
  color: #6b808e;
  font-size: 0.76rem;
}

.agent-attachment-field small {
  color: #617888;
  line-height: 1.8;
}

.agent-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
  color: #617888;
  font-size: 0.86rem;
}

.agent-selected-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4f8fb;
  border: 1px solid #d9e4ec;
  color: #24445a;
}

.agent-selected-file small {
  color: #6b808e;
}

.agent-template-hint {
  border: 1px dashed #cfe0ea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f7fbfd;
  color: #536b7b;
  font-size: 0.88rem;
  line-height: 1.9;
}

.conversation-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-left: 4px;
}

.message-bubble {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid #e0e8ee;
  background: #fff;
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.message-delete-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #d8c4c7;
  border-radius: 999px;
  background: #fff6f7;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
}

.message-delete-btn:hover:not(:disabled) {
  background: #fdecee;
}

.message-delete-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

.message-bubble.user {
  justify-self: end;
  background: #eef8ff;
  border-color: #c7dfef;
}

.message-bubble.agent {
  justify-self: start;
  background: #edfbf7;
  border-color: #caece2;
}

.message-bubble.system {
  justify-self: center;
  background: #fff8e8;
  border-color: #f2ddb1;
}

.message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
}

.message-meta {
  margin-top: 6px;
  color: #647b8a;
  font-size: 0.78rem;
}

.empty-ticket-state {
  color: #708391;
  padding: 16px;
}

.pre {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #12202b;
  color: #f5f9ff;
  padding: 12px;
  overflow-x: auto;
  min-height: 220px;
}

.reports-canvas {
  margin-top: 12px;
  border: 1px solid #dce7ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f9fcff);
  padding: 13px;
  min-height: 220px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.kpi-card {
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #fff;
  padding: 11px;
}

.kpi-label {
  color: #5f7383;
  font-size: 0.82rem;
}

.kpi-value {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #17384c;
}

.report-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-block {
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #fff;
  padding: 11px;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tickets-workspace {
    grid-template-columns: minmax(250px, 1fr) minmax(320px, 1.5fr);
  }
}

.report-block h4 {
  margin: 0 0 8px;
  color: #1b4c66;
}

.report-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #e3edf4;
  padding-bottom: 5px;
}

.report-count {
  color: #1f7a58;
  font-weight: 700;
}

.report-table-wrap {
  overflow: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid #e3edf4;
  padding: 8px;
  text-align: right;
  white-space: nowrap;
}

.report-table th {
  background: #f5f9fc;
  color: #355569;
  font-weight: 700;
}

.faq-item {
  border: 1px solid #dce7ef;
  border-radius: 10px;
  padding: 9px;
  background: #fff;
}

.faq-question {
  font-weight: 700;
  color: #203949;
}

.faq-meta {
  margin-top: 4px;
  color: #587181;
  font-size: 0.85rem;
}

.faq-samples {
  margin-top: 7px;
  color: #2f4e62;
  font-size: 0.85rem;
}

.toast {
  white-space: pre-wrap;
  max-height: 500px;
  overflow: auto;
  color: #15303f;
  line-height: 1.8;
}

.session {
  margin-top: 10px;
  background: #edf7f5;
  border: 1px solid #cde7e1;
  border-radius: 10px;
  padding: 10px;
  color: #184e59;
}

.password-meter-box {
  display: grid;
  gap: 6px;
}

.password-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e6edf2;
  overflow: hidden;
}

.password-meter > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
  background: #9aa9b5;
}

.password-meter.weak > span {
  background: #bb3e03;
}

.password-meter.medium > span {
  background: #ee9b00;
}

.password-meter.strong > span {
  background: #2a9d8f;
}

#view-password {
  max-width: 720px;
}

#logout-btn {
  margin-top: 0;
  width: auto;
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 23, 33, 0.58);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 14px;
}

.auth-modal-card {
  width: min(560px, 96vw);
  border: 1px solid #c8d6de;
  animation: riseIn 0.28s ease-out;
}

.confirm-modal-card {
  width: min(460px, 94vw);
}

.image-preview-modal-card {
  width: min(960px, 96vw);
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-height: 360px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid #dce6ed;
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fcff, #f2f7fb);
  padding: 14px;
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(72vh - 32px);
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(20, 43, 60, 0.12);
}

.confirm-modal-body {
  margin: 8px 0 18px;
  padding: 14px 16px;
  border: 1px solid #e2e9ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff, #f5f9fc);
  color: #304756;
  line-height: 1.9;
}

.confirm-modal-body p {
  margin: 0;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-close {
  border: 1px solid #cad8e3;
  background: #fff;
  color: #355569;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

code {
  background: #eef3f7;
  border-radius: 8px;
  padding: 2px 6px;
}

.hidden {
  display: none !important;
}

.landing-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #17384c, #2b5f86);
  color: #fff;
  font-family: "Lalezar", cursive;
  font-size: 1.3rem;
  box-shadow: 0 14px 28px rgba(31, 75, 110, 0.24);
}

.brand-lockup strong,
.sidebar-brand strong {
  display: block;
  color: #19384e;
}

.brand-lockup div:last-child,
.sidebar-brand small {
  color: #5d7686;
  font-size: 0.9rem;
}

.landing-home {
  display: grid;
  gap: 18px;
}

.hero-landing {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  padding: 8px 0;
}

.hero-copy-landing {
  padding-top: 24px;
}

.hero-secondary-btn {
  color: #234357;
}

.hero-showcase {
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 249, 240, 0.88), rgba(243, 250, 255, 0.78));
}

.showcase-header {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.showcase-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 12px;
  background: #18384c;
  color: #fff;
  font-size: 0.78rem;
}

.showcase-flow {
  display: grid;
  gap: 12px;
}

.showcase-step {
  border: 1px solid #dbe6ee;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.showcase-step span,
.feature-index,
.preview-card span {
  display: inline-flex;
  font-weight: 800;
  color: #2b5f86;
  margin-bottom: 8px;
}

.showcase-step h3,
.feature-card h3,
.preview-card strong {
  margin: 0 0 8px;
  color: #153347;
}

.showcase-step p,
.feature-card p,
.preview-card p {
  margin: 0;
  color: #5e7687;
  line-height: 1.9;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-featured {
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 252, 0.95));
}

.feature-featured h2 {
  margin: 12px 0 10px;
  line-height: 1.7;
}

.feature-card {
  display: grid;
  align-content: start;
  min-height: 100%;
}

.soft-amber {
  background: linear-gradient(180deg, #fff7ef, #fffdf9);
}

.soft-blue {
  background: linear-gradient(180deg, #f2f8ff, #fbfdff);
}

.soft-green {
  background: linear-gradient(180deg, #f1fbf7, #fbfffd);
}

.landing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #17384c, #2a506b 54%, #f0c58a 180%);
  color: #fff;
}

.landing-banner .section-label {
  background: rgba(255, 255, 255, 0.12);
  color: #f6fbff;
}

.landing-banner h2 {
  margin: 12px 0 10px;
}

.landing-banner p {
  color: rgba(241, 248, 252, 0.82);
  margin: 0;
}

.mobile-landing-bar {
  display: none;
}

.dashboard-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #17384c, #274b63);
  color: #f4f9fc;
  min-height: calc(100vh - 48px);
}

.dashboard-sidebar .brand-mark {
  background: linear-gradient(135deg, #f3c488, #f7d6a9);
  color: #17384c;
}

.dashboard-sidebar .sidebar-brand strong,
.dashboard-sidebar h1,
.dashboard-sidebar strong {
  color: #fff;
}

.dashboard-sidebar .sidebar-brand small,
.dashboard-sidebar p {
  color: rgba(233, 242, 247, 0.78);
}

.sidebar-copy h1 {
  margin: 14px 0 10px;
  font-size: 2rem;
  line-height: 1.45;
}

.sidebar-highlights {
  display: grid;
  gap: 12px;
}

.sidebar-highlights div {
  border: 1px solid rgba(239, 248, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.dashboard-sidebar .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
  border-color: rgba(255, 255, 255, 0.12);
}

.dashboard-main {
  display: grid;
  gap: 16px;
}

.dashboard-welcome {
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.92));
}

.dashboard-welcome h2 {
  margin: 12px 0 10px;
  line-height: 1.7;
}

.dashboard-welcome p {
  margin: 0;
  color: #5b7383;
  line-height: 1.95;
}

.dashboard-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.preview-card {
  border: 1px solid #dce7ef;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #fdfefe, #f7fbfe);
}

.dashboard-panel-elevated {
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow: 0 20px 45px rgba(20, 43, 60, 0.12);
}

.dashboard-head {
  align-items: center;
}

.dashboard-head small {
  display: block;
  margin-top: 4px;
}

.mobile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mobile-section-head h3 {
  margin: 0;
}

.mobile-filter-toggle {
  display: none;
}

.mobile-dock {
  display: none;
}

@media (max-width: 1100px) {
  .landing-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    min-height: auto;
    gap: 14px;
  }

  .dashboard-preview-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .landing-story,
  .landing-metrics {
    grid-column: span 12;
  }

  .story-points {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #public-panel,
  #public-note-panel,
  #auth-panel,
  #activity-panel {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  body {
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .panel {
    border-radius: 20px;
    padding: 14px;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1rem;
  }

  .hero {
    flex-direction: column;
    gap: 14px;
  }

  .hero-copy {
    padding-left: 0;
    padding-top: 0;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    line-height: 1.35;
  }

  .hero p,
  .landing-story p,
  .landing-banner p,
  .dashboard-welcome p {
    line-height: 1.95;
    font-size: 0.95rem;
  }

  .landing-topbar,
  .landing-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .landing-topbar {
    position: sticky;
    top: 8px;
    z-index: 20;
    padding: 12px 14px;
    border: 1px solid rgba(214, 224, 232, 0.95);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
  }

  .brand-lockup,
  .sidebar-brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .spotlight-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .landing-cta-band {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .landing-topbar .btn,
  .landing-banner .btn,
  .sidebar-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .landing-grid {
    gap: 12px;
  }

  .feature-featured,
  .feature-card,
  .hero-showcase,
  .dashboard-welcome {
    padding: 16px;
  }

  .showcase-flow,
  .sidebar-highlights,
  .dashboard-preview-grid,
  .story-points {
    gap: 10px;
  }

  .dashboard-shell,
  .landing-shell {
    width: 100%;
  }

  .dashboard-shell {
    gap: 12px;
  }

  .dashboard-sidebar {
    min-height: auto;
    padding: 16px;
    border-radius: 24px;
    position: relative;
    top: 0;
  }

  .sidebar-copy h1 {
    font-size: 1.45rem;
    margin: 10px 0 8px;
  }

  .sidebar-copy p {
    font-size: 0.93rem;
    line-height: 1.9;
  }

  .sidebar-highlights {
    grid-template-columns: 1fr;
  }

  .sidebar-highlights div {
    padding: 12px;
  }

  .head-tools {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .dashboard-head {
    gap: 12px;
    align-items: stretch;
  }

  .mobile-filter-toggle {
    display: inline-flex;
    width: auto;
    min-width: 108px;
  }

  .ticket-filter-form {
    overflow: hidden;
    transition: max-height 0.24s ease, opacity 0.24s ease, margin 0.24s ease;
    max-height: 240px;
    opacity: 1;
  }

  .ticket-filter-form.mobile-collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
  }

  .menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .menu button {
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
  }

  .view {
    padding: 11px;
    border-radius: 14px;
  }

  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.92rem;
  }

  textarea {
    min-height: 120px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tickets-workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ticket-attachments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tickets-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .ticket-card {
    border-radius: 16px;
    padding: 14px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-block-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    gap: 4px;
  }

  .ticket-detail-panel {
    min-height: 240px;
    padding: 12px;
  }

  .ticket-attachments-block {
    padding: 10px;
  }

  .attachment-card {
    padding: 8px;
    border-radius: 14px;
  }

  .conversation-list {
    max-height: none;
    overflow: visible;
  }

  .message-bubble {
    max-width: 100%;
  }

  .report-table-wrap {
    margin: 0 -4px;
  }

  .report-table th,
  .report-table td {
    padding: 10px 8px;
    font-size: 0.84rem;
  }

  #logout-btn {
    width: 100%;
  }

  .auth-modal {
    align-items: end;
    padding: 10px;
  }

  .auth-modal-card,
  .confirm-modal-card {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    border-radius: 22px 22px 18px 18px;
  }

  .image-preview-stage {
    min-height: 240px;
    max-height: 62vh;
    padding: 10px;
  }

  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .mobile-landing-bar {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(214, 224, 232, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(20, 43, 60, 0.16);
  }

  .mobile-dock {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    border: 1px solid rgba(205, 217, 227, 0.95);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 253, 0.92));
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 38px rgba(20, 43, 60, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .mobile-dock button {
    flex: 1 0 clamp(72px, 18vw, 96px);
    min-width: clamp(72px, 18vw, 96px);
    max-width: 104px;
    border: 1px solid #d7e3eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f4f8fb);
    color: #234357;
    min-height: 48px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: -0.1px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(24, 52, 73, 0.06);
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 0 10px;
  }

  .mobile-dock button.active {
    background: linear-gradient(135deg, #17384c, #2b5f86);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 22px rgba(25, 63, 92, 0.26);
    transform: translateY(-1px);
  }

  .mobile-dock::-webkit-scrollbar {
    display: none;
  }

  body.dashboard-page {
    padding-bottom: 96px;
  }

  body.landing-page {
    padding-bottom: 88px;
  }

  #public-panel,
  #public-note-panel,
  #auth-panel,
  #activity-panel,
  #dashboard-panel,
  .landing-story,
  .landing-metrics,
  .landing-cta-band {
    grid-column: span 12;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
