:root {
  --accent: #b0124d;
  --accent-bright: #d6154f;
  --line: #e3e7ec;
  --panel: #ffffff;
  --surface: #f7f9fb;
  --muted: #667085;
  --text: #1f2933;
  --soft-red: #fff3f5;
  --shadow: 0 16px 40px rgba(31, 41, 51, 0.12);
  --card-shadow: 0 10px 26px rgba(31, 41, 51, 0.08);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: #eef2f6;
}

button,
input {
  font: inherit;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(176, 18, 77, 0.10), rgba(255, 255, 255, 0.42)),
    #eef2f6;
}

.login-card {
  width: min(380px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.login-brand {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-bottom: 20px;
}

.login-brand h1 {
  margin: 0;
  color: var(--accent-bright);
  font-size: 20px;
}

.login-card label {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: #5d6570;
  font-size: 12px;
  font-weight: 700;
}

.login-card input {
  min-height: 34px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
}

.login-card button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.login-card button:hover {
  background: var(--accent-bright);
}

.login-test-button {
  margin-top: 8px;
  color: var(--accent) !important;
  background: #fff !important;
}

.login-test-button:hover {
  background: #fff2f6 !important;
}

.app-shell {
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.top-banner {
  display: grid;
  grid-template-columns: 210px 128px 1fr 180px;
  min-height: 138px;
  background:
    linear-gradient(90deg, rgba(176, 18, 77, 0.08), rgba(255, 255, 255, 0.2)),
    #fff;
  gap: 10px;
  padding: 16px 18px 0;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: center;
  min-height: 98px;
  margin-left: 0;
  padding: 10px 10px 8px;
  background: #fff;
  border: 1px solid rgba(214, 21, 79, 0.18);
  border-left: 6px solid var(--accent-bright);
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.demo-logo {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  align-self: center;
  min-width: 124px;
  min-height: 38px;
  border: 1px solid rgba(13, 20, 33, 0.88);
  border-radius: 8px;
  padding: 5px 10px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(214, 21, 79, 0.95), rgba(214, 21, 79, 0.78) 36%, transparent 36%),
    #111827;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
}

.demo-logo::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-right-color: rgba(255, 255, 255, 0.36);
  border-bottom-color: rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.demo-logo::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 7px;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: #d6154f;
  box-shadow:
    -14px -8px 0 rgba(255, 255, 255, 0.22),
    10px -16px 0 rgba(255, 255, 255, 0.18);
}

.brand-mark {
  color: var(--accent-bright);
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  margin-top: 14px;
}

.main-nav,
.service-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
  min-height: 108px;
  padding: 9px 9px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(227, 231, 236, 0.9);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.main-nav a,
.service-links a {
  color: #505761;
  font-size: 11px;
  text-decoration: none;
  border-radius: 5px;
  padding: 3px 6px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.hero-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 108px;
}

.hero-tile {
  background-size: cover;
  background-position: center;
  filter: grayscale(0.85) contrast(0.96);
  border-radius: 8px;
  opacity: 0.9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.tile-one {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(176, 18, 77, 0.08)),
    url("assets/header-service.png");
}

.tile-two {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(176, 18, 77, 0.08)),
    url("assets/header-devices.png");
}

.user-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 18px 0 238px;
  color: #fff;
  background: linear-gradient(90deg, #9f1246, #c01855);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  box-shadow: 0 8px 18px rgba(176, 18, 77, 0.22);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar-actions button,
.detail-actions button {
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  padding: 3px 7px;
}

.bar-actions button:hover,
.detail-actions button:hover {
  background: rgba(176, 18, 77, 0.08);
  border-color: rgba(176, 18, 77, 0.16);
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search input {
  width: 220px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  padding: 3px 9px;
  box-shadow: inset 0 1px 2px rgba(31, 41, 51, 0.12);
}

.search-results {
  position: absolute;
  top: 40px;
  right: 22px;
  z-index: 5;
  width: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.18);
  overflow: hidden;
}

.search-result {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e4e6e8;
  padding: 7px 9px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus {
  outline: none;
  background: var(--soft-red);
}

.search-result strong {
  font-size: 12px;
}

.search-result span,
.search-empty {
  color: var(--muted);
  font-size: 11px;
}

.search-result small {
  color: #6c7580;
  font-size: 10px;
  line-height: 1.3;
}

.search-empty {
  padding: 8px 9px;
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: 24px;
  padding: 20px 22px 44px;
}

.workspace.list-mode {
  grid-template-columns: 1fr;
  padding-left: 28px;
  padding-right: 28px;
}

.ticket-column,
.action-column {
  align-self: start;
  padding: 18px 14px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ticket-column {
  border-right: 1px solid var(--line);
}

.action-column {
  border-left: 1px solid var(--line);
}

.ticket-column h2,
.action-column h2 {
  margin: 6px 0 18px;
  color: var(--accent-bright);
  font-size: 16px;
  font-weight: 600;
}

.ticket-column h2 {
  color: #4c5560;
  font-size: 11px;
}

.ticket {
  margin-bottom: 12px;
  padding: 10px;
  color: #46515d;
  font-size: 11px;
  line-height: 1.25;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ticket-clickable {
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.ticket-clickable:hover,
.ticket-clickable:focus {
  outline: none;
  border-color: rgba(176, 18, 77, 0.32);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.1);
  transform: translateY(-1px);
}

.ticket strong,
.ticket a {
  color: #26333f;
  font-weight: 700;
}

.ticket .state-done {
  color: #677500;
  font-weight: 700;
}

.ticket .state-open {
  color: #005ca8;
}

.contract-panel {
  padding: 0;
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 0 2px;
}

.section-heading p,
.section-heading h1 {
  margin: 0;
  color: var(--accent-bright);
  font-weight: 600;
}

.section-heading h1 {
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  padding-left: 0;
}

.tabs button {
  min-width: 90px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #394553;
  cursor: pointer;
  font-size: 11px;
}

.tabs button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.detail-card {
  min-height: 426px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 18px 18px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.create-card {
  min-height: 426px;
  max-width: 620px;
  margin: 42px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 18px 18px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.list-card {
  min-height: 426px;
  margin-top: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 18px 18px;
  background: #fff;
  overflow-x: auto;
  box-shadow: var(--card-shadow);
}

.ticket-overview-card,
.handypool-card {
  min-height: 426px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  overflow-x: auto;
  box-shadow: var(--card-shadow);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.detail-head h2 {
  margin: 0;
  color: var(--accent-bright);
  font-size: 16px;
  font-weight: 600;
}

.status-pill {
  min-width: 64px;
  padding: 5px 10px;
  color: #375000;
  background: #eef7dc;
  border: 1px solid #cfe2a5;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.4fr);
  gap: 1px;
  max-width: 500px;
  margin: 0;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-grid dt,
.detail-grid dd {
  min-height: 15px;
  margin: 0;
  padding: 5px 7px;
  background: #f3f5f7;
}

.detail-grid dt {
  color: #5d6570;
  font-weight: 700;
  text-decoration: none;
  background: #e9edf2;
}

.detail-grid .detail-section-title,
.detail-grid .detail-section-spacer {
  margin-top: 12px;
  color: var(--accent-bright);
  background: #fff2f6;
  font-weight: 700;
}

.detail-grid .detail-section-spacer {
  display: flex;
  justify-content: flex-end;
  color: var(--accent-bright);
}

.device-delete-button {
  min-height: 24px;
  border: 1px solid rgba(176, 18, 77, 0.28);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.device-delete-button:hover {
  border-color: var(--accent);
  background: #fff8fa;
}

.detail-input {
  width: 100%;
  height: 24px;
  border: 1px solid #c9d0d8;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--text);
  background: #fff;
  font-size: 11px;
}

.detail-input:focus {
  outline: 2px solid rgba(176, 18, 77, 0.24);
  border-color: var(--accent);
}

.document-panel {
  max-width: 500px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  font-size: 11px;
}

.document-panel-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.document-panel h3 {
  margin: 0;
  color: var(--accent-bright);
  font-size: 13px;
}

.document-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.document-upload-form input {
  max-width: 320px;
  min-height: 28px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 3px;
  background: #fff;
}

.document-upload-form button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.document-upload-form button:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.document-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.document-list li {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: #eef2f5;
}

.document-list a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.document-list a:hover {
  text-decoration: underline;
}

.document-list span,
.document-empty {
  color: #5d6570;
}

.document-delete-button {
  min-height: 26px;
  border: 1px solid rgba(176, 18, 77, 0.28);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
}

.document-delete-button:hover {
  background: #fff2f6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px 14px;
  max-width: 520px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #5d6570;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.form-grid input,
.form-grid select {
  min-height: 26px;
  border: 1px solid #aeb4ba;
  border-radius: 6px;
  padding: 4px 6px;
  color: var(--text);
  background: #f7f7f7;
  font-size: 12px;
  text-decoration: none;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: 2px solid rgba(176, 18, 77, 0.24);
  border-color: var(--accent);
  background: #fff;
}

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--accent-bright);
  font-size: 12px;
}

.form-error.is-info {
  color: #35516b;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 500px;
  margin-top: 12px;
  color: #5d6570;
  font-size: 11px;
}

.save-feedback {
  margin-right: auto;
  color: #375000;
  font-weight: 700;
}

.save-feedback.is-error {
  color: #b0124d;
}

.create-actions {
  max-width: 520px;
}

.record-table {
  min-width: 1080px;
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.record-count {
  color: var(--muted);
  font-size: 11px;
}

.record-table th,
.record-table td {
  border-bottom: 1px solid #fff;
  padding: 7px 8px;
  background: #f3f5f7;
  text-align: left;
  vertical-align: top;
}

.record-table th {
  color: #5d6570;
  font-weight: 700;
  text-decoration: none;
  background: #e9edf2;
  position: sticky;
  top: 0;
}

.record-link {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.record-link:hover,
.record-link:focus {
  outline: none;
  text-decoration: underline;
}

.reporting-card,
.history-card {
  max-width: 720px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.handypool-card {
  overflow-x: auto;
}

.handypool-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
}

.handypool-actions button {
  min-height: 30px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 5px 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.handypool-actions button:hover {
  background: var(--accent-bright);
}

.handypool-edit-button {
  min-height: 24px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 2px 8px;
  color: #394553;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.handypool-edit-button:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.history-card {
  max-width: none;
  overflow-x: auto;
}

.user-management-card {
  max-width: 860px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.user-create-form {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.user-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #5d6570;
  font-size: 11px;
  font-weight: 700;
}

.user-form-grid input,
.user-form-grid select {
  min-height: 30px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.user-form-actions button {
  min-height: 30px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 5px 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.user-form-actions button:hover {
  background: var(--accent-bright);
}

.reporting-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.reporting-panel h3 {
  margin: 0 0 4px;
  color: var(--accent-bright);
  font-size: 15px;
}

.reporting-panel p {
  margin: 0;
  color: #5d6570;
  font-size: 12px;
}

.reporting-panel button {
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.reporting-panel button:hover {
  background: var(--accent-bright);
}

.user-management-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table {
  min-width: 1120px;
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 11px;
}

.history-table th,
.history-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #fff;
  background: #f3f5f7;
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: #5d6570;
  background: #e9edf2;
  font-weight: 700;
}

.user-management-table th,
.user-management-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #fff;
  background: #f3f5f7;
  text-align: left;
}

.user-table-input {
  width: 100%;
  min-height: 28px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
}

.user-table-actions {
  white-space: nowrap;
}

.user-table-actions button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  color: #394553;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.user-table-actions button:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.user-management-table th {
  color: #5d6570;
  background: #e9edf2;
  font-weight: 700;
}

.user-status {
  display: inline-block;
  min-width: 54px;
  padding: 3px 8px;
  color: #375000;
  background: #eef7dc;
  border: 1px solid #cfe2a5;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}

.ticket-toolbar,
.ticket-list-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
  color: #4c5560;
  font-size: 11px;
}

.ticket-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.ticket-id-search {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
}

.ticket-id-search input {
  width: 100px;
  min-height: 26px;
  border: 1px solid #aeb4ba;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 12px;
}

.ticket-id-search button {
  min-height: 26px;
  border: 1px solid #9ca6b0;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ticket-status-info {
  margin: -6px 0 14px;
  color: #4c5560;
  font-size: 11px;
  line-height: 1.4;
}

.ticket-list-head {
  justify-content: space-between;
  margin-top: 36px;
}

.ticket-list-head h2 {
  margin: 0 0 4px;
  color: #4c5560;
  font-size: 13px;
  font-weight: 700;
}

.ticket-toolbar select {
  min-height: 28px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.export-button,
.new-ticket-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #394553;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.export-button:hover,
.new-ticket-button:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.ticket-table {
  min-width: 1700px;
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.handypool-table {
  min-width: 900px;
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.ticket-create-form {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.ticket-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  max-width: 860px;
}

.ticket-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #5d6570;
  font-size: 11px;
  font-weight: 700;
}

.ticket-form-grid input,
.ticket-form-grid select,
.ticket-form-grid textarea {
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
}

.ticket-form-grid textarea {
  resize: vertical;
}

.ticket-form-grid .wide-field {
  grid-column: 1 / -1;
}

.ticket-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  max-width: 860px;
}

.ticket-form-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #394553;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ticket-form-actions button:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 41, 51, 0.36);
}

.modal-backdrop[hidden] {
  display: none;
}

.quick-ticket-card {
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 41, 51, 0.24);
}

.modal-close {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #394553;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ticket-table th,
.ticket-table td,
.handypool-table th,
.handypool-table td {
  border-bottom: 1px solid #fff;
  padding: 7px 8px;
  background: #f3f5f7;
  text-align: left;
  vertical-align: top;
}

.ticket-table th,
.handypool-table th {
  color: #5d6570;
  font-weight: 700;
  background: #e9edf2;
  position: sticky;
  top: 0;
}

.ticket-table tr.ticket-row-highlight td {
  background: #fff2f6;
  box-shadow: inset 0 1px 0 rgba(176, 18, 77, 0.24), inset 0 -1px 0 rgba(176, 18, 77, 0.24);
}

.ticket-table tr.ticket-row-expanded td {
  background: #e7eef3;
}

.ticket-row-toggle {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid #c9d0d8;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.08);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.ticket-row-toggle[aria-expanded="true"] {
  border-color: rgba(176, 18, 77, 0.42);
  background: #fff2f6;
}

.ticket-row-toggle::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: rotate(45deg);
  transition:
    border-color 0.16s ease,
    transform 0.16s ease;
}

.ticket-row-toggle[aria-expanded="true"]::before {
  top: 8px;
  border-color: var(--accent);
  transform: rotate(225deg);
}

.ticket-row-toggle:hover,
.ticket-row-toggle:focus {
  outline: none;
  border-color: rgba(176, 18, 77, 0.42);
  transform: translateY(-1px);
}

.ticket-phone-link {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ticket-phone-link:hover,
.ticket-phone-link:focus {
  outline: none;
  text-decoration: underline;
}

.pool-badge {
  display: inline-block;
  min-width: 28px;
  border-radius: 4px;
  padding: 2px 5px;
  background: #dfe7f0;
  font-weight: 700;
}

.pool-badge:has(+ *) {
  display: inline-block;
}

.ticket-status-done {
  display: inline-block;
  min-width: 16px;
  border-radius: 4px;
  padding: 2px 5px;
  background: #dff1bd;
  color: #375000;
  font-weight: 700;
}

.ticket-status-open {
  color: #005ca8;
  font-weight: 700;
}

.ticket-status-cancelled {
  color: #7a3647;
  font-weight: 700;
}

.ticket-status-select {
  width: 190px;
  max-width: 100%;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.ticket-status-select:focus {
  outline: 2px solid rgba(176, 18, 77, 0.22);
  border-color: var(--accent);
}

.ticket-detail-row td {
  background: #f9fbfc;
  border-bottom: 1px solid #b9c5ce;
}

.ticket-detail-panel {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr) auto minmax(260px, 1.2fr);
  gap: 16px;
  align-items: start;
  max-width: 1180px;
  padding: 8px 0 10px;
}

.ticket-detail-panel label,
.ticket-detail-panel div {
  display: grid;
  gap: 5px;
}

.ticket-detail-panel span {
  color: #5d6570;
  font-weight: 700;
}

.ticket-detail-panel strong {
  font-weight: 500;
}

.ticket-note-input {
  min-height: 52px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  padding: 6px 8px;
  resize: vertical;
  font-size: 12px;
}

.ticket-note-save {
  align-self: center;
  min-height: 28px;
  border: 1px solid #9ca6b0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ticket-note-save:hover {
  border-color: rgba(176, 18, 77, 0.28);
  color: var(--accent);
}

.ticket-history-field {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.ticket-history-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticket-history-list li {
  display: grid;
  grid-template-columns: 145px 160px minmax(260px, 1fr) 150px;
  gap: 10px;
  align-items: start;
  padding: 6px 8px;
  border-radius: 6px;
  background: #eef2f5;
}

.ticket-history-list time {
  color: #5d6570;
}

.ticket-history-list strong {
  color: #394553;
  font-weight: 700;
}

.ticket-history-list span,
.ticket-history-list small,
.ticket-history-empty {
  color: #5d6570;
}

.action-group {
  margin-bottom: 18px;
}

.action-group button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 4px 6px;
  color: #000;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.action-group button:hover,
.main-nav a:hover,
.service-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 880px) {
  .top-banner {
    grid-template-columns: 1fr;
    padding-top: 12px;
  }

  .brand-panel {
    align-self: auto;
    width: 188px;
    margin: 0 12px 12px;
  }

  .main-nav,
  .service-links,
  .hero-strip {
    min-height: auto;
    margin: 0 12px 8px;
  }

  .hero-strip {
    min-height: 130px;
  }

  .user-bar {
    padding-left: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ticket-column,
  .action-column {
    border: 0;
    border-top: 1px solid var(--accent);
  }

  .contract-panel {
    padding: 18px 12px;
  }
}

@media (max-width: 560px) {
  .user-bar,
  .section-heading,
  .bar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-bar {
    gap: 8px;
    padding: 8px 12px;
  }

  .tabs {
    overflow-x: auto;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
