:root {
  color-scheme: light;
  --bg: #edf4f6;
  --surface: #ffffff;
  --surface-soft: #e7f0f3;
  --surface-tint: #f6fbfc;
  --text: #0d2734;
  --muted: #5f7480;
  --line: #cfdee4;
  --brand: #05384f;
  --brand-2: #0a526d;
  --accent: #0d7892;
  --accent-dark: #05384f;
  --green: #15916b;
  --amber: #b87911;
  --red: #c44949;
  --cyan: #19a7a1;
  --shadow: 0 18px 45px rgba(5, 56, 79, 0.1);
  --shadow-soft: 0 10px 28px rgba(5, 56, 79, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(25, 167, 161, 0.1), transparent 30%),
    linear-gradient(180deg, #f7fbfc 0%, var(--bg) 42%, #eaf2f4 100%);
  color: var(--text);
}

html[dir="ltr"] body {
  text-align: left;
}

html[dir="ltr"] .nav-item,
html[dir="ltr"] .ticket-card,
html[dir="ltr"] .data-table th,
html[dir="ltr"] .data-table td {
  text-align: left;
}

html[dir="ltr"] .nav-item.active {
  box-shadow: inset 4px 0 0 #19a7a1;
}

html[dir="ltr"] .nav-item:hover,
html[dir="ltr"] .nav-item.active,
html[dir="ltr"] .ticket-card:hover,
html[dir="ltr"] .ticket-card.selected {
  transform: translateX(3px);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

[hidden] {
  display: none !important;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(237, 244, 246, 0.58);
  backdrop-filter: blur(4px);
}

.loading-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(207, 222, 228, 0.9);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #d7e7ec;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.is-submitting {
  opacity: 0.86;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(5, 56, 79, 0.16), transparent 38%),
    linear-gradient(315deg, rgba(25, 167, 161, 0.16), transparent 42%),
    #f6fbfc;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-top,
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-top {
  margin-bottom: 8px;
  flex-direction: column;
  align-items: flex-start;
}

.login-top h1,
.login-top p,
.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.login-top h1,
.brand h1 {
  font-size: 21px;
}

.login-top p,
.brand p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.login-hint {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.remember-login input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.language-login-button {
  justify-self: start;
  min-width: 96px;
}

.domain-login-button {
  width: 100%;
  justify-content: center;
}

html[dir="ltr"] .language-login-button {
  justify-self: end;
}

.form-error,
.muted-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.form-error {
  color: var(--red);
  min-height: 22px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 68px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, #063b53 0%, #042f43 54%, #032738 100%);
  color: #ffffff;
  padding: 24px;
  box-shadow: 12px 0 34px rgba(5, 56, 79, 0.12);
  overflow: hidden;
  transition: padding 0.2s ease;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0 0 18px auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-2px);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px 14px;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  margin: 0 auto;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .nav-list {
  display: none;
}

.brand {
  margin-bottom: 34px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand p {
  color: #bad5de;
}

.logo-image {
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  box-shadow: none;
}

.login-logo {
  width: min(280px, 100%);
  height: auto;
  max-height: 125px;
  background: #ffffff;
  padding: 10px 12px;
  border: 1px solid rgba(198, 216, 225, 0.75);
}

.sidebar-logo {
  width: min(220px, 100%);
  height: auto;
  max-height: 125px;
  background: #ffffff;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  color: #dce7ef;
  background: transparent;
  text-align: right;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  transform: translateX(-3px);
}

.main-content {
  padding: 30px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  position: relative;
  z-index: 80;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(207, 222, 228, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.eyebrow {
  color: var(--muted);
  font-size: 14px;
}

.topbar h2 {
  font-size: 32px;
  margin-top: 4px;
}

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

.notification-box {
  position: relative;
}

.notification-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notification-button span {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: min(380px, calc(100vw - 36px));
  max-height: min(440px, calc(100vh - 150px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(23, 33, 43, 0.18);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-header button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.notification-list {
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.notification-item {
  display: grid;
  gap: 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  text-align: right;
}

.notification-item.unread {
  background: #f0f8fb;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.screen-notification-toast {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 4000;
  width: min(340px, calc(100vw - 44px));
  border: 1px solid rgba(27, 112, 137, 0.24);
  border-inline-start: 5px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(12, 44, 58, 0.24);
  color: var(--text);
  cursor: pointer;
  padding: 14px 16px;
  text-align: start;
}

.screen-notification-toast strong,
.screen-notification-toast span {
  display: block;
}

.screen-notification-toast span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.notification-detail-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: transparent;
}

.notification-detail-dialog::backdrop {
  background: rgba(5, 24, 35, 0.44);
  backdrop-filter: blur(5px);
}

.notification-detail-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(5, 56, 79, 0.24);
}

.notification-detail-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.notification-detail-body p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.notification-detail-meta {
  margin: 0;
}

.user-chip {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-chip span {
  color: var(--muted);
  font-size: 13px;
}

.primary-action,
.secondary-action,
.danger-action {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.primary-action {
  background: linear-gradient(135deg, var(--accent), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 20px rgba(13, 120, 146, 0.18);
}

.primary-action:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-action {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid rgba(207, 222, 228, 0.85);
}

.danger-action {
  background: #fff0f0;
  color: var(--red);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.summary-card {
  padding: 18px;
  border-top: 4px solid var(--accent);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfd 100%);
}

.summary-card span {
  color: var(--muted);
  font-size: 14px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(6, minmax(130px, 0.7fr));
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.category-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
}

.category-checkbox-grid label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.category-checkbox-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.category-checkbox-grid label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(13, 120, 146, 0.08);
  box-shadow: inset 0 0 0 1px rgba(13, 120, 146, 0.18);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(13, 120, 146, 0.16);
  border-color: var(--accent);
}

.date-input {
  direction: ltr;
  text-align: center;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  min-height: 43px;
  padding-inline: 12px 10px;
}

.date-input::placeholder {
  color: #7b8f99;
  font-weight: 500;
}

textarea {
  resize: vertical;
}

.content-grid,
.dashboard-layout,
.users-layout,
.reports-layout,
.analytics-layout,
.welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.welcome-hero,
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid rgba(13, 120, 146, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 120, 146, 0.1), rgba(21, 145, 107, 0.08)),
    #ffffff;
  box-shadow: var(--shadow-soft);
}

.welcome-kicker {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-copy h3,
.dashboard-hero h3 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.welcome-copy p,
.dashboard-hero p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.welcome-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border-radius: 8px;
  background: #07384f;
  color: #ffffff;
}

.welcome-card span,
.welcome-card p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.welcome-card strong {
  font-size: 46px;
  line-height: 1;
}

.dashboard-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dashboard-mini-stats article {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.dashboard-mini-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-mini-stats strong {
  color: var(--ink);
  font-size: 28px;
}

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

.status-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.status-chart-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.status-chart-card strong {
  color: var(--ink);
  font-size: 30px;
}

.status-chart-card span {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.status-chart-card .ring {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 52%, transparent 54%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), #dfecef 0);
}

.compact-ticket-list {
  display: grid;
}

.compact-ticket {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  text-align: inherit;
  cursor: pointer;
}

.compact-ticket:hover {
  background: #eef8fa;
}

.compact-ticket span {
  color: var(--muted);
  font-size: 13px;
}

.reports-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
}

.reports-layout .panel:first-child {
  grid-row: span 2;
}

.analytics-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.analytics-layout .panel:first-child {
  grid-row: span 2;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.report-filters {
  display: grid;
  grid-template-columns:
    minmax(130px, 0.75fr)
    minmax(150px, 0.85fr)
    minmax(150px, 0.85fr)
    minmax(140px, 0.8fr)
    minmax(140px, 0.8fr)
    minmax(170px, 1fr)
    minmax(120px, 0.7fr)
    auto
    auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
}

.dropdown-form {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.profile-email-form {
  border-bottom: 1px solid var(--line);
  background: #f8fcfd;
}

.password-dropdown {
  width: min(340px, calc(100vw - 36px));
}

.force-password-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 1px solid rgba(207, 222, 228, 0.95);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.force-password-dialog::backdrop {
  background:
    linear-gradient(135deg, rgba(234, 245, 247, 0.98), rgba(220, 239, 242, 0.98)),
    rgba(234, 245, 247, 0.98);
}

.force-password-note {
  margin: 0;
  padding: 12px;
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  background: #f8fcfd;
  color: var(--muted);
  font-weight: 800;
}

.panel {
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
}

.panel-header span {
  color: var(--muted);
  font-size: 14px;
}

.ticket-list,
.users-list,
.audit-list,
.workload-list {
  display: grid;
}

.ticket-card {
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 16px 18px;
  text-align: right;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.ticket-card:hover,
.ticket-card.selected {
  background: #eef8fa;
  border-color: rgba(13, 120, 146, 0.2);
  transform: translateX(-2px);
}

.ticket-card.walk-in-ticket {
  border-color: #efd092;
  background: linear-gradient(180deg, #fffdf6 0%, #ffffff 100%);
  box-shadow:
    inset -4px 0 0 #d99a19,
    0 8px 18px rgba(153, 100, 11, 0.08);
}

.ticket-card:last-child {
  border-bottom: 0;
}

.ticket-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.ticket-title-row strong {
  font-size: 16px;
}

.ticket-meta,
.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ticket-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.open {
  background: #e8f5f8;
  color: var(--accent-dark);
}

.badge.in_progress {
  background: #fff4df;
  color: var(--amber);
}

.badge.closed {
  background: #e8f7ef;
  color: var(--green);
}

.badge.walk-in {
  background: #fff4df;
  color: #9b640b;
  border: 1px solid #efd092;
}

.badge.high {
  background: #fff0f0;
  color: var(--red);
}

.badge.medium {
  background: #fff4df;
  color: var(--amber);
}

.badge.low,
.badge.support {
  background: #eaf7f7;
  color: #087775;
}

.badge.admin {
  background: #e8f5f8;
  color: var(--accent-dark);
}

.badge.user {
  background: #eef1f4;
  color: #4c5967;
}

.details-content {
  padding: 18px;
}

.details-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.details-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.walk-in-ticket-option {
  padding: 12px;
  border: 1px solid #efd092;
  border-radius: 8px;
  background: #fff9ea;
  color: #805000;
}

.close-reason-note {
  border: 1px solid #c9d7df;
  border-radius: 8px;
  background: #f8fbfc;
  padding: 10px 12px;
  font-weight: 800;
  color: #0b3d53;
}

.details-content h3 {
  font-size: 22px;
  margin: 0 0 10px;
}

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

.info-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-grid span {
  color: var(--muted);
  font-size: 12px;
}

.info-grid strong {
  font-size: 14px;
}

.details-description {
  color: #334150;
  line-height: 1.8;
  margin: 18px 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
}

.attachments-section {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.knowledge-base {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  background: #f2f8fa;
  box-shadow: inset 4px 0 0 var(--accent);
}

.knowledge-base h4 {
  margin: 0;
  font-size: 17px;
}

.knowledge-base ul {
  margin: 0;
  padding-inline-start: 20px;
  color: #334150;
  line-height: 1.8;
}

.attachments-section h4 {
  margin: 0;
  font-size: 18px;
}

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

.attachment-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-item img,
.file-icon {
  width: 88px;
  height: 68px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.attachment-item img {
  object-fit: cover;
}

.file-icon {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 800;
}

.attachment-item div {
  display: grid;
  gap: 5px;
}

.attachment-item span {
  color: var(--muted);
  font-size: 13px;
}

.attachment-item a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.assign-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.feedback-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.feedback-section h4 {
  margin: 0;
  font-size: 18px;
}

.feedback-form,
.escalate-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 8px;
}

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

.feedback-item,
.audit-item,
.workload-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feedback-item div,
.audit-item div:first-child,
.workload-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-item span,
.audit-item span,
.workload-row span {
  color: var(--muted);
  font-size: 13px;
}

.feedback-item p,
.audit-item p {
  margin: 10px 0 0;
  color: #334150;
  line-height: 1.7;
  white-space: pre-wrap;
}

.locked-note {
  padding: 12px;
  background: #fff8ec;
  border: 1px solid #ffe3ad;
  border-radius: 8px;
  color: var(--amber);
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.bar-list {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
}

.bar-fill.in_progress {
  background: var(--amber);
}

.bar-fill.closed {
  background: var(--green);
}

.workload-list {
  gap: 10px;
  padding: 18px;
}

.settings-panel {
  max-width: 920px;
}

.settings-panel p,
.settings-actions,
.settings-form {
  margin: 18px;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  max-width: 520px;
}

.email-settings-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  max-width: 720px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.checkbox-setting {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.checkbox-setting input {
  width: 18px;
  height: 18px;
}

.inline-actions {
  justify-content: flex-start;
  margin: 0;
}

.user-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-actions .secondary-action,
.user-actions .danger-action {
  padding: 8px 10px;
  font-size: 13px;
}

.user-row:last-child {
  border-bottom: 0;
}

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

.user-row span {
  color: var(--muted);
  font-size: 14px;
}

.customer-row small,
.customer-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.customer-row p {
  max-width: 620px;
}

.audit-list {
  gap: 10px;
  padding: 18px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: #edf6f8;
  font-size: 13px;
}

.data-table tbody tr:hover td {
  background: #f7fbfc;
}

.data-table tr.late-row td {
  background: #fff6f2;
}

.data-table tr.late-row td:last-child {
  color: var(--red);
  font-weight: 800;
}

.compact-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.compact-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.trend-chart {
  min-height: 230px;
  display: grid;
  grid-template-columns: repeat(14, minmax(34px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 18px;
}

.trend-day {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.trend-bars {
  height: 140px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.trend-bars span {
  width: 11px;
  border-radius: 999px 999px 0 0;
}

.trend-created {
  background: var(--brand-2);
}

.trend-closed {
  background: var(--green);
}

.trend-day small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.analytics-bars {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.analytics-bar-row {
  display: grid;
  gap: 7px;
}

.analytics-bar-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pie-chart-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.pie-chart {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid #fff;
  box-shadow: var(--shadow-soft);
  background: #e7f0f3;
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.pie-legend-row span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.pie-legend-row em {
  font-style: normal;
  font-weight: 800;
  color: var(--text);
}

.padded {
  padding: 18px;
}

dialog {
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(23, 33, 43, 0.22);
  padding: 0;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(23, 33, 43, 0.45);
}

body.dialog-fallback-open {
  overflow: hidden;
}

body.dialog-fallback-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(23, 33, 43, 0.45);
}

body.dialog-fallback-open dialog[open] {
  display: block;
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1000;
  transform: translate(-50%, -50%);
  background: #fff;
}

.ticket-form {
  padding: 20px;
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-header,
.dialog-actions,
.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dialog-header,
.dialog-actions {
  justify-content: space-between;
}

.dialog-header h3 {
  margin: 0;
  font-size: 22px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 24px;
  line-height: 1;
}

.form-row label {
  flex: 1;
}

.no-results {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

/* UI refresh */
.login-screen {
  background:
    linear-gradient(135deg, rgba(5, 56, 79, 0.2), transparent 34%),
    linear-gradient(315deg, rgba(25, 167, 161, 0.18), transparent 40%),
    radial-gradient(circle at center, #ffffff 0%, #edf7f8 52%, #dcebed 100%);
}

.login-card {
  padding: 30px;
  border-color: rgba(13, 120, 146, 0.18);
  box-shadow: 0 26px 70px rgba(5, 56, 79, 0.16);
}

.login-card .primary-action {
  min-height: 48px;
}

.brand {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand h1,
.login-top h1 {
  letter-spacing: 0;
}

.nav-item {
  position: relative;
  min-height: 46px;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset -4px 0 0 #19a7a1;
}

.topbar {
  min-height: 82px;
}

.topbar h2 {
  font-size: clamp(24px, 2.4vw, 34px);
}

.user-strip > span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notification-button,
#passwordButton,
#logoutButton {
  min-height: 42px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.summary-card-button {
  width: 100%;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

.summary-card-button:focus-visible {
  outline: 3px solid rgba(25, 167, 161, 0.35);
  outline-offset: 2px;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 16px;
  bottom: 16px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(25, 167, 161, 0.55);
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(5, 56, 79, 0.12);
}

.toolbar,
.report-filters {
  padding: 14px;
  border: 1px solid rgba(207, 222, 228, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

input,
select,
textarea {
  min-height: 43px;
  border-color: #c7d9df;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a9c4cc;
}

input:focus,
select:focus,
textarea:focus {
  background: #fbfeff;
  box-shadow:
    0 0 0 3px rgba(13, 120, 146, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.panel {
  overflow: hidden;
  border-color: rgba(207, 222, 228, 0.9);
}

.panel-header h3 {
  font-size: 18px;
}

.ticket-list {
  gap: 10px;
  padding: 12px;
  background: #f7fbfc;
}

.ticket-card {
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(5, 56, 79, 0.05);
}

.ticket-card:last-child {
  border-bottom: 1px solid #d7e5ea;
}

.ticket-card.selected {
  background: #eef9fb;
  border-color: rgba(13, 120, 146, 0.42);
  box-shadow:
    inset -4px 0 0 var(--accent),
    0 12px 26px rgba(5, 56, 79, 0.1);
}

.ticket-title-row strong {
  line-height: 1.5;
}

.ticket-meta span,
.audit-meta span,
.ticket-footer {
  line-height: 1.6;
}

.badge {
  min-height: 26px;
  padding: 5px 10px;
}

.details-content {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}

.details-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.info-grid div,
.details-description,
.feedback-form,
.assign-form,
.attachment-item,
.feedback-item,
.audit-item,
.workload-row {
  border-color: #d7e5ea;
}

.info-grid div {
  background: #f4fafb;
}

.details-description {
  background: #ffffff;
  box-shadow: inset 4px 0 0 rgba(13, 120, 146, 0.18);
}

.details-actions .secondary-action,
.details-actions .primary-action,
.details-actions .danger-action {
  min-height: 40px;
}

.feedback-form,
.escalate-form,
.assign-form {
  background: #f2f8fa;
}

.escalate-form {
  border-color: rgba(185, 74, 72, 0.24);
  background: #fff7f6;
}

.attachment-item {
  box-shadow: 0 8px 18px rgba(5, 56, 79, 0.04);
}

.file-icon {
  background: linear-gradient(180deg, #e8f5f8 0%, #dceff2 100%);
}

.data-table {
  border-spacing: 0;
}

.data-table th {
  color: #46606b;
  font-weight: 800;
}

.data-table td {
  background: #fff;
}

.user-row {
  background: #fff;
}

.user-row:hover,
.feedback-item:hover,
.audit-item:hover,
.workload-row:hover {
  background: #f7fbfc;
}

#usersView .users-layout {
  grid-template-columns: minmax(390px, 0.95fr) minmax(520px, 1.05fr);
  gap: 14px;
}

#usersView .panel {
  overflow: hidden;
}

#usersView .panel-header {
  min-height: 56px;
  padding: 14px 16px;
}

#usersView .user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

#usersView .user-form label {
  min-width: 0;
}

#usersView .user-form label:first-child,
#usersView .user-form button {
  grid-column: 1 / -1;
}

#usersView .users-list {
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding: 12px;
  background: linear-gradient(180deg, rgba(245, 251, 252, 0.8), rgba(255, 255, 255, 0.96));
}

#usersView .users-search {
  padding: 12px 12px 0;
  background: linear-gradient(180deg, rgba(245, 251, 252, 0.8), rgba(245, 251, 252, 0));
}

#usersView .users-search input {
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

#usersView .user-group {
  overflow: hidden;
  border: 1px solid rgba(207, 222, 228, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(8, 51, 68, 0.04);
}

#usersView .user-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f3fafb 100%);
}

#usersView .user-group-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#usersView .user-group-header strong {
  color: var(--ink);
  font-size: 15px;
}

#usersView .user-group-header em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

#usersView .user-group-body {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
}

#usersView .user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: auto;
  padding: 12px;
  border: 1px solid rgba(207, 222, 228, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#usersView .user-row:last-child {
  border-bottom: 1px solid rgba(207, 222, 228, 0.95);
}

#usersView .user-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#usersView .user-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#usersView .user-row small,
#usersView .user-row span:not(.badge) {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#usersView .user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 178px;
}

#usersView .user-actions .secondary-action,
#usersView .user-actions .danger-action {
  min-width: 58px;
  padding: 7px 10px;
  font-size: 12px;
}

dialog {
  overflow: hidden;
  border: 1px solid rgba(207, 222, 228, 0.9);
}

.dialog-header {
  margin: -20px -20px 4px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #063b53, #0a526d);
  color: #fff;
  position: sticky;
  top: -20px;
  z-index: 2;
}

.dialog-header h3 {
  color: #fff;
}

.dialog-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  margin: 4px -20px -20px;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, #ffffff 45%);
  border-top: 1px solid var(--line);
}

.dialog-header .icon-button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.dialog-actions {
  padding-top: 4px;
}

.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(5, 56, 79, 0.18), transparent 36%),
    radial-gradient(circle at bottom left, rgba(25, 167, 161, 0.16), transparent 34%),
    var(--bg);
}

.not-found-card {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px;
  border: 1px solid rgba(207, 222, 228, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
  box-shadow: var(--shadow);
}

.not-found-card h1,
.not-found-card p {
  margin: 0;
}

.not-found-card p {
  color: var(--muted);
}

.error-code {
  color: var(--accent);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}

.link-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

/* Simpler home dashboard */
#ticketsView .summary-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

#ticketsView .summary-card {
  min-height: 92px;
  padding: 16px;
}

#ticketsView .summary-card strong {
  font-size: 26px;
}

.quick-search-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(207, 222, 228, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.quick-search-bar .secondary-action {
  min-height: 43px;
  white-space: nowrap;
}

.compact-toolbar {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin-top: 0;
  box-shadow: none;
  background: #f7fbfc;
}

#ticketsView .content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
  gap: 14px;
}

#ticketsView .panel-header {
  padding: 14px 16px;
}

#ticketsView .ticket-list {
  max-height: calc(100vh - 350px);
  min-height: 360px;
  overflow: auto;
}

#ticketsView .details-panel {
  position: sticky;
  top: 24px;
}

#ticketsView .details-content {
  padding: 16px;
}

#ticketsView .info-grid {
  grid-template-columns: 1fr;
}

#ticketsView .details-description {
  max-height: 180px;
  overflow: auto;
}

/* Refined operational screens */
#welcomeView,
#ticketsView,
#dashboardView,
#reportsView {
  display: none;
  gap: 16px;
}

#welcomeView.active-view,
#ticketsView.active-view,
#dashboardView.active-view,
#reportsView.active-view {
  display: grid;
}

#welcomeView .welcome-hero,
#dashboardView .dashboard-hero {
  border: 1px solid rgba(207, 222, 228, 0.95);
  border-top: 4px solid var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 252, 0.98)),
    #ffffff;
  box-shadow: 0 14px 32px rgba(5, 56, 79, 0.08);
}

#welcomeView .welcome-copy h3,
#dashboardView .dashboard-hero h3 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

#welcomeView .welcome-card {
  background:
    linear-gradient(145deg, #06384f 0%, #0b5c70 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#welcomeView .summary-grid,
#reportsView .report-summary {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

#welcomeView .summary-card,
#ticketsView .summary-card,
#reportsView .summary-card {
  border-top-width: 0;
  border-inline-start: 4px solid var(--accent);
  background: #ffffff;
}

#welcomeView .welcome-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
}

#welcomeView .compact-ticket-list {
  gap: 8px;
  padding: 12px;
  background: #f7fbfc;
}

#welcomeView .compact-ticket {
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(5, 56, 79, 0.04);
}

#ticketsView .quick-search-bar,
#reportsView .report-filters {
  border-color: rgba(13, 120, 146, 0.18);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(5, 56, 79, 0.07);
}

#ticketsView .content-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.78fr);
}

#ticketsView .ticket-list {
  padding: 14px;
  background:
    linear-gradient(180deg, #f8fbfc 0%, #eef6f8 100%);
}

#ticketsView .ticket-card {
  padding: 15px 16px;
  border-color: #d7e5ea;
  background: #ffffff;
}

#ticketsView .ticket-card:hover {
  background: #f4fbfc;
  border-color: rgba(13, 120, 146, 0.34);
}

#ticketsView .ticket-card.selected {
  background: #ffffff;
  border-color: rgba(13, 120, 146, 0.62);
  box-shadow:
    inset -5px 0 0 var(--accent),
    0 12px 26px rgba(5, 56, 79, 0.09);
}

#ticketsView .ticket-title-row strong {
  line-height: 1.35;
}

#ticketsView .ticket-meta {
  gap: 6px;
}

#ticketsView .details-panel {
  border-top: 4px solid var(--brand-2);
}

#dashboardView .dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

#dashboardView .dashboard-mini-stats article,
#dashboardView .status-chart-card {
  border-color: rgba(207, 222, 228, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  box-shadow: 0 10px 24px rgba(5, 56, 79, 0.06);
}

#dashboardView .pro-dashboard {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

#dashboardView .panel:first-child,
#dashboardView .panel:nth-child(2) {
  min-height: 310px;
}

#dashboardView .status-chart-grid {
  align-items: stretch;
}

#dashboardView .pie-chart-card {
  align-items: center;
  min-height: 220px;
}

#reportsView .report-filters {
  grid-template-columns:
    minmax(130px, 0.7fr)
    minmax(145px, 0.82fr)
    minmax(145px, 0.82fr)
    minmax(135px, 0.75fr)
    minmax(135px, 0.75fr)
    minmax(160px, 0.95fr)
    minmax(110px, 0.62fr)
    auto
    auto;
  align-items: end;
}

#reportsView .reports-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
}

#reportsView .report-wide {
  grid-column: 1 / -1;
}

#reportsView .table-wrap {
  max-height: 440px;
  overflow: auto;
}

#reportsView .data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

#reportsView .panel-header,
#dashboardView .panel-header,
#ticketsView .panel-header,
#welcomeView .panel-header {
  min-height: 58px;
}

@media (max-width: 1120px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #welcomeView .summary-grid,
  #reportsView .report-summary {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  #dashboardView .dashboard-hero,
  #dashboardView .pro-dashboard,
  #ticketsView .content-grid,
  #reportsView .reports-layout,
  #welcomeView .welcome-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .app-shell.sidebar-collapsed .sidebar {
    min-height: 76px;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-grid,
  .dashboard-layout,
  .analytics-layout,
  .reports-layout,
  .users-layout,
  .quick-search-bar,
  .toolbar,
  .report-filters,
  .settings-form {
    grid-template-columns: 1fr;
  }

  #usersView .users-layout,
  #usersView .user-form {
    grid-template-columns: 1fr;
  }

  #usersView .users-list {
    max-height: none;
  }

  #usersView .user-row {
    grid-template-columns: 1fr;
  }

  #usersView .user-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  #ticketsView .content-grid,
  #ticketsView .summary-grid,
  .compact-toolbar {
    grid-template-columns: 1fr;
  }

  #ticketsView .details-panel {
    position: static;
  }

  #ticketsView .ticket-list {
    max-height: none;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .sidebar-toggle,
  .topbar,
  .view,
  .report-filters,
  #exportReportsButton,
  #exportReportsPdfButton {
    display: none !important;
  }

  #reportsView {
    display: block !important;
  }

  .main-content {
    padding: 0;
  }

  .panel,
  .summary-card,
  .report-card {
    box-shadow: none;
    break-inside: avoid;
  }
}

@media (max-width: 620px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .user-strip,
  .assign-form,
  .dialog-actions,
  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .nav-list,
  .info-grid,
  .attachment-item,
  .pie-chart-card {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    width: 130px;
    justify-self: center;
  }

  .trend-chart {
    overflow-x: auto;
    grid-template-columns: repeat(14, 42px);
  }

  .attachment-item img,
  .file-icon {
    width: 100%;
  }

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

/* Ticket details refresh */
#ticketsView .details-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.ticket-detail-hero,
.ticket-detail-section,
.feedback-section {
  border: 1px solid #d2e3e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(5, 56, 79, 0.07);
}

.ticket-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border-top: 4px solid var(--accent);
}

.ticket-detail-number {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e8f4f7;
  color: var(--accent-dark);
  font-weight: 900;
  direction: ltr;
}

.ticket-detail-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.3;
}

.ticket-detail-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.ticket-detail-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ticket-detail-status article {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fafb 100%);
}

.ticket-detail-status span,
.section-title-row span {
  color: var(--muted);
  font-size: 12px;
}

.ticket-detail-status strong {
  color: var(--text);
  line-height: 1.35;
}

.ticket-detail-section {
  padding: 16px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row h4 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

#ticketsView .ticket-detail-section .details-description {
  margin: 0;
  border: 0;
  background: #f7fbfc;
}

#ticketsView .ticket-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

#ticketsView .ticket-detail-grid div {
  background: #ffffff;
}

.ticket-timeline-section {
  overflow: hidden;
}

.ticket-timeline {
  display: grid;
  gap: 0;
  position: relative;
}

.timeline-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  position: relative;
  padding: 0 0 14px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 0;
  right: 8px;
  width: 2px;
  background: #d8e8ed;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 3px solid #d8e8ed;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.timeline-item.current .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 120, 146, 0.12);
}

.timeline-item strong {
  color: var(--text);
}

.timeline-item p {
  margin: 5px 0;
  color: #344b57;
  line-height: 1.6;
  white-space: pre-wrap;
}

.timeline-item small {
  color: var(--muted);
}

#ticketsView .action-section .assign-form {
  margin-top: 12px;
}

#ticketsView .feedback-section {
  margin-top: 0;
  padding: 16px;
  border-top: 1px solid #d2e3e8;
}

#ticketsView .feedback-form,
#ticketsView .escalate-form {
  border: 1px solid #d7e5ea;
  background: #f7fbfc;
}

#ticketsView .feedback-item {
  border-color: #d7e5ea;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}

@media (max-width: 720px) {
  .ticket-detail-hero,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ticket-detail-status,
  #ticketsView .ticket-detail-grid {
    grid-template-columns: 1fr;
  }
}

.status-dialog {
  width: min(480px, calc(100vw - 28px));
}

.status-dialog::backdrop {
  background: rgba(4, 24, 35, 0.52);
  backdrop-filter: blur(3px);
}

.status-picker-note {
  padding: 12px;
  border: 1px solid #d7e5ea;
  border-radius: 8px;
  background: #f7fbfc;
}

/* Ticket cards refresh */
#ticketsView .content-grid {
  grid-template-columns: minmax(560px, 1.25fr) minmax(390px, 0.75fr);
  align-items: start;
}

#ticketsView .ticket-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-height: calc(100vh - 330px);
  min-height: 430px;
  padding: 16px;
}

#ticketsView .ticket-card.ticket-tile {
  min-height: 245px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  align-content: start;
  text-align: right;
  border: 1px solid #d2e3e8;
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  box-shadow: 0 14px 28px rgba(5, 56, 79, 0.07);
}

#ticketsView .ticket-card.ticket-tile:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(13, 120, 146, 0.45);
  box-shadow: 0 18px 34px rgba(5, 56, 79, 0.11);
}

#ticketsView .ticket-card.ticket-tile.selected {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 2px rgba(13, 120, 146, 0.16),
    0 18px 36px rgba(5, 56, 79, 0.13);
}

.ticket-number-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f4f7;
  color: var(--accent-dark);
  font-weight: 800;
  direction: ltr;
}

#ticketsView .ticket-tile-title {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.ticket-tile-description {
  min-height: 54px;
  color: #617786;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

.ticket-tile-info {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f0f7f9;
}

.ticket-tile-info div {
  display: grid;
  gap: 2px;
}

.ticket-tile-info span {
  color: var(--muted);
  font-size: 12px;
}

.ticket-tile-info strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

#ticketsView .ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid #dce9ed;
  color: var(--muted);
  font-size: 12px;
}

#ticketsView .ticket-footer strong {
  color: var(--accent);
  white-space: nowrap;
}

#ticketsView .details-panel {
  overflow: hidden;
}

#ticketsView .details-heading {
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbfc 0%, #edf7fa 100%);
  border: 1px solid #d7e5ea;
}

#ticketsView .details-description {
  max-height: none;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d7e5ea;
  line-height: 1.8;
}

#ticketsView .assign-form {
  padding: 14px;
  border-radius: 8px;
  background: #f7fbfc;
  border: 1px solid #d7e5ea;
}

@media (max-width: 1180px) {
  #ticketsView .content-grid {
    grid-template-columns: 1fr;
  }

  #ticketsView .details-panel {
    position: static;
  }

  #ticketsView .ticket-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  #ticketsView .ticket-list {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #ticketsView .ticket-card.ticket-tile {
    min-height: auto;
  }

  #ticketsView .ticket-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}


#usersView .import-users-panel {
  grid-column: 1;
}

#usersView .users-layout > .panel:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
}

#usersView .import-users-form {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 16px 16px;
}

#usersView .import-users-form .muted-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

#usersView .import-users-form label,
#usersView .import-users-form button {
  grid-column: 1 / -1;
}

#usersView .import-users-form button {
  min-height: 40px;
}

@media (max-width: 980px) {
  #usersView .import-users-panel,
  #usersView .users-layout > .panel:last-child {
    grid-column: 1;
    grid-row: auto;
  }
}


#usersView .import-users-actions {
  display: flex;
  justify-content: flex-start;
  grid-column: 1 / -1;
}

#usersView .import-users-actions .danger-action {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}
.report-creator-tickets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.report-assignee-group {
  border: 1px solid #c9dce6;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(9, 54, 70, 0.05);
}

.report-assignee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #eef8fb;
  border-bottom: 1px solid #c9dce6;
}

.report-assignee-header strong {
  color: #102f3d;
  font-size: 14px;
}

.report-assignee-header span {
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dff4f7;
  color: #07657a;
  font-weight: 800;
  text-align: center;
  font-size: 12px;
}

.report-assignee-tickets {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: 360px;
  overflow: auto;
}

.assignee-ticket-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e7ee;
  border-radius: 7px;
  background: #fafdfe;
}

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

.assignee-ticket-main strong {
  color: #0b2b3a;
  font-size: 13px;
  line-height: 1.5;
}

.assignee-ticket-main span {
  color: #5c7280;
  font-size: 12px;
  line-height: 1.4;
}

.assignee-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: #607985;
  font-size: 11px;
}

.assignee-ticket-meta .pill {
  margin: 0;
  font-size: 11px;
}
.report-creator-tickets {
  display: block;
}

.assignee-report-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #c9dce6;
  border-radius: 8px;
  background: #ffffff;
}

.assignee-report-table {
  min-width: 980px;
}

.assignee-report-table th,
.assignee-report-table td {
  padding: 9px 10px;
  vertical-align: middle;
  line-height: 1.5;
}

.assignee-report-group-row td {
  background: #eef8fb;
  border-top: 1px solid #bdd7e3;
  border-bottom: 1px solid #bdd7e3;
  padding: 10px 12px;
}

.assignee-report-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.assignee-report-group-title strong {
  color: #0b2b3a;
  font-size: 14px;
}

.assignee-report-group-title span,
.assignee-report-group-title small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c9dce6;
  color: #425f6d;
  font-weight: 800;
  font-size: 12px;
}

.assignee-report-group-title span {
  background: #dff4f7;
  color: #07657a;
}

@media print {
  .assignee-report-table-wrap {
    max-height: none;
    overflow: visible;
  }
}
.assignee-report-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #c9dce6;
  border-radius: 8px;
  background: #f7fbfd;
}

.assignee-report-toolbar label {
  display: grid;
  gap: 4px;
  color: #607985;
  font-size: 12px;
  font-weight: 800;
}

.assignee-report-toolbar select {
  min-width: 240px;
  height: 36px;
  border: 1px solid #bcd4df;
  border-radius: 7px;
  background: #ffffff;
  color: #102f3d;
  font-weight: 800;
  padding: 0 10px;
}
