:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #eef4f5;
  --text: #142426;
  --muted: #657476;
  --line: #dce6e8;
  --primary: #176b5b;
  --primary-dark: #0f4d42;
  --accent: #e3a72f;
  --danger: #c84630;
  --shadow: 0 18px 45px rgba(28, 48, 52, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.is-hidden {
  display: none !important;
}

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

button {
  cursor: pointer;
}

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

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  align-items: center;
  gap: 36px;
  padding: 40px;
  background:
    linear-gradient(rgba(18, 49, 51, 0.82), rgba(18, 49, 51, 0.76)),
    url("data:image/svg+xml,%3Csvg width='1200' height='800' viewBox='0 0 1200 800' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='800' fill='%23dce6e8'/%3E%3Cg fill='none' stroke='%238fa3a7' stroke-width='4'%3E%3Cpath d='M120 120h360v220H120zM520 120h280v220H520zM840 120h240v520H840zM120 390h300v250H120zM460 390h340v250H460z'/%3E%3Cpath d='M260 120v220M520 230h280M620 390v250M120 510h300M960 120v520'/%3E%3C/g%3E%3Cg fill='%23176b5b'%3E%3Ccircle cx='290' cy='245' r='16'/%3E%3Ccircle cx='675' cy='525' r='16'/%3E%3Ccircle cx='960' cy='310' r='16'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.update-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(10, 31, 36, 0.82), rgba(10, 31, 36, 0.82)),
    url("data:image/svg+xml,%3Csvg width='1200' height='800' viewBox='0 0 1200 800' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='800' fill='%23dce6e8'/%3E%3Cg fill='none' stroke='%238fa3a7' stroke-width='4'%3E%3Cpath d='M120 120h360v220H120zM520 120h280v220H520zM840 120h240v520H840zM120 390h300v250H120zM460 390h340v250H460z'/%3E%3Cpath d='M260 120v220M520 230h280M620 390v250M120 510h300M960 120v520'/%3E%3C/g%3E%3Cg fill='%23176b5b'%3E%3Ccircle cx='290' cy='245' r='16'/%3E%3Ccircle cx='675' cy='525' r='16'/%3E%3Ccircle cx='960' cy='310' r='16'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.update-card {
  width: min(92vw, 560px);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.update-card p {
  color: var(--muted);
  line-height: 1.5;
}

.update-meta {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.92rem;
}

.update-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-brand {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: start;
}

.login-brand .brand-mark {
  width: 56px;
  height: 56px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 28px;
}

.login-brand span {
  color: #d9e7e8;
  margin-top: 5px;
}

.login-card {
  width: min(100%, 520px);
  justify-self: end;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
  font-size: 34px;
  line-height: 1.12;
}

.login-copy {
  color: var(--muted);
  line-height: 1.55;
  margin: 14px 0 24px;
}

.login-form {
  display: grid;
  gap: 4px;
}

.registration-form {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px 0;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.registration-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.registration-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.registration-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.login-form .primary-button,
.login-form .ghost-button,
.registration-form .primary-button,
.registration-form .ghost-button {
  width: 100%;
  margin-top: 4px;
}

.privacy-consent-box {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}

.privacy-consent-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.privacy-consent-box.is-accepted p {
  color: #176b5b;
  font-weight: 700;
}

.login-note {
  margin-top: 18px;
  padding: 13px;
  display: grid;
  gap: 4px;
  background: var(--surface-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.login-note:empty {
  display: none;
}

.login-note strong {
  color: var(--text);
}

.sidebar {
  background: #123133;
  color: #f6fbfb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #123133;
  background: #f3c14e;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #bdd1d0;
  font-size: 13px;
  margin-top: 3px;
}

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

.nav-item {
  border: 0;
  border-radius: var(--radius);
  padding: 13px 14px;
  text-align: left;
  color: #e8f2f2;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-project-list {
  display: grid;
  gap: 5px;
  margin: -2px 0 4px 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-project-item {
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: transparent;
  color: #bdd1d0;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.sidebar-project-item:hover,
.sidebar-project-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bdd1d0;
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #58d184;
}

.main {
  padding: 28px;
  overflow: hidden;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

.topbar-actions,
.toolbar-actions,
.project-actions,
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.connection-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 13px;
  border: 1px solid #a7d9ba;
  background: #ecfff3;
  color: #17613a;
  font-weight: 800;
}

.connection-status.offline {
  border-color: #f0cf7c;
  background: #fff4d3;
  color: #7a5512;
}

.primary-button,
.ghost-button,
.file-button {
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled,
.primary-button:disabled:hover {
  background: #c9d1d5;
  border-color: #c9d1d5;
  color: #66737a;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-button,
.file-button {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.file-button input {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

.metric {
  padding: 18px;
}

.assigned-ticket-button {
  text-align: left;
  cursor: pointer;
}

.assigned-ticket-button:hover {
  border-color: var(--primary);
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.assigned-ticket-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: -2px 0 14px;
  box-shadow: var(--shadow);
}

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

.assigned-ticket-row {
  display: grid;
  grid-template-columns: auto 1.2fr 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.assigned-ticket-row:hover {
  border-color: var(--primary);
  background: #fff;
}

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

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

.settings-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.settings-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.settings-tab.active,
.settings-tab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
}

#adminSettingsPanel.settings-panel {
  max-width: none;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.admin-list-row strong,
.admin-list-row small,
.admin-list-row span {
  display: block;
}

.admin-list-row small,
.admin-list-row span {
  color: var(--muted);
}

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

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

.custom-permission-form input[type="text"],
.custom-permission-form input:not([type]) {
  grid-column: 1 / -1;
}

.custom-permission-form label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.custom-permission-form button {
  justify-self: start;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

.notification-settings-form {
  display: grid;
  gap: 12px;
}

.notification-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.notification-option input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.notification-option strong,
.notification-option small {
  display: block;
}

.notification-option small {
  color: var(--muted);
  margin-top: 4px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.project-admin-stack {
  display: grid;
  gap: 18px;
}

.project-back-row {
  margin-bottom: 14px;
}

.plan-add-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
}

.plan-file-list {
  display: grid;
  gap: 9px;
}

.plan-add-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.plan-add-block h3 {
  margin: 2px 0 12px;
  font-size: 18px;
}

.plan-file-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.plan-file-button:hover {
  border-color: var(--primary);
  background: #eef8f5;
}

.plan-file-button strong {
  overflow-wrap: anywhere;
}

.plan-file-button span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.panel {
  padding: 22px;
}

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

.badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff6df;
  color: #7a5512;
  font-size: 12px;
  font-weight: 700;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.project-meta div {
  padding: 14px;
  background: var(--surface-strong);
  border-radius: var(--radius);
}

dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

dd {
  margin: 0;
  font-weight: 700;
}

.invite-form,
.company-admin-form,
.filter-bar {
  display: grid;
  gap: 10px;
}

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

.invite-form .primary-button {
  grid-column: 1 / -1;
  justify-self: start;
}

.company-admin-form {
  grid-template-columns: 1fr 1fr 1.2fr auto;
  margin-bottom: 18px;
}

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

textarea {
  resize: vertical;
}

.invite-list,
.company-admin-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}

.invite-list li,
.company-admin-list li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.invite-main {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.profile-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.profile-link:hover {
  color: var(--primary);
}

.project-client-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.project-client-link.is-clickable {
  cursor: pointer;
  color: var(--primary);
}

.client-contact-card {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.client-contact-card span {
  color: var(--muted);
}

.client-contact-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.member-profile {
  flex-basis: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

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

.profile-meta div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-meta dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.super-admin-panel {
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.admin-grid-bottom {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
}

.company-list,
.chat-list {
  display: grid;
  gap: 10px;
}

.company-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fff;
  text-align: left;
}

.company-row.active,
.company-row:hover {
  border-color: var(--primary);
  background: #eef8f5;
}

.company-row strong,
.company-row span {
  display: block;
}

.company-row span {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

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

.detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-strong);
}

.detail-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.user-row,
.project-row,
.chat-message {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
}

.plan-filter-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.plan-filter-panel label {
  margin: 0;
}

.project-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.user-row small,
.project-row small,
.chat-message small {
  color: var(--muted);
}

.support-chat-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.scope-banner {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #5f410c;
  background: #fff4d3;
  border: 1px solid #f0cf7c;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.organization-project-home {
  margin-bottom: 18px;
}

.empty-project-state {
  padding: 22px;
  margin-bottom: 16px;
  border: 1px dashed #9db0b4;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.empty-project-state h2 {
  margin-bottom: 8px;
}

.empty-project-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.project-create-form .primary-button {
  min-height: 46px;
}

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

.organization-project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: #fff;
}

.organization-project-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.organization-project-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.plan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.plan-canvas-wrap {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #cfdadd;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.plan-zoom-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 12;
  display: grid;
  gap: 8px;
}

.plan-zoom-controls .ghost-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  box-shadow: var(--shadow);
}

.plan-canvas-wrap.is-panning {
  cursor: grabbing;
}

.plan-canvas {
  position: relative;
  width: 100%;
  height: 680px;
  margin: 30px auto;
  background: #cfdadd;
  border: 1px solid #bac8cb;
  transform-origin: top center;
  max-width: none;
  max-height: none;
  overflow: hidden;
}

.plan-content {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 920px;
  height: 640px;
  background:
    linear-gradient(90deg, rgba(20, 36, 38, 0.08) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(rgba(20, 36, 38, 0.08) 1px, transparent 1px) 0 0 / 64px 64px,
    #fff;
  border: 1px solid #bac8cb;
  transform-origin: 0 0;
  will-change: width, height, transform;
}

.plan-content::before,
.plan-content::after {
  content: "";
  position: absolute;
  border: 3px solid #273d42;
  pointer-events: none;
}

.plan-content::before {
  inset: 58px 70px 86px;
}

.plan-content::after {
  left: 188px;
  top: 58px;
  bottom: 86px;
  width: 220px;
  border-top: 0;
  border-bottom: 0;
}

.plan-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.plan-canvas.has-pdf .plan-placeholder {
  display: none;
}

.pdf-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: none;
  z-index: 1;
  display: block;
}

.marker-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.plan-placeholder span {
  font-size: 24px;
  font-weight: 800;
  color: #2e484d;
}

.plan-placeholder small {
  margin-top: 8px;
}

.marker {
  position: absolute;
  width: calc(18px * var(--marker-zoom, 1));
  height: calc(18px * var(--marker-zoom, 1));
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border: 0;
  padding: 0;
  appearance: none;
  box-sizing: border-box;
  background: transparent;
  box-shadow: 0 8px 18px rgba(20, 36, 38, 0.25);
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: auto;
}

.marker::before {
  content: "";
  position: absolute;
  inset: calc(-3px * var(--marker-zoom, 1));
  border: 2px solid #000;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.marker::after {
  content: "";
  width: calc(18px * var(--marker-zoom, 1));
  height: calc(18px * var(--marker-zoom, 1));
  border-radius: 50%;
  background: #2563eb;
}

.marker.is-selected {
  box-shadow: 0 8px 18px rgba(20, 36, 38, 0.25);
  z-index: 8;
}

.marker.is-selected::before {
  opacity: 1;
}

.marker.status-open::after { background: #d92d20; }
.marker.status-closed::after { background: #74c69d; }
.marker.status-fixed::after { background: #f2c94c; }
.marker.status-rejected::after { background: #fb923c; }
.marker.is-overdue::after { background: #7f1d1d; }

.marker-cluster {
  width: calc(26px * var(--marker-zoom, 1));
  height: calc(26px * var(--marker-zoom, 1));
  background: #111827;
  color: #fff;
  border: 2px solid #fff;
  font-size: calc(12px * var(--marker-zoom, 1));
}

.marker-cluster::before,
.marker-cluster::after {
  content: none;
}

.marker-cluster.is-overdue {
  background: #7f1d1d;
}

.pending-marker {
  position: absolute;
  width: 30px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--danger);
  filter: drop-shadow(0 6px 10px rgba(20, 36, 38, 0.3));
  transform: translate(-50%, -100%);
  z-index: 6;
  pointer-events: none;
}

.pending-marker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: currentColor;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-sizing: border-box;
}

.pending-marker::after {
  content: "+";
  position: absolute;
  top: 4px;
  left: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.ticket-editor {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.ticket-editor.active {
  display: block;
}

.ticket-history {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.ticket-history h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

#ticketHistoryList {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.history-entry,
.history-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.history-empty {
  color: var(--muted);
}

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

.ticket-photo {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
}

.ticket-photo:focus-visible {
  outline: 3px solid rgba(48, 98, 111, 0.35);
  outline-offset: 2px;
}

.ticket-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.ticket-photo figcaption,
.photo-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.photo-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 20, 24, 0.82);
}

.photo-modal-content {
  position: relative;
  width: min(96vw, 1100px);
  max-height: 92vh;
  display: grid;
  gap: 10px;
}

.photo-modal-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  justify-self: center;
  border-radius: 8px;
  background: #fff;
}

.photo-modal-content p {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 14px;
}

.photo-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 28, 0.72);
}

.privacy-modal-content {
  width: min(92vw, 820px);
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.privacy-modal-header,
.privacy-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.privacy-modal-actions {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.privacy-modal-header h2 {
  margin: 0;
}

.privacy-scroll {
  overflow: auto;
  padding: 22px 24px;
  color: var(--text);
  line-height: 1.6;
}

.privacy-scroll h3 {
  margin: 22px 0 8px;
}

.privacy-scroll h3:first-child {
  margin-top: 0;
}

.privacy-scroll p {
  margin: 0 0 12px;
}

#privacyScrollHint {
  color: var(--muted);
  font-size: 0.92rem;
}

form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-bar {
  grid-template-columns: minmax(260px, 1fr) 220px 220px;
  margin-bottom: 16px;
}

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

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ticket-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ticket-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.ticket-card p {
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.ticket-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.delete-ticket-button {
  color: var(--danger);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 700;
}

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

.report-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.report-output {
  min-height: 160px;
  white-space: pre-wrap;
  background: #102c2f;
  color: #effafa;
  padding: 18px;
  border-radius: var(--radius);
  overflow: auto;
}

@media (max-width: 1100px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-card {
    justify-self: start;
  }

  .app-shell {
    grid-template-columns: 86px 1fr;
  }

  .sidebar {
    padding: 18px 12px;
    align-items: center;
  }

  .brand div:not(.brand-mark),
  .sidebar-footer span:not(.status-dot),
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    width: 52px;
    height: 52px;
    padding: 0;
    text-align: center;
  }

  .nav-item::first-letter {
    font-size: 18px;
  }

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

  .assigned-ticket-row {
    grid-template-columns: 1fr;
  }

  .workspace-grid,
  .plan-layout {
    grid-template-columns: 1fr;
  }

  .ticket-editor {
    order: -1;
  }

  .plan-filter-panel {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 20px;
    gap: 28px;
  }

  .login-brand {
    align-self: auto;
  }

  .login-brand strong {
    font-size: 22px;
  }

  .login-brand span {
    font-size: 13px;
  }

  .login-card {
    padding: 24px;
  }

  .login-card h1 {
    font-size: 26px;
  }

  .plan-filter-panel {
    grid-template-columns: 1fr;
  }

  .photo-modal {
    padding: 12px;
  }

  .photo-modal-close {
    top: 8px;
    right: 8px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-list {
    display: flex;
    flex: 1;
  }

  .nav-item {
    min-width: 52px;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .plan-toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  .summary-grid,
  .project-meta,
  .ticket-grid,
  .report-grid,
  .organization-project-list,
  .project-create-form,
  .plan-add-form,
  .filter-bar,
  .invite-form,
  .admin-settings-grid,
  .compact-form,
  .custom-permission-form,
  .company-admin-form,
  .admin-grid,
  .admin-grid-bottom,
  .support-chat-form,
  .user-row,
  .project-row,
  .form-row {
    grid-template-columns: 1fr;
  }

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

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

  .plan-canvas-wrap {
    min-height: 520px;
  }

  .plan-canvas {
    width: 760px;
    height: 540px;
    margin: 18px;
  }
}
