:root {
  --brand-orange: #e4572e;
  --brand-orange-2: #f06b44;
  --brand-gray: #6c6c6c;
  --bg: #f6f7f8;
  --card: #ffffff;
  --text: #232323;
  --line: #dadde1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 10%, rgba(228, 87, 46, 0.18), transparent 28%),
    radial-gradient(circle at 95% 90%, rgba(108, 108, 108, 0.14), transparent 30%),
    var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 1.3rem;
  background: #646669;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  background-color: white;
  border-radius: 6px;
}

.brand h1 {
  margin: 0;
  letter-spacing: 0.0em;
  font-size: 1.1rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.brand p {
  margin: 0;
  opacity: 0.95;
  font-size: 0.88rem;
}


.container {
  /*width: min(1050px, 100% - 2rem);*/
  margin: 1.2rem auto 2rem;
  width: 90%;
}


.container.container-wide {
  width: 100%;
  max-width: none;
  margin: 0.35rem auto 0.75rem;
  padding: 0 0.35rem;
}

.container.container-wide.viewer-page {
  width: 100%;
  margin: 0;
  padding: 0;
}

.card {
  background: rgba(229, 227, 226, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 4px 18px rgba(14, 24, 40, 0.06);
  margin-bottom: 1rem;
}

.card.card-create {
  background: #a2e3d8;
}

.card-centered {
  max-width: 470px;
  margin: 2.5rem auto;
}

.login-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.login-logo {
  display: block;
  object-fit: contain;
}

.login-logo-nexus {
  width: 120px;
  max-width: 40%;
}

.login-logo-ss {
  width: 82px;
  max-width: 28%;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.58rem 0.95rem;
  background: var(--brand-orange);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  background: #cb471f;
}

.btn.success {
  background: #2ea44f;
}

.btn.success:hover {
  background: #258741;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  border: 0px solid rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.btn.secondary.dark {
  background: #6b737f;
  border: 1px solid #6b737f;
  color: #fff;
}

.btn.small {
  padding: 0.38rem 0.72rem;
  font-size: 0.82rem;
}

.btn.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-icon {
  display: inline-flex;
  line-height: 0;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn.secondary.icon-only-btn {
  color: #383538;
}

.btn.secondary.icon-only-btn:hover {
  color: #ea2542;
}

input,
select {
  width: 100%;
  border: 1px solid #cfd4da;
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

.hint {
  margin-top: 0.6rem;
  color: #5f6368;
  font-size: 0.9rem;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.55rem;
  align-items: end;
}

.filters-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.stack-list {
  display: grid;
  gap: 0.7rem;
}

.project-item {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 8px solid var(--brand-gray);
  border-radius: 12px;
  padding: 0.9rem;
}

.project-item:hover {
  border-left-color: var(--brand-orange);
  transform: translateY(-1px);
}

.project-item h3 {
  margin: 0 0 0.35rem;
}

.project-item p {
  margin: 0 0 0.25rem;
  color: #565b61;
}

.link-row {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.link-btn {
  width: 100%;
  text-align: left;
  background: linear-gradient(90deg, var(--brand-gray), #7d7d7d);
}

.link-btn:hover {
  background: linear-gradient(90deg, #5e5e5e, #757575);
}

.meta {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  color: #5f6368;
  font-size: 0.82rem;
}

.powerbi-frame {
  width: 100%;
  min-height: 380px;
  border: 1px solid #d3d7dc;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  background: #fafbfc;
}

.inline-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0.6rem;
  align-items: end;
  background: rgb(194, 237, 194);
}

.span-2 {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.8rem;

}

.projects-table {
  width: 97%;
  min-width: 0;
  table-layout: fixed;
}

.projects-table .projects-col-project {
  width: 30%;
}

.projects-table .projects-col-links {
  width: 31%;
}

.projects-table .projects-col-year {
  width: 5%;
}

.projects-table .projects-col-type {
  width: 10%;
}

.projects-table .projects-col-companies {
  width: 15%;
}

.projects-table .projects-col-created,
.projects-table .projects-col-last-used {
  width: 9%;
}

.projects-table .projects-col-visibility {
  width: 9%;
}

.projects-table .projects-col-actions {
  width: 4%;
}

.projects-table th:nth-child(1),
.projects-table td:nth-child(1),
.projects-table th:nth-child(2),
.projects-table td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.projects-table th:nth-child(4),
.projects-table td:nth-child(4),
.projects-table th:nth-child(5),
.projects-table td:nth-child(5),
.projects-table th:nth-child(8),
.projects-table td:nth-child(8) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

th,
td {
  border-bottom: 1px solid #eceff3;
  padding: 0.5rem;
  vertical-align: top;
  text-align: left;
   padding: 0.3rem 0.4rem;
}

.alert {
  background: #fff3f0;
  border: 1px solid #ffd6cc;
  color: #8b3218;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
}

.ghost {
  display: none;
}

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

  .filters-actions {
    width: 100%;
  }

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

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

.project-item-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.btn.danger {
  background: #c73a2a;
}

.btn.danger:hover {
  background: #a92f21;
}

details summary {
  cursor: pointer;
  color: #4d535a;
  font-weight: 600;
}

@media (max-width: 900px) {
  .project-item-wrap {
    grid-template-columns: 1fr;
  }
}

.actions-cell {
  text-align: right;
  white-space: nowrap;
}

.actions-cell form {
  display: inline;
}

.icon-only-btn {
  min-width: 0;
  padding: 0.5rem 0.6rem;
  margin-left: 0.35rem;
  background: green;
}

.icon-only-btn .btn-icon svg {
  width: 15px;
  height: 15px;
}

details {
  margin-top: 0.35rem;
}

details > summary {
  cursor: pointer;
  color: #4d535a;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.checklist {
  border: 1px solid #cfd4da;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  max-height: 170px;
  overflow: auto;
  background: #fff;
  min-height: 170px;
}

.check-group {
  margin-bottom: 0.45rem;
}

.check-group-title {
  font-size: 0.82rem;
  color: #5d6470;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.check-item {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0.2rem 0;
  font-size: 0.92rem;
}

.check-item input[type="checkbox"] {
  width: auto;
}

.muted {
  color: #7a818d;
  font-size: 0.88rem;
}

.edit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  background: rgb(194, 237, 194);
}

.edit-panel {
  display: grid;
  gap: 0.65rem;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
}

.project-edit-card {
  display: grid;
  gap: 1rem;
}

.checklist-fixed {
  height: 210px;
  max-height: 210px;
}

.edit-visibility-panel {
  margin-top: 134px;
}

.edit-action-bar {
  min-height: 82px;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  background: #f8f9fb;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.my-projects-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  background: #121315;
  border: 1px solid #22252a;
  border-radius: 14px;
  padding: 1rem;
  color: #f0f1f2;
  font-size: 1.05rem;
  min-height: calc(100vh - 130px);
}

.my-projects-sidebar {
  background: #15171a;
  border: 1px solid #242830;
  border-radius: 12px;
  padding: 0.9rem;
}

.my-projects-sidebar h2 {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
}

.mp-sidebar-search {
  margin: 0 0 0.85rem;
}

.mp-sidebar-search input {
  width: 100%;
  background: #23262d;
  color: #eef1f5;
  border: 1px solid #2b313c;
}

.mp-sidebar-search input::placeholder {
  color: #9aa3b1;
}

.mp-group {
  margin-bottom: 1rem;
}

.mp-group-collapsible {
  border: 1px solid #242830;
  border-radius: 10px;
  background: #191c21;
  padding: 0.2rem 0.2rem 0.35rem;
}

.mp-group-collapsible[open] {
  background: #1d2127;
}

.mp-section-divider {
  border-top: 2px solid #ff6d3e;
  opacity: 0.9;
  margin: 0.4rem 0 0.75rem;
}

.mp-group-title {
  font-weight: 800;
  color: #ff8a5c;
  font-size: 1.2rem;
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  margin: 0;
}

.mp-group-title.accent {
  color: #ff6d3e;
}

.mp-group-title::-webkit-details-marker {
  display: none;
}

.mp-group-title::after {
  content: "+";
  float: right;
  color: #c9d0db;
}

.mp-group-collapsible[open] .mp-group-title::after {
  content: "-";
}

.mp-group-body {
  padding: 0.3rem 0.15rem 0 0.15rem;
}

.mp-project-item {
  display: block;
  text-decoration: none;
  color: #eef1f5;
  background: #23262d;
  border: 1px solid #2b313c;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.45rem;
}

.mp-project-item strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
}

.mp-project-item span {
  color: #b8bec8;
  font-size: 1.05rem;
}

.mp-project-item.active,
.mp-project-item:hover {
  border-color: #ff6d3e;
  background: #292d34;
}

.my-projects-main {
  display: grid;
  gap: 0.9rem;
}

.mp-hero {
  background: #1a1d22;
  border: 1px solid #2a2f39;
  border-radius: 12px;
  padding: 1rem;
  width: min(100%, 980px);
  justify-self: start;
}

.mp-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.mp-hero p {
  margin: 1;
  color: #b7bdc8;
  font-size: 1.05rem;
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.9rem;
}

.mp-card {
  background:#868686;
  border-radius: 12px;
  padding: 1rem;
  min-height: 190px;
}

.mp-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.mp-card p {
  margin: 0 0 0.9rem;
  color: white;
  font-size: 1.05rem;
}

.mp-btn {
  background: #e76a3d;
}

.mp-btn:hover {
  background: #cf5429;
}

.my-projects-shell-clean {
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: 10px;
  min-height: calc(100vh - 88px);
}

.my-projects-sidebar-clean {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.mp-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mp-sidebar-head h2 {
  margin: 0;
}

.mp-client-chip {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.9rem;
  color: #c8ced8;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #2d3340;
  background: #1f232a;
}

.mp-sidebar-scroll {
  overflow: auto;
  padding-right: 0.2rem;
}

.my-projects-main-clean {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.mp-hero-clean {
  width: min(100%);
  padding: 0.75rem 0.9rem;
}

.mp-hero-clean h1 {
  line-height: 1.15;
}

.mp-grid-clean {
  align-content: start;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  min-height: 0;
}

.mp-card-head {
  margin-bottom: 0.45rem;
}

.viewer-topbar {
  height: 56px;
  background: #1d1f23;
  color: #eceef2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;}

.viewer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.viewer-back {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.viewer-title {
  color: #c4cad3;
  font-size: 1.02rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-right {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  white-space: nowrap;
}

.viewer-right a,
.viewer-logout {
  color: #d8dde6;
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.viewer-right a:hover,
.viewer-logout:hover {
  color: #ffffff;
}

.viewer-frame-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(100vh - 56px);
  background: #f1f2f4;
}

.viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.viewer-share-mask {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100px;
  height: 40px;
  background: transparent;
  z-index: 10;
  pointer-events: auto;
}

@media (max-width: 760px) {
  .edit-split {
    grid-template-columns: 1fr;
  }

  .edit-visibility-panel {
    margin-top: 0;
  }

  .edit-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .my-projects-shell {
    grid-template-columns: 1fr;
  }

  .mp-grid-clean {
    grid-template-columns: 1fr;
  }

  .viewer-topbar {
    padding: 0 0.6rem;
    gap: 0.6rem;
  }

  .viewer-right {
    gap: 0.55rem;
  }

  .viewer-title {
    font-size: 0.93rem;
  }
}
