/* Version: 1.16.0 */
/* Updated: 2026-05-13T00:00:00Z */
/* Git Branch: main */
/* Git Remote: git@git:/home/git/repos/ticket-rokumanage.git */
:root {
  --bg: #f3ede2;
  --bg-accent: #e0d2b8;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffaf2;
  --text: #1f2933;
  --muted: #5d6a75;
  --line: rgba(31, 41, 51, 0.12);
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(87, 70, 42, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 30%),
    linear-gradient(145deg, var(--bg) 0%, #efe1cc 45%, var(--bg-accent) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-layout,
.page-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.otp-auth-layout {
  width: min(520px, calc(100% - 24px));
}

.auth-card,
.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(480px, 100%);
  padding: 40px;
}

.otp-auth-card {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--surface);
  box-shadow:
    var(--shadow);
  backdrop-filter: blur(14px);
}

.otp-auth-card::before {
  content: "";
  position: absolute;
  inset: -60px auto auto -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
}

.otp-auth-card::after {
  content: "";
  position: absolute;
  inset: auto -50px -70px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.08) 0%, rgba(15, 118, 110, 0) 72%);
  pointer-events: none;
}

.page-shell {
  padding: 28px 0 48px;
}

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

.topbar-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: max-content;
}

.topbar-email {
  display: inline-block;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.topbar-actions form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.app-title,
h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--muted);
}

.muted,
.hint {
  color: var(--muted);
}

.otp-eyebrow {
  margin-bottom: 8px;
}

.otp-title {
  color: var(--text);
}

.otp-intro {
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.otp-timer {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.turnstile-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.turnstile-wrap .cf-turnstile {
  margin: 0 auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 51, 0.32);
  backdrop-filter: blur(8px);
}

.otp-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.otp-modal-card {
  width: min(560px, calc(100vw - 32px));
  position: relative;
  padding: 40px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.otp-modal-eyebrow {
  margin-bottom: 12px;
}

.otp-modal-intro {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.otp-modal-timer {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.otp-modal-flashes {
  margin-top: 18px;
  margin-bottom: 0;
}

.otp-modal-form {
  margin-top: 28px;
  justify-items: center;
}

.otp-modal-form label {
  width: min(100%, 400px);
  text-align: center;
}

.otp-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(100%, 400px);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.otp-slot {
  min-height: 72px;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid rgba(31, 41, 51, 0.12);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.otp-slot:first-child {
  border-left: 0;
}

.otp-slot-filled {
  background: rgba(255, 255, 255, 0.96);
}

.otp-slot-active {
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.otp-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.otp-modal-submit {
  width: min(100%, 480px);
  margin-top: 8px;
  min-height: 54px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow:
    0 12px 24px rgba(15, 118, 110, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.otp-modal-back-link {
  width: min(100%, 480px);
  text-decoration: none;
}

label {
  font-weight: 600;
}

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

button,
.button-link {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.desktop-app-link {
  justify-self: center;
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border: 1px solid var(--line);
}

.detail-header-inline {
  display: inline-flex;
  align-items: center;
}

.inline-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5ch;
  padding: 0;
  min-height: auto;
  font-size: 0.42em;
  font-weight: 400;
  line-height: 1;
  vertical-align: middle;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  top: 0.02em;
}

.inline-back-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

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

.flash-error {
  background: rgba(180, 35, 24, 0.1);
  border: 1px solid rgba(180, 35, 24, 0.18);
  color: var(--danger);
}

@media (max-width: 640px) {
  .otp-modal {
    padding: 16px;
  }

  .otp-modal-card {
    padding: 28px 20px 24px;
  }

  .otp-slot {
    min-height: 62px;
    font-size: 1.38rem;
  }
}

.panel {
  padding: 28px;
}

.ticket-list-panel {
  padding: 32px 36px 30px;
}

.landing-shell {
  width: 100%;
}

.landing-auth-card {
  width: min(620px, 100%);
}

.landing-topbar {
  display: block;
}

.landing-eyebrow {
  margin: 0;
}

.landing-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.landing-user-email {
  color: var(--muted);
}

.landing-logout-form {
  margin: 0;
}

.landing-actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.landing-choice-form {
  margin: 0;
}

.landing-button {
  width: 100%;
  min-height: 52px;
  text-align: center;
  font-size: 1rem;
}

.landing-choice-form .landing-button:hover {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.ticket-create-card {
  width: min(760px, 100%);
}

.ticket-create-title {
  margin-top: 4px;
  font-size: 1.7rem;
}

.ticket-create-email {
  margin: 18px 0 0;
  color: var(--muted);
}

.ticket-create-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.ticket-create-field {
  display: grid;
  gap: 10px;
}

.ticket-create-field label {
  font-size: 1rem;
}

.ticket-create-field textarea {
  min-height: 260px;
}

.ticket-create-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.ticket-create-actions-left,
.ticket-create-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ticket-create-cancel {
  min-width: 120px;
}

.ticket-create-file-input {
  display: none;
}

.ticket-create-attach-trigger {
  min-width: 130px;
}

.ticket-create-file-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ticket-create-attachments {
  display: grid;
  gap: 8px;
}

.ticket-create-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.ticket-create-attachment-name {
  font-size: 0.92rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ticket-create-attachment-remove {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  font-weight: 700;
  line-height: 1;
}

.detail-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.ticket-list-actions {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-back-button {
  min-width: 120px;
}

.ticket-export-button {
  gap: 8px;
  min-width: 168px;
}

.excel-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: #1f7a3f;
}

.excel-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.excel-icon-sheet {
  fill: rgba(31, 122, 63, 0.14);
  stroke: currentColor;
  stroke-width: 1.8;
}

.excel-icon-fold,
.excel-icon-mark {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 41, 51, 0.28);
  backdrop-filter: blur(10px);
  z-index: 40;
}

.loading-overlay-open {
  overflow: hidden;
}

.loading-card {
  width: min(640px, calc(100vw - 32px));
  padding: 22px 24px 20px;
  background: rgba(255, 250, 242, 0.95);
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 54px rgba(31, 41, 51, 0.16);
}

.loading-card-text {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.loading-progress {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.12);
}

.loading-progress-bar {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.22) 75%, transparent 75%, transparent 100%),
    linear-gradient(90deg, #0f766e 0%, #16998f 100%);
  background-size: 18px 18px, 100% 100%;
  animation: loading-progress-slide 1.25s linear infinite;
}

.panel-head,
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.conversation-item,
.table-wrap {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.table-wrap {
  overflow-x: auto;
  padding: 12px 14px;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.col-ticket-id {
  width: 13%;
}

.col-subject {
  width: 30%;
}

.col-status {
  width: 10%;
}

.col-channel {
  width: 14%;
}

.col-created,
.col-closed {
  width: 16.5%;
}

.ticket-table-account .col-ticket-id {
  width: 11%;
}

.ticket-table-account .col-owner {
  width: 18%;
}

.ticket-table-account .col-subject {
  width: 25%;
}

.ticket-table-account .col-channel {
  width: 10%;
}

.ticket-table-account .col-status {
  width: 10%;
}

.ticket-table-account .col-created,
.ticket-table-account .col-closed {
  width: 13%;
}

.ticket-table th {
  padding: 18px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  word-break: normal;
}

.ticket-table td {
  padding: 18px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

.ticket-table th + th,
.ticket-table td + td {
  padding-left: calc(6ch + 16px);
}

.ticket-table-account th + th,
.ticket-table-account td + td {
  padding-left: 16px;
}

.ticket-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.ticket-table tbody tr:hover {
  background: rgba(31, 41, 51, 0.12);
}

.ticket-table tbody tr:last-child td {
  border-bottom: 0;
}

.ticket-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ticket-id-link {
  display: inline-block;
  width: 13ch;
  white-space: nowrap;
}

.ticket-table-account .owner-cell,
.ticket-table-account .channel-cell,
.ticket-table-account .status-cell,
.ticket-table-account .created-cell,
.ticket-table-account .closed-cell,
.ticket-table-account .status-text,
.ticket-table .channel-cell,
.ticket-table .status-cell,
.ticket-table .created-cell,
.ticket-table .closed-cell {
  white-space: nowrap;
}

.status-text {
  font-size: 0.96rem;
  font-weight: 700;
}

.status-open {
  color: #b42318;
}

.status-close {
  color: #067647;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.page-link {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.page-link-active {
  background: var(--primary-dark);
  color: #fff;
}

.conversation-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.detail-grid {
  display: grid;
  gap: 14px;
}

.detail-grid div {
  display: grid;
  gap: 4px;
}

dt {
  font-size: 0.84rem;
  color: var(--muted);
}

dd {
  margin: 0;
}

.assignee-block {
  display: grid;
  gap: 4px;
}

.assignee-name {
  font-weight: 700;
}

.assignee-email {
  color: var(--muted);
  word-break: break-word;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0 0 28px;
}

.conversation-block + .conversation-block {
  margin-top: 28px;
}

.conversation-list {
  display: grid;
  gap: 14px;
}

.conversation-item {
  padding: 18px;
}

.thread-card {
  display: grid;
  gap: 18px;
}

.thread-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.thread-identity {
  display: grid;
  gap: 4px;
}

.thread-email,
.thread-time {
  color: var(--muted);
  word-break: break-word;
}

.thread-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.thread-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.thread-direction-in {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
}

.thread-direction-out {
  background: rgba(6, 118, 71, 0.12);
  color: #067647;
}

.thread-direction-unknown {
  background: rgba(31, 41, 51, 0.08);
  color: var(--text);
}

.thread-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

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

.thread-meta-grid dd {
  word-break: break-word;
}

.thread-summary {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.thread-summary p {
  margin: 8px 0 0;
  color: var(--muted);
}

.rich-text {
  line-height: 1.65;
  word-break: break-word;
}

.rich-text > :first-child {
  margin-top: 0;
}

.rich-text > :last-child {
  margin-bottom: 0;
}

.rich-text p,
.rich-text div,
.rich-text ul,
.rich-text ol,
.rich-text blockquote {
  margin: 0 0 12px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.46);
}

@keyframes loading-progress-slide {
  0% {
    transform: translateX(-10%);
    background-position: 0 0, 0 0;
  }

  100% {
    transform: translateX(185%);
    background-position: 18px 0, 0 0;
  }
}

@media (max-width: 640px) {
  .landing-auth-card {
    padding: 32px 24px;
  }

  .landing-user-row {
    align-items: flex-start;
  }
}
