:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --border: #cfd8e3;
  --text: #0b1f33;
  --muted: #50647b;
  --primary: #2b78c5;
  --sidebar: #17253a;
  --sidebarText: #d6e2f0;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: #f8fbff;
  border: 1px solid #b9cde2;
  color: #12324f;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #eaf3fb;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: var(--sidebarText);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brandBlock {
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
}

.brandCompany {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ab0ca;
  font-weight: 700;
}

.brandAssistant {
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subnav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -4px;
  margin-left: 8px;
}

.subnavbtn {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #b9cce2;
  border: 1px solid #304765;
  background: #1f2f45;
}

.subnavbtn.active {
  color: #ffffff;
  border-color: #4b6690;
  background: #253a56;
}

.subnav2 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -2px 0 2px 10px;
}

.subnav2btn {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #314965;
  background: #1e2f46;
  color: #a7bdd7;
  border-radius: 2px;
}

.subnav2btn.active {
  background: #274361;
  border-color: #4f729f;
  color: #ffffff;
}

.navbtn {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  background: #1f3047;
  border: 1px solid #314965;
  color: #c9d8ea;
}

.navbtn.active {
  background: #294364;
  border-color: #5d85bb;
  color: #ffffff;
}

.navbtn.danger {
  margin-top: auto;
  background: #253447;
  border-color: #42536b;
  color: #d7e3ef;
}

.main {
  flex: 1;
  padding: 32px 40px;
}

.main.standalone {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.container {
  max-width: 1500px;
  margin: 0;
}

.title {
  font-size: 32px;
  margin: 0 0 20px 0;
}

.configKpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.configKpiCard {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 12px;
}

.configKpiLabel {
  font-size: 12px;
  color: #64748b;
}

.configKpiValue {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}

.box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.box.user {
  border-left: 6px solid rgba(37, 99, 235, 0.55);
}

.box.assistant {
  border-left: 6px solid rgba(34, 197, 94, 0.55);
}

.box.ai {
  border-left: 6px solid rgba(99, 102, 241, 0.55);
}

.content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 8px;
}

form[action="/chat"] textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border-radius: 2px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}

form[action="/chat"] button,
.loginBtn {
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  cursor: pointer;
}

.loginForm {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  max-width: 520px;
}

.loginForm label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.loginForm input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 2px;
  border: 1px solid var(--border);
  margin-top: 6px;
  font-size: 14px;
}

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

.h2 {
  margin: 0;
  font-size: 22px;
}

.inboxHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.headerActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inboxList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.notice-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notice-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.notice-error {
  background: #fef2f2;
  border-color: #fecaca;
}

.teamFlatUi .notice {
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.debugPanel {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.debugPanel > summary {
  cursor: pointer;
  font-weight: 700;
}

.debugGrid {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.inboxGrid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.emailGrid {
  display: grid;
  grid-template-columns: 0.85fr 1.1fr 1.2fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.emailColList,
.emailColReader,
.emailColActions {
  min-width: 0;
}

.inboxLeft {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inboxInternalChat {
  margin-top: 2px;
}

.refreshLink {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  padding: 8px 10px;
}

.refreshLink.activeFilter {
  border-color: #93c5fd;
  background: #eff6ff;
}

.mailCardLink {
  display: block;
}

.mailCard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}

.mailCard.selected {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22) inset;
}

.mailTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mailSubj {
  font-weight: 700;
}

.mailReader {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  min-height: 120px;
  position: sticky;
  top: 18px;
}

.emailColReader .mailBodyWrap {
  max-height: 72vh;
}

.emailColActions {
  position: sticky;
  top: 18px;
}

.mailReaderDetails > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.mailReaderDetails > summary::-webkit-details-marker {
  display: none;
}

.mailReaderDetails[open] > summary {
  margin-bottom: 10px;
}

.mailBodyWrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}

.threadStack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.threadCardLink {
  display: block;
}

.threadCard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
}

.threadCard.selected {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22) inset;
}

.threadCardTitle {
  font-weight: 700;
  margin-bottom: 3px;
}

.mailBody {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font-size: 15px;
  color: #111827;
}

.mailBody a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.statusTag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: #334155;
  text-transform: capitalize;
}

.mailThreadMeta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.threadCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  border: 1px solid #d1d5db;
}

.unreadDot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.status-pending {
  background: #fff7ed;
  border-color: #fed7aa;
}

.status-review {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.status-replied {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-hidden {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.readerActions {
  margin-bottom: 10px;
}

.readerActions form {
  margin-bottom: 8px;
}

.inlineInput,
.draftComposer input,
.draftComposer textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.inputWithMic {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.inputWithMic input,
.inputWithMic textarea {
  flex: 1;
}

.dictateBtn {
  margin-top: 0;
  padding: 8px 10px;
  min-width: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.draftComposer textarea {
  min-height: 150px;
  white-space: pre-wrap;
}

.newComposeBox {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 14px;
}

.newComposeBox textarea {
  min-height: 90px;
}

.composeDetails > summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 0 8px 0;
}

.composeDetails > summary::-webkit-details-marker {
  display: none;
}

.readerActions button,
.statusActions button,
.draftActions button {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

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

.statusActions form {
  margin: 0;
}

.draftComposer {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.draftTitle {
  font-weight: 700;
  margin-bottom: 8px;
}

.draftComposer label {
  display: block;
  margin-top: 8px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

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

.sendConfirmBox {
  margin-top: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    flex: none;
    flex-direction: row;
    align-items: center;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .navbtn.danger {
    margin-top: 0;
  }

  .main {
    padding: 20px;
  }

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

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

  .mailReader {
    position: static;
  }

  .emailColActions {
    position: static;
  }
}

.teamGrid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  margin-bottom: 14px;
}

.teamInfoRow {
  font-size: 14px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table thead th {
  background: #f8fafc;
}

.actionMenu {
  position: relative;
}

.actionMenu summary {
  cursor: pointer;
  list-style: none;
}

.actionMenu summary::-webkit-details-marker {
  display: none;
}

.actionMenuList {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 4px);
  min-width: 150px;
  background: #f8fafc;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
  padding: 6px;
  display: grid;
  gap: 6px;
}

.actionMenuList form {
  margin: 0;
}

.actionMenuList button {
  width: 100%;
  text-align: left;
}

.iconActions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iconButton {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #b6c7d9;
  background: #f8fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: #2a4663;
}

.iconButton:hover {
  background: #eaf2fb;
}

.iconDanger {
  color: #b42318;
  border-color: #e4b4ae;
}

.iconSvg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.selectableCostRow {
  cursor: pointer;
}

.selectableCostRow:hover {
  background: #eef6ff;
}

.hiddenForm {
  display: none;
}

@media (max-width: 1100px) {
  .teamGrid {
    grid-template-columns: 1fr;
  }
  .teamSummary {
    grid-template-columns: 1fr;
  }
}

.teamStatusBar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.teamStatusBar span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.teamTabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.teamModuleTabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.teamTabs form {
  margin: 0;
}

.teamModuleTabs form {
  margin: 0;
}

.teamTabs button,
.teamModuleTabs button,
.teamFormGrid + button,
.teamFlagForm button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

.teamTabs button.activeTab {
  background: #eff6ff;
  border-color: #93c5fd;
}

.teamFormGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.projectStageGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.projectStageGrid label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #2a4663;
}

.projectStageGrid input,
.projectStageGrid select {
  border: 1px solid #9cb7d3 !important;
  border-radius: 4px !important;
  background: #edf4fb !important;
  color: #1a3a58;
}

.teamFormGrid label,
.teamFlagForm label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: #475569;
}

.teamFormGrid input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
}

.teamFlagForm {
  margin-top: 12px;
}

.teamFlagGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

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

.teamControlGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.teamControlGrid h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.teamControlGrid select,
.teamControlGrid input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  margin-bottom: 8px;
}

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

.employeeDialogSection {
  border: 1px solid var(--border);
  background: #f8fbff;
  padding: 10px;
}

.employeeDialogSection h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #1e3a56;
}

.employeeDialogSection textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: inherit;
}

.projectTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.projectActions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.projectActiveLabel {
  margin-bottom: 10px;
}

.projectTabs form {
  margin: 0;
}

.projectContactsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.projectContactCard {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px;
  border-radius: 2px;
}

.projectContactCard h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.projectContactCard input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  font-family: inherit;
}

.keyPlayersDialog {
  width: min(1080px, 92vw);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  display: none;
}

.keyPlayersDialog[open],
.keyPlayersDialog.is-open {
  display: block;
  position: fixed;
  inset: 8vh auto auto 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  max-height: 80vh;
  overflow: auto;
}

.structureCalendarDialog[open],
.structureCalendarDialog.is-open {
  width: 96vw;
  max-width: 1700px;
  max-height: 92vh;
  inset: 4vh auto auto 50%;
}

.keyPlayersDialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.keyPlayersDialogHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dialogHeaderActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#structure-employee-dialog .draftActions {
  position: sticky;
  bottom: -12px;
  background: #fff;
  padding: 10px 0;
  border-top: 1px solid #d6e2ef;
}

.teamFlatUi button,
.teamFlatUi input,
.teamFlatUi select,
.teamFlatUi textarea,
.teamFlatUi .table th,
.teamFlatUi .table td,
.teamFlatUi .projectContactCard,
.teamFlatUi .mailReader,
.teamFlatUi .statusTag,
.teamFlatUi .refreshLink {
  border-radius: 2px !important;
}

.teamFlatUi .table,
.teamFlatUi .table th,
.teamFlatUi .table td {
  font-size: 13px;
}

.colorRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.colorInput {
  width: 48px !important;
  height: 34px;
  padding: 1px !important;
}

.colorPreview,
.colorChip {
  width: 26px;
  height: 26px;
  border: 1px solid #cfd8e3;
  display: inline-block;
}

.calendarToolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.calendarTitle {
  min-width: 180px;
  text-align: center;
  font-weight: 700;
}

.calendarEventForm {
  margin-bottom: 12px;
}

.calendarFilterForm {
  margin-bottom: 6px;
}

.googleCalendar {
  border: 1px solid #d2dce7;
  background: #fff;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.structureCalendarDialog .googleCalendar {
  max-height: calc(100vh - 150px);
}

body[data-frame-view="1"] .googleCalendar {
  max-height: none;
  overflow: visible;
}

.calendarWeekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdayCell {
  border-right: 1px solid #e4eaf1;
  border-bottom: 1px solid #d8e1ec;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: #f3f7fb;
}

.weekdayCell:last-child {
  border-right: 0;
}

.calendarDay {
  position: relative;
  min-height: clamp(56px, 7.2vh, 96px);
  border-right: 1px solid #eef2f6;
  border-bottom: 1px solid #e8edf3;
  padding: 4px;
  background: #fff;
  padding-top: calc(4px + (var(--week-strip-rows, 0) * 16px));
}

.calendarDayOpenOverlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.disabledLink {
  opacity: 0.45;
  pointer-events: none;
}

.calendarDay.openCalendarEventDialog {
  cursor: pointer;
}

.calendarDay.otherMonth {
  background: #f8fbff;
  color: #8ba0b6;
}

.calendarDayHead {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.calendarDayHeadForm {
  margin: 0 0 4px 0;
}

.calendarDayHeadBtn {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 700;
  font-size: 11px;
  color: inherit;
  position: relative;
  z-index: 5;
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  padding: 0 2px;
}

.projectStrip {
  color: #fff;
  font-size: 11px;
  padding: 2px 4px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendarWeek {
  position: relative;
}

.calendarWeekBars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  z-index: 3;
  pointer-events: none;
  margin-bottom: 2px;
}

.calendarWeekBar {
  min-height: 16px;
  line-height: 16px;
  font-size: 11px;
  color: #fff;
  margin: 0 2px;
  padding: 0 6px;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendarWeekDays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.structureCalendarDialog .calendarDayHead {
  position: relative;
  z-index: 2;
  display: inline-block;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  padding: 0 2px;
}

.weekStripOverlay {
  position: absolute;
  left: 40px;
  right: calc((100% / 7) * 2);
  top: 34px;
  z-index: 1;
  pointer-events: none;
}

.weekStripRow {
  position: absolute;
  left: 0;
  right: 3px;
  height: 14px;
  top: calc(var(--strip-row, 0) * 16px);
  color: #fff;
  font-size: 11px;
  line-height: 14px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendarMore summary {
  font-size: 11px;
  color: #2563eb;
  cursor: pointer;
}

.calendarMoreOpen {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  padding: 0;
  margin-top: 2px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.compactDate {
  max-width: 180px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0;
  padding: 8px 10px !important;
  border: 1px solid #9cb7d3 !important;
  border-radius: 4px !important;
  background: #edf4fb !important;
  color: #1a3a58;
  -webkit-appearance: none;
  appearance: none;
}

.compactDate:focus {
  outline: none;
  border-color: #7ea5cc !important;
  box-shadow: 0 0 0 2px rgba(126, 165, 204, 0.2);
}

.compactDate::-webkit-calendar-picker-indicator {
  opacity: 0.8;
  cursor: pointer;
}

.dateStepWrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dateStepWrap .compactDate {
  max-width: 152px;
}

.dateStepBtn {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 20px;
  text-align: center;
  border-radius: 4px !important;
  border: 1px solid #9cb7d3 !important;
  background: #edf4fb !important;
  color: #1a3a58;
  font-size: 11px;
}

.weeksAuto {
  max-width: 96px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.calendarDialogSubmit {
  display: flex;
  align-items: end;
}

.calendarDialogSubmit button {
  margin-top: 0;
}

.permissionChecks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.permissionChecks label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendarEvent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-left: 3px solid #64748b;
  background: #f8fbff;
  padding: 2px 5px;
  margin-bottom: 3px;
  font-size: 11px;
  position: relative;
  z-index: 2;
}

.calendarEventOpen {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #1f2937;
  text-align: left;
  flex: 1;
  font-size: 11px;
  cursor: pointer;
}

.dayEventsList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dayEventListBtn {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--event-bg, #f8fbff);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--event-fg, #1f2937);
}

.calendarNotes {
  width: 100%;
  min-height: 90px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
}

.eventDelete {
  border: 0;
  background: transparent;
  color: #9aa9b8;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.checkLabel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.moduleLauncher {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.launcherGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.launcherCard {
  border: 1px solid var(--border);
  background: #f8fbff;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.launcherCard:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.launcherTitle {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.launcherText {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.launcherDialog {
  width: min(1680px, 95vw);
  max-width: 95vw;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.launcherDialog::backdrop {
  background: rgba(7, 18, 34, 0.46);
}

.launcherDialogHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.launcherFrame {
  width: 100%;
  height: min(84vh, 920px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

  .teamFormGrid,
  .projectStageGrid,
  .teamFlagGrid,
  .teamControlGrid {
    grid-template-columns: 1fr;
  }

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

  .teamTabs {
    flex-wrap: wrap;
  }
  .teamModuleTabs {
    flex-wrap: wrap;
  }
}
