/*
 * MTM CRM GLOBAL DESIGN SYSTEM
 * ----------------------------
 * Navigation, page shell, tabs, toolbars and shared colors live here.
 * Change this file once and every module inherits the design.
 */
:root {
  --mtm-bg: #cfd2d4;
  --mtm-surface: #ffffff;
  --mtm-surface-soft: #f4f4f4;
  --mtm-border: #c7cccf;
  --mtm-border-strong: #abb2b6;
  --mtm-text: #101417;
  --mtm-muted: #6f787e;
  --mtm-red: #c90d1d;
  --mtm-red-dark: #9f0a16;
  --mtm-blue: #17779a;
  --mtm-blue-dark: #0e6485;
  --mtm-green: #2f8b52;
  --mtm-row-blue: #cfe6f7;
  --mtm-row-blue-alt: #dfedf8;
  --mtm-row-hover: #badbf1;
  --mtm-shadow: 0 7px 20px rgba(29, 41, 50, .11);
  --mtm-radius: 3px;
  --mtm-content-max: 1740px;
  --mtm-content-min: 1180px;
  --mtm-nav-height: 72px;
}

html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--mtm-bg);
  color: var(--mtm-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

/* Familiar MTM two-level header: brand/status above, module navigation below. */
.topbar {
  display: block;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 0;
  padding: 0;
  border: 0;
  background: linear-gradient(90deg, #cfd2d4 0%, #f3f4f4 47%, #d5d7d8 100%);
  box-shadow: 0 2px 7px rgba(0,0,0,.07);
}

.header-meta {
  width: calc(100% - 40px);
  max-width: var(--mtm-content-max);
  min-width: var(--mtm-content-min);
  height: 94px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 12px;
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  min-width: 160px;
  padding: 0;
  color: inherit;
}
.brand img {
  display: block;
  width: 205px;
  height: 70px;
  object-fit: contain;
}
.brand:hover { color: inherit; }

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  color: #5e666b;
  font-size: 13px;
  letter-spacing: .01em;
  white-space: nowrap;
}
.mtm-meta-separator { color: #8a9094; }

.nav-row {
  background: transparent;
  border: 0;
}
.nav-inner {
  width: calc(100% - 40px);
  max-width: var(--mtm-content-max);
  min-width: var(--mtm-content-min);
  height: var(--mtm-nav-height);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: #fff;
}
.main-nav {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-width: 0;
}
.mtm-nav-item {
  position: relative;
  flex: 0 0 155px;
  min-width: 145px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px;
  border-left: 1px solid #f7f7f7;
  border-right: 1px solid #e3e3e3;
  border-bottom: 0;
  background: linear-gradient(#fff 0%, #fff 45%, #e5e5e5 100%);
  color: #52595e;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .015em;
  text-decoration: none;
}
.mtm-nav-item:first-child { border-left-color: #eee; }
.mtm-nav-item:hover {
  color: var(--mtm-red);
  background: linear-gradient(#f1f1f1 0%, #fff 44%, #f3f3f3 100%);
}
.mtm-nav-item.active {
  color: var(--mtm-red);
  background: linear-gradient(#9a9a9a 0%, #e7e7e7 14%, #fff 49%, #fff 100%);
}
.mtm-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: #6d6d6d;
}
.mtm-nav-icon {
  position: relative;
  width: 31px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 31px;
}
.mtm-nav-icon img { position: absolute; max-width: 30px; max-height: 22px; }
.mtm-nav-icon-active { opacity: 0; }
.mtm-nav-item:hover .mtm-nav-icon-normal,
.mtm-nav-item.active .mtm-nav-icon-normal { opacity: 0; }
.mtm-nav-item:hover .mtm-nav-icon-active,
.mtm-nav-item.active .mtm-nav-icon-active { opacity: 1; }

.top-actions {
  position: relative;
  flex: 1 0 92px;
  min-width: 92px;
  max-width: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  padding: 8px 13px 8px 8px;
  background: #fff;
}
.mtm-top-action-form { display: block; margin: 0; }
.mtm-top-action {
  position: relative;
  width: 31px;
  height: 27px;
  border: 0;
  padding: 2px;
  background: transparent;
  cursor: pointer;
}
.mtm-top-action img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 25px;
  max-height: 23px;
}
.mtm-top-action img.hover { opacity: 0; }
.mtm-top-action:hover img.normal,
.mtm-top-action.is-open img.normal { opacity: 0; }
.mtm-top-action:hover img.hover,
.mtm-top-action.is-open img.hover { opacity: 1; }

/* Main white work surface. Keep desktop information density instead of mobile cards. */
.app-shell {
  width: calc(100% - 40px);
  max-width: var(--mtm-content-max);
  min-width: var(--mtm-content-min);
  margin: 34px auto 0;
  min-height: calc(100vh - 270px);
  padding: 24px 24px 46px;
  border: 0;
  background: var(--mtm-surface);
  box-shadow: none;
}

.app-footer {
  width: calc(100% - 40px);
  max-width: var(--mtm-content-max);
  min-width: var(--mtm-content-min);
  height: 70px;
  margin: 0 auto 22px;
  background: #9e9e9f;
  color: #fff;
}
.app-footer-inner {
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,.86);
}
.app-footer-brand { font-size: 18px; letter-spacing: .02em; color: #2e2e2f; }

/* Shared compact list/page header. */
.mtm-list-head {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.mtm-breadcrumb {
  padding-top: 2px;
  color: #101214;
  font-size: 12px;
  font-weight: 700;
}
.mtm-list-create { margin-top: -2px; }
.mtm-breadcrumb--shared a { color:#17688c; text-decoration:none; font-weight:500; }
.mtm-breadcrumb--shared a:hover { color:var(--mtm-red); }
.mtm-breadcrumb--shared strong { color:#15191c; font-weight:700; }
.mtm-list-head--subpage { align-items:flex-start; }
.mtm-list-back {
  display:inline-flex; align-items:center; gap:6px; margin-top:0;
  color:#17688c; font-size:12px; font-weight:600; text-decoration:none; white-space:nowrap;
}
.mtm-list-back:hover { color:var(--mtm-red); }
.mtm-list-back-arrow { font-size:16px; line-height:1; }


.page-head { margin-bottom: 18px; align-items: center; }
.page-head h1 {
  margin: 0;
  color: var(--mtm-red);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.page-head .subtle { margin-top: 4px; color: #7a8389; }

.btn {
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid #a9b1b6;
  padding: 6px 16px;
}
.btn.primary {
  min-width: 325px;
  background: linear-gradient(#2b8cad, #0c6687);
  border-color: #0e6688;
  color: #fff;
  box-shadow: 0 5px 13px rgba(17, 83, 111, .24);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}
.btn.primary:hover { background: linear-gradient(#227f9e, #095873); color: #fff; }

.tabs {
  display: flex;
  gap: 2px;
  margin: 18px 0 0;
  border-bottom: 0;
}
.tabs a {
  position: relative;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(#fff, #e5e5e5);
  color: #666d72;
  font-size: 13px;
  font-weight: 500;
}
.tabs a.active {
  background: #fff;
  color: var(--mtm-red);
  box-shadow: inset 0 3px 0 #707070;
}
.tabs span { padding: 0; background: transparent; color: inherit; font-size: inherit; }

.mtm-list-toolbar,
.toolbar {
  min-height: 52px;
  padding: 9px 10px;
  border: 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #d9dddf;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.mtm-live-search-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}
.mtm-live-search-form > label {
  color: #5e666b;
  font-size: 12px;
  white-space: nowrap;
}
.mtm-live-search-box { position: relative; width: 260px; }
.mtm-live-search-box input,
.toolbar input {
  width: 100%;
  min-width: 0;
  height: 31px;
  border: 1px solid #b9c0c4;
  border-radius: 0;
  padding: 5px 9px 5px 28px;
  background: #fff;
}
.mtm-live-search-box input:focus,
.toolbar input:focus {
  outline: 2px solid rgba(23,119,154,.11);
  border-color: #87959d;
}
.mtm-search-symbol {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #7b858b;
  font-size: 17px;
  pointer-events: none;
}
.mtm-section-title {
  margin: 17px 0 4px;
  color: var(--mtm-red);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.panel { border-radius: 2px; box-shadow: none; }
.panel h2, .section-title { color: var(--mtm-red); font-weight: 500; }

.status {
  display: inline-block;
  min-width: 54px;
  padding: 3px 6px;
  border-radius: 1px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.status.open { background: #467f9c; color: #fff; }
.status.paid { background: #dcefe2; color: #286842; }
.status.draft { background: #dfe9f0; color: #315c77; }
.status.cancelled { background: #f0dddd; color: #8e3535; }

@media (max-width: 1260px) {
  .header-meta, .nav-inner, .app-shell, .app-footer { margin-left: 12px; margin-right: 12px; }
  .mtm-nav-item { flex-basis: 145px; }
}

/* Login keeps the familiar centered MTM composition, without the old browser dependencies. */
.mtm-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #c8cbcd 0%, #f3f4f4 50%, #c8cbcd 100%);
}
.mtm-login-shell {
  position: relative;
  width: min(1240px, calc(100vw - 50px));
  min-height: 760px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 135px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.mtm-login-logo { position: absolute; left: 18px; top: 18px; width: 235px; height: 82px; object-fit: contain; object-position: left top; }
.mtm-login-card {
  width: 540px;
  margin: 0;
  padding: 44px 54px;
  border: 0;
  border-radius: 7px;
  background: #d4d6d7;
  box-shadow: none;
}
.mtm-login-card .login-brand { color: #565f64; font-size: 25px; font-weight: 500; }
.mtm-login-card .login-subtitle { color: #7a8287; margin-bottom: 24px; }
.mtm-login-card .btn.primary { min-width: 150px; align-self: flex-end; }

/* ============================================================
 * V1.5 layout corrections
 * One desktop shell, full working width and a single nav design.
 * These selectors intentionally outrank the legacy app.css rules.
 * ============================================================ */
:root {
  --mtm-page-gutter: 12px;
  --mtm-content-max: none;
  --mtm-content-min: 1180px;
}

.topbar .header-meta,
.topbar .nav-inner,
.app-shell,
.app-footer {
  width: calc(100% - (var(--mtm-page-gutter) * 2));
  max-width: none;
}

.topbar .header-meta {
  height: 88px;
  padding-top: 7px;
}
.topbar .brand {
  width: 220px;
  min-width: 220px;
  height: 80px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.topbar .brand img {
  width: 205px;
  height: 70px;
  object-fit: contain;
  object-position: left top;
}
.topbar .header-status { padding-top: 15px; }

.topbar .nav-inner { height: 72px; }
.topbar .main-nav { gap: 0; align-items: stretch; }
.topbar .main-nav .mtm-nav-item {
  flex: 0 0 158px;
  min-width: 150px;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid #f3f3f3;
  border-right: 1px solid #dedede;
  border-bottom: 0 !important;
  border-radius: 0;
  background: linear-gradient(#fff 0%, #fff 45%, #e5e5e5 100%);
  color: #565d62;
  font-weight: 500;
  box-shadow: none;
}
.topbar .main-nav .mtm-nav-item:hover {
  border-bottom: 0 !important;
  background: linear-gradient(#eeeeee 0%, #fff 46%, #f1f1f1 100%);
  color: var(--mtm-red);
}
.topbar .main-nav .mtm-nav-item.active {
  border-bottom: 0 !important;
  background: linear-gradient(#8e8e8e 0%, #dddddd 14%, #fff 52%, #fff 100%);
  color: var(--mtm-red);
}
.topbar .main-nav .mtm-nav-item.active::before {
  height: 3px;
  background: #6d6d6d;
}
.topbar .main-nav .mtm-nav-item.active::after { display: none; }
.topbar .main-nav .mtm-nav-item .mtm-nav-label { color: inherit; }
.topbar .top-actions {
  flex: 1 0 92px;
  min-width: 92px;
  max-width: 112px;
  border: 0;
  background: #fff;
}

.app-shell {
  margin: 30px auto 0;
  min-height: calc(100vh - 258px);
  padding: 22px 24px 42px;
  background: #fff;
}
.app-footer { margin-bottom: 12px; }

/* ============================================================
 * V1.6 layout refinements
 * ============================================================ */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar { flex: 0 0 auto; }
.app-shell {
  flex: 1 0 auto;
  min-height: 0;
  padding-top: 30px;
}
.app-footer {
  flex: 0 0 auto;
  margin-top: 0;
}

/* ============================================================
 * V1.9 - MTM legacy identity + modern desktop shell
 * ------------------------------------------------------------
 * Reintroduces the original Core Mellow UI identity (when the
 * customer's existing font files are installed locally), keeps
 * dense desktop geometry, and limits ultra-wide layouts without
 * wasting normal 1920px screens.
 * ============================================================ */
@font-face {
  font-family: 'core45regular';
  src: url('/static/fonts/s-core_-_coremellow45regular-webfont.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'core55medium';
  src: url('/static/fonts/s-core_-_coremellow55medium-webfont.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'core65bold';
  src: url('/static/fonts/s-core_-_coremellow65bold-webfont.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --mtm-page-gutter: 20px;
  --mtm-content-max: 1800px;
  --mtm-content-min: 1180px;
  --mtm-nav-height: 60px;
  --mtm-font-body: Verdana, Geneva, Arial, sans-serif;
  --mtm-font-ui: 'core45regular', 'Trebuchet MS', Arial, sans-serif;
  --mtm-font-ui-medium: 'core55medium', 'Trebuchet MS', Arial, sans-serif;
  --mtm-font-ui-bold: 'core65bold', 'Trebuchet MS', Arial, sans-serif;
}

html { min-height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--mtm-font-body);
  background: var(--mtm-bg);
}

/* The old CRM used Core Mellow selectively, not for long body text. */
.mtm-nav-item,
.page-head h1,
.mtm-section-title,
.tabs a,
.mtm-list-create,
.btn.primary,
.mtm-process-label,
.mtm-process-action,
.mtm-popover-head,
.mtm-popover-action,
.wizard-step,
.wizard-step-menu,
.mtm-next-button {
  font-family: var(--mtm-font-ui);
}

.topbar {
  flex: 0 0 auto;
  position: relative;
  top: auto;
}
.topbar .header-meta,
.topbar .nav-inner,
.app-shell,
.app-footer {
  width: calc(100% - (var(--mtm-page-gutter) * 2));
  max-width: var(--mtm-content-max);
  min-width: var(--mtm-content-min);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Slightly tighter header, close to the proportions of the original CRM. */
.topbar .header-meta {
  height: 80px;
  padding-top: 6px;
}
.topbar .brand {
  width: 205px;
  min-width: 205px;
  height: 72px;
}
.topbar .brand img {
  width: 195px;
  height: 66px;
}
.topbar .header-status {
  padding-top: 13px;
  font-size: 13px;
}
.topbar .nav-inner { height: var(--mtm-nav-height); }
.topbar .main-nav .mtm-nav-item {
  flex-basis: 150px;
  min-width: 142px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
}
.topbar .top-actions {
  min-width: 82px;
  max-width: 92px;
  padding-right: 10px;
}

/* Content always starts after a deliberate gap. It never creeps under nav. */
.app-shell {
  flex: 1 0 auto;
  margin-top: 22px;
  min-height: 0;
  padding: 18px 20px 42px;
  background: #fff;
}
.app-footer {
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: 12px;
}

/* Shared sharper controls. Keep small controls compact; no oversized SaaS buttons. */
.btn {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 4px;
  border-color: #a4aaae;
  font-size: 12px;
  box-shadow: none;
}
.btn:hover {
  border-color: #858d92;
  background: #eceff0;
}
.btn.primary {
  min-width: 250px;
  min-height: 34px;
  padding: 5px 18px;
  border: 1px solid #0b627f;
  border-radius: 6px;
  background: linear-gradient(to bottom, #2490b1 0%, #147a99 42%, #0d6685 100%);
  box-shadow: 4px 4px 12px -6px rgba(0,0,0,.70);
  font-size: 16px;
  font-weight: 400;
}
.btn.primary:hover {
  background: linear-gradient(to bottom, #157392 0%, #0e6380 48%, #0a536b 100%);
  box-shadow: 4px 4px 14px -4px rgba(0,0,0,.72);
}
.btn.small {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11px;
}

/* Match the older CRM's typography rhythm in list chrome. */
.mtm-breadcrumb {
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 10px;
  font-weight: 400;
}
.mtm-breadcrumb strong,
.mtm-breadcrumb b { font-weight: 700; }
.mtm-list-head { min-height: 48px; }
.page-head h1,
.mtm-section-title {
  font-weight: 400;
}

@media (max-width: 1840px) {
  :root { --mtm-page-gutter: 12px; }
}
@media (max-width: 1260px) {
  .topbar .header-meta, .topbar .nav-inner, .app-shell, .app-footer {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ============================================================
 * V1.10 - continuous header/nav gradients + viewport-fit shell
 * ============================================================ */
:root {
  --mtm-header-gradient: linear-gradient(90deg, #c9ccce 0%, #f3f4f4 50%, #d3d5d6 100%);
  --mtm-nav-fill-gradient: linear-gradient(to bottom, #ffffff 0%, #ffffff 45%, #e5e5e5 100%);
}

/* The brand/status header keeps one uninterrupted gradient all the way
   down to the navigation. There is no separate white strip between them. */
.topbar {
  background: var(--mtm-header-gradient);
}
.topbar .header-meta {
  background: transparent;
}
.topbar .nav-row {
  background: transparent;
}

/* The navigation's button gradient continues automatically through the
   unused area to the power/admin controls, regardless of viewport width. */
.topbar .nav-inner {
  background: var(--mtm-nav-fill-gradient);
}
.topbar .main-nav {
  background: transparent;
}
.topbar .top-actions {
  background: transparent;
}

/* Preserve the original tab look while letting the shared fill show in the
   free space to the right of the final module button. */
.topbar .main-nav .mtm-nav-item {
  background: var(--mtm-nav-fill-gradient);
}
.topbar .main-nav .mtm-nav-item:hover {
  background: linear-gradient(to bottom, #ededed 0%, #ffffff 46%, #f1f1f1 100%);
}
.topbar .main-nav .mtm-nav-item.active {
  background: linear-gradient(to bottom, #8e8e8e 0%, #dddddd 14%, #ffffff 52%, #ffffff 100%);
}

/* Keep the normal desktop start screen inside a typical browser viewport.
   Long lists/forms remain free to grow and scroll naturally. */
.app-footer {
  height: 60px;
  margin-bottom: 8px;
}

/* A little less dead space below the menu while retaining the deliberate
   separation that makes the old CRM feel ordered. */
.app-shell {
  margin-top: 18px;
  padding-top: 16px;
  padding-bottom: 28px;
}

/* ============================================================
 * V1.11 - header flow correction
 * ------------------------------------------------------------
 * A legacy app.css rule still fixed .topbar to 54px. The modern
 * two-row header is taller, so its children overflowed the header,
 * creating a grey strip and allowing page content to start beneath
 * the navigation. Let the header participate in normal document
 * flow again and keep a small, deliberate logo-to-navigation gap.
 * ============================================================ */
.topbar {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.topbar .header-meta {
  height: 84px;
  padding-top: 7px;
  padding-bottom: 9px;
  background: transparent;
}

.topbar .brand {
  height: 68px;
  align-items: flex-start;
}

.topbar .brand img {
  height: 64px;
}

/* Keep the work surface clearly below the navigation now that the
   header has its real height. This is a visual breathing space, not
   a compensation for overlapping elements. */
.app-shell {
  margin-top: 18px;
}

/* ============================================================
 * V1.14 - global live-search highlighting
 * ------------------------------------------------------------
 * Every HTMX search field named q highlights its current search
 * string directly in the visible result target. This is purely
 * presentational and never changes stored/server-side values.
 * ============================================================ */
.mtm-search-hit {
  background: transparent;
  color: #d1121d;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

/* ============================================================
 * V1.15 - list title/search share one level + custom confirms
 * ============================================================ */
.mtm-list-toolbar.has-title {
  min-height: 44px;
  padding: 5px 10px;
  justify-content: space-between;
  gap: 20px;
}
.mtm-list-toolbar-title {
  color: var(--mtm-red);
  font-family: var(--mtm-font-ui);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.mtm-live-search-form > label {
  font-family: var(--mtm-font-ui);
  font-size: 13px;
}

.btn.danger {
  min-width: 120px;
  border-color: #ae1720;
  background: linear-gradient(#df2832, #b70e18);
  color: #fff;
}
.btn.danger:hover {
  border-color: #8f0b13;
  background: linear-gradient(#c91b25, #9f0911);
  color: #fff;
}
.mtm-confirm-backdrop[hidden] { display: none; }
.mtm-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.34);
}
.mtm-confirm {
  width: min(440px, calc(100vw - 40px));
  border: 1px solid #a4aaae;
  background: #f4f4f4;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.mtm-confirm-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #c4c9cc;
  background: linear-gradient(#fff, #dedede);
  color: var(--mtm-red);
  font-family: var(--mtm-font-ui);
  font-size: 18px;
}
.mtm-confirm-body {
  padding: 22px 18px 20px;
  background: #fff;
  color: #202326;
  font-size: 13px;
  line-height: 1.45;
}
.mtm-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #d0d4d6;
}


/* ============================================================
 * V1.19 - legacy-gradient tabs + employee list filter
 * ============================================================ */
.tabs {
  gap: 4px;
  margin-bottom: 0;
  align-items: flex-end;
}
.tabs a {
  border: 1px solid #d5d5d5;
  border-bottom: 0;
  background: linear-gradient(to bottom, #ffffff 0%, #f6f6f6 28%, #dedede 72%, #c8c8c8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  transition: color .12s ease, background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.tabs a:hover {
  color: var(--mtm-red);
  background: linear-gradient(to bottom, #ffffff 0%, #f9f9f9 22%, #e9e9e9 70%, #d3d3d3 100%);
  box-shadow: inset 0 3px 0 #8b8b8b, 0 -1px 4px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.tabs a.active,
.tabs a.active:hover {
  z-index: 2;
  margin-bottom: -1px;
  border-color: #ededed;
  background: #f5f5f5;
  color: var(--mtm-red);
  box-shadow: inset 0 4px 8px -5px rgba(0,0,0,.95);
  transform: none;
}
.tabs + .mtm-list-toolbar {
  border-top: 0;
}
.mtm-list-select {
  height: 29px;
  min-width: 160px;
  padding: 3px 24px 3px 8px;
  border: 1px solid #aeb7bc;
  border-radius: 0;
  background: #9ea2a5;
  color: #fff;
  font-family: var(--mtm-font-ui);
  font-size: 13px;
}
.mtm-list-select:focus {
  outline: 1px solid #7a858c;
  outline-offset: 1px;
}

/* ============================================================
 * V1.24.11 - administration gear hover polish
 * The red hover artwork is only shown while the trigger is actually hovered/focused.
 * Opening the popover no longer leaves the header gear stuck in its hover state.
 * ============================================================ */
.mtm-top-action img { transition: opacity .12s ease; }
.mtm-top-action.is-open:not(:hover):not(:focus-visible) img.normal { opacity: 1; }
.mtm-top-action.is-open:not(:hover):not(:focus-visible) img.hover { opacity: 0; }
.mtm-top-action:hover img.normal,
.mtm-top-action:focus-visible img.normal { opacity: 0; }
.mtm-top-action:hover img.hover,
.mtm-top-action:focus-visible img.hover { opacity: 1; }

/* V1.24.20 - Projects / payment plan */
.mtm-project-list-head,.mtm-project-detail-head{align-items:flex-end}.mtm-project-new{min-width:210px!important}.mtm-project-head-actions{display:flex;align-items:center;gap:8px}
.mtm-project-kpis{display:grid;grid-template-columns:repeat(6,minmax(150px,1fr));gap:8px;margin:14px 0 8px}.mtm-project-kpis>div{min-height:76px;padding:12px 14px;border:1px solid #d2d8dc;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.04)}.mtm-project-kpis span,.mtm-project-kpis small{display:block;color:#707a80;font-size:11px}.mtm-project-kpis strong{display:block;margin-top:5px;color:#26353d;font-size:18px;font-weight:600}.mtm-project-kpis small{margin-top:3px}.mtm-project-kpis .is-alert{border-color:#dfb3b6;background:#fff7f7}.mtm-project-kpis .is-alert strong{color:#b5121b}.mtm-project-kpis .is-remaining{border-color:#b9cbd4;background:#f7fbfd}.mtm-project-kpis .is-remaining strong{color:#1f4658}
.mtm-project-progress{margin:0 0 13px;padding:9px 12px;border:1px solid #d7dcdf;background:#f8f9fa}.mtm-project-progress-track{position:relative;height:8px;margin-bottom:7px;background:#e4e8ea;overflow:hidden}.mtm-project-progress-track span,.mtm-project-progress-track i{position:absolute;left:0;top:0;height:100%;display:block}.mtm-project-progress-track span{background:#80aab9}.mtm-project-progress-track i{background:#17779a}.mtm-project-progress>div:last-child{display:flex;gap:22px;color:#657078;font-size:11px}.mtm-project-progress-legend span{display:inline-flex;align-items:center;gap:6px}.mtm-project-progress-legend .is-invoiced:before,.mtm-project-progress-legend .is-paid:before{content:"";width:8px;height:8px;display:inline-block}.mtm-project-progress-legend .is-invoiced:before{background:#80aab9}.mtm-project-progress-legend .is-paid:before{background:#17779a}
.mtm-project-masterdata{margin:0 0 14px;padding:0}.mtm-project-masterdata>summary{cursor:pointer;padding:10px 13px;color:#176d98;font-weight:700}.mtm-project-masterdata[open]>summary{border-bottom:1px solid #dde1e3}.mtm-project-masterdata form{padding:14px}
.mtm-project-payment-section{margin-top:12px}.mtm-project-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:8px}.mtm-project-section-head h2{margin:0;color:#333;font-size:18px}.mtm-project-section-head p{margin:3px 0 0;color:#727b81;font-size:11px}.mtm-project-plan-actions{display:flex;align-items:flex-end;gap:14px}.mtm-project-plan-total{text-align:right;min-width:190px}.mtm-project-plan-total span,.mtm-project-plan-total small{display:block;color:#727b81;font-size:10px}.mtm-project-plan-total strong{display:block;color:#26353d;font-size:16px;line-height:1.15}.mtm-project-plan-total.is-difference small{color:#b5121b;font-weight:700}.mtm-project-add-position-btn{min-width:190px!important}.mtm-payment-legend{display:flex;justify-content:flex-start;gap:18px;margin-top:7px;color:#68747b;font-size:11px}.mtm-payment-legend .is-within-limit:before,.mtm-payment-legend .is-over-limit:before{content:"";display:inline-block;width:8px;height:8px;margin-right:5px;vertical-align:middle;border-radius:1px}.mtm-payment-legend .is-within-limit:before{background:#cfe9d3}.mtm-payment-legend .is-over-limit:before{background:#f1caca}.mtm-money-alert,.mtm-days-overdue{color:#b5121b!important;font-weight:700}
@media(max-width:1300px){.mtm-project-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.mtm-project-section-head{align-items:flex-start;flex-direction:column}.mtm-project-plan-actions{width:100%;justify-content:flex-end}.mtm-project-progress>div:last-child{flex-wrap:wrap;gap:8px 18px}}

/* V1.24.27 bank reconciliation */
.mtm-bank-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;margin:12px 0 24px}
.mtm-bank-card{border:1px solid #c7d0d5;background:#fafbfb;padding:16px 18px}
.mtm-bank-card h2{margin:0 0 8px;color:#333;font-size:16px}
.mtm-bank-card p{margin:6px 0 12px;line-height:1.45}
.mtm-bank-upload{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mtm-bank-upload input[type=file]{max-width:430px}
.mtm-bank-status{display:inline-block;margin:2px 0 10px;padding:4px 8px;border-radius:2px;font-weight:700}
.mtm-bank-status.is-ready{background:#dcefdc;color:#2d6b3a}.mtm-bank-status.is-pending{background:#f7e9c9;color:#805d16}
.mtm-section-title{margin:24px 0 9px;font-size:18px}
.mtm-bank-table .mtm-bank-reference{font-family:monospace;font-size:11px}
.mtm-bank-match{display:inline-block;min-width:72px;padding:2px 6px;border-radius:2px;text-align:center;font-size:11px;font-weight:700;background:#e5e9eb;color:#4f5b62}
.mtm-bank-match.is-matched{background:#dcefdc;color:#2d6b3a}.mtm-bank-match.is-partial{background:#dce9f3;color:#245f7a}.mtm-bank-match.is-overpaid,.mtm-bank-match.is-review{background:#f6d7d7;color:#9b1a21}.mtm-bank-match.is-unmatched,.mtm-bank-match.is-suggested{background:#f7e9c9;color:#805d16}.mtm-bank-match.is-ignored{background:#ececec;color:#777}
@media(max-width:1180px){.mtm-bank-grid{grid-template-columns:1fr}}
.mtm-bank-assign{margin-top:4px}.mtm-bank-assign summary{cursor:pointer;color:#0e6485;font-size:11px}.mtm-bank-assign form{display:flex;gap:4px;margin-top:4px}.mtm-bank-assign select{max-width:160px;height:28px;font-size:11px}

/* V1.24.28 payment incoming workflow */
.mtm-bank-page-head{align-items:flex-end}
.mtm-bank-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.mtm-bank-head-actions form{margin:0}
.mtm-bank-tabs{margin-top:2px}
.mtm-bank-ebics-panel{margin-top:18px;padding:0}
.mtm-bank-ebics-panel>summary{cursor:pointer;padding:10px 13px;color:#176d98;font-weight:700}
.mtm-bank-ebics-panel[open]>summary{border-bottom:1px solid #dde1e3}
.mtm-bank-ebics-content{padding:14px}
.mtm-bank-ebics-content .mtm-detail-table{max-width:860px}
.mtm-bank-assign[open]{padding-top:2px}
.mtm-bank-assign form{align-items:center}
.mtm-process-action.is-disabled{cursor:not-allowed;pointer-events:none;opacity:.55;filter:grayscale(.35)}

/* ============================================================
 * V1.24.60 - focused CRM login
 * The login is deliberately language-neutral before authentication.
 * User language is applied after login from the user profile.
 * ============================================================ */
.mtm-login-body {
  min-height: 100vh;
  padding: 32px 20px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(47,139,82,.08), transparent 34%),
    linear-gradient(180deg, #f7f9f7 0%, #eef2ef 100%);
  color: #2c3330;
}
.mtm-login-shell {
  position: relative;
  display: block;
  width: min(440px, 100%);
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.mtm-login-card {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 42px 44px 38px;
  overflow: hidden;
  border: 1px solid #d9dfdb;
  border-top: 4px solid var(--mtm-green);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 52px rgba(42,54,48,.12);
}
.mtm-login-brandmark {
  display: flex;
  justify-content: center;
  margin: 0 0 24px;
}
.mtm-login-logo {
  position: static;
  display: block;
  width: 224px;
  height: auto;
  max-width: 82%;
  object-fit: contain;
}
.mtm-login-card .login-brand {
  margin: 0;
  color: #38413d;
  font-family: var(--mtm-font-ui);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: .035em;
  line-height: 1.15;
  text-align: center;
}
.mtm-login-card .login-subtitle {
  margin: 6px 0 30px;
  color: #8a938e;
  font-size: 12px;
  letter-spacing: .035em;
  text-align: center;
}
.mtm-login-alert {
  margin: -8px 0 20px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
}
.mtm-login-form {
  gap: 17px;
}
.mtm-login-form label {
  gap: 7px;
  color: #4b5751;
  font-size: 12px;
  font-weight: 600;
}
.mtm-login-form input {
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8d0cb;
  border-radius: 7px;
  background: #fbfcfb;
  color: #28312c;
  font-size: 14px;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.mtm-login-form input:hover {
  border-color: #aeb9b2;
  background: #fff;
}
.mtm-login-form input:focus {
  outline: none;
  border-color: var(--mtm-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47,139,82,.13);
}
.mtm-login-form input:-webkit-autofill,
.mtm-login-form input:-webkit-autofill:hover,
.mtm-login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #28312c;
  -webkit-box-shadow: 0 0 0 1000px #fbfcfb inset;
  caret-color: #28312c;
}
.mtm-password-field {
  position: relative;
  display: block;
  width: 100%;
}
.mtm-password-field input {
  padding-right: 48px;
}
.mtm-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7c8881;
  cursor: pointer;
}
.mtm-password-toggle:hover,
.mtm-password-toggle:focus-visible {
  outline: none;
  background: #eef4f0;
  color: var(--mtm-green);
}
.mtm-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.mtm-password-toggle .mtm-eye-closed { display: none; }
.mtm-password-toggle.is-visible .mtm-eye-open { display: none; }
.mtm-password-toggle.is-visible .mtm-eye-closed { display: block; }
.mtm-login-card .mtm-login-submit {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin-top: 4px;
  align-self: stretch;
  border: 1px solid #267647;
  border-radius: 7px;
  background: linear-gradient(180deg, #389a5d 0%, #2f8b52 52%, #287b48 100%);
  box-shadow: 0 6px 16px rgba(47,139,82,.20);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .015em;
}
.mtm-login-card .mtm-login-submit:hover,
.mtm-login-card .mtm-login-submit:focus-visible {
  border-color: #22693f;
  outline: none;
  background: linear-gradient(180deg, #328d56 0%, #297c49 55%, #236d40 100%);
  box-shadow: 0 7px 19px rgba(47,139,82,.25);
}
.mtm-login-card .mtm-login-submit:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(47,139,82,.18);
}

@media (max-width: 520px) {
  .mtm-login-body { padding: 20px 14px; }
  .mtm-login-card { padding: 34px 24px 30px; border-radius: 11px; }
  .mtm-login-logo { width: 205px; }
  .mtm-login-card .login-brand { font-size: 25px; }
}


/* V1.24.67 - bank assignment stays usable inside the viewport */
.mtm-bank-table th:last-child,
.mtm-bank-table .mtm-data-row>td:last-child{
  position:sticky;
  right:0;
  z-index:2;
  box-shadow:-1px 0 0 #9eb8c8;
}
.mtm-bank-table thead th:last-child{z-index:4;background:#f7f7f7}
.mtm-bank-table .mtm-data-row>td:last-child{white-space:normal;overflow:visible;text-overflow:clip}
.mtm-bank-assign{max-width:100%;min-width:0}
.mtm-bank-assign form{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:4px;
  width:100%;
  min-width:0;
  margin-top:4px;
}
.mtm-bank-assign select{
  width:100%;
  max-width:none;
  min-width:0;
  height:28px;
  box-sizing:border-box;
  font-size:11px;
}
.mtm-bank-assign-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:4px;
  min-width:0;
}
.mtm-bank-assign input[type=number]{
  width:100%;
  min-width:0;
  height:28px;
  box-sizing:border-box;
  padding:3px 5px;
  font-size:11px;
}
.mtm-bank-assign-actions .btn{min-width:72px;white-space:nowrap}
.mtm-bank-ignore-form{margin-top:4px}
@media(max-width:900px){
  .mtm-bank-table th:last-child,
  .mtm-bank-table .mtm-data-row>td:last-child{position:static;box-shadow:none}
}

/* V1.24.72 - project billing release workflow */
.mtm-project-kpis--billing{grid-template-columns:repeat(5,minmax(150px,1fr))}
.mtm-project-plan-actions{flex-wrap:wrap;justify-content:flex-end}
.mtm-project-plan-actions .btn,.mtm-project-add-position-btn{min-width:0!important}
.mtm-project-release-error{margin-top:6px;padding:6px 9px;border-left:3px solid #b5121b;background:#fff3f3;color:#9b171d;font-size:12px}
.mtm-payment-release-modal{width:min(720px,calc(100vw - 40px))}
.mtm-release-grid{align-items:end}
@media(max-width:1300px){.mtm-project-kpis--billing{grid-template-columns:repeat(3,1fr)}}
@media(max-width:780px){.mtm-project-kpis--billing{grid-template-columns:1fr 1fr}.mtm-project-plan-actions{justify-content:flex-start}}

/* V1.24.73 - simplified payment-plan billing */
.mtm-project-kpis--billing.mtm-project-kpis--simple{grid-template-columns:repeat(4,minmax(160px,1fr))}
@media(max-width:1100px){.mtm-project-kpis--billing.mtm-project-kpis--simple{grid-template-columns:repeat(2,minmax(160px,1fr))}}

/* V1.24.79 - clearer paid/open/not-invoiced project progress */
.mtm-project-progress--financial{padding:12px 14px 10px}
.mtm-project-progress-track--stacked{position:relative;display:flex;height:20px;border-radius:3px;background:#e5eaed;overflow:hidden;margin-bottom:8px;box-shadow:inset 0 0 0 1px rgba(38,53,61,.08)}
.mtm-project-progress-track--stacked span{position:static!important;left:auto!important;top:auto!important;height:100%;min-width:0;transition:width .18s ease}
.mtm-project-progress-track--stacked .is-paid{background:#4d9c67}
.mtm-project-progress-track--stacked .is-open{background:#e7a73a}
.mtm-project-progress-track--stacked .is-not-invoiced{background:#cbd5da}
.mtm-project-progress-legend--financial{display:flex!important;align-items:center;gap:10px 20px!important;flex-wrap:wrap;color:#53616a!important}
.mtm-project-progress-legend--financial span:before{content:"";width:9px;height:9px;display:inline-block;border-radius:1px}
.mtm-project-progress-legend--financial .is-paid:before{background:#4d9c67}
.mtm-project-progress-legend--financial .is-open:before{background:#e7a73a}
.mtm-project-progress-legend--financial .is-not-invoiced:before{background:#cbd5da}
.mtm-project-progress-legend--financial .is-overdue{color:#a3151d;font-weight:700}
.mtm-project-progress-legend--financial .is-overdue:before{background:#c7383f}
.mtm-project-cost-control-btn{white-space:nowrap}


/* V1.24.79 - compact project dashboard matching the approved 3-card preview */
.mtm-project-tabbar{
  min-height:62px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  border-bottom:1px solid #e1e5e7;
  background:#fff;
}
.mtm-project-tabs{margin:0;flex:0 0 auto}
.mtm-project-search-form{align-self:center;margin-top:8px;margin-right:10px}
.mtm-project-search-form .mtm-live-search-box{width:300px}

.mtm-project-overview-shell{display:grid;gap:14px}
.mtm-project-overview-toprow{
  display:grid;
  grid-template-columns:minmax(650px,43%) minmax(0,57%);
  gap:18px;
  align-items:stretch;
  padding:12px 16px;
  background:#f5f6f6;
  border-bottom:1px solid #e5e8ea;
}
.mtm-project-overview-tools{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:8px;
  align-items:stretch;
}
.mtm-project-tool-btn{
  min-width:0!important;
  min-height:48px!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:7px 10px!important;
  background:#fff;
  border-color:#c7ced2;
  color:#176d92;
  font-family:var(--mtm-font-ui-medium);
  font-size:13px!important;
  white-space:nowrap;
}
.mtm-project-tool-btn:hover{color:#0e5e80;background:#f9fbfc}
.mtm-project-tool-icon,.mtm-project-portfolio-icon,.mtm-project-meta-icon,.mtm-project-card-action-icon{
  display:inline-block;
  flex:0 0 auto;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}
.mtm-project-tool-icon{width:22px;height:22px}
.mtm-project-tool-icon.is-invoice,.mtm-project-tool-icon.is-document{background-image:url('../img/projects/document-blue.svg')}
.mtm-project-tool-icon.is-warning{background-image:url('../img/projects/warning-red.svg')}
.mtm-project-tool-icon.is-controlling{background-image:url('../img/ui/ico-controlling.png');width:26px;height:22px}

.mtm-project-portfolio{display:grid;gap:10px}
.mtm-project-portfolio--compact{grid-template-columns:.82fr 1fr 1fr}
.mtm-project-portfolio-card{
  min-width:0;
  min-height:48px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:9px 14px;
  border:1px solid #ccd4d8;
  border-radius:3px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.025);
}
.mtm-project-portfolio-card.is-soft-green{background:#f1f8f1;border-color:#cde0cd}
.mtm-project-portfolio-card.is-soft-blue{background:#eef7fc;border-color:#c9dfea}
.mtm-project-portfolio-stat{flex-direction:row;align-items:center;justify-content:flex-start;gap:14px}
.mtm-project-portfolio-icon.is-folder{width:36px;height:30px;background-image:url('../img/projects/folder.svg')}
.mtm-project-portfolio-headline{
  color:#24404e;
  font-family:var(--mtm-font-ui-bold);
  font-size:20px;
  line-height:1.05;
  white-space:nowrap;
}
.mtm-project-portfolio-stat .mtm-project-portfolio-headline{font-size:28px}
.mtm-project-portfolio-subline{margin-top:4px;color:#6c7880;font-size:11px;white-space:nowrap}

.mtm-project-overview-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  padding:0 2px 2px;
}
.mtm-project-overview-grid.is-single{grid-template-columns:minmax(0,1fr)}
.mtm-project-overview-card{
  min-width:0;
  padding:0;
  overflow:hidden;
  border:1px solid #cbd4d9;
  border-radius:4px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.025);
}
.mtm-project-overview-card-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  min-height:124px;
  padding:15px 17px 8px;
  box-sizing:border-box;
}
.mtm-project-overview-titleblock{min-width:0}
.mtm-project-overview-pretitle{
  margin-bottom:4px;
  color:#74828a;
  font-family:var(--mtm-font-ui-medium);
  font-size:11px;
  font-weight:600;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.mtm-project-overview-card-head h3{
  margin:0 0 12px;
  color:#233744;
  font-family:var(--mtm-font-ui-bold);
  font-size:18px;
  font-weight:700;
  line-height:1.16;
}
.mtm-project-overview-card-head h3 a{color:#233744;text-decoration:none}
.mtm-project-overview-card-head h3 a:hover{color:#176d92;text-decoration:none}
.mtm-project-overview-party,.mtm-project-overview-city{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:#33454f;
  font-size:12px;
  line-height:18px;
}
.mtm-project-overview-party strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:700;
}
.mtm-project-overview-city{margin-top:3px;color:#5d6c75}
.mtm-project-meta-icon{width:18px;height:18px}
.mtm-project-meta-icon.is-customer{background-image:url('../img/projects/customer.svg')}
.mtm-project-meta-icon.is-location{background-image:url('../img/projects/location.svg')}
.mtm-project-overview-badges{display:flex;align-items:flex-start;justify-content:flex-end}
.mtm-project-currency-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  height:26px;
  padding:0 8px;
  border-radius:6px;
  background:#e3f2f9;
  color:#13729b;
  font-family:var(--mtm-font-ui-bold);
  font-size:11px;
  font-weight:700;
}
.mtm-project-overview-progress-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:0 17px 10px;
}
.mtm-project-progress--tight{margin:0!important;padding:0!important;background:transparent!important;border:0!important}
.mtm-project-progress-track--single{
  position:relative;
  overflow:hidden;
  height:14px;
  border:1px solid #cad3d8;
  border-radius:5px;
  background:#edf1f3;
  box-shadow:inset 0 1px 1px rgba(0,0,0,.03);
}
.mtm-project-progress-track--single>span{display:block;height:100%;border-radius:4px;background:#50a653}
.mtm-project-progress-value{color:#53636c;font-size:11px;font-weight:700;white-space:nowrap}

.mtm-project-overview-finance{padding:0 17px 11px}
.mtm-project-overview-finance-row{
  min-height:34px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:0 7px;
  border-top:1px solid #dfe6e9;
  color:#2f424d;
  box-sizing:border-box;
}
.mtm-project-overview-finance-row span{font-size:12px}
.mtm-project-overview-finance-row strong{font-size:12px;font-weight:700;white-space:nowrap}
.mtm-project-overview-finance-row .is-positive{color:#2c823e}
.mtm-project-overview-finance-row .is-negative{color:#d01921}
.mtm-project-overview-finance-row.is-overdue{background:#fff1f1}
.mtm-project-overview-finance-row.is-open-overdue strong{color:#d01921}

.mtm-project-overview-actions{
  display:grid;
  grid-template-columns:1.06fr .96fr 1.15fr;
  gap:7px;
  padding:12px 16px 14px;
  border-top:1px solid #e2e7e9;
  background:#fcfcfd;
}
.mtm-project-overview-actions .btn{
  min-width:0!important;
  min-height:38px!important;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:5px 8px!important;
  font-family:var(--mtm-font-ui-medium);
  font-size:11px!important;
  white-space:nowrap;
}
.mtm-project-overview-actions .btn.primary{
  border-radius:4px;
  font-size:12px!important;
  box-shadow:2px 3px 8px -5px rgba(0,0,0,.65);
}
.mtm-project-card-action-icon{width:19px;height:17px}
.mtm-project-card-action-icon.is-folder{background-image:url('../img/projects/folder-white.svg')}
.mtm-project-card-action-icon.is-document{width:18px;height:18px;background-image:url('../img/projects/document-blue.svg')}
.mtm-project-empty{margin:0 2px;padding:20px}

@media(max-width:1500px){
  .mtm-project-overview-toprow{grid-template-columns:minmax(570px,46%) minmax(0,54%);gap:12px}
  .mtm-project-tool-btn{font-size:11px!important;gap:6px}
  .mtm-project-overview-card-head h3{font-size:17px}
  .mtm-project-overview-finance-row strong{font-size:11px}
}
@media(max-width:1250px){
  .mtm-project-overview-toprow{grid-template-columns:1fr}
  .mtm-project-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .mtm-project-tabbar{align-items:stretch;flex-direction:column;gap:0}
  .mtm-project-search-form{align-self:stretch;justify-content:flex-end;padding:8px 0}
  .mtm-project-overview-grid{grid-template-columns:1fr}
  .mtm-project-portfolio--compact{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
  .mtm-project-overview-tools{grid-template-columns:1fr 1fr}
  .mtm-project-portfolio--compact{grid-template-columns:1fr}
  .mtm-project-overview-actions{grid-template-columns:1fr}
}

/* V1.24.90 - project invoice approval */
.mtm-warning-text{color:#a66a00!important}.mtm-project-email-distribution-note{margin:8px 0 2px;padding:9px 11px;border-left:3px solid #1a87a7;background:#f4f9fb}.mtm-approval-summary{margin-top:10px;padding:8px 10px;border:1px solid #ead7a3;background:#fff8e8;color:#7a5a11;font-size:12px}.mtm-approval-summary.is-approved{border-color:#bcdcc4;background:#eef8f0;color:#2b6f39}.mtm-approval-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:18px;padding:0 4px;border-radius:3px;background:#f5d783;color:#654b00;font-size:10px;font-weight:700}.mtm-approval-badge.is-approved{background:#bfe1c6;color:#235f30}

/* E-Mail-Log: shared CRM list CI. */
.mtm-email-log-tabs{margin-top:18px}
.mtm-email-log-list-toolbar{margin-top:0}
.mtm-email-log-list-toolbar .mtm-list-toolbar-title{color:#5e666b;font-size:12px}
.mtm-email-log-search{display:flex;gap:8px;align-items:center}
.mtm-email-log-search .mtm-live-search-box{width:300px}
.mtm-email-log-search-submit{height:31px;margin:0;padding:0 14px}
.mtm-email-log-panel{padding:0;overflow:hidden;border-top:0}
.mtm-email-log-table{width:100%;table-layout:fixed;border-collapse:collapse}
.mtm-email-log-table col.mtm-email-log-col-time{width:150px}
.mtm-email-log-table col.mtm-email-log-col-document{width:205px}
.mtm-email-log-table col.mtm-email-log-col-to{width:245px}
.mtm-email-log-table col.mtm-email-log-col-cc{width:255px}
.mtm-email-log-table col.mtm-email-log-col-subject{width:auto}
.mtm-email-log-table col.mtm-email-log-col-sender{width:120px}
.mtm-email-log-table col.mtm-email-log-col-reply{width:150px}
.mtm-email-log-table col.mtm-email-log-col-status{width:80px}
.mtm-email-log-table thead th{height:34px;padding:0 8px;border-bottom:1px solid #a9b5bc;border-right:1px solid #e2e5e7;background:#f7f7f7;color:#545c61;text-align:left;vertical-align:middle;font-family:var(--mtm-font-ui);font-size:13px;font-weight:400;text-transform:uppercase;letter-spacing:.018em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtm-email-log-table thead th:last-child{border-right:0}
.mtm-email-log-table tbody td{padding:8px;border-right:1px solid #dde3e6;border-bottom:1px solid #d6dde1;background:#fff;vertical-align:top}
.mtm-email-log-table tbody tr:nth-child(even) td{background:#fbfcfc}
.mtm-email-log-table tbody td:last-child{border-right:0}
.mtm-email-log-table .nowrap{white-space:nowrap}
.mtm-email-address-cell{overflow-wrap:anywhere;word-break:break-word}
.mtm-email-address{display:block;line-height:1.35}
.mtm-email-address+.mtm-email-address{margin-top:2px}
.mtm-email-log-details{margin-top:5px}
.mtm-email-log-details summary{cursor:pointer;color:#19789c;font-size:12px}
.mtm-email-log-details pre{max-width:520px;max-height:240px;overflow:auto;white-space:pre-wrap;font-family:Arial,sans-serif;font-size:12px;background:#f7f9fa;border:1px solid #e1e6e9;padding:8px}
.mtm-email-status{display:inline-block;padding:3px 7px;border-radius:10px;background:#edf1f3;font-size:11px;font-weight:700}
.mtm-email-status.is-sent{background:#e6f5e8;color:#2c723d}
.mtm-email-status.is-failed{background:#fdeaea;color:#b5121b}
.mtm-email-status.is-simulated{background:#fff4dd;color:#9a6300}
.mtm-email-log-error{margin-top:5px;max-width:280px;color:#b5121b;font-size:11px;overflow-wrap:anywhere}
@media(max-width:1100px){.mtm-email-log-search .mtm-live-search-box{width:240px}.mtm-email-log-table{min-width:1320px}}
@media(max-width:900px){.mtm-email-log-list-toolbar{align-items:stretch;flex-direction:column}.mtm-email-log-search{justify-content:flex-end}.mtm-email-log-search .mtm-live-search-box{width:min(100%,300px)}}
