:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #18201f;
  --muted: #65716f;
  --line: #d9e1df;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warning: #b45309;
  --danger: #b42318;
  --info: #2563eb;
  --closed: #4b5563;
  --shadow: 0 18px 50px rgba(24, 32, 31, 0.1);
}

.service-page-heading,
.service-card-heading,
.service-policy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.service-page-heading h2,
.service-card-heading h3,
.service-summary-card h3 { margin: .25rem 0; }

.service-summary-card,
.service-management-card,
.service-policy-form {
  margin: 1rem 0;
  padding: 1.15rem;
  border: 1px solid #d7e2e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(30 64 83 / 7%);
}

.service-policy-grid,
.service-facts,
.service-action-form,
.service-performance-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .8rem;
}

.service-policy-field,
.service-action-form label,
.service-performance-filters label {
  display: grid;
  gap: .35rem;
  font-weight: 600;
}

.service-policy-matrix {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

.service-policy-matrix th,
.service-policy-matrix td {
  padding: .65rem;
  border-bottom: 1px solid #e2e8ec;
  text-align: left;
}

.service-policy-matrix input { width: 100%; }

.service-notification-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .55rem;
  margin: 1rem 0;
}

.service-notification-settings label { display: flex; align-items: center; gap: .45rem; }

.service-notification-rule {
  min-width: 0;
  padding: .65rem;
  border: 1px solid #d7e2e8;
  border-radius: 10px;
  background: #f8faf9;
}

.notification-recipient-dropdown {
  position: relative;
  margin-top: .5rem;
}

.notification-recipient-dropdown summary {
  min-height: 42px;
  padding: .65rem 2rem .65rem .75rem;
  border: 1px solid #cbd8dd;
  border-radius: 8px;
  background: #fff;
  color: #23342f;
  cursor: pointer;
  font-size: .88rem;
  list-style: none;
}

.notification-recipient-dropdown summary::-webkit-details-marker { display: none; }

.notification-recipient-dropdown summary::after {
  content: "▾";
  position: absolute;
  top: .67rem;
  right: .75rem;
  color: #526775;
}

.notification-recipient-dropdown[open] summary::after { content: "▴"; }
.notification-recipient-dropdown summary.is-empty { color: #7a8985; }

.notification-recipient-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: .2rem;
  padding: .55rem;
  border: 1px solid #cbd8dd;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

.notification-recipient-options label {
  padding: .45rem .5rem;
  border-radius: 7px;
  cursor: pointer;
}

.service-queue-page,
.settings-page {
  padding: 24px;
}

.service-queue-controls,
.queue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.service-queue-controls {
  justify-content: space-between;
  margin: 18px 0 12px;
}

.queue-tabs button.is-active,
.role-config-list button.is-active {
  background: #006b5f;
  color: #fff;
  border-color: #006b5f;
}

.service-queue-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe5e2;
  border-radius: 12px;
  background: #f8fbfa;
}

.service-queue-filters label,
.role-config-editor > label {
  display: grid;
  gap: 5px;
  font-size: .82rem;
  color: #425b55;
}

.queue-summary {
  color: #52645f;
  margin: 14px 0 8px;
}

.service-queue-list {
  display: grid;
  gap: 8px;
}

.service-queue-row {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(190px, 1fr) minmax(120px, .7fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dbe5e2;
  border-left: 4px solid #76958d;
  border-radius: 10px;
  background: #fff;
  color: #172c27;
  text-align: left;
}

.service-queue-row.queue-overdue { border-left-color: #c93c38; }
.service-queue-row.queue-due-soon { border-left-color: #d59a21; }
.service-queue-row.queue-action { border-left-color: #287aa8; }
.service-queue-identity,
.service-queue-reason { display: grid; gap: 3px; min-width: 0; }
.service-queue-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-queue-reason small,
.service-queue-owner { color: #63756f; }

.dashboard-service-queue {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.dashboard-service-queue .service-queue-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr);
  padding: 10px 12px;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.settings-card {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border: 1px solid #dbe5e2;
  border-radius: 14px;
  background: #fff;
  color: #17332c;
  text-align: left;
}

.settings-card strong { font-size: 1.05rem; }
.settings-card span { color: #61736d; line-height: 1.45; }

.role-config-layout {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(340px, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.role-config-list,
.role-config-editor { display: grid; align-content: start; gap: 10px; }
.role-config-editor { padding: 18px; border: 1px solid #dbe5e2; border-radius: 12px; }
.role-config-editor fieldset { display: grid; gap: 8px; margin: 4px 0; }
.role-config-editor fieldset label { display: flex; gap: 8px; align-items: center; }
.role-page-child { margin-left: 28px; color: #536760; }
.user-status-cell select { max-width: 190px; }

@media (max-width: 800px) {
  .service-queue-row { grid-template-columns: 1fr; gap: 7px; }
  .role-config-layout { grid-template-columns: 1fr; }
}

.notification-recipient-options label:hover { background: #edf7f5; }

.service-facts div { padding: .6rem; border-radius: 10px; background: #f4f8fa; }
.service-facts dt { color: #526775; font-size: .8rem; }
.service-facts dd { margin: .2rem 0 0; font-weight: 700; }
.service-warning-pill { background: #fff1cf; color: #7b5311; }
.service-action-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #dfe8ed; }
.service-action-form button { align-self: end; }
.service-stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .65rem; }
.service-stage-grid div { display: flex; justify-content: space-between; padding: .7rem; background: #f4f8fa; border-radius: 10px; }
.service-stage-grid strong { color: #115e59; }

.status-under-review,
.status-awaiting-approval,
.status-scheduled { background: #e7f0fb; color: #214969; }
.status-implementing,
.status-validation,
.status-pending-on-user-confirmation { background: #fff1cf; color: #7b5311; }
.status-completed { background: #dff3e7; color: #28633e; }
.status-deferred { background: #eee8f8; color: #594078; }
.status-rejected,
.status-cancelled { background: #f8e3e3; color: #8a3030; }

@media (max-width: 760px) {
  .service-page-heading,
  .service-card-heading,
  .service-policy-actions { align-items: stretch; flex-direction: column; }
  .service-policy-matrix { display: block; overflow-x: auto; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0.78rem 1rem;
}

button:hover {
  background: var(--accent-strong);
}

button.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

button.ghost:hover {
  background: #eef5f3;
}

button.ghost:disabled {
  background: #eef2f1;
  color: var(--muted);
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 400;
  padding: 0.75rem 0.8rem;
}

option,
input::placeholder,
textarea::placeholder {
  font-weight: 400;
}

textarea {
  resize: vertical;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: 32px;
}

.brand-panel {
  padding: 44px;
  border-radius: 8px;
  background: #143d3a;
  color: white;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 620px;
  color: #d7e9e6;
  font-size: 1.1rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-panel .eyebrow {
  color: #8ee4d8;
}

.login-card,
.submit-panel,
.tickets-panel,
.ticket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 1rem;
  padding: 28px;
}

.login-card h2,
.submit-panel h2,
.tickets-panel h2 {
  margin: 0;
}

.error {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.app-view {
  display: grid;
  gap: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 340px minmax(180px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 2.7rem;
  letter-spacing: 0;
}

.topbar-logo {
  display: block;
  width: 150px;
  height: auto;
}

.topbar-action {
  display: flex;
  justify-content: flex-start;
  padding-left: 22px;
}

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

#userName {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 0 0.85rem;
  color: var(--ink);
  font-weight: 700;
}

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

.notification-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}

.notification-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid #d5e4e1;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f7fbfa 100%);
  padding: 22px 24px 24px;
  box-shadow: 0 14px 36px rgba(24, 67, 62, 0.09);
}

.notification-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #35a99c 55%, #8dd8ce);
}

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

.notification-heading-copy { min-width: 0; }

.notification-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-heading-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e2f5f1;
  color: var(--accent);
  font-size: 1rem;
}

.notification-heading h2,
.notification-heading p { margin: 0; }

.notification-heading h2 { font-size: 1.45rem; }

.notification-panel-count,
.notification-unread-label {
  border-radius: 999px;
  background: #e2f5f1;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.notification-panel-count { padding: 6px 9px; }

.notification-heading > button {
  flex: 0 0 auto;
  padding: 0.65rem 0.9rem;
  border-color: #c8dcd8;
  color: var(--accent-strong);
}

.notification-heading p {
  margin: 5px 0 0 44px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 18px;
  border: 1px solid #d7e5e2;
  border-radius: 12px;
  background: white;
  box-shadow: 0 5px 16px rgba(31, 65, 61, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.notification-item:hover {
  transform: translateY(-1px);
  border-color: #add5cf;
  box-shadow: 0 9px 22px rgba(31, 65, 61, 0.09);
}

.notification-item.unread {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, #f0faf8 0%, #ffffff 32%);
  padding-left: 15px;
}

.notification-item-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(15, 118, 110, 0.2);
}

.notification-item-icon:hover,
.notification-item-icon:focus-visible {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.notification-content { min-width: 0; }

.notification-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.notification-item h3,
.notification-item p { margin: 0; }

.notification-item h3 {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
}

.notification-unread-label { padding: 5px 7px; }

.notification-item p {
  color: #354542;
  line-height: 1.45;
}

.notification-item > .notification-read-button {
  padding: 0.62rem 0.82rem;
  border-color: #c8dcd8;
  color: var(--accent-strong);
  white-space: nowrap;
}

.notification-time {
  display: block;
  margin-top: 6px;
  color: #71807d;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 700px) {
  .notification-panel { padding: 18px 16px; }
  .notification-heading { align-items: flex-start; }
  .notification-heading p { margin-left: 0; }
  .notification-item { grid-template-columns: 34px minmax(0, 1fr); }
  .notification-item-icon { width: 34px; height: 34px; }
  .notification-item > .notification-read-button { grid-column: 2; justify-self: start; }
}

.change-password-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.change-password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.change-password-form .error {
  grid-column: 1 / -1;
  min-height: 0;
}

.success {
  color: #047857;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.submit-panel,
.tickets-panel {
  padding: 24px;
}

.submit-panel {
  min-width: 0;
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.submit-panel::before {
  content: "";
  display: block;
  height: 5px;
  margin: -24px -24px 18px;
  background: linear-gradient(90deg, var(--accent), #2563eb 55%, #b45309);
}

.submit-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.submit-panel-heading .eyebrow {
  margin-bottom: 0.35rem;
}

.submit-panel-badge {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
}

.submit-panel-copy {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

#ticketForm,
.it-form {
  display: grid;
  gap: 0.95rem;
  margin-top: 1rem;
}

#ticketForm,
#ticketForm label {
  min-width: 0;
}

#ticketForm input,
#ticketForm select,
#ticketForm textarea {
  min-width: 0;
}

.ticket-form-actions {
  display: grid;
  grid-template-columns: minmax(140px, 0.3fr) minmax(220px, 1fr);
  gap: 12px;
}

.ticket-form-actions button {
  width: 100%;
}

.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.help-button:hover,
.help-button:focus-visible {
  background: var(--accent-strong);
}

.type-help-popover {
  border: 1px solid #f3b4ae;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  max-height: min(420px, calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.type-help-popover section + section {
  margin-top: 10px;
}

.type-help-popover strong {
  display: block;
  margin-bottom: 4px;
}

.type-help-popover ul {
  margin: 0;
  padding-left: 1.1rem;
}

.type-help-popover p {
  margin: 0;
}

.help-note {
  margin-top: 10px !important;
  color: var(--danger);
  font-weight: 700;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 18px;
}

.panel-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.user-ticket-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-tile {
  display: grid;
  grid-template-rows: 28px auto 1fr;
  align-content: start;
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 12px 14px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.summary-tile:hover,
.summary-tile:focus-visible {
  border-color: #99d8d0;
  background: transparent;
  color: inherit;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.summary-tile:active,
.summary-tile.is-active,
.summary-tile.is-active:hover,
.summary-tile.is-active:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: transparent;
  color: inherit;
}

.summary-tile strong {
  display: block;
  align-self: start;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.summary-tile span,
.summary-tile small {
  display: block;
  overflow-wrap: anywhere;
}

.summary-tile span {
  margin-top: 0.35rem;
  font-weight: 800;
}

.summary-tile small {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.35;
}

.employee-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.status-filter {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 800;
}

.status-filter:hover {
  border-color: #99d8d0;
  background: #eef8f6;
  color: var(--accent-strong);
}

.status-filter.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.admin-create-panel,
.user-management-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 16px;
}

.user-management-panel {
  margin-bottom: 16px;
}

.user-management-content {
  margin-top: 12px;
}

.section-heading h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-create-form,
.user-form {
  display: grid;
  gap: 12px;
  align-items: end;
}

.admin-create-form {
  grid-template-columns: minmax(0, 0.58fr) minmax(0, 0.72fr) minmax(0, 1.28fr) minmax(0, 0.72fr) minmax(0, 0.68fr) minmax(0, 0.88fr);
}

.admin-create-form > label {
  min-width: 0;
}

.admin-create-form .email-report-field,
.admin-create-form .error,
.user-form .error {
  grid-column: 1 / -1;
}

.admin-create-form .form-label-text {
  padding-left: calc(0.8rem + 1px);
}

.admin-create-form .email-report-field {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.email-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.email-report-layout textarea {
  min-height: 108px;
  resize: vertical;
}

.admin-screenshot-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0.65rem 0.8rem;
}

.admin-screenshot-button {
  align-self: flex-start;
  border: 1px solid #a9b5b2;
  border-radius: 8px;
  background: #f7f8f8;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
  cursor: pointer;
  font-weight: 400;
  white-space: nowrap;
}

.admin-screenshot-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-attachment-preview {
  margin-top: 0;
}

.admin-create-form button[type="submit"] {
  grid-column: 1 / 2;
}

.user-management-toggle {
  grid-column: 5 / 7;
  justify-self: end;
  min-width: 12rem;
}

.admin-create-form .error,
.user-form .error {
  min-height: 0;
}

.user-form {
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) auto;
}

.user-form .user-form-label-text {
  padding-left: calc(0.8rem + 1px);
}

.user-form .user-id-field {
  position: relative;
}

.form-column-resize-handle {
  position: absolute;
  top: 0;
  right: -8px;
  z-index: 3;
  width: 16px;
  height: 28px;
  cursor: col-resize;
  touch-action: none;
}

.form-column-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  left: 7px;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: #d8e2df;
}

.form-column-resize-handle:hover::after,
.form-column-resize-handle:active::after {
  background: var(--accent);
}

.user-list {
  margin-top: 14px;
}

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

.compact-button {
  padding: 0.55rem 0.75rem;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.88fr) minmax(0, 0.76fr) minmax(0, 0.82fr) minmax(0, 0.86fr) minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 0.92fr) minmax(0, 0.92fr) minmax(84px, 0.48fr);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 14px;
  margin-bottom: 16px;
}

.admin-filters label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-weight: 400;
  min-width: 0;
}

.admin-filters .filter-label-text {
  padding-left: calc(0.8rem + 1px);
}

.admin-filters input,
.admin-filters select {
  display: block;
  min-width: 0;
}

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

.workspace:not(.admin-workspace) .ticket-list {
  max-height: calc(100vh - 390px);
  overflow-y: auto;
  padding-right: 6px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 32px;
  text-align: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ticket-table,
.user-table {
  width: 100%;
  border-collapse: collapse;
}

.ticket-table {
  min-width: 1120px;
  table-layout: fixed;
}

.ticket-table.resizable-table {
  border-collapse: separate;
  border-spacing: 8px 0;
}

.user-table {
  border-collapse: separate;
  border-spacing: 8px;
  min-width: 920px;
  table-layout: fixed;
}

.ticket-table th,
.ticket-table td,
.user-table th,
.user-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.ticket-table th,
.user-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.ticket-table.resizable-table th {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 14px rgba(24, 32, 31, 0.05);
  overflow: visible;
  white-space: nowrap;
}

.ticket-table.resizable-table th,
.ticket-table.resizable-table td { width: auto; min-width: 0; }

.ticket-table.employee-ticket-table th,
.ticket-table.employee-ticket-table td {
  width: auto;
  min-width: 0;
}

.ticket-table.employee-ticket-table th {
  white-space: nowrap;
}

.ticket-table.employee-ticket-table td {
  white-space: normal;
}

.ticket-table td {
  overflow-wrap: anywhere;
}

.user-table th:not(:last-child) {
  padding-left: calc(0.75rem + 0.6rem + 1px);
}

.user-table th {
  position: relative;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 14px rgba(24, 32, 31, 0.05);
  white-space: nowrap;
}

.column-resize-handle {
  position: absolute;
  top: 8px;
  right: -7px;
  z-index: 2;
  width: 14px;
  height: calc(100% - 16px);
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  left: 6px;
  width: 3px;
  height: 100%;
  border-radius: 999px;
  background: #d8e2df;
}

.column-resize-handle:hover::after,
.column-resize-handle:active::after {
  background: var(--accent);
}

.user-table th:last-child,
.user-table td:last-child {
  text-align: center;
}

.ticket-table td,
.user-table td {
  font-size: 0.9rem;
}

.ticket-table tr:hover td,
.user-table tr:hover td {
  background: #f8fbfa;
}

.user-table input,
.user-table select {
  min-width: 150px;
  padding: 0.55rem 0.6rem;
}

.user-table .user-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
  max-width: none;
  margin: 0 auto;
}

.user-table .user-actions button {
  font-weight: 400;
}

.compact-button {
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  white-space: nowrap;
}

.ticket-actions {
  text-align: left;
  white-space: nowrap;
}

.ticket-table th.actions-header {
  text-align: left;
  white-space: nowrap;
}

.ticket-table th.status-header {
  padding-left: calc(0.75rem + 0.7rem);
}

.ticket-actions-group {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

.ticket-action-button {
  font-weight: 400;
  padding-left: 0;
  padding-right: 0;
  width: 5.5rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.pagination-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.danger-text-button {
  color: #b42318;
}

.danger-text-button:hover {
  color: #8a1c13;
}

.danger-button {
  background: #d8665b;
}

.danger-button:hover {
  background: #c45147;
}

.danger-button:disabled {
  border: 1px solid var(--line);
  background: #eef2f1;
  color: var(--muted);
  cursor: not-allowed;
}

.description-cell {
  max-width: 260px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ticket-number-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  text-align: left;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ticket-number-link:hover {
  background: transparent;
  color: var(--accent-strong);
}

.attachment-preview,
.ticket-attachments,
.table-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-preview {
  margin-top: -0.4rem;
}

.file-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  font-weight: 700;
}

.attachment-field {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 0;
}

.attachment-field-label {
  display: block;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border: 1px solid #a9b5b2;
  border-radius: 4px;
  background: #f7f8f8;
  padding: 0.28rem 0.55rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.file-picker-status {
  flex: 1 1 150px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ticketForm .file-picker {
  align-items: flex-start;
  flex-direction: column;
}

#ticketForm .file-picker-status {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: normal;
}

.attachment-field .file-picker {
  align-items: flex-start;
  flex-direction: column;
}

.attachment-field .file-picker-status {
  flex-basis: auto;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.preview-item,
.attachment-link {
  display: inline-grid;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.preview-item {
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  max-width: 280px;
}

.attachment-link {
  grid-template-columns: 44px minmax(0, 1fr);
}

.attachment-link:hover {
  border-color: var(--accent);
}

.preview-item img,
.attachment-link img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef5f3;
}

.preview-item span,
.attachment-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid #a9b5b2;
  border-radius: 3px;
  background: #f7f8f8;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.preview-remove-button:hover,
.preview-remove-button:focus-visible {
  border-color: var(--accent);
  background: #eef5f3;
  color: var(--ink);
}

.ticket-attachments {
  margin: 1rem 0;
}

.table-attachments {
  min-width: 180px;
}

.table-attachments .attachment-link {
  grid-template-columns: 34px minmax(0, 1fr);
  max-width: 180px;
  padding: 5px;
}

.table-attachments .attachment-link img {
  width: 34px;
  height: 34px;
}

.muted-text {
  color: var(--muted);
}

.admin-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
}

.detail-toolbar,
.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.detail-toolbar {
  align-items: center;
  margin-bottom: 18px;
}

.detail-heading {
  align-items: flex-start;
  display: block;
}

.detail-heading > div:first-child:empty {
  display: none;
}

.detail-heading h2 {
  margin: 0.2rem 0 0;
  font-size: 1.6rem;
}

.detail-section {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.detail-section h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.ticket-task-section {
  display: grid;
  gap: 10px;
}

.employee-task-section {
  border: 1px solid #d7e3e0;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 0.9rem 1rem;
}

.ticket-task-list {
  display: grid;
  gap: 8px;
}

.task-empty {
  margin: 0;
}

.ticket-task-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.ticket-task-item.is-completed {
  background: #f3f7f6;
}

.task-complete-toggle {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.task-complete-toggle:disabled {
  opacity: 1;
}

.task-content {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(145px, 0.35fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-content strong {
  overflow-wrap: anywhere;
}

.task-due-date {
  color: var(--muted);
  font-size: 0.82rem;
}

.is-completed .task-content strong {
  color: var(--muted);
  text-decoration: line-through;
}

.task-state {
  border-radius: 999px;
  background: #e8f0ee;
  color: #42514e;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.32rem 0.55rem;
  white-space: nowrap;
}

.task-state-completed {
  background: #dcfce7;
  color: #166534;
}

.task-state-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.task-state-due-today {
  background: #fef3c7;
  color: #92400e;
}

.task-actions {
  display: flex;
  gap: 6px;
}

.task-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.35fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px dashed #b8ccc8;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.task-create-form .error {
  grid-column: 1 / -1;
  margin: 0;
}

.task-list-error:empty {
  display: none;
}

.ticket-subject-cell {
  display: grid;
  gap: 6px;
}

.ticket-task-summary {
  justify-self: start;
  border-radius: 999px;
  background: #e8f0ee;
  color: #42514e;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

.ticket-task-summary.has-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.ticket-due-summary {
  justify-self: start;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.ticket-due-summary.is-overdue {
  color: #b42318;
}

.admin-detail-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) max-content;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.admin-detail-form label {
  min-width: 0;
  font-weight: 400;
  padding-left: calc(0.8rem + 1px);
}

.admin-detail-form label > input,
.admin-detail-form label > select,
.admin-detail-form label > textarea {
  min-width: 0;
  margin-left: calc(-0.8rem - 1px);
  width: calc(100% + 0.8rem + 1px);
}

.admin-detail-form .comment-field {
  grid-column: 1 / -1;
}

.comment-field {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(160px, 0.85fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.comment-field > label {
  grid-column: 1 / 3;
}

.comment-field > .attachment-field {
  grid-column: 3 / 5;
}

.comment-field label {
  min-width: 0;
  padding-left: 0;
}

.comment-field .file-picker {
  min-width: 0;
}

.comment-field label > textarea {
  margin-left: 0;
  width: 100%;
}

.comment-field .attachment-preview {
  grid-column: 1 / -1;
  margin-top: 0;
}

.admin-detail-form .error {
  align-self: center;
  min-height: 0;
}

.admin-detail-form .save-message {
  grid-column: 1 / -1;
  margin-left: 4px;
}

.admin-detail-form .save-changes-button {
  min-width: 116px;
  padding-inline: 0.9rem;
  white-space: nowrap;
}

.cr-metadata-section .section-heading {
  align-items: baseline;
  gap: 12px;
}

.cr-metadata-section .section-heading p {
  margin: 0;
}

.cr-metadata-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.cr-metadata-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}

.cr-metadata-form label:first-child,
.cr-metadata-form label:last-of-type {
  grid-column: span 2;
}

.cr-metadata-form textarea,
.cr-metadata-form input,
.cr-metadata-form select {
  width: 100%;
  min-width: 0;
}

.cr-metadata-form button {
  justify-self: start;
}

.cr-metadata-form .cr-metadata-message {
  grid-column: 2 / -1;
  min-height: 0;
  margin: 0;
}

.cr-metadata-facts {
  margin-top: 12px;
}

.workflow-metadata-note {
  grid-column: 1 / -1;
  margin: 0;
}

.close-reason-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  margin-top: 18px;
  padding: 16px;
}

.close-reason-section label {
  min-width: 0;
}

.close-reason-editor {
  position: relative;
  display: block;
  min-width: 0;
}

.close-reason-editor textarea {
  display: block;
  min-height: 112px;
  padding-right: 118px;
  padding-bottom: 62px;
  resize: none;
}

.close-reason-editor .close-ticket-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 92px;
}

.close-reason-section.is-closed textarea {
  background: white;
  color: var(--ink);
  cursor: default;
  padding: 0.75rem 0.8rem;
}

.ticket-card {
  box-shadow: none;
  padding: 18px;
}

.employee-ticket-card {
  display: grid;
  gap: 14px;
  border-color: #8fc3ba;
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%);
  padding: 20px;
}

.ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ticket-number {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.ticket-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
}

.status-pill {
  align-self: start;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.detail-inline-status {
  align-self: center;
  margin-left: auto;
  padding: 0.65rem 1rem;
}

.detail-status-badge {
  border: 2px solid currentColor;
  box-shadow: 0 2px 8px rgba(24, 39, 35, 0.14);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.priority-p1 { background: #fde8e8; color: #9b1c1c; }
.priority-p2 { background: #fff0dc; color: #9a4b08; }
.priority-p3 { background: #e7f0fb; color: #214969; }
.priority-p4 { background: #e2f4e9; color: #28633e; }
.priority-unspecified { background: #eef2f1; color: #3e514b; }

.table-status-pill {
  font-size: 0.78rem;
  font-weight: 400;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1.75rem 0 1rem;
}

.ticket-meta div {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.42rem 0.58rem;
}

.ticket-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
}

.ticket-meta dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 400;
}

.employee-ticket-card .ticket-meta .date-meta dd {
  font-size: 0.85rem;
  white-space: nowrap;
}

.ticket-description {
  color: #313b39;
  line-height: 1.55;
  white-space: pre-wrap;
}

.employee-ticket-card .ticket-description {
  margin: 0;
  border: 1px solid #b7cfca;
  border-radius: 8px;
  background: white;
  padding: 0.9rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(20, 129, 116, 0.08);
}

.notes-block {
  border-left: 3px solid var(--accent);
  background: #eef8f6;
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
}

.comment-empty,
.comment-text {
  margin: 0.35rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.comments-list {
  display: grid;
  gap: 10px;
  margin-top: 0.45rem;
}

.comment-item {
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: white;
  padding: 0.7rem 0.8rem;
}

.comment-item.is-reply-target {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.reply-workflow-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  border: 1px solid #d59b19;
  border-radius: 10px;
  background: #fff8df;
  padding: 14px 16px;
}

.reply-workflow-banner.hidden { display: none; }

.reply-workflow-banner p { margin: 0.3rem 0 0; }

.attention-banner {
  border-color: #c65b4a;
  background: #fff1ee;
}

.reply-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.reply-workflow-banner > .error { grid-column: 1 / -1; }

.attention-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c65b4a;
  border-radius: 999px;
  background: #fff1ee;
  color: #8f2f22;
  padding: 0.28rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-needs-attention td { background: #fffaf7; }

.comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.comment-header strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.comment-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.comments-heading h3 {
  margin-bottom: 0;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.55rem;
}

.comment-reply-button {
  min-width: 86px;
}

.comment-attachments {
  margin-top: 0.6rem;
}

.employee-ticket-card .notes-block {
  border: 1px solid #cfe7e2;
  border-left: 4px solid var(--accent);
  background: #f1fbf9;
}

.comment-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  gap: 12px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.comment-reply-form > label {
  min-width: 0;
}

.comment-reply-form .attachment-preview,
.comment-reply-form .error {
  grid-column: 1 / -1;
}

.comment-reply-form button[type="submit"] {
  justify-self: start;
}

.reply-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: 16px;
  background: white;
  padding: 0;
  box-shadow: 0 24px 70px rgba(10, 35, 31, 0.28);
}

.reply-dialog::backdrop {
  background: rgba(9, 31, 28, 0.56);
  backdrop-filter: blur(2px);
}

.reply-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.reply-dialog-heading span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reply-dialog-heading h3 {
  margin: 0.25rem 0 0;
}

.reply-dialog .comment-reply-form {
  margin: 0;
  border-top: 0;
  padding: 20px;
}

@media (max-width: 720px) {
  .reply-workflow-banner { grid-template-columns: 1fr; }
  .reply-workflow-actions { justify-content: flex-start; }
}

.announcement-dialog {
  overflow: auto;
}

.announcement-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.announcement-form textarea {
  min-height: 150px;
}

.announcement-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.announcement-form-actions .error {
  flex: 1;
}

.announcement-history {
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
}

.announcement-history h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.announcement-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfa;
  padding: 12px 14px;
}

.announcement-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.announcement-item-heading time,
.announcement-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.announcement-item p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.it-form {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

@media (max-width: 1120px) {
  .admin-create-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-detail-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cr-metadata-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-detail-form .save-message {
    grid-column: 2 / -1;
  }

  .admin-create-form button[type="submit"],
  .user-management-toggle {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .login-view,
  .workspace {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 360px;
    padding: 30px;
  }

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

  .comment-field > label,
  .comment-field > .attachment-field {
    grid-column: 1;
  }

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

  .submit-panel {
    position: static;
  }

  .workspace:not(.admin-workspace) .ticket-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

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

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar-action {
    justify-content: flex-start;
    padding-left: 0;
  }

  .user-chip {
    justify-content: flex-start;
  }

  .panel-heading,
  .ticket-header {
    flex-direction: column;
  }

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

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

  .detail-toolbar,
  .detail-heading,
  .admin-create-form,
  .user-form,
  .change-password-form,
  .admin-detail-form,
  .cr-metadata-form {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .cr-metadata-form label:first-child,
  .cr-metadata-form label:last-of-type,
  .cr-metadata-form .cr-metadata-message {
    grid-column: 1;
  }

  .admin-detail-form .save-message {
    grid-column: 1;
  }

  .admin-create-form button[type="submit"],
  .user-management-toggle {
    grid-column: 1;
  }

  .ticket-task-item {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .task-content,
  .task-create-form {
    grid-template-columns: 1fr;
  }

  .task-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .submit-panel,
  .tickets-panel,
  .employee-ticket-card {
    padding: 16px;
  }

  .submit-panel::before {
    margin: -16px -16px 14px;
  }

  .panel-heading {
    align-items: stretch;
  }

  .panel-heading .ghost,
  .status-filter,
  #ticketForm button[type="submit"] {
    width: 100%;
  }

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

  .employee-status-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-ticket-summary {
    grid-template-columns: 1fr;
  }

  .ticket-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .file-picker {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Phase 1 workspace redesign */
:root {
  --bg: #edf2f1;
  --surface: #ffffff;
  --ink: #17201e;
  --muted: #66736f;
  --line: #dbe5e2;
  --accent: #137a70;
  --accent-strong: #0b5e57;
  --sidebar: #123b37;
  --sidebar-soft: #1c4b46;
  --shadow: 0 12px 32px rgba(24, 56, 51, 0.08);
}

body {
  background: var(--bg);
}

button,
input,
select,
textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(19, 122, 112, 0.2);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #72aaa4;
  box-shadow: 0 0 0 3px rgba(19, 122, 112, 0.1);
}

.shell {
  width: 100%;
  padding: 0;
}

.login-view {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 0;
}

.brand-panel {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 24px 0 0 24px;
  background: #123b37;
  padding: 64px;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-panel::before {
  width: 380px;
  height: 380px;
  top: -160px;
  right: -90px;
  border: 70px solid rgba(101, 202, 186, 0.12);
}

.brand-panel::after {
  width: 220px;
  height: 220px;
  top: 72px;
  left: 64px;
  background: rgba(52, 151, 139, 0.16);
  box-shadow: 150px 118px 0 rgba(255, 255, 255, 0.04);
}

.brand-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 12px 0 18px;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.brand-panel > p {
  position: relative;
  z-index: 1;
  max-width: 540px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.login-card {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0 24px 24px 0;
  box-shadow: none;
  padding: 64px 54px;
}

.login-card h2 {
  margin-bottom: 1.8rem;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

.app-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  background: var(--sidebar);
  color: white;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 4px 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 6px;
}

.sidebar-brand div,
.sidebar-profile div {
  display: grid;
  min-width: 0;
}

.sidebar-brand strong {
  font-size: 0.96rem;
}

.sidebar-brand span,
.sidebar-profile span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.74rem;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
  margin-top: 24px;
}

button.sidebar-nav-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
}

button.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

button.sidebar-nav-item.is-active {
  border-color: rgba(134, 222, 207, 0.22);
  background: rgba(107, 205, 188, 0.16);
  color: white;
  box-shadow: inset 3px 0 0 #70d3c1;
}

.sidebar-notification-count {
  min-width: 22px;
  border-radius: 999px;
  background: #ec6b5e;
  color: white;
  padding: 2px 6px;
  text-align: center;
  font-size: 0.68rem;
}

.sidebar-profile {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 8px 4px;
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #65b9aa;
  color: #0c3733 !important;
  font-weight: 800;
}

button.sidebar-logout {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  padding: 9px 12px;
}

button.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.app-main {
  min-width: 0;
  padding: 26px 30px 42px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.page-heading .eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.page-heading > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
}

.topbar-logo,
.user-chip > #userName,
.user-chip > #logoutButton,
.user-chip > #changePasswordToggle,
#viewAllTicketsButton {
  display: none !important;
}

.topbar-action {
  padding: 0;
}

.user-chip {
  padding: 0;
  background: transparent;
}

.notification-button {
  position: relative;
  min-height: 44px;
}

.dashboard-panel {
  display: grid;
  gap: 20px;
}

.dashboard-welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 18px;
  background: #174b46;
  color: white;
  padding: 30px 34px;
  box-shadow: var(--shadow);
}

.dashboard-welcome::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -95px;
  border: 42px solid rgba(119, 214, 197, 0.12);
  border-radius: 50%;
}

.dashboard-welcome > * {
  position: relative;
  z-index: 1;
}

.dashboard-kicker,
.dashboard-card-kicker {
  color: #72d1c0;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.dashboard-welcome h2 {
  margin: 7px 0 6px;
  font-size: 1.75rem;
  letter-spacing: -0.035em;
}

.dashboard-welcome p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-welcome button {
  background: white;
  color: #16463f;
}

.dashboard-welcome button:hover {
  background: #e7f4f1;
}

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

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

.my-tickets-overview {
  display: grid;
  gap: 20px;
}

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

.my-tickets-metric {
  cursor: pointer;
  text-align: left;
}

.my-tickets-metric:hover {
  border-color: #9bc8c1;
  box-shadow: 0 10px 24px rgba(24, 56, 51, 0.1);
  transform: translateY(-2px);
}

.dashboard-metric {
  position: relative;
  display: grid;
  gap: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(24, 56, 51, 0.045);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-metric:hover {
  border-color: #9bc8c1;
  background: white;
  box-shadow: 0 10px 24px rgba(24, 56, 51, 0.1);
  transform: translateY(-2px);
}

.dashboard-metric.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(28, 138, 126, 0.16), 0 10px 24px rgba(24, 56, 51, 0.1);
}

@media (max-width: 1400px) {
  .admin-filters {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .admin-filters {
    grid-template-columns: 1fr;
  }
}

.dashboard-metric::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #a9bab6;
}

.dashboard-metric.metric-accent::before { background: #249184; }
.dashboard-metric.metric-warning::before { background: #d49b3d; }
.dashboard-metric.metric-danger::before { background: #d8665b; }
.dashboard-metric.metric-success::before { background: #5b9b73; }

.dashboard-metric > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.dashboard-metric strong {
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.dashboard-metric small {
  color: #83908c;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.6fr);
  gap: 16px;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(24, 56, 51, 0.045);
}

.dashboard-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dashboard-card-kicker {
  color: var(--accent);
}

.dashboard-card h3 {
  margin: 5px 0 12px;
  font-size: 1.08rem;
}

.dashboard-recent-list {
  display: grid;
}

button.dashboard-ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 120px;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  border-top: 1px solid #edf1f0;
  border-radius: 0;
  background: white;
  color: var(--ink);
  padding: 13px 4px;
  text-align: left;
  font-weight: 400;
}

button.dashboard-ticket-row:hover {
  background: #f6faf9;
}

.dashboard-ticket-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-ticket-identity strong {
  color: var(--accent-strong);
  font-size: 0.78rem;
}

.dashboard-ticket-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ticket-row time {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.dashboard-focus-card {
  background: #fbfdfc;
}

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

.dashboard-focus-list > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #e3ebe9;
  border-radius: 10px;
  background: white;
  padding: 11px 12px;
}

.dashboard-focus-list strong {
  color: var(--accent-strong);
  font-size: 1.3rem;
}

.dashboard-focus-list span {
  color: #52605c;
  font-size: 0.84rem;
}

.dashboard-focus-list.dashboard-announcement-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 3px;
}

.dashboard-focus-list.dashboard-announcement-list > article {
  display: grid;
  grid-template-columns: 1fr;
  align-items: initial;
  gap: 8px;
  border: 1px solid #dce8e5;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: white;
  padding: 13px 14px;
}

.dashboard-announcement-heading {
  display: grid;
  gap: 5px;
}

.dashboard-announcement-heading strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.dashboard-announcement-heading time,
.dashboard-announcement-item small {
  color: var(--muted);
  font-size: 0.74rem;
}

.dashboard-announcement-item p {
  margin: 0;
  color: #43524f;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dashboard-announcement-empty {
  margin: 0;
  border: 1px dashed #ccdcd8;
  border-radius: 10px;
  background: white;
  color: var(--muted);
  padding: 18px 14px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.user-status-cell {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.user-status-cell small {
  color: var(--muted);
}

.user-status-badge {
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-status-badge.is-active {
  background: #dcfce7;
  color: #166534;
}

.user-status-badge.is-inactive {
  background: #eef2f1;
  color: #66716f;
}

.detail-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.internal-notes-section {
  border: 1px solid #f0d6a5;
  border-radius: 12px;
  background: #fffaf0;
  padding: 16px;
}

.internal-notes-section .section-heading {
  margin-bottom: 10px;
}

.internal-notes-section .section-heading h3,
.internal-notes-section .section-heading p {
  margin: 0;
}

.internal-notes-section .section-heading p {
  margin-top: 4px;
  color: #8a6a32;
  font-size: 0.8rem;
}

.internal-notes-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.internal-note-item {
  border: 1px solid #eedbb8;
  border-radius: 9px;
  background: white;
  padding: 10px 12px;
}

.internal-note-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.internal-note-item span {
  color: var(--muted);
  font-size: 0.76rem;
}

.internal-note-item p {
  margin: 7px 0 0;
  white-space: pre-wrap;
}

.internal-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.internal-note-form .error {
  grid-column: 1 / -1;
  margin: 0;
}

.status-history-list {
  display: grid;
  gap: 0;
}

.status-history-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  min-height: 48px;
}

.status-history-marker {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #9dc9c2;
}

.status-history-marker::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 3px;
  width: 2px;
  height: 36px;
  background: #dce7e4;
}

.status-history-item:last-child .status-history-marker::after {
  display: none;
}

.status-history-item > div {
  display: grid;
  gap: 3px;
}

.status-history-item span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.workspace,
.workspace.admin-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.submit-panel,
.tickets-panel,
.notification-panel,
.change-password-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.submit-panel {
  position: static;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.tickets-panel {
  padding: 22px;
}

.tickets-panel.create-workspace,
.tickets-panel.users-workspace {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.admin-create-panel,
.user-management-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 24px;
  box-shadow: var(--shadow);
}

.user-management-toggle {
  display: none !important;
}

.panel-heading {
  margin-bottom: 16px;
}

.admin-filters {
  border: 1px solid #dce7e4;
  border-radius: 12px;
  background: #f7faf9;
  padding: 14px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.ticket-xlsx-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  padding: 10px 12px;
}

.ticket-xlsx-toolbar button {
  padding: 0.62rem 0.8rem;
}

.xlsx-import-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 24px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgb(15 23 42 / 28%);
}

.create-success-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 16px;
  border: 1px solid #90c5a7;
  border-radius: 10px;
  background: #e7f5eb;
  color: #194b2b;
  font-weight: 700;
}

.create-success-banner.hidden { display: none; }

.xlsx-import-dialog::backdrop {
  background: rgb(15 23 42 / 52%);
}

.xlsx-import-heading,
.xlsx-import-actions,
.xlsx-import-controls,
.xlsx-import-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xlsx-import-heading {
  justify-content: space-between;
}

.xlsx-import-heading span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.xlsx-import-heading h2 {
  margin: 3px 0 0;
}

.xlsx-import-controls {
  flex-wrap: wrap;
  margin: 20px 0 12px;
}

.xlsx-file-label {
  font-weight: 700;
}

.xlsx-import-summary {
  flex-wrap: wrap;
  margin: 12px 0;
}

.xlsx-import-summary span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  font-weight: 700;
}

.xlsx-import-preview {
  max-height: min(52vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.xlsx-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.xlsx-preview-table th,
.xlsx-preview-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.xlsx-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.xlsx-row-new,
.xlsx-row-changed,
.xlsx-change {
  background: #fef9c3;
}

.xlsx-row-error {
  background: #fee2e2;
}

.xlsx-result-badge {
  font-weight: 800;
}

.xlsx-change {
  margin-bottom: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.xlsx-warning {
  margin-top: 6px;
  color: #92400e;
  font-weight: 650;
}

.xlsx-import-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .xlsx-import-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .xlsx-import-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .xlsx-import-controls button,
  .xlsx-import-controls input {
    width: 100%;
  }
}

.ticket-selection-checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.ticket-table.resizable-table {
  border-spacing: 0;
}

.ticket-table.resizable-table th {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #f6f9f8;
  box-shadow: none;
}

button.sort-header-button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font-size: inherit;
  font-weight: 800;
  text-transform: inherit;
}

button.sort-header-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.ticket-table tr:hover td {
  background: #f4f9f8;
}

.admin-detail {
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.ticket-meta > div {
  border-radius: 10px;
  background: #f8faf9;
}

.notification-panel,
.change-password-panel {
  max-width: none;
  margin: 0;
  padding: 24px;
}

.notification-panel::before {
  display: none;
}

@media (max-width: 1500px) {
  .dashboard-metrics,
  .dashboard-metrics.employee-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .dashboard-metrics,
  .dashboard-metrics.employee-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .app-sidebar {
    position: static;
    height: auto;
    padding: 12px 14px;
  }

  .sidebar-brand {
    min-height: 54px;
    padding: 0 4px 10px;
  }

  .sidebar-logo {
    width: 40px;
    height: 40px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 2px;
  }

  button.sidebar-nav-item {
    width: auto;
    min-width: max-content;
    grid-template-columns: auto auto;
  }

  .sidebar-profile {
    display: none;
  }

  .app-main {
    padding: 22px 18px 34px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .user-chip {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .login-view {
    width: 100%;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .brand-panel {
    min-height: 280px;
    border-radius: 0;
    padding: 34px 24px;
  }

  .brand-panel h1 {
    font-size: 2.8rem;
  }

  .login-card {
    min-height: calc(100vh - 280px);
    border-radius: 0;
    padding: 36px 24px;
  }

  .app-main {
    padding: 18px 12px 30px;
  }

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

  .topbar-action,
  .user-chip {
    grid-column: 1;
    justify-content: flex-start;
  }

  .dashboard-welcome {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

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

  button.dashboard-ticket-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-ticket-row time {
    display: none;
  }

  .tickets-panel,
  .admin-detail,
  .admin-create-panel,
  .user-management-panel {
    padding: 16px;
    border-radius: 12px;
  }
}
.task-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.task-filters label { display: flex; flex-direction: column; gap: 6px; }
.task-table-scroll { overflow-x: auto; max-height: 560px; margin-bottom: 18px; }
.task-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.task-table th, .task-table td { padding: 10px; text-align: left; border-bottom: 1px solid #dce3eb; }
.task-table th { position: sticky; top: 0; background: #f5f7fb; z-index: 1; }
.task-table th button { color: #24344b; background: transparent; padding: 4px; }
.task-table td:nth-child(3) { min-width: 220px; overflow-wrap: anywhere; }
.task-table th:nth-child(4), .task-table td:nth-child(4) { width: 210px; max-width: 210px; min-width: 0; }
.task-number-link { background: transparent; color: #245eb8; padding: 0; text-decoration: underline; text-align: left; }
.task-pin-button { font-size: 22px; min-width: 40px; }
.task-pin-button[aria-pressed="true"] { color: #8a6000; }
.task-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; }
.task-save-toolbar { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.task-cell-modified { background: #fff0c2; box-shadow: inset 4px 0 #a05a00; }
.task-cell-modified::after { content: attr(data-changed); display: block; color: #754000; font-size: 0.75rem; font-weight: 700; }
.task-cell-modified :focus-visible { outline: 3px solid #245eb8; outline-offset: 2px; }
.task-is-focused { outline: 3px solid #245eb8; outline-offset: 3px; }
.task-assignee-input { width: 100%; }
.task-number-label { grid-column: 1 / -1; color: var(--muted); font-size: 0.82rem; }
.task-create-form { grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr) minmax(140px, 0.5fr) auto; }
@media (max-width: 700px) { .task-create-form { grid-template-columns: 1fr; } }
.dashboard-focus-button { width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; background: #f5f7fb; color: #24344b; }
.dashboard-focus-button:focus-visible, .task-table button:focus-visible { outline: 3px solid #245eb8; outline-offset: 3px; }

.ticket-xlsx-toolbar, .sync-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sync-controls { color: var(--muted); font-size: 0.85rem; }
.ticket-table th { white-space: nowrap; }
.projects-panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.reports-panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.report-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.report-filter-grid label { display: grid; gap: 5px; font-weight: 600; }
.report-summary { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0; }
.report-summary strong { display: block; font-size: 1.2rem; }
.task-inline-error { color: #b42318; display: block; max-width: 180px; }
.stopwatch-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; margin: 0 0 12px; padding: 12px 16px; border: 1px solid #b9d7d3; border-radius: 12px; background: #edf8f6; }
.stopwatch-bar > div { display: grid; gap: 2px; min-width: 0; }
.stopwatch-label { color: var(--accent); font-size: 0.72rem; font-weight: 800; letter-spacing: .08em; }
.stopwatch-bar strong, .stopwatch-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stopwatch-bar output { min-width: 90px; font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 800; text-align: right; }
.task-time-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 170px; }
.task-hours-button { font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-project-link { display: block; width: 100%; max-width: 210px; min-width: 0; padding-inline: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.task-man-hour-summary { color: var(--muted); font-size: .85rem; }
.time-record-dialog { width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.time-record-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.time-record-total { display: flex; align-items: baseline; gap: 12px; margin: 12px 0 18px; }
.time-record-total strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.time-record-new-form { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(120px, .7fr)) minmax(120px, .6fr) auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf9; }
.time-record-new-form output { min-height: 43px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.time-record-new-actions, .time-record-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.time-record-table-wrap { overflow: auto; max-height: 420px; margin-top: 16px; }
.time-record-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.time-record-table th, .time-record-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }
.time-record-table th { position: sticky; top: 0; background: #f5f7fb; z-index: 1; }
.time-record-table input { min-width: 110px; }
.time-record-table select { min-width: 150px; }
.time-record-table td:last-child input { min-width: 0; width: auto; }
.time-record-table tr.is-deleted { opacity: .48; text-decoration: line-through; }
@media (max-width: 760px) {
  .stopwatch-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .stopwatch-bar output { grid-column: 1; text-align: left; }
  .stopwatch-bar button { grid-column: 2; grid-row: 1 / span 2; }
  .time-record-new-form { grid-template-columns: 1fr; }
}
.project-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.project-filters, .project-link-filters, .project-editor { display: grid; grid-template-columns: repeat(3,minmax(160px,1fr)); gap: 14px; margin: 20px 0; }
.project-editor h2, .project-editor > p { grid-column: 1 / -1; }
.project-editor textarea { min-height: 110px; width: 100%; }
.project-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.project-table th, .project-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.project-table th { white-space: nowrap; font-size: 0.85rem; background: #f5f7fb; }
.capacity-panel, .project-timeline, .project-gantt { border: 1px solid var(--line); padding: 16px; border-radius: 12px; margin: 16px 0; }
.project-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.project-warning { color: #8a4600; background: #fff4db; padding: 12px; }
.timeline-chart { overflow-x: auto; padding: 12px 0; }
.timeline-row { display: grid; grid-template-columns: 240px minmax(360px,1fr) 260px; gap: 12px; align-items: center; min-width: 920px; margin: 12px 0; }
.timeline-track { height: 28px; position: relative; background: #edf1f6; margin-right: 12px; }
.timeline-bar { position: absolute; top: 7px; height: 14px; background: #245eb8; }
.timeline-marker { border-radius: 50%; transform: translateX(-4px); }
.timeline-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #151e31; z-index: 1; }
.timeline-bar.is-completed { background: #25835a; }
.timeline-bar.is-overdue { background: #b33930; }
.project-gantt-scroll { max-width: 100%; overflow-x: auto; padding: 12px 0; }
.project-gantt-scroll:focus-visible, .project-gantt-row:focus-visible { outline: 3px solid #245eb8; outline-offset: 2px; }
.project-gantt-chart { width: calc(260px + var(--gantt-width)); min-width: 100%; }
.project-gantt-axis, .project-gantt-row { display: grid; grid-template-columns: 260px var(--gantt-width); align-items: center; }
.project-gantt-axis { min-height: 55px; border-bottom: 1px solid var(--line); }
.project-gantt-label { position: sticky; left: 0; z-index: 2; display: grid; gap: 3px; padding: 6px 12px; background: white; text-align: left; overflow-wrap: anywhere; }
.project-gantt-label small { color: var(--muted); }
.project-gantt-scale, .project-gantt-track { position: relative; margin: 0 30px; }
.project-gantt-scale { height: 46px; }
.project-gantt-tick { position: absolute; top: 4px; display: block; white-space: nowrap; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); }
.project-gantt-tick:first-child { transform: none; }
.project-gantt-tick:last-child { transform: translateX(-100%); }
.project-gantt-tick.is-today { color: #151e31; font-weight: 700; }
.project-gantt-row { width: 100%; min-height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: white; color: inherit; cursor: pointer; font: inherit; }
.project-gantt-row:hover { background: #f5f7fb; }
.project-gantt-row:hover .project-gantt-label { background: #f5f7fb; }
.project-gantt-track { height: 34px; background: #edf1f6; }
.project-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #151e31; z-index: 1; }
.project-gantt-bar { position: absolute; top: 5px; min-width: 20px; height: 24px; overflow: hidden; white-space: nowrap; padding: 2px 6px; border-radius: 4px; background: #245eb8; color: white; text-align: left; font-size: 0.75rem; }
.project-gantt-bar.is-warning { background: #946000; }
.project-gantt-bar.is-risk { background: #b33930; }
.project-gantt-unplanned li { margin: 8px 0; }
.project-gantt-details { margin-top: 14px; }
.project-gantt-details summary { cursor: pointer; }
.workload-track { width: 150px; background: #edf1f6; min-height: 24px; }
.workload-fill { display: block; box-sizing: border-box; min-height: 24px; overflow: hidden; white-space: nowrap; background: #245eb8; color: white; padding: 2px 0; text-align: center; }
.workload-fill:empty { min-height: 0; padding: 0; }
.ticket-project-link { margin: 20px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.ticket-project-link form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
@media (max-width: 760px) { .projects-panel { padding: 12px; } .project-filters, .project-link-filters, .project-editor { grid-template-columns: 1fr; } }
.ticket-created-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.ticket-created-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.ticket-created-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dff7ed;
  color: #08775f;
  font-size: 34px;
  font-weight: 800;
}

.ticket-created-kicker {
  color: #08775f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ticket-created-dialog h2 {
  margin: 8px 0;
}

.ticket-created-dialog p {
  margin: 0 0 24px;
  color: var(--muted-text);
}

.ticket-created-dialog button {
  width: 100%;
}
